From 54c841d47d94a4df7d6ce8477b8da8dc363dffb8 Mon Sep 17 00:00:00 2001 From: Thomas Wallner Date: Tue, 5 Sep 2023 15:01:54 +0200 Subject: [PATCH 01/10] added postgresql functions for graph ql api --- package.json | 2 +- packages/repco-cli/src/commands/debug.ts | 3 +- packages/repco-core/src/datasources/cba.ts | 81 ++- .../repco-core/src/datasources/cba/types.ts | 1 + packages/repco-core/src/datasources/rss.ts | 6 +- packages/repco-core/src/datasources/xrcb.ts | 4 + packages/repco-core/src/repo.ts | 10 +- packages/repco-core/test/bench/basic.ts | 1 + packages/repco-core/test/circular.ts | 4 + packages/repco-core/test/datasource.ts | 5 +- packages/repco-frontend/app/graphql/types.ts | 455 ++++++-------- .../repco-graphql/generated/schema.graphql | 559 ++++++++++-------- packages/repco-graphql/src/lib.ts | 3 +- .../src/plugins/custom-filter.ts | 18 + .../20230712072235_language/migration.sql | 2 + .../20230713110521_languagepoc/migration.sql | 9 + .../20230718063427_languagepoc2/migration.sql | 12 + .../20230720132041_multilingual/migration.sql | 63 ++ .../migration.sql | 149 +++++ packages/repco-prisma/prisma/schema.prisma | 68 ++- 20 files changed, 890 insertions(+), 565 deletions(-) create mode 100644 packages/repco-graphql/src/plugins/custom-filter.ts create mode 100644 packages/repco-prisma/prisma/migrations/20230712072235_language/migration.sql create mode 100644 packages/repco-prisma/prisma/migrations/20230713110521_languagepoc/migration.sql create mode 100644 packages/repco-prisma/prisma/migrations/20230718063427_languagepoc2/migration.sql create mode 100644 packages/repco-prisma/prisma/migrations/20230720132041_multilingual/migration.sql create mode 100644 packages/repco-prisma/prisma/migrations/20230905113840_graph_ql_functions/migration.sql diff --git a/package.json b/package.json index 3b3c04df..d6e00902 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "migrate:dev": "yarn --cwd packages/repco-prisma prisma migrate dev && yarn --cwd packages/repco-graphql export-schema", "codegen": "yarn migrate:dev", "server": "yarn --cwd packages/repco-server start", + "graphql": "yarn --cwd packages/repco-graphql export-schema && yarn --cwd packages/repco-graphql start", "cli": "node packages/repco-cli/bin.js", "lint": "eslint packages", "lint:fix": "eslint packages --fix", @@ -58,4 +59,3 @@ "typescript": "^4.8" } } - diff --git a/packages/repco-cli/src/commands/debug.ts b/packages/repco-cli/src/commands/debug.ts index 152d514a..be13054f 100644 --- a/packages/repco-cli/src/commands/debug.ts +++ b/packages/repco-cli/src/commands/debug.ts @@ -39,7 +39,7 @@ export const createContent = createCommand({ try { for (let i = 0; i < batches; i++) { const items = Array(batch).fill(null).map(createItem) - await repo.saveBatch('me', items) + // await repo.saveBatch('me', items) bar.update(i * batch, { commits: i }) } bar.update(count, { commits: batches - 1 }) @@ -62,6 +62,7 @@ function createItem() { contentFormat: 'text/plain', title: casual.catch_phrase, content: casual.sentences(3), + summary: '{}', }, } return item diff --git a/packages/repco-core/src/datasources/cba.ts b/packages/repco-core/src/datasources/cba.ts index 117a3e1d..155b819b 100644 --- a/packages/repco-core/src/datasources/cba.ts +++ b/packages/repco-core/src/datasources/cba.ts @@ -450,9 +450,15 @@ export class CbaDataSource implements DataSource { resolution: null, } + //TODO: find language code + var titleJson: { [k: string]: any } = {} + titleJson['de'] = { value: media.title.rendered } + var descriptionJson: { [k: string]: any } = {} + descriptionJson['de'] = { value: media.description?.rendered } + const asset: form.MediaAssetInput = { - title: media.title.rendered, - description: media.description?.rendered, + title: titleJson, + description: descriptionJson, mediaType: 'audio', duration, Concepts: media.media_tag.map((cbaId) => ({ @@ -502,9 +508,15 @@ export class CbaDataSource implements DataSource { media.media_details.width.toString() } + //TODO: find language code + var titleJson: { [k: string]: any } = {} + titleJson['de'] = { value: media.title.rendered } + var descriptionJson: { [k: string]: any } = {} + descriptionJson['de'] = { value: media.description?.rendered } + const asset: form.MediaAssetInput = { - title: media.title.rendered || '', - description: media.description?.rendered || null, + title: titleJson, + description: descriptionJson, mediaType: 'image', Concepts: media.media_tag.map((cbaId) => ({ uri: this._uri('tags', cbaId), @@ -528,11 +540,20 @@ export class CbaDataSource implements DataSource { } private _mapCategories(categories: CbaCategory): EntityForm[] { + //TODO: find language code + var nameJson: { [k: string]: any } = {} + nameJson['de'] = { value: categories.name } + var descriptionJson: { [k: string]: any } = {} + descriptionJson['de'] = { value: categories.description } + var summaryJson: { [k: string]: any } = {} + summaryJson['de'] = { value: categories.description } + const content: form.ConceptInput = { - name: categories.name, - description: categories.description, + name: nameJson, + description: descriptionJson, kind: ConceptKind.CATEGORY, originNamespace: 'https://cba.fro.at/wp-json/wp/v2/categories', + summary: summaryJson, } if (categories.parent !== undefined) { content.ParentConcept = { @@ -557,11 +578,21 @@ export class CbaDataSource implements DataSource { console.error('Invalid tags input.') throw new Error('Invalid tags input.') } + + //TODO: find language code + var nameJson: { [k: string]: any } = {} + nameJson['de'] = { value: tags.name } + var descriptionJson: { [k: string]: any } = {} + descriptionJson['de'] = { value: tags.description } + var summaryJson: { [k: string]: any } = {} + summaryJson['de'] = { value: tags.description } + const content: form.ConceptInput = { - name: tags.name, - description: tags.description, + name: nameJson, + description: descriptionJson, kind: ConceptKind.TAG, originNamespace: 'https://cba.fro.at/wp-json/wp/v2/tags', + summary: summaryJson, } const revisionId = this._revisionUri('tags', tags.id, new Date().getTime()) const uri = this._uri('tags', tags.id) @@ -578,11 +609,14 @@ export class CbaDataSource implements DataSource { `Missing or invalid title for station with ID ${station.id}`, ) } + //TODO: find language code + var nameJson: { [k: string]: any } = {} + nameJson['de'] = { value: station.title.rendered } const content: form.PublicationServiceInput = { medium: station.type || '', address: station.link || '', - name: station.title.rendered, + name: nameJson, } const revisionId = this._revisionUri( @@ -606,12 +640,20 @@ export class CbaDataSource implements DataSource { throw new Error('Series title is missing.') } + //TODO: find language code + var descriptionJson: { [k: string]: any } = {} + descriptionJson['de'] = { value: series.content.rendered } + var summaryJson: { [k: string]: any } = {} + summaryJson['de'] = { value: series.content.rendered } + var titleJson: { [k: string]: any } = {} + titleJson['de'] = { value: series.title.rendered } + const content: form.ContentGroupingInput = { - title: series.title.rendered, - description: series.content.rendered || null, + title: titleJson, + description: descriptionJson, groupingType: 'show', subtitle: null, - summary: null, + summary: summaryJson, broadcastSchedule: null, startingDate: null, terminationDate: null, @@ -664,13 +706,22 @@ export class CbaDataSource implements DataSource { .filter(notEmpty) ?? [] const conceptLinks = [...categories, ...tags] + var title: { [k: string]: any } = {} + title[post.language_codes[0]] = { value: post.title.rendered } + + var summary: { [k: string]: any } = {} + summary[post.language_codes[0]] = { value: post.excerpt.rendered } + + var contentJson: { [k: string]: any } = {} + contentJson[post.language_codes[0]] = { value: post.content.rendered } + const content: form.ContentItemInput = { pubDate: new Date(post.date), - content: post.content.rendered, + content: contentJson, contentFormat: 'text/html', - title: post.title.rendered, + title: title, subtitle: 'missing', - summary: post.excerpt.rendered, + summary: summary, PublicationService: this._uriLink('station', post.meta.station_id), Concepts: conceptLinks, MediaAssets: mediaAssetLinks, diff --git a/packages/repco-core/src/datasources/cba/types.ts b/packages/repco-core/src/datasources/cba/types.ts index 5adadcfc..11d6fcd2 100644 --- a/packages/repco-core/src/datasources/cba/types.ts +++ b/packages/repco-core/src/datasources/cba/types.ts @@ -25,6 +25,7 @@ export interface CbaPost { categories: number[] tags: number[] language: number[] + language_codes: string[] editor: number[] acf: any[] post_parent: number diff --git a/packages/repco-core/src/datasources/rss.ts b/packages/repco-core/src/datasources/rss.ts index cf4162e7..bab6756b 100644 --- a/packages/repco-core/src/datasources/rss.ts +++ b/packages/repco-core/src/datasources/rss.ts @@ -322,7 +322,8 @@ export class RssDataSource extends BaseDataSource implements DataSource { groupingType: 'feed', title: feed.title || feed.feedUrl || 'unknown', variant: ContentGroupingVariant.EPISODIC, - description: feed.description, + description: feed.description || '{}', + summary: '{}', } return [ { @@ -362,6 +363,7 @@ export class RssDataSource extends BaseDataSource implements DataSource { duration: 0, mediaType: 'audio', File: { uri: fileUri }, + description: '{}', }, headers: { EntityUris: [mediaUri] }, }) @@ -384,7 +386,7 @@ export class RssDataSource extends BaseDataSource implements DataSource { ) const content: ContentItemInput = { title: item.title || item.guid || 'missing', - summary: item.contentSnippet, + summary: item.contentSnippet || '{}', content: item.content || '', contentFormat: 'text/plain', pubDate: item.pubDate ? new Date(item.pubDate) : null, diff --git a/packages/repco-core/src/datasources/xrcb.ts b/packages/repco-core/src/datasources/xrcb.ts index eedd631c..99ef6386 100644 --- a/packages/repco-core/src/datasources/xrcb.ts +++ b/packages/repco-core/src/datasources/xrcb.ts @@ -274,6 +274,7 @@ export class XrcbDataSource extends BaseDataSource implements DataSource { description: category.description || '', kind: ConceptKind.CATEGORY, originNamespace: 'https://xrcb.cat/wp-json/wp/v2/podcast_category', + summary: '{}', } const revisionId = this._revisionUri( @@ -299,6 +300,7 @@ export class XrcbDataSource extends BaseDataSource implements DataSource { description: tag.description || '', kind: ConceptKind.TAG, originNamespace: 'https://xrcb.cat/wp-json/wp/v2/podcast_tag', + summary: '{}', } const revisionId = this._revisionUri('tag', tag.id, new Date().getTime()) const uri = this._uri('tag', tag.id) @@ -353,6 +355,7 @@ export class XrcbDataSource extends BaseDataSource implements DataSource { description: series.description || '', variant: ContentGroupingVariant.SERIAL, groupingType: 'series', + summary: '{}', } const revisionId = this._revisionUri( 'series', @@ -525,6 +528,7 @@ export class XrcbDataSource extends BaseDataSource implements DataSource { title: post.acf?.img_podcast?.title ?? '', mediaType: 'image', File: { uri: fileId }, + description: '{}', } const imageFileEntity: EntityForm = { diff --git a/packages/repco-core/src/repo.ts b/packages/repco-core/src/repo.ts index 9f24f8c9..1883c643 100644 --- a/packages/repco-core/src/repo.ts +++ b/packages/repco-core/src/repo.ts @@ -441,7 +441,10 @@ export class Repo { return importRepoFromCar(this, stream, onProgress) } - async saveBatch(inputs: UnknownEntityInput[], opts: Partial = {}) { + async saveBatch( + inputs: UnknownEntityInput[], + opts: Partial = {}, + ) { if (!this.writeable) throw new Error('Repo is not writeable') const fullOpts: SaveBatchOpts = { ...SAVE_BATCH_DEFAULTS, ...opts } @@ -775,7 +778,9 @@ function parseEntity(input: UnknownEntityInput): EntityFormWithHeaders { } } -export function parseEntities(inputs: UnknownEntityInput[]): EntityFormWithHeaders[] { +export function parseEntities( + inputs: UnknownEntityInput[], +): EntityFormWithHeaders[] { return inputs.map(parseEntity) } @@ -803,5 +808,6 @@ export function revisionIpldToDb( contentCid: headers.BodyCid.toString(), revisionCid: headers.Cid.toString(), derivedFromUid: headers.DerivedFrom || null, + languages: '', } } diff --git a/packages/repco-core/test/bench/basic.ts b/packages/repco-core/test/bench/basic.ts index 6f941865..00c1377c 100644 --- a/packages/repco-core/test/bench/basic.ts +++ b/packages/repco-core/test/bench/basic.ts @@ -53,6 +53,7 @@ function createItem(i: number) { contentFormat: 'text/plain', title: 'Item #' + i, content: 'foobar' + i, + summary: '{}', }, } return item diff --git a/packages/repco-core/test/circular.ts b/packages/repco-core/test/circular.ts index 0b3f9194..fae87a4f 100644 --- a/packages/repco-core/test/circular.ts +++ b/packages/repco-core/test/circular.ts @@ -54,6 +54,8 @@ class TestDataSource extends BaseDataSource implements DataSource { name: 'concept1', kind: ConceptKind.CATEGORY, SameAs: { uri: 'urn:repco:concept:2' }, + description: '{}', + summary: '{}', }, headers: { EntityUris: ['urn:repco:concept:1'] }, }, @@ -63,6 +65,8 @@ class TestDataSource extends BaseDataSource implements DataSource { name: 'concept2', kind: ConceptKind.CATEGORY, // SameAs: { uri: 'urn:repco:concept:1' }, + description: '{}', + summary: '{}', }, headers: { EntityUris: ['urn:repco:concept:2'] }, }, diff --git a/packages/repco-core/test/datasource.ts b/packages/repco-core/test/datasource.ts index 98096aa9..3644ec61 100644 --- a/packages/repco-core/test/datasource.ts +++ b/packages/repco-core/test/datasource.ts @@ -70,6 +70,7 @@ class TestDataSource extends BaseDataSource implements DataSource { MediaAssets: [{ uri: 'urn:test:media:1' }], content: 'helloworld', contentFormat: 'text/plain', + summary: '{}', }, headers: { EntityUris: ['urn:test:content:1'] }, } @@ -102,6 +103,7 @@ class TestDataSource extends BaseDataSource implements DataSource { title: 'Media1', mediaType: 'audio/mp3', File: { uri: 'urn:test:file:1' }, + description: '{}', }, headers: { EntityUris: ['urn:test:media:1'] }, }), @@ -115,6 +117,7 @@ class TestDataSource extends BaseDataSource implements DataSource { title: 'MediaMissingResolved', mediaType: 'audio/mp3', File: { uri: 'urn:test:file:1' }, + description: '{}', }, headers: { EntityUris: ['urn:test:media:fail'] }, }), @@ -127,7 +130,7 @@ class TestDataSource extends BaseDataSource implements DataSource { const form = JSON.parse(record.body) as EntityForm if (this.mapUppercase) { if (form.type === 'ContentItem') { - form.content.title = form.content.title.toUpperCase() + form.content.title = form.content.title //.toUpperCase() } } return [form] diff --git a/packages/repco-frontend/app/graphql/types.ts b/packages/repco-frontend/app/graphql/types.ts index 3c9bb90a..1ba6e474 100644 --- a/packages/repco-frontend/app/graphql/types.ts +++ b/packages/repco-frontend/app/graphql/types.ts @@ -30,14 +30,14 @@ export type Scalars = { export type Agent = { /** Reads and enables pagination through a set of `Commit`. */ - commitsByAgentDid: CommitsConnection + commits: CommitsConnection /** Reads and enables pagination through a set of `Commit`. */ commitsByCommitAgentDidAndParent: AgentCommitsByCommitAgentDidAndParentManyToManyConnection did: Scalars['String'] /** Reads and enables pagination through a set of `Repo`. */ reposByCommitAgentDidAndRepoDid: AgentReposByCommitAgentDidAndRepoDidManyToManyConnection /** Reads and enables pagination through a set of `Revision`. */ - revisionsByAgentDid: RevisionsConnection + revisions: RevisionsConnection type?: Maybe /** Reads a single `User` that is related to this `Agent`. */ userByDid?: Maybe @@ -45,10 +45,10 @@ export type Agent = { * Reads and enables pagination through a set of `User`. * @deprecated Please use userByDid instead */ - usersByDid: UsersConnection + usersBy: UsersConnection } -export type AgentCommitsByAgentDidArgs = { +export type AgentCommitsArgs = { after: InputMaybe before: InputMaybe condition: InputMaybe @@ -81,7 +81,7 @@ export type AgentReposByCommitAgentDidAndRepoDidArgs = { orderBy?: InputMaybe> } -export type AgentRevisionsByAgentDidArgs = { +export type AgentRevisionsArgs = { after: InputMaybe before: InputMaybe condition: InputMaybe @@ -92,7 +92,7 @@ export type AgentRevisionsByAgentDidArgs = { orderBy?: InputMaybe> } -export type AgentUsersByDidArgs = { +export type AgentUsersByArgs = { after: InputMaybe before: InputMaybe condition: InputMaybe @@ -150,20 +150,20 @@ export type AgentCondition = { export type AgentFilter = { /** Checks for all expressions in this list. */ and?: InputMaybe> - /** Filter by the object’s `commitsByAgentDid` relation. */ - commitsByAgentDid?: InputMaybe - /** Some related `commitsByAgentDid` exist. */ - commitsByAgentDidExist?: InputMaybe + /** Filter by the object’s `commits` relation. */ + commits?: InputMaybe + /** Some related `commits` exist. */ + commitsExist?: InputMaybe /** Filter by the object’s `did` field. */ did?: InputMaybe /** Negates the expression. */ not?: InputMaybe /** Checks for any expressions in this list. */ or?: InputMaybe> - /** Filter by the object’s `revisionsByAgentDid` relation. */ - revisionsByAgentDid?: InputMaybe - /** Some related `revisionsByAgentDid` exist. */ - revisionsByAgentDidExist?: InputMaybe + /** Filter by the object’s `revisions` relation. */ + revisions?: InputMaybe + /** Some related `revisions` exist. */ + revisionsExist?: InputMaybe /** Filter by the object’s `type` field. */ type?: InputMaybe /** Filter by the object’s `userByDid` relation. */ @@ -187,7 +187,7 @@ export type AgentReposByCommitAgentDidAndRepoDidManyToManyConnection = { /** A `Repo` edge in the connection, with data from `Commit`. */ export type AgentReposByCommitAgentDidAndRepoDidManyToManyEdge = { /** Reads and enables pagination through a set of `Commit`. */ - commitsByRepoDid: CommitsConnection + commits: CommitsConnection /** A cursor for use in pagination. */ cursor?: Maybe /** The `Repo` at the end of the edge. */ @@ -195,17 +195,16 @@ export type AgentReposByCommitAgentDidAndRepoDidManyToManyEdge = { } /** A `Repo` edge in the connection, with data from `Commit`. */ -export type AgentReposByCommitAgentDidAndRepoDidManyToManyEdgeCommitsByRepoDidArgs = - { - after: InputMaybe - before: InputMaybe - condition: InputMaybe - filter: InputMaybe - first: InputMaybe - last: InputMaybe - offset: InputMaybe - orderBy?: InputMaybe> - } +export type AgentReposByCommitAgentDidAndRepoDidManyToManyEdgeCommitsArgs = { + after: InputMaybe + before: InputMaybe + condition: InputMaybe + filter: InputMaybe + first: InputMaybe + last: InputMaybe + offset: InputMaybe + orderBy?: InputMaybe> +} /** A filter to be used against many `Commit` object types. All fields are combined with a logical ‘and.’ */ export type AgentToManyCommitFilter = { @@ -481,7 +480,7 @@ export type Chapter = { revision?: Maybe revisionId: Scalars['String'] start: Scalars['Float'] - title: Scalars['String'] + title: Scalars['JSON'] type: Scalars['String'] uid: Scalars['String'] } @@ -497,7 +496,7 @@ export type ChapterCondition = { /** Checks for equality with the object’s `start` field. */ start?: InputMaybe /** Checks for equality with the object’s `title` field. */ - title?: InputMaybe + title?: InputMaybe /** Checks for equality with the object’s `type` field. */ type?: InputMaybe /** Checks for equality with the object’s `uid` field. */ @@ -525,7 +524,7 @@ export type ChapterFilter = { /** Filter by the object’s `start` field. */ start?: InputMaybe /** Filter by the object’s `title` field. */ - title?: InputMaybe + title?: InputMaybe /** Filter by the object’s `type` field. */ type?: InputMaybe /** Filter by the object’s `uid` field. */ @@ -575,7 +574,7 @@ export enum ChaptersOrderBy { export type Commit = { /** Reads a single `Agent` that is related to this `Commit`. */ - agentByAgentDid?: Maybe + agent?: Maybe agentDid: Scalars['String'] /** Reads and enables pagination through a set of `Agent`. */ agentsByCommitParentAndAgentDid: CommitAgentsByCommitParentAndAgentDidManyToManyConnection @@ -586,7 +585,7 @@ export type Commit = { commitsByParent: CommitsConnection parent?: Maybe /** Reads a single `Repo` that is related to this `Commit`. */ - repoByRepoDid?: Maybe + repo?: Maybe repoDid: Scalars['String'] /** Reads and enables pagination through a set of `Repo`. */ reposByCommitParentAndRepoDid: CommitReposByCommitParentAndRepoDidManyToManyConnection @@ -655,7 +654,7 @@ export type CommitAgentsByCommitParentAndAgentDidManyToManyConnection = { /** A `Agent` edge in the connection, with data from `Commit`. */ export type CommitAgentsByCommitParentAndAgentDidManyToManyEdge = { /** Reads and enables pagination through a set of `Commit`. */ - commitsByAgentDid: CommitsConnection + commits: CommitsConnection /** A cursor for use in pagination. */ cursor?: Maybe /** The `Agent` at the end of the edge. */ @@ -663,17 +662,16 @@ export type CommitAgentsByCommitParentAndAgentDidManyToManyEdge = { } /** A `Agent` edge in the connection, with data from `Commit`. */ -export type CommitAgentsByCommitParentAndAgentDidManyToManyEdgeCommitsByAgentDidArgs = - { - after: InputMaybe - before: InputMaybe - condition: InputMaybe - filter: InputMaybe - first: InputMaybe - last: InputMaybe - offset: InputMaybe - orderBy?: InputMaybe> - } +export type CommitAgentsByCommitParentAndAgentDidManyToManyEdgeCommitsArgs = { + after: InputMaybe + before: InputMaybe + condition: InputMaybe + filter: InputMaybe + first: InputMaybe + last: InputMaybe + offset: InputMaybe + orderBy?: InputMaybe> +} /** A condition to be used against `Commit` object types. All fields are tested for equality and combined with a logical ‘and.’ */ export type CommitCondition = { @@ -693,8 +691,8 @@ export type CommitCondition = { /** A filter to be used against `Commit` object types. All fields are combined with a logical ‘and.’ */ export type CommitFilter = { - /** Filter by the object’s `agentByAgentDid` relation. */ - agentByAgentDid?: InputMaybe + /** Filter by the object’s `agent` relation. */ + agent?: InputMaybe /** Filter by the object’s `agentDid` field. */ agentDid?: InputMaybe /** Checks for all expressions in this list. */ @@ -715,8 +713,8 @@ export type CommitFilter = { or?: InputMaybe> /** Filter by the object’s `parent` field. */ parent?: InputMaybe - /** Filter by the object’s `repoByRepoDid` relation. */ - repoByRepoDid?: InputMaybe + /** Filter by the object’s `repo` relation. */ + repo?: InputMaybe /** Filter by the object’s `repoDid` field. */ repoDid?: InputMaybe /** Filter by the object’s `reposByHead` relation. */ @@ -744,7 +742,7 @@ export type CommitReposByCommitParentAndRepoDidManyToManyConnection = { /** A `Repo` edge in the connection, with data from `Commit`. */ export type CommitReposByCommitParentAndRepoDidManyToManyEdge = { /** Reads and enables pagination through a set of `Commit`. */ - commitsByRepoDid: CommitsConnection + commits: CommitsConnection /** A cursor for use in pagination. */ cursor?: Maybe /** The `Repo` at the end of the edge. */ @@ -752,17 +750,16 @@ export type CommitReposByCommitParentAndRepoDidManyToManyEdge = { } /** A `Repo` edge in the connection, with data from `Commit`. */ -export type CommitReposByCommitParentAndRepoDidManyToManyEdgeCommitsByRepoDidArgs = - { - after: InputMaybe - before: InputMaybe - condition: InputMaybe - filter: InputMaybe - first: InputMaybe - last: InputMaybe - offset: InputMaybe - orderBy?: InputMaybe> - } +export type CommitReposByCommitParentAndRepoDidManyToManyEdgeCommitsArgs = { + after: InputMaybe + before: InputMaybe + condition: InputMaybe + filter: InputMaybe + first: InputMaybe + last: InputMaybe + offset: InputMaybe + orderBy?: InputMaybe> +} /** A filter to be used against many `Commit` object types. All fields are combined with a logical ‘and.’ */ export type CommitToManyCommitFilter = { @@ -834,11 +831,11 @@ export type Concept = { conceptsBySameAs: ConceptsConnection /** Reads and enables pagination through a set of `ContentItem`. */ contentItems: ConceptContentItemsByConceptToContentItemAAndBManyToManyConnection - description?: Maybe + description?: Maybe kind: ConceptKind /** Reads and enables pagination through a set of `MediaAsset`. */ mediaAssets: ConceptMediaAssetsByConceptToMediaAssetAAndBManyToManyConnection - name: Scalars['String'] + name: Scalars['JSON'] originNamespace?: Maybe /** Reads a single `Concept` that is related to this `Concept`. */ parent?: Maybe @@ -849,7 +846,7 @@ export type Concept = { /** Reads a single `Concept` that is related to this `Concept`. */ sameAs?: Maybe sameAsUid?: Maybe - summary?: Maybe + summary?: Maybe uid: Scalars['String'] wikidataIdentifier?: Maybe } @@ -995,11 +992,11 @@ export type ConceptConceptsByConceptSameAsUidAndParentUidManyToManyEdgeChildConc /** A condition to be used against `Concept` object types. All fields are tested for equality and combined with a logical ‘and.’ */ export type ConceptCondition = { /** Checks for equality with the object’s `description` field. */ - description?: InputMaybe + description?: InputMaybe /** Checks for equality with the object’s `kind` field. */ kind?: InputMaybe /** Checks for equality with the object’s `name` field. */ - name?: InputMaybe + name?: InputMaybe /** Checks for equality with the object’s `originNamespace` field. */ originNamespace?: InputMaybe /** Checks for equality with the object’s `parentUid` field. */ @@ -1009,7 +1006,7 @@ export type ConceptCondition = { /** Checks for equality with the object’s `sameAsUid` field. */ sameAsUid?: InputMaybe /** Checks for equality with the object’s `summary` field. */ - summary?: InputMaybe + summary?: InputMaybe /** Checks for equality with the object’s `uid` field. */ uid?: InputMaybe /** Checks for equality with the object’s `wikidataIdentifier` field. */ @@ -1065,11 +1062,11 @@ export type ConceptFilter = { /** Some related `conceptsBySameAs` exist. */ conceptsBySameAsExist?: InputMaybe /** Filter by the object’s `description` field. */ - description?: InputMaybe + description?: InputMaybe /** Filter by the object’s `kind` field. */ kind?: InputMaybe /** Filter by the object’s `name` field. */ - name?: InputMaybe + name?: InputMaybe /** Negates the expression. */ not?: InputMaybe /** Checks for any expressions in this list. */ @@ -1093,7 +1090,7 @@ export type ConceptFilter = { /** Filter by the object’s `sameAsUid` field. */ sameAsUid?: InputMaybe /** Filter by the object’s `summary` field. */ - summary?: InputMaybe + summary?: InputMaybe /** Filter by the object’s `uid` field. */ uid?: InputMaybe /** Filter by the object’s `wikidataIdentifier` field. */ @@ -1229,7 +1226,7 @@ export type ContentGrouping = { contentItems: ContentGroupingContentItemsByContentGroupingToContentItemAAndBManyToManyConnection /** Reads and enables pagination through a set of `ContentItem`. */ contentItemsByPrimaryGrouping: ContentItemsConnection - description?: Maybe + description?: Maybe groupingType: Scalars['String'] /** Reads a single `License` that is related to this `ContentGrouping`. */ license?: Maybe @@ -1243,9 +1240,9 @@ export type ContentGrouping = { revisionId: Scalars['String'] startingDate?: Maybe subtitle?: Maybe - summary?: Maybe + summary?: Maybe terminationDate?: Maybe - title: Scalars['String'] + title: Scalars['JSON'] uid: Scalars['String'] variant: ContentGroupingVariant } @@ -1304,7 +1301,7 @@ export type ContentGroupingCondition = { /** Checks for equality with the object’s `broadcastSchedule` field. */ broadcastSchedule?: InputMaybe /** Checks for equality with the object’s `description` field. */ - description?: InputMaybe + description?: InputMaybe /** Checks for equality with the object’s `groupingType` field. */ groupingType?: InputMaybe /** Checks for equality with the object’s `licenseUid` field. */ @@ -1316,11 +1313,11 @@ export type ContentGroupingCondition = { /** Checks for equality with the object’s `subtitle` field. */ subtitle?: InputMaybe /** Checks for equality with the object’s `summary` field. */ - summary?: InputMaybe + summary?: InputMaybe /** Checks for equality with the object’s `terminationDate` field. */ terminationDate?: InputMaybe /** Checks for equality with the object’s `title` field. */ - title?: InputMaybe + title?: InputMaybe /** Checks for equality with the object’s `uid` field. */ uid?: InputMaybe /** Checks for equality with the object’s `variant` field. */ @@ -1375,7 +1372,7 @@ export type ContentGroupingFilter = { /** Some related `contentItemsByPrimaryGrouping` exist. */ contentItemsByPrimaryGroupingExist?: InputMaybe /** Filter by the object’s `description` field. */ - description?: InputMaybe + description?: InputMaybe /** Filter by the object’s `groupingType` field. */ groupingType?: InputMaybe /** Filter by the object’s `license` relation. */ @@ -1397,11 +1394,11 @@ export type ContentGroupingFilter = { /** Filter by the object’s `subtitle` field. */ subtitle?: InputMaybe /** Filter by the object’s `summary` field. */ - summary?: InputMaybe + summary?: InputMaybe /** Filter by the object’s `terminationDate` field. */ terminationDate?: InputMaybe /** Filter by the object’s `title` field. */ - title?: InputMaybe + title?: InputMaybe /** Filter by the object’s `uid` field. */ uid?: InputMaybe /** Filter by the object’s `variant` field. */ @@ -1579,7 +1576,7 @@ export type ContentItem = { broadcastEvents: BroadcastEventsConnection /** Reads and enables pagination through a set of `Concept`. */ concepts: ContentItemConceptsByConceptToContentItemBAndAManyToManyConnection - content: Scalars['String'] + content: Scalars['JSON'] contentFormat: Scalars['String'] /** Reads and enables pagination through a set of `ContentGrouping`. */ contentGroupings: ContentItemContentGroupingsByContentGroupingToContentItemBAndAManyToManyConnection @@ -1603,8 +1600,8 @@ export type ContentItem = { revision?: Maybe revisionId: Scalars['String'] subtitle?: Maybe - summary?: Maybe - title: Scalars['String'] + summary?: Maybe + title: Scalars['JSON'] uid: Scalars['String'] } @@ -1717,7 +1714,7 @@ export type ContentItemConceptsByConceptToContentItemBAndAManyToManyEdge_Concept */ export type ContentItemCondition = { /** Checks for equality with the object’s `content` field. */ - content?: InputMaybe + content?: InputMaybe /** Checks for equality with the object’s `contentFormat` field. */ contentFormat?: InputMaybe /** Checks for equality with the object’s `licenseUid` field. */ @@ -1733,9 +1730,9 @@ export type ContentItemCondition = { /** Checks for equality with the object’s `subtitle` field. */ subtitle?: InputMaybe /** Checks for equality with the object’s `summary` field. */ - summary?: InputMaybe + summary?: InputMaybe /** Checks for equality with the object’s `title` field. */ - title?: InputMaybe + title?: InputMaybe /** Checks for equality with the object’s `uid` field. */ uid?: InputMaybe } @@ -1823,7 +1820,7 @@ export type ContentItemFilter = { /** Some related `broadcastEvents` exist. */ broadcastEventsExist?: InputMaybe /** Filter by the object’s `content` field. */ - content?: InputMaybe + content?: InputMaybe /** Filter by the object’s `contentFormat` field. */ contentFormat?: InputMaybe /** Filter by the object’s `license` relation. */ @@ -1857,9 +1854,9 @@ export type ContentItemFilter = { /** Filter by the object’s `subtitle` field. */ subtitle?: InputMaybe /** Filter by the object’s `summary` field. */ - summary?: InputMaybe + summary?: InputMaybe /** Filter by the object’s `title` field. */ - title?: InputMaybe + title?: InputMaybe /** Filter by the object’s `uid` field. */ uid?: InputMaybe } @@ -3124,6 +3121,43 @@ export type FloatFilter = { notIn?: InputMaybe> } +/** All input for the `getContentItemsByLanguage` mutation. */ +export type GetContentItemsByLanguageInput = { + /** + * An arbitrary string value with no semantic meaning. Will be included in the + * payload verbatim. May be used to track mutations by the client. + */ + clientMutationId?: InputMaybe + languageCode?: InputMaybe +} + +/** The output of our `getContentItemsByLanguage` mutation. */ +export type GetContentItemsByLanguagePayload = { + /** + * The exact same `clientMutationId` that was provided in the mutation input, + * unchanged and unused. May be used by a client to track mutations. + */ + clientMutationId?: Maybe + /** Our root query field type. Allows us to run any query from our mutation payload. */ + query?: Maybe + results?: Maybe>> +} + +/** The return type of our `getContentItemsByLanguage` mutation. */ +export type GetContentItemsByLanguageRecord = { + content?: Maybe + contentformat?: Maybe + licenseuid?: Maybe + primarygroupinguid?: Maybe + pubdate?: Maybe + publicationserviceuid?: Maybe + revisionid?: Maybe + subtitle?: Maybe + summary?: Maybe + title?: Maybe + uid?: Maybe +} + /** A filter to be used against Int fields. All fields are combined with a logical ‘and.’ */ export type IntFilter = { /** Not equal to the specified value, treating null like an ordinary value. */ @@ -3648,7 +3682,7 @@ export type MediaAsset = { contentItems: MediaAssetContentItemsByContentItemToMediaAssetBAndAManyToManyConnection /** Reads and enables pagination through a set of `Contribution`. */ contributions: MediaAssetContributionsByContributionToMediaAssetBAndAManyToManyConnection - description?: Maybe + description?: Maybe duration?: Maybe /** Reads a single `File` that is related to this `MediaAsset`. */ file?: Maybe @@ -3663,11 +3697,9 @@ export type MediaAsset = { /** Reads a single `File` that is related to this `MediaAsset`. */ teaserImage?: Maybe teaserImageUid?: Maybe - title: Scalars['String'] + title: Scalars['JSON'] /** Reads and enables pagination through a set of `Transcript`. */ transcripts: TranscriptsConnection - /** Reads and enables pagination through a set of `Translation`. */ - translations: TranslationsConnection uid: Scalars['String'] } @@ -3726,17 +3758,6 @@ export type MediaAssetTranscriptsArgs = { orderBy?: InputMaybe> } -export type MediaAssetTranslationsArgs = { - after: InputMaybe - before: InputMaybe - condition: InputMaybe - filter: InputMaybe - first: InputMaybe - last: InputMaybe - offset: InputMaybe - orderBy?: InputMaybe> -} - /** A connection to a list of `Concept` values, with data from `_ConceptToMediaAsset`. */ export type MediaAssetConceptsByConceptToMediaAssetBAndAManyToManyConnection = { /** A list of edges which contains the `Concept`, info from the `_ConceptToMediaAsset`, and the cursor to aid in pagination. */ @@ -3778,7 +3799,7 @@ export type MediaAssetConceptsByConceptToMediaAssetBAndAManyToManyEdge_ConceptTo */ export type MediaAssetCondition = { /** Checks for equality with the object’s `description` field. */ - description?: InputMaybe + description?: InputMaybe /** Checks for equality with the object’s `duration` field. */ duration?: InputMaybe /** Checks for equality with the object’s `fileUid` field. */ @@ -3792,7 +3813,7 @@ export type MediaAssetCondition = { /** Checks for equality with the object’s `teaserImageUid` field. */ teaserImageUid?: InputMaybe /** Checks for equality with the object’s `title` field. */ - title?: InputMaybe + title?: InputMaybe /** Checks for equality with the object’s `uid` field. */ uid?: InputMaybe } @@ -3880,7 +3901,7 @@ export type MediaAssetFilter = { /** Some related `chapters` exist. */ chaptersExist?: InputMaybe /** Filter by the object’s `description` field. */ - description?: InputMaybe + description?: InputMaybe /** Filter by the object’s `duration` field. */ duration?: InputMaybe /** Filter by the object’s `file` relation. */ @@ -3910,15 +3931,11 @@ export type MediaAssetFilter = { /** Filter by the object’s `teaserImageUid` field. */ teaserImageUid?: InputMaybe /** Filter by the object’s `title` field. */ - title?: InputMaybe + title?: InputMaybe /** Filter by the object’s `transcripts` relation. */ transcripts?: InputMaybe /** Some related `transcripts` exist. */ transcriptsExist?: InputMaybe - /** Filter by the object’s `translations` relation. */ - translations?: InputMaybe - /** Some related `translations` exist. */ - translationsExist?: InputMaybe /** Filter by the object’s `uid` field. */ uid?: InputMaybe } @@ -3943,16 +3960,6 @@ export type MediaAssetToManyTranscriptFilter = { some?: InputMaybe } -/** A filter to be used against many `Translation` object types. All fields are combined with a logical ‘and.’ */ -export type MediaAssetToManyTranslationFilter = { - /** Every related `Translation` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - every?: InputMaybe - /** No related `Translation` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - none?: InputMaybe - /** Some related `Translation` matches the filter criteria. All fields are combined with a logical ‘and.’ */ - some?: InputMaybe -} - /** A connection to a list of `MediaAsset` values. */ export type MediaAssetsConnection = { /** A list of edges which contains the `MediaAsset` and cursor to aid in pagination. */ @@ -4086,6 +4093,16 @@ export type MetadatumFilter = { uid?: InputMaybe } +/** The root mutation type which contains root level fields which mutate data. */ +export type Mutation = { + getContentItemsByLanguage?: Maybe +} + +/** The root mutation type which contains root level fields which mutate data. */ +export type MutationGetContentItemsByLanguageArgs = { + input: GetContentItemsByLanguageInput +} + /** Information about pagination in a connection. */ export type PageInfo = { /** When paginating forwards, the cursor to continue. */ @@ -4111,7 +4128,7 @@ export type PublicationService = { /** Reads and enables pagination through a set of `License`. */ licensesByContentItemPublicationServiceUidAndLicenseUid: PublicationServiceLicensesByContentItemPublicationServiceUidAndLicenseUidManyToManyConnection medium?: Maybe - name: Scalars['String'] + name: Scalars['JSON'] /** Reads a single `Contributor` that is related to this `PublicationService`. */ publisher?: Maybe publisherUid?: Maybe @@ -4189,7 +4206,7 @@ export type PublicationServiceCondition = { /** Checks for equality with the object’s `medium` field. */ medium?: InputMaybe /** Checks for equality with the object’s `name` field. */ - name?: InputMaybe + name?: InputMaybe /** Checks for equality with the object’s `publisherUid` field. */ publisherUid?: InputMaybe /** Checks for equality with the object’s `revisionId` field. */ @@ -4289,7 +4306,7 @@ export type PublicationServiceFilter = { /** Filter by the object’s `medium` field. */ medium?: InputMaybe /** Filter by the object’s `name` field. */ - name?: InputMaybe + name?: InputMaybe /** Negates the expression. */ not?: InputMaybe /** Checks for any expressions in this list. */ @@ -4479,9 +4496,6 @@ export type Query = { transcript?: Maybe /** Reads and enables pagination through a set of `Transcript`. */ transcripts?: Maybe - translation?: Maybe - /** Reads and enables pagination through a set of `Translation`. */ - translations?: Maybe ucan?: Maybe /** Reads and enables pagination through a set of `Ucan`. */ ucans?: Maybe @@ -4877,23 +4891,6 @@ export type QueryTranscriptsArgs = { orderBy?: InputMaybe> } -/** The root query type which gives access points into the data universe. */ -export type QueryTranslationArgs = { - uid: Scalars['String'] -} - -/** The root query type which gives access points into the data universe. */ -export type QueryTranslationsArgs = { - after: InputMaybe - before: InputMaybe - condition: InputMaybe - filter: InputMaybe - first: InputMaybe - last: InputMaybe - offset: InputMaybe - orderBy?: InputMaybe> -} - /** The root query type which gives access points into the data universe. */ export type QueryUcanArgs = { cid: Scalars['String'] @@ -4934,15 +4931,15 @@ export type Repo = { /** Reads a single `Commit` that is related to this `Repo`. */ commitByHead?: Maybe /** Reads and enables pagination through a set of `Commit`. */ - commitsByCommitRepoDidAndParent: RepoCommitsByCommitRepoDidAndParentManyToManyConnection + commits: CommitsConnection /** Reads and enables pagination through a set of `Commit`. */ - commitsByRepoDid: CommitsConnection + commitsByCommitRepoDidAndParent: RepoCommitsByCommitRepoDidAndParentManyToManyConnection did: Scalars['String'] gateways?: Maybe>> head?: Maybe name?: Maybe /** Reads and enables pagination through a set of `Revision`. */ - revisionsByRepoDid: RevisionsConnection + revisions: RevisionsConnection tail?: Maybe } @@ -4957,7 +4954,7 @@ export type RepoAgentsByCommitRepoDidAndAgentDidArgs = { orderBy?: InputMaybe> } -export type RepoCommitsByCommitRepoDidAndParentArgs = { +export type RepoCommitsArgs = { after: InputMaybe before: InputMaybe condition: InputMaybe @@ -4968,7 +4965,7 @@ export type RepoCommitsByCommitRepoDidAndParentArgs = { orderBy?: InputMaybe> } -export type RepoCommitsByRepoDidArgs = { +export type RepoCommitsByCommitRepoDidAndParentArgs = { after: InputMaybe before: InputMaybe condition: InputMaybe @@ -4979,7 +4976,7 @@ export type RepoCommitsByRepoDidArgs = { orderBy?: InputMaybe> } -export type RepoRevisionsByRepoDidArgs = { +export type RepoRevisionsArgs = { after: InputMaybe before: InputMaybe condition: InputMaybe @@ -5005,7 +5002,7 @@ export type RepoAgentsByCommitRepoDidAndAgentDidManyToManyConnection = { /** A `Agent` edge in the connection, with data from `Commit`. */ export type RepoAgentsByCommitRepoDidAndAgentDidManyToManyEdge = { /** Reads and enables pagination through a set of `Commit`. */ - commitsByAgentDid: CommitsConnection + commits: CommitsConnection /** A cursor for use in pagination. */ cursor?: Maybe /** The `Agent` at the end of the edge. */ @@ -5013,17 +5010,16 @@ export type RepoAgentsByCommitRepoDidAndAgentDidManyToManyEdge = { } /** A `Agent` edge in the connection, with data from `Commit`. */ -export type RepoAgentsByCommitRepoDidAndAgentDidManyToManyEdgeCommitsByAgentDidArgs = - { - after: InputMaybe - before: InputMaybe - condition: InputMaybe - filter: InputMaybe - first: InputMaybe - last: InputMaybe - offset: InputMaybe - orderBy?: InputMaybe> - } +export type RepoAgentsByCommitRepoDidAndAgentDidManyToManyEdgeCommitsArgs = { + after: InputMaybe + before: InputMaybe + condition: InputMaybe + filter: InputMaybe + first: InputMaybe + last: InputMaybe + offset: InputMaybe + orderBy?: InputMaybe> +} /** A connection to a list of `Commit` values, with data from `Commit`. */ export type RepoCommitsByCommitRepoDidAndParentManyToManyConnection = { @@ -5082,10 +5078,10 @@ export type RepoFilter = { commitByHead?: InputMaybe /** A related `commitByHead` exists. */ commitByHeadExists?: InputMaybe - /** Filter by the object’s `commitsByRepoDid` relation. */ - commitsByRepoDid?: InputMaybe - /** Some related `commitsByRepoDid` exist. */ - commitsByRepoDidExist?: InputMaybe + /** Filter by the object’s `commits` relation. */ + commits?: InputMaybe + /** Some related `commits` exist. */ + commitsExist?: InputMaybe /** Filter by the object’s `did` field. */ did?: InputMaybe /** Filter by the object’s `gateways` field. */ @@ -5098,10 +5094,10 @@ export type RepoFilter = { not?: InputMaybe /** Checks for any expressions in this list. */ or?: InputMaybe> - /** Filter by the object’s `revisionsByRepoDid` relation. */ - revisionsByRepoDid?: InputMaybe - /** Some related `revisionsByRepoDid` exist. */ - revisionsByRepoDidExist?: InputMaybe + /** Filter by the object’s `revisions` relation. */ + revisions?: InputMaybe + /** Some related `revisions` exist. */ + revisionsExist?: InputMaybe /** Filter by the object’s `tail` field. */ tail?: InputMaybe } @@ -5165,7 +5161,7 @@ export enum ReposOrderBy { export type Revision = { /** Reads a single `Agent` that is related to this `Revision`. */ - agentByAgentDid?: Maybe + agent?: Maybe agentDid: Scalars['String'] /** Reads and enables pagination through a set of `BroadcastEvent`. */ broadcastEvents: BroadcastEventsConnection @@ -5213,6 +5209,7 @@ export type Revision = { filesByMediaAssetRevisionIdAndTeaserImageUid: RevisionFilesByMediaAssetRevisionIdAndTeaserImageUidManyToManyConnection id: Scalars['String'] isDeleted: Scalars['Boolean'] + languages: Scalars['String'] /** Reads and enables pagination through a set of `License`. */ licenses: LicensesConnection /** Reads and enables pagination through a set of `License`. */ @@ -5237,7 +5234,7 @@ export type Revision = { /** Reads and enables pagination through a set of `PublicationService`. */ publicationServicesByContentItemRevisionIdAndPublicationServiceUid: RevisionPublicationServicesByContentItemRevisionIdAndPublicationServiceUidManyToManyConnection /** Reads a single `Repo` that is related to this `Revision`. */ - repoByRepoDid?: Maybe + repo?: Maybe repoDid: Scalars['String'] revisionCid: Scalars['String'] revisionUris?: Maybe>> @@ -5711,6 +5708,8 @@ export type RevisionCondition = { id?: InputMaybe /** Checks for equality with the object’s `isDeleted` field. */ isDeleted?: InputMaybe + /** Checks for equality with the object’s `languages` field. */ + languages?: InputMaybe /** Checks for equality with the object’s `prevRevisionId` field. */ prevRevisionId?: InputMaybe /** Checks for equality with the object’s `repoDid` field. */ @@ -5982,8 +5981,8 @@ export type RevisionFilesByMediaAssetRevisionIdAndTeaserImageUidManyToManyEdgeMe /** A filter to be used against `Revision` object types. All fields are combined with a logical ‘and.’ */ export type RevisionFilter = { - /** Filter by the object’s `agentByAgentDid` relation. */ - agentByAgentDid?: InputMaybe + /** Filter by the object’s `agent` relation. */ + agent?: InputMaybe /** Filter by the object’s `agentDid` field. */ agentDid?: InputMaybe /** Checks for all expressions in this list. */ @@ -6040,6 +6039,8 @@ export type RevisionFilter = { id?: InputMaybe /** Filter by the object’s `isDeleted` field. */ isDeleted?: InputMaybe + /** Filter by the object’s `languages` field. */ + languages?: InputMaybe /** Filter by the object’s `licenses` relation. */ licenses?: InputMaybe /** Some related `licenses` exist. */ @@ -6066,8 +6067,8 @@ export type RevisionFilter = { publicationServices?: InputMaybe /** Some related `publicationServices` exist. */ publicationServicesExist?: InputMaybe - /** Filter by the object’s `repoByRepoDid` relation. */ - repoByRepoDid?: InputMaybe + /** Filter by the object’s `repo` relation. */ + repo?: InputMaybe /** Filter by the object’s `repoDid` field. */ repoDid?: InputMaybe /** Filter by the object’s `revisionCid` field. */ @@ -6484,6 +6485,8 @@ export enum RevisionsOrderBy { IdDesc = 'ID_DESC', IsDeletedAsc = 'IS_DELETED_ASC', IsDeletedDesc = 'IS_DELETED_DESC', + LanguagesAsc = 'LANGUAGES_ASC', + LanguagesDesc = 'LANGUAGES_DESC', Natural = 'NATURAL', PrevRevisionIdAsc = 'PREV_REVISION_ID_ASC', PrevRevisionIdDesc = 'PREV_REVISION_ID_DESC', @@ -6819,92 +6822,6 @@ export enum TranscriptsOrderBy { UidDesc = 'UID_DESC', } -export type Translation = { - engine: Scalars['String'] - language: Scalars['String'] - /** Reads a single `MediaAsset` that is related to this `Translation`. */ - mediaAsset?: Maybe - mediaAssetUid: Scalars['String'] - text: Scalars['String'] - uid: Scalars['String'] -} - -/** - * A condition to be used against `Translation` object types. All fields are tested - * for equality and combined with a logical ‘and.’ - */ -export type TranslationCondition = { - /** Checks for equality with the object’s `engine` field. */ - engine?: InputMaybe - /** Checks for equality with the object’s `language` field. */ - language?: InputMaybe - /** Checks for equality with the object’s `mediaAssetUid` field. */ - mediaAssetUid?: InputMaybe - /** Checks for equality with the object’s `text` field. */ - text?: InputMaybe - /** Checks for equality with the object’s `uid` field. */ - uid?: InputMaybe -} - -/** A filter to be used against `Translation` object types. All fields are combined with a logical ‘and.’ */ -export type TranslationFilter = { - /** Checks for all expressions in this list. */ - and?: InputMaybe> - /** Filter by the object’s `engine` field. */ - engine?: InputMaybe - /** Filter by the object’s `language` field. */ - language?: InputMaybe - /** Filter by the object’s `mediaAsset` relation. */ - mediaAsset?: InputMaybe - /** Filter by the object’s `mediaAssetUid` field. */ - mediaAssetUid?: InputMaybe - /** Negates the expression. */ - not?: InputMaybe - /** Checks for any expressions in this list. */ - or?: InputMaybe> - /** Filter by the object’s `text` field. */ - text?: InputMaybe - /** Filter by the object’s `uid` field. */ - uid?: InputMaybe -} - -/** A connection to a list of `Translation` values. */ -export type TranslationsConnection = { - /** A list of edges which contains the `Translation` and cursor to aid in pagination. */ - edges: Array - /** A list of `Translation` objects. */ - nodes: Array - /** Information to aid in pagination. */ - pageInfo: PageInfo - /** The count of *all* `Translation` you could get from the connection. */ - totalCount: Scalars['Int'] -} - -/** A `Translation` edge in the connection. */ -export type TranslationsEdge = { - /** A cursor for use in pagination. */ - cursor?: Maybe - /** The `Translation` at the end of the edge. */ - node: Translation -} - -/** Methods to use when ordering `Translation`. */ -export enum TranslationsOrderBy { - EngineAsc = 'ENGINE_ASC', - EngineDesc = 'ENGINE_DESC', - LanguageAsc = 'LANGUAGE_ASC', - LanguageDesc = 'LANGUAGE_DESC', - MediaAssetUidAsc = 'MEDIA_ASSET_UID_ASC', - MediaAssetUidDesc = 'MEDIA_ASSET_UID_DESC', - Natural = 'NATURAL', - PrimaryKeyAsc = 'PRIMARY_KEY_ASC', - PrimaryKeyDesc = 'PRIMARY_KEY_DESC', - TextAsc = 'TEXT_ASC', - TextDesc = 'TEXT_DESC', - UidAsc = 'UID_ASC', - UidDesc = 'UID_DESC', -} - export type Ucan = { audience: Scalars['String'] cid: Scalars['String'] @@ -7588,15 +7505,15 @@ export type LoadContentItemQueryVariables = Exact<{ export type LoadContentItemQuery = { contentItem?: { - title: string + title: any uid: string - content: string + content: any revisionId: string mediaAssets: { nodes: Array<{ uid: string mediaType: string - title: string + title: any duration?: number | null file?: { uid: string; contentUrl: string } | null }> @@ -7624,17 +7541,17 @@ export type LoadContentItemsQuery = { } nodes: Array<{ pubDate?: any | null - title: string + title: any uid: string subtitle?: string | null - summary?: string | null + summary?: any | null mediaAssets: { nodes: Array<{ duration?: number | null fileUid: string licenseUid?: string | null mediaType: string - title: string + title: any uid: string file?: { contentUrl: string @@ -7643,7 +7560,7 @@ export type LoadContentItemsQuery = { } | null }> } - publicationService?: { name: string } | null + publicationService?: { name: any } | null }> } | null } @@ -7668,9 +7585,9 @@ export type LoadDashboardDataQuery = { concepts?: { totalCount: number } | null publicationServices?: { totalCount: number - nodes: Array<{ name: string; contentItems: { totalCount: number } }> + nodes: Array<{ name: any; contentItems: { totalCount: number } }> } | null - latestConetentItems?: { nodes: Array<{ title: string; uid: string }> } | null + latestConetentItems?: { nodes: Array<{ title: any; uid: string }> } | null totalPublicationServices?: { totalCount: number } | null totalContentItems?: { totalCount: number } | null contentGroupings?: { totalCount: number } | null diff --git a/packages/repco-graphql/generated/schema.graphql b/packages/repco-graphql/generated/schema.graphql index fc5f7960..410e9195 100644 --- a/packages/repco-graphql/generated/schema.graphql +++ b/packages/repco-graphql/generated/schema.graphql @@ -720,7 +720,7 @@ type Chapter { revision: Revision revisionId: String! start: Float! - title: String! + title: JSON! type: String! uid: String! } @@ -742,7 +742,7 @@ input ChapterCondition { start: Float """Checks for equality with the object’s `title` field.""" - title: String + title: JSON """Checks for equality with the object’s `type` field.""" type: String @@ -783,7 +783,7 @@ input ChapterFilter { start: FloatFilter """Filter by the object’s `title` field.""" - title: StringFilter + title: JSONFilter """Filter by the object’s `type` field.""" type: StringFilter @@ -1446,7 +1446,7 @@ type Concept { """The method to use when ordering `ContentItem`.""" orderBy: [ContentItemsOrderBy!] = [PRIMARY_KEY_ASC] ): ConceptContentItemsByConceptToContentItemAAndBManyToManyConnection! - description: String + description: JSON kind: ConceptKind! """Reads and enables pagination through a set of `MediaAsset`.""" @@ -1482,7 +1482,7 @@ type Concept { """The method to use when ordering `MediaAsset`.""" orderBy: [MediaAssetsOrderBy!] = [PRIMARY_KEY_ASC] ): ConceptMediaAssetsByConceptToMediaAssetAAndBManyToManyConnection! - name: String! + name: JSON! originNamespace: String """Reads a single `Concept` that is related to this `Concept`.""" @@ -1496,7 +1496,7 @@ type Concept { """Reads a single `Concept` that is related to this `Concept`.""" sameAs: Concept sameAsUid: String - summary: String + summary: JSON uid: String! wikidataIdentifier: String } @@ -1626,13 +1626,13 @@ A condition to be used against `Concept` object types. All fields are tested for """ input ConceptCondition { """Checks for equality with the object’s `description` field.""" - description: String + description: JSON """Checks for equality with the object’s `kind` field.""" kind: ConceptKind """Checks for equality with the object’s `name` field.""" - name: String + name: JSON """Checks for equality with the object’s `originNamespace` field.""" originNamespace: String @@ -1647,7 +1647,7 @@ input ConceptCondition { sameAsUid: String """Checks for equality with the object’s `summary` field.""" - summary: String + summary: JSON """Checks for equality with the object’s `uid` field.""" uid: String @@ -1740,13 +1740,13 @@ input ConceptFilter { conceptsBySameAsExist: Boolean """Filter by the object’s `description` field.""" - description: StringFilter + description: JSONFilter """Filter by the object’s `kind` field.""" kind: ConceptKindFilter """Filter by the object’s `name` field.""" - name: StringFilter + name: JSONFilter """Negates the expression.""" not: ConceptFilter @@ -1782,7 +1782,7 @@ input ConceptFilter { sameAsUid: StringFilter """Filter by the object’s `summary` field.""" - summary: StringFilter + summary: JSONFilter """Filter by the object’s `uid` field.""" uid: StringFilter @@ -2045,7 +2045,7 @@ type ContentGrouping { """The method to use when ordering `ContentItem`.""" orderBy: [ContentItemsOrderBy!] = [PRIMARY_KEY_ASC] ): ContentItemsConnection! - description: String + description: JSON groupingType: String! """Reads a single `License` that is related to this `ContentGrouping`.""" @@ -2125,9 +2125,9 @@ type ContentGrouping { revisionId: String! startingDate: Datetime subtitle: String - summary: String + summary: JSON terminationDate: Datetime - title: String! + title: JSON! uid: String! variant: ContentGroupingVariant! } @@ -2141,7 +2141,7 @@ input ContentGroupingCondition { broadcastSchedule: String """Checks for equality with the object’s `description` field.""" - description: String + description: JSON """Checks for equality with the object’s `groupingType` field.""" groupingType: String @@ -2159,13 +2159,13 @@ input ContentGroupingCondition { subtitle: String """Checks for equality with the object’s `summary` field.""" - summary: String + summary: JSON """Checks for equality with the object’s `terminationDate` field.""" terminationDate: Datetime """Checks for equality with the object’s `title` field.""" - title: String + title: JSON """Checks for equality with the object’s `uid` field.""" uid: String @@ -2257,7 +2257,7 @@ input ContentGroupingFilter { contentItemsByPrimaryGroupingExist: Boolean """Filter by the object’s `description` field.""" - description: StringFilter + description: JSONFilter """Filter by the object’s `groupingType` field.""" groupingType: StringFilter @@ -2290,13 +2290,13 @@ input ContentGroupingFilter { subtitle: StringFilter """Filter by the object’s `summary` field.""" - summary: StringFilter + summary: JSONFilter """Filter by the object’s `terminationDate` field.""" terminationDate: DatetimeFilter """Filter by the object’s `title` field.""" - title: StringFilter + title: JSONFilter """Filter by the object’s `uid` field.""" uid: StringFilter @@ -2627,7 +2627,7 @@ type ContentItem { """The method to use when ordering `Concept`.""" orderBy: [ConceptsOrderBy!] = [PRIMARY_KEY_ASC] ): ContentItemConceptsByConceptToContentItemBAndAManyToManyConnection! - content: String! + content: JSON! contentFormat: String! """Reads and enables pagination through a set of `ContentGrouping`.""" @@ -2787,8 +2787,8 @@ type ContentItem { revision: Revision revisionId: String! subtitle: String - summary: String - title: String! + summary: JSON + title: JSON! uid: String! } @@ -2862,7 +2862,7 @@ for equality and combined with a logical ‘and.’ """ input ContentItemCondition { """Checks for equality with the object’s `content` field.""" - content: String + content: JSON """Checks for equality with the object’s `contentFormat` field.""" contentFormat: String @@ -2886,10 +2886,10 @@ input ContentItemCondition { subtitle: String """Checks for equality with the object’s `summary` field.""" - summary: String + summary: JSON """Checks for equality with the object’s `title` field.""" - title: String + title: JSON """Checks for equality with the object’s `uid` field.""" uid: String @@ -3043,7 +3043,7 @@ input ContentItemFilter { broadcastEventsExist: Boolean """Filter by the object’s `content` field.""" - content: StringFilter + content: JSONFilter """Filter by the object’s `contentFormat` field.""" contentFormat: StringFilter @@ -3094,10 +3094,10 @@ input ContentItemFilter { subtitle: StringFilter """Filter by the object’s `summary` field.""" - summary: StringFilter + summary: JSONFilter """Filter by the object’s `title` field.""" - title: StringFilter + title: JSONFilter """Filter by the object’s `uid` field.""" uid: StringFilter @@ -5184,6 +5184,234 @@ input FloatFilter { notIn: [Float!] } +"""All input for the `getChapterByLanguage` mutation.""" +input GetChapterByLanguageInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + languageCode: String +} + +"""The output of our `getChapterByLanguage` mutation.""" +type GetChapterByLanguagePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + results: [GetChapterByLanguageRecord] +} + +"""The return type of our `getChapterByLanguage` mutation.""" +type GetChapterByLanguageRecord { + duration: Float + revisionid: String + start: Float + title: String + type: String + uid: String +} + +"""All input for the `getConceptByLanguage` mutation.""" +input GetConceptByLanguageInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + languageCode: String +} + +"""The output of our `getConceptByLanguage` mutation.""" +type GetConceptByLanguagePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + results: [GetConceptByLanguageRecord] +} + +"""The return type of our `getConceptByLanguage` mutation.""" +type GetConceptByLanguageRecord { + description: String + kind: ConceptKind + name: String + originnamespace: String + parentuid: String + revisionid: String + sameasuid: String + summary: String + uid: String + wikidataidentifier: String +} + +"""All input for the `getContentGroupingsByLanguage` mutation.""" +input GetContentGroupingsByLanguageInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + languageCode: String +} + +"""The output of our `getContentGroupingsByLanguage` mutation.""" +type GetContentGroupingsByLanguagePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + results: [GetContentGroupingsByLanguageRecord] +} + +"""The return type of our `getContentGroupingsByLanguage` mutation.""" +type GetContentGroupingsByLanguageRecord { + broadcastschedule: String + description: String + groupingtype: String + licenseuid: String + revisionid: String + startingdate: Datetime + subtitle: String + summary: String + terminationdate: Datetime + title: String + uid: String + variant: ContentGroupingVariant +} + +"""All input for the `getContentItemsByLanguage` mutation.""" +input GetContentItemsByLanguageInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + languageCode: String +} + +"""The output of our `getContentItemsByLanguage` mutation.""" +type GetContentItemsByLanguagePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + results: [GetContentItemsByLanguageRecord] +} + +"""The return type of our `getContentItemsByLanguage` mutation.""" +type GetContentItemsByLanguageRecord { + content: String + contentformat: String + licenseuid: String + primarygroupinguid: String + pubdate: Datetime + publicationserviceuid: String + revisionid: String + subtitle: String + summary: String + title: String + uid: String +} + +"""All input for the `getMediaAssetByLanguage` mutation.""" +input GetMediaAssetByLanguageInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + languageCode: String +} + +"""The output of our `getMediaAssetByLanguage` mutation.""" +type GetMediaAssetByLanguagePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + results: [GetMediaAssetByLanguageRecord] +} + +"""The return type of our `getMediaAssetByLanguage` mutation.""" +type GetMediaAssetByLanguageRecord { + description: String + duration: Float + fileuid: String + licenseuid: String + mediatype: String + revisionid: String + teaserimageuid: String + title: String + uid: String +} + +"""All input for the `getPublicationServiceByLanguage` mutation.""" +input GetPublicationServiceByLanguageInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + languageCode: String +} + +"""The output of our `getPublicationServiceByLanguage` mutation.""" +type GetPublicationServiceByLanguagePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + results: [GetPublicationServiceByLanguageRecord] +} + +"""The return type of our `getPublicationServiceByLanguage` mutation.""" +type GetPublicationServiceByLanguageRecord { + address: String + medium: String + publisheruid: String + revisionid: String + title: String + uid: String +} + """ A filter to be used against Int fields. All fields are combined with a logical ‘and.’ """ @@ -6217,7 +6445,7 @@ type MediaAsset { """The method to use when ordering `Contribution`.""" orderBy: [ContributionsOrderBy!] = [PRIMARY_KEY_ASC] ): MediaAssetContributionsByContributionToMediaAssetBAndAManyToManyConnection! - description: String + description: JSON duration: Float """Reads a single `File` that is related to this `MediaAsset`.""" @@ -6236,7 +6464,7 @@ type MediaAsset { """Reads a single `File` that is related to this `MediaAsset`.""" teaserImage: File teaserImageUid: String - title: String! + title: JSON! """Reads and enables pagination through a set of `Transcript`.""" transcripts( @@ -6271,40 +6499,6 @@ type MediaAsset { """The method to use when ordering `Transcript`.""" orderBy: [TranscriptsOrderBy!] = [PRIMARY_KEY_ASC] ): TranscriptsConnection! - - """Reads and enables pagination through a set of `Translation`.""" - translations( - """Read all values in the set after (below) this cursor.""" - after: Cursor - - """Read all values in the set before (above) this cursor.""" - before: Cursor - - """ - A condition to be used in determining which values should be returned by the collection. - """ - condition: TranslationCondition - - """ - A filter to be used in determining which values should be returned by the collection. - """ - filter: TranslationFilter - - """Only read the first `n` values of the set.""" - first: Int - - """Only read the last `n` values of the set.""" - last: Int - - """ - Skip the first `n` values from our `after` cursor, an alternative to cursor - based pagination. May not be used with `last`. - """ - offset: Int - - """The method to use when ordering `Translation`.""" - orderBy: [TranslationsOrderBy!] = [PRIMARY_KEY_ASC] - ): TranslationsConnection! uid: String! } @@ -6378,7 +6572,7 @@ for equality and combined with a logical ‘and.’ """ input MediaAssetCondition { """Checks for equality with the object’s `description` field.""" - description: String + description: JSON """Checks for equality with the object’s `duration` field.""" duration: Float @@ -6399,7 +6593,7 @@ input MediaAssetCondition { teaserImageUid: String """Checks for equality with the object’s `title` field.""" - title: String + title: JSON """Checks for equality with the object’s `uid` field.""" uid: String @@ -6551,7 +6745,7 @@ input MediaAssetFilter { chaptersExist: Boolean """Filter by the object’s `description` field.""" - description: StringFilter + description: JSONFilter """Filter by the object’s `duration` field.""" duration: FloatFilter @@ -6596,7 +6790,7 @@ input MediaAssetFilter { teaserImageUid: StringFilter """Filter by the object’s `title` field.""" - title: StringFilter + title: JSONFilter """Filter by the object’s `transcripts` relation.""" transcripts: MediaAssetToManyTranscriptFilter @@ -6604,12 +6798,6 @@ input MediaAssetFilter { """Some related `transcripts` exist.""" transcriptsExist: Boolean - """Filter by the object’s `translations` relation.""" - translations: MediaAssetToManyTranslationFilter - - """Some related `translations` exist.""" - translationsExist: Boolean - """Filter by the object’s `uid` field.""" uid: StringFilter } @@ -6654,26 +6842,6 @@ input MediaAssetToManyTranscriptFilter { some: TranscriptFilter } -""" -A filter to be used against many `Translation` object types. All fields are combined with a logical ‘and.’ -""" -input MediaAssetToManyTranslationFilter { - """ - Every related `Translation` matches the filter criteria. All fields are combined with a logical ‘and.’ - """ - every: TranslationFilter - - """ - No related `Translation` matches the filter criteria. All fields are combined with a logical ‘and.’ - """ - none: TranslationFilter - - """ - Some related `Translation` matches the filter criteria. All fields are combined with a logical ‘and.’ - """ - some: TranslationFilter -} - """A connection to a list of `MediaAsset` values.""" type MediaAssetsConnection { """ @@ -6836,6 +7004,48 @@ input MetadatumFilter { uid: StringFilter } +""" +The root mutation type which contains root level fields which mutate data. +""" +type Mutation { + getChapterByLanguage( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: GetChapterByLanguageInput! + ): GetChapterByLanguagePayload + getConceptByLanguage( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: GetConceptByLanguageInput! + ): GetConceptByLanguagePayload + getContentGroupingsByLanguage( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: GetContentGroupingsByLanguageInput! + ): GetContentGroupingsByLanguagePayload + getContentItemsByLanguage( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: GetContentItemsByLanguageInput! + ): GetContentItemsByLanguagePayload + getMediaAssetByLanguage( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: GetMediaAssetByLanguageInput! + ): GetMediaAssetByLanguagePayload + getPublicationServiceByLanguage( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: GetPublicationServiceByLanguageInput! + ): GetPublicationServiceByLanguagePayload +} + """Information about pagination in a connection.""" type PageInfo { """When paginating forwards, the cursor to continue.""" @@ -7024,7 +7234,7 @@ type PublicationService { orderBy: [LicensesOrderBy!] = [PRIMARY_KEY_ASC] ): PublicationServiceLicensesByContentItemPublicationServiceUidAndLicenseUidManyToManyConnection! medium: String - name: String! + name: JSON! """ Reads a single `Contributor` that is related to this `PublicationService`. @@ -7052,7 +7262,7 @@ input PublicationServiceCondition { medium: String """Checks for equality with the object’s `name` field.""" - name: String + name: JSON """Checks for equality with the object’s `publisherUid` field.""" publisherUid: String @@ -7220,7 +7430,7 @@ input PublicationServiceFilter { medium: StringFilter """Filter by the object’s `name` field.""" - name: StringFilter + name: JSONFilter """Negates the expression.""" not: PublicationServiceFilter @@ -8208,41 +8418,6 @@ type Query { """The method to use when ordering `Transcript`.""" orderBy: [TranscriptsOrderBy!] = [PRIMARY_KEY_ASC] ): TranscriptsConnection - translation(uid: String!): Translation - - """Reads and enables pagination through a set of `Translation`.""" - translations( - """Read all values in the set after (below) this cursor.""" - after: Cursor - - """Read all values in the set before (above) this cursor.""" - before: Cursor - - """ - A condition to be used in determining which values should be returned by the collection. - """ - condition: TranslationCondition - - """ - A filter to be used in determining which values should be returned by the collection. - """ - filter: TranslationFilter - - """Only read the first `n` values of the set.""" - first: Int - - """Only read the last `n` values of the set.""" - last: Int - - """ - Skip the first `n` values from our `after` cursor, an alternative to cursor - based pagination. May not be used with `last`. - """ - offset: Int - - """The method to use when ordering `Translation`.""" - orderBy: [TranslationsOrderBy!] = [PRIMARY_KEY_ASC] - ): TranslationsConnection ucan(cid: String!): Ucan """Reads and enables pagination through a set of `Ucan`.""" @@ -9389,6 +9564,7 @@ type Revision { ): RevisionFilesByMediaAssetRevisionIdAndTeaserImageUidManyToManyConnection! id: String! isDeleted: Boolean! + languages: String! """Reads and enables pagination through a set of `License`.""" licenses( @@ -9990,6 +10166,9 @@ input RevisionCondition { """Checks for equality with the object’s `isDeleted` field.""" isDeleted: Boolean + """Checks for equality with the object’s `languages` field.""" + languages: String + """Checks for equality with the object’s `prevRevisionId` field.""" prevRevisionId: String @@ -10531,6 +10710,9 @@ input RevisionFilter { """Filter by the object’s `isDeleted` field.""" isDeleted: BooleanFilter + """Filter by the object’s `languages` field.""" + languages: StringFilter + """Filter by the object’s `licenses` relation.""" licenses: RevisionToManyLicenseFilter @@ -11298,6 +11480,8 @@ enum RevisionsOrderBy { ID_DESC IS_DELETED_ASC IS_DELETED_DESC + LANGUAGES_ASC + LANGUAGES_DESC NATURAL PREV_REVISION_ID_ASC PREV_REVISION_ID_DESC @@ -11761,113 +11945,6 @@ enum TranscriptsOrderBy { UID_DESC } -type Translation { - engine: String! - language: String! - - """Reads a single `MediaAsset` that is related to this `Translation`.""" - mediaAsset: MediaAsset - mediaAssetUid: String! - text: String! - uid: String! -} - -""" -A condition to be used against `Translation` object types. All fields are tested -for equality and combined with a logical ‘and.’ -""" -input TranslationCondition { - """Checks for equality with the object’s `engine` field.""" - engine: String - - """Checks for equality with the object’s `language` field.""" - language: String - - """Checks for equality with the object’s `mediaAssetUid` field.""" - mediaAssetUid: String - - """Checks for equality with the object’s `text` field.""" - text: String - - """Checks for equality with the object’s `uid` field.""" - uid: String -} - -""" -A filter to be used against `Translation` object types. All fields are combined with a logical ‘and.’ -""" -input TranslationFilter { - """Checks for all expressions in this list.""" - and: [TranslationFilter!] - - """Filter by the object’s `engine` field.""" - engine: StringFilter - - """Filter by the object’s `language` field.""" - language: StringFilter - - """Filter by the object’s `mediaAsset` relation.""" - mediaAsset: MediaAssetFilter - - """Filter by the object’s `mediaAssetUid` field.""" - mediaAssetUid: StringFilter - - """Negates the expression.""" - not: TranslationFilter - - """Checks for any expressions in this list.""" - or: [TranslationFilter!] - - """Filter by the object’s `text` field.""" - text: StringFilter - - """Filter by the object’s `uid` field.""" - uid: StringFilter -} - -"""A connection to a list of `Translation` values.""" -type TranslationsConnection { - """ - A list of edges which contains the `Translation` and cursor to aid in pagination. - """ - edges: [TranslationsEdge!]! - - """A list of `Translation` objects.""" - nodes: [Translation!]! - - """Information to aid in pagination.""" - pageInfo: PageInfo! - - """The count of *all* `Translation` you could get from the connection.""" - totalCount: Int! -} - -"""A `Translation` edge in the connection.""" -type TranslationsEdge { - """A cursor for use in pagination.""" - cursor: Cursor - - """The `Translation` at the end of the edge.""" - node: Translation! -} - -"""Methods to use when ordering `Translation`.""" -enum TranslationsOrderBy { - ENGINE_ASC - ENGINE_DESC - LANGUAGE_ASC - LANGUAGE_DESC - MEDIA_ASSET_UID_ASC - MEDIA_ASSET_UID_DESC - NATURAL - PRIMARY_KEY_ASC - PRIMARY_KEY_DESC - TEXT_ASC - TEXT_DESC - UID_ASC - UID_DESC -} - type Ucan { audience: String! cid: String! diff --git a/packages/repco-graphql/src/lib.ts b/packages/repco-graphql/src/lib.ts index ae6cb15d..a04aecc1 100644 --- a/packages/repco-graphql/src/lib.ts +++ b/packages/repco-graphql/src/lib.ts @@ -52,11 +52,12 @@ export function getPostGraphileOptions() { CustomInflector, WrapResolversPlugin, ExportSchemaPlugin, + // CustomFilterPlugin, ], dynamicJson: true, graphileBuildOptions: { // https://github.com/graphile-contrib/postgraphile-plugin-connection-filter#performance-and-security - connectionFilterComputedColumns: false, + connectionFilterComputedColumns: true, connectionFilterSetofFunctions: false, connectionFilterLists: false, connectionFilterRelations: true, diff --git a/packages/repco-graphql/src/plugins/custom-filter.ts b/packages/repco-graphql/src/plugins/custom-filter.ts new file mode 100644 index 00000000..90b75cee --- /dev/null +++ b/packages/repco-graphql/src/plugins/custom-filter.ts @@ -0,0 +1,18 @@ +import { makeAddPgTableConditionPlugin } from 'graphile-utils' +import { GraphQLNonNull, GraphQLString } from 'graphql' + +const CustomFilterPlugin = makeAddPgTableConditionPlugin( + 'repco', + 'Revision', + 'language', + (build) => ({ + description: 'Filters the list to Revisions that have a specific language.', + type: new build.graphql.GraphQLList(new GraphQLNonNull(GraphQLString)), + }), + (value, helpers, build) => { + const { sql, sqlTableAlias } = helpers + return sql.fragment`${sqlTableAlias}->>'en' LIKE '%${sql.value(value)}%'` + }, +) + +export default CustomFilterPlugin diff --git a/packages/repco-prisma/prisma/migrations/20230712072235_language/migration.sql b/packages/repco-prisma/prisma/migrations/20230712072235_language/migration.sql new file mode 100644 index 00000000..4a416c2d --- /dev/null +++ b/packages/repco-prisma/prisma/migrations/20230712072235_language/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Revision" ADD COLUMN "languages" TEXT NOT NULL DEFAULT ''; diff --git a/packages/repco-prisma/prisma/migrations/20230713110521_languagepoc/migration.sql b/packages/repco-prisma/prisma/migrations/20230713110521_languagepoc/migration.sql new file mode 100644 index 00000000..b846c8e3 --- /dev/null +++ b/packages/repco-prisma/prisma/migrations/20230713110521_languagepoc/migration.sql @@ -0,0 +1,9 @@ +/* + Warnings: + + - The `languages` column on the `Revision` table would be dropped and recreated. This will lead to data loss if there is data in the column. + +*/ +-- AlterTable +ALTER TABLE "Revision" DROP COLUMN "languages", +ADD COLUMN "languages" JSONB NOT NULL DEFAULT '[]'; diff --git a/packages/repco-prisma/prisma/migrations/20230718063427_languagepoc2/migration.sql b/packages/repco-prisma/prisma/migrations/20230718063427_languagepoc2/migration.sql new file mode 100644 index 00000000..5381d9f3 --- /dev/null +++ b/packages/repco-prisma/prisma/migrations/20230718063427_languagepoc2/migration.sql @@ -0,0 +1,12 @@ +/* + Warnings: + + - The `title` column on the `ContentItem` table would be dropped and recreated. This will lead to data loss if there is data in the column. + +*/ +-- AlterTable +ALTER TABLE "ContentItem" DROP COLUMN "title", +ADD COLUMN "title" JSONB NOT NULL DEFAULT '{}'; + +-- AlterTable +ALTER TABLE "Revision" ALTER COLUMN "languages" SET DEFAULT '{}'; diff --git a/packages/repco-prisma/prisma/migrations/20230720132041_multilingual/migration.sql b/packages/repco-prisma/prisma/migrations/20230720132041_multilingual/migration.sql new file mode 100644 index 00000000..a58d71a5 --- /dev/null +++ b/packages/repco-prisma/prisma/migrations/20230720132041_multilingual/migration.sql @@ -0,0 +1,63 @@ +/* + Warnings: + + - The `name` column on the `Concept` table would be dropped and recreated. This will lead to data loss if there is data in the column. + - The `summary` column on the `Concept` table would be dropped and recreated. This will lead to data loss if there is data in the column. + - The `description` column on the `Concept` table would be dropped and recreated. This will lead to data loss if there is data in the column. + - The `description` column on the `ContentGrouping` table would be dropped and recreated. This will lead to data loss if there is data in the column. + - The `summary` column on the `ContentGrouping` table would be dropped and recreated. This will lead to data loss if there is data in the column. + - The `title` column on the `ContentGrouping` table would be dropped and recreated. This will lead to data loss if there is data in the column. + - The `summary` column on the `ContentItem` table would be dropped and recreated. This will lead to data loss if there is data in the column. + - The `content` column on the `ContentItem` table would be dropped and recreated. This will lead to data loss if there is data in the column. + - The `title` column on the `MediaAsset` table would be dropped and recreated. This will lead to data loss if there is data in the column. + - The `description` column on the `MediaAsset` table would be dropped and recreated. This will lead to data loss if there is data in the column. + - The `name` column on the `PublicationService` table would be dropped and recreated. This will lead to data loss if there is data in the column. + - You are about to drop the `Translation` table. If the table is not empty, all the data it contains will be lost. + - Changed the type of `title` on the `Chapter` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required. + +*/ +-- DropForeignKey +ALTER TABLE "Translation" DROP CONSTRAINT "Translation_mediaAssetUid_fkey"; + +-- AlterTable +ALTER TABLE "Chapter" DROP COLUMN "title", +ADD COLUMN "title" JSONB NOT NULL; + +-- AlterTable +ALTER TABLE "Concept" DROP COLUMN "name", +ADD COLUMN "name" JSONB NOT NULL DEFAULT '{}', +DROP COLUMN "summary", +ADD COLUMN "summary" JSONB, +DROP COLUMN "description", +ADD COLUMN "description" JSONB; + +-- AlterTable +ALTER TABLE "ContentGrouping" DROP COLUMN "description", +ADD COLUMN "description" JSONB, +DROP COLUMN "summary", +ADD COLUMN "summary" JSONB, +DROP COLUMN "title", +ADD COLUMN "title" JSONB NOT NULL DEFAULT '{}'; + +-- AlterTable +ALTER TABLE "ContentItem" DROP COLUMN "summary", +ADD COLUMN "summary" JSONB, +DROP COLUMN "content", +ADD COLUMN "content" JSONB NOT NULL DEFAULT '{}'; + +-- AlterTable +ALTER TABLE "MediaAsset" DROP COLUMN "title", +ADD COLUMN "title" JSONB NOT NULL DEFAULT '{}', +DROP COLUMN "description", +ADD COLUMN "description" JSONB; + +-- AlterTable +ALTER TABLE "PublicationService" DROP COLUMN "name", +ADD COLUMN "name" JSONB NOT NULL DEFAULT '{}'; + +-- AlterTable +ALTER TABLE "Revision" ALTER COLUMN "languages" SET DEFAULT '', +ALTER COLUMN "languages" SET DATA TYPE TEXT; + +-- DropTable +DROP TABLE "Translation"; diff --git a/packages/repco-prisma/prisma/migrations/20230905113840_graph_ql_functions/migration.sql b/packages/repco-prisma/prisma/migrations/20230905113840_graph_ql_functions/migration.sql new file mode 100644 index 00000000..ec21c64a --- /dev/null +++ b/packages/repco-prisma/prisma/migrations/20230905113840_graph_ql_functions/migration.sql @@ -0,0 +1,149 @@ +CREATE OR REPLACE FUNCTION get_content_groupings_by_language(language_code text) +RETURNS TABLE(uid text, + revisionid text, + broadcastschedule text, + groupingtype text, + startingdate timestamp without time zone, + subtitle text, + terminationDate timestamp without time zone, + variant "ContentGroupingVariant", + licenseuid text, + description text, + title text, + summary text) +AS $$ +begin + return query EXECUTE 'select + uid, "ContentGrouping"."revisionId", "ContentGrouping"."broadcastSchedule", "ContentGrouping"."groupingType", "ContentGrouping"."startingDate", + subtitle, "ContentGrouping"."terminationDate", variant, "ContentGrouping"."licenseUid", + description#>>''{' || language_code ||',value}'' as description, + title#>>''{' || language_code ||',value}'' as title, + summary#>>''{' || language_code ||',value}'' as summary + from + "ContentGrouping" + where title->>'|| quote_literal(language_code) ||' is not null + or description->>'|| quote_literal(language_code) ||' is not null + or summary->>'|| quote_literal(language_code) ||' is not null' + using language_code; +end; +$$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION get_content_items_by_language(language_code text) +RETURNS TABLE(uid text, + revisionid text, + subtitle text, + pubdate timestamp without time zone, + contentformat text, + primarygroupinguid text, + licenseuid text, + publicationserviceuid text, + title text, + content text, + summary text) +AS $$ +begin + return query EXECUTE 'select + uid, "ContentItem"."revisionId", subtitle, "ContentItem"."pubDate", "ContentItem"."contentFormat", + "ContentItem"."primaryGroupingUid", "ContentItem"."licenseUid","ContentItem"."publicationServiceUid", + title#>>''{' || language_code ||',value}'' as title, + content#>>''{' || language_code ||',value}'' as content, + summary#>>''{' || language_code ||',value}'' as summary + from + "ContentItem" + where title->>'|| quote_literal(language_code) ||' is not null + or content->>'|| quote_literal(language_code) ||' is not null + or summary->>'|| quote_literal(language_code) ||' is not null' + using language_code; +end; +$$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION get_media_asset_by_language(language_code text) +RETURNS TABLE(uid text, + revisionid text, + duration float, + mediatype text, + fileuid text, + teaserimageuid text, + licenseuid text, + title text, + description text) +AS $$ +begin + return query EXECUTE 'select + uid, "MediaAsset"."revisionId", duration, "MediaAsset"."mediaType", "MediaAsset"."fileUid", + "MediaAsset"."teaserImageUid", "MediaAsset"."licenseUid", + title#>>''{' || language_code ||',value}'' as title, + description#>>''{' || language_code ||',value}'' as description + from + "MediaAsset" + where title->>'|| quote_literal(language_code) ||' is not null + or description->>'|| quote_literal(language_code) ||' is not null' + using language_code; +end; +$$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION get_chapter_by_language(language_code text) +RETURNS TABLE(uid text, + revisionid text, + start float, + duration float, + type text, + title text) +AS $$ +begin + return query EXECUTE 'select + uid, "Chapter"."revisionId", start, duration, type, + title#>>''{' || language_code ||',value}'' as title + from + "Chapter" + where title->>'|| quote_literal(language_code) ||' is not null' + using language_code; +end; +$$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION get_publication_service_by_language(language_code text) +RETURNS TABLE(uid text, + revisionid text, + medium text, + address text, + publisheruid text, + title text) +AS $$ +begin + return query EXECUTE 'select + uid, "PublicationService"."revisionId", medium, address, "PublicationService"."publisherUid", + name#>>''{' || language_code ||',value}'' as name + from + "PublicationService" + where name->>'|| quote_literal(language_code) ||' is not null' + using language_code; +end; +$$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION get_concept_by_language(language_code text) +RETURNS TABLE(uid text, + revisionid text, + originnamespace text, + wikidataidentifier text, + sameasuid text, + parentuid text, + kind "ConceptKind", + name text, + summary text, + description text) +AS $$ +begin + return query EXECUTE 'select + uid, "Concept"."revisionId", "PublicationService"."originNamespace", "PublicationService"."wikidataIdentifier", + "PublicationService"."sameAsUid", "PublicationService"."parentUid", kind, + name#>>''{' || language_code ||',value}'' as name, + summary#>>''{' || language_code ||',value}'' as summary, + description#>>''{' || language_code ||',value}'' as description + from + "Concept" + where name->>'|| quote_literal(language_code) ||' is not null + or summary->>'|| quote_literal(language_code) ||' is not null + or description->>'|| quote_literal(language_code) ||' is not null' + using language_code; +end; +$$ LANGUAGE plpgsql; \ No newline at end of file diff --git a/packages/repco-prisma/prisma/schema.prisma b/packages/repco-prisma/prisma/schema.prisma index 00bdbe22..41034304 100644 --- a/packages/repco-prisma/prisma/schema.prisma +++ b/packages/repco-prisma/prisma/schema.prisma @@ -31,10 +31,10 @@ enum AgentType { // Core data model model Repo { - did String @id @unique - name String? @unique - head String? @unique - tail String? @unique + did String @id @unique + name String? @unique + head String? @unique + tail String? @unique gateways String[] Head Commit? @relation("RepoToHead", fields: [head], references: [rootCid]) @@ -112,11 +112,11 @@ model Keypair { } model FailedDatasourceFetches { - uri String + uri String datasourceUid String - timestamp DateTime - errorMessage String - errorDetails Json? + timestamp DateTime + errorMessage String + errorDetails Json? @@id([uri, datasourceUid]) } @@ -160,6 +160,8 @@ model Revision { entityUris String[] revisionUris String[] + languages String @default("") + // core derived fields contentCid String // cid of content block revisionCid String @unique // cid of revision block @@ -224,13 +226,13 @@ model ContentGrouping { revisionId String @unique broadcastSchedule String? // TODO: JSON (channel, rrule) - description String? + description Json? groupingType String // TODO: enum? startingDate DateTime? subtitle String? - summary String? + summary Json? terminationDate DateTime? - title String + title Json @default("{}") variant ContentGroupingVariant licenseUid String? @@ -245,11 +247,11 @@ model ContentGrouping { model ContentItem { uid String @id @unique /// @zod.refine(imports.isValidUID) revisionId String @unique - title String + title Json @default("{}") subtitle String? pubDate DateTime? // TODO: Review this - summary String? - content String + summary Json? + content Json @default("{}") contentFormat String primaryGroupingUid String? @@ -281,10 +283,10 @@ model License { /// @repco(Entity) model MediaAsset { - uid String @id @unique - revisionId String @unique - title String - description String? + uid String @id @unique + revisionId String @unique + title Json @default("{}") + description Json? duration Float? mediaType String // TODO: Enum? @@ -301,7 +303,7 @@ model MediaAsset { License License? @relation(fields: [licenseUid], references: [uid]) Contributions Contribution[] Concepts Concept[] - Translation Translation[] + // Translation Translation[] } /// @repco(Entity) @@ -339,7 +341,7 @@ model Chapter { start Float duration Float - title String + title Json type String // TODO: enum? mediaAssetUid String @@ -369,7 +371,7 @@ model PublicationService { uid String @id @unique revisionId String @unique - name String + name Json publisher Contributor? @relation(fields: [publisherUid], references: [uid]) medium String? // FM, Web, ... address String @@ -390,20 +392,22 @@ model Transcript { mediaAssetUid String + //TODO: Contributor relation MediaAsset MediaAsset @relation(fields: [mediaAssetUid], references: [uid]) } +// might not be needed? /// @repco(Entity) -model Translation { - uid String @id @unique - language String - text String - engine String +// model Translation { +// uid String @id @unique +// language String +// text String +// engine String - mediaAssetUid String +// mediaAssetUid String - MediaAsset MediaAsset @relation(fields: [mediaAssetUid], references: [uid]) -} +// MediaAsset MediaAsset @relation(fields: [mediaAssetUid], references: [uid]) +// } /// @repco(Entity) model File { @@ -438,9 +442,9 @@ model Concept { originNamespace String? kind ConceptKind - name String - summary String? - description String? + name Json @default("{}") + summary Json? + description Json? wikidataIdentifier String? sameAsUid String? @unique parentUid String? From 0b19372a46549b420681f3c89331eb8d0b78137b Mon Sep 17 00:00:00 2001 From: Thomas Wallner Date: Fri, 20 Oct 2023 14:06:39 +0200 Subject: [PATCH 02/10] added transcript changes --- packages/repco-core/src/datasources/cba.ts | 40 ++++++++++++++++++- .../repco-core/src/datasources/cba/types.ts | 3 ++ packages/repco-prisma/prisma/schema.prisma | 11 +++-- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/packages/repco-core/src/datasources/cba.ts b/packages/repco-core/src/datasources/cba.ts index 155b819b..819c07ce 100644 --- a/packages/repco-core/src/datasources/cba.ts +++ b/packages/repco-core/src/datasources/cba.ts @@ -479,7 +479,9 @@ export class CbaDataSource implements DataSource { headers: { EntityUris: [audioId] }, } - return [fileEntity, mediaEntity] + var transcripts = this._mapTranscripts(media, media.transcripts) + + return [fileEntity, mediaEntity, ...transcripts] } private _mapImage(media: CbaImage): EntityForm[] { @@ -536,7 +538,9 @@ export class CbaDataSource implements DataSource { headers: { EntityUris: [imageId] }, } - return [fileEntity, mediaEntity] + var transcripts = this._mapTranscripts(media, media.transcripts) + + return [fileEntity, mediaEntity, ...transcripts] } private _mapCategories(categories: CbaCategory): EntityForm[] { @@ -715,6 +719,12 @@ export class CbaDataSource implements DataSource { var contentJson: { [k: string]: any } = {} contentJson[post.language_codes[0]] = { value: post.content.rendered } + Object.entries(post.translations).forEach((entry) => { + title[entry[1]['language']] = { value: entry[1]['post_title'] } + summary[entry[1]['language']] = { value: entry[1]['post_excerpt'] } + contentJson[entry[1]['language']] = { value: entry[1]['post_content'] } + }) + const content: form.ContentItemInput = { pubDate: new Date(post.date), content: contentJson, @@ -756,6 +766,32 @@ export class CbaDataSource implements DataSource { } } + private _mapTranscripts( + media: any, + transcripts: any[], + mediaAssetLinks: any, + ): EntityForm[] { + const entities: EntityForm[] = [] + + transcripts.forEach((transcript) => { + const transcriptId = this._uri('transcript', transcript.id) + const content: form.TranscriptInput = { + language: transcript['language'], + text: transcript['transcript'], + engine: '', + MediaAsset: mediaAssetLinks, + //TODO: refresh zod client and add new fields + } + entities.push({ + type: 'Transcript', + content, + headers: { EntityUris: [transcriptId] }, + }) + }) + + return entities + } + private _url(urlString: string, opts: FetchOpts = {}) { const url = new URL(this.endpoint + urlString) if (opts.params) { diff --git a/packages/repco-core/src/datasources/cba/types.ts b/packages/repco-core/src/datasources/cba/types.ts index 11d6fcd2..b0bb9799 100644 --- a/packages/repco-core/src/datasources/cba/types.ts +++ b/packages/repco-core/src/datasources/cba/types.ts @@ -33,6 +33,7 @@ export interface CbaPost { production_date: Date _links: Links _fetchedAttachements: any[] + translations: any[] } export interface About { @@ -244,6 +245,7 @@ export interface CbaAudio { media_tag: any[] acf: any[] originators: any[] + transcripts: any[] source_url: string license: { license_image: string @@ -306,6 +308,7 @@ export interface CbaImage { media_tag: any[] acf: any[] originators: any[] + transcripts: any[] source_url: string license: { license_image: string diff --git a/packages/repco-prisma/prisma/schema.prisma b/packages/repco-prisma/prisma/schema.prisma index 41034304..4166c2b2 100644 --- a/packages/repco-prisma/prisma/schema.prisma +++ b/packages/repco-prisma/prisma/schema.prisma @@ -385,10 +385,13 @@ model PublicationService { /// @repco(Entity) model Transcript { - uid String @id @unique - language String - text String - engine String + uid String @id @unique + language String + text String + engine String + subtitleUrl String // url to webvtt file (string) + author String // field for author (string) + license String // license field (string) mediaAssetUid String From eeabfc37ffa55ab1a68cc34179e1a4c82c5bca56 Mon Sep 17 00:00:00 2001 From: Mario te Best Date: Tue, 31 Oct 2023 13:48:59 +0100 Subject: [PATCH 03/10] + add elasticsearch & pgsync --- docker-compose.yml | 84 +++++++++++++++++++++++++++++++++++++++ pgsync/Dockerfile | 16 ++++++++ pgsync/README.md | 32 +++++++++++++++ pgsync/config/schema.json | 65 ++++++++++++++++++++++++++++++ pgsync/src/entrypoint.sh | 10 +++++ sample.env | 10 +++++ 6 files changed, 217 insertions(+) create mode 100644 pgsync/Dockerfile create mode 100644 pgsync/README.md create mode 100644 pgsync/config/schema.json create mode 100644 pgsync/src/entrypoint.sh diff --git a/docker-compose.yml b/docker-compose.yml index b1c3a376..44e5f809 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: - "./data/postgres:/var/lib/postgresql/data" ports: - 5432:5432 + command: [ "postgres", "-c", "wal_level=logical", "-c", "max_replication_slots=4" ] environment: POSTGRES_PASSWORD: repco POSTGRES_USER: repco @@ -23,3 +24,86 @@ services: - MEILI_MASTER_KEY=${MEILISEARCH_API_KEY} volumes: - ./data/meilisearch:/meili_data + + es01: + image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION} + labels: + co.elastic.logs/module: elasticsearch + volumes: + - ./data/elastic/es01:/usr/share/elasticsearch/data + ports: + - ${ELASTIC_PORT}:9200 + environment: + - node.name=es01 + - cluster.name=${ELASTIC_CLUSTER_NAME} + - discovery.type=single-node + - ELASTIC_PASSWORD=${ELASTIC_PASSWORD} + - bootstrap.memory_lock=true + - xpack.security.enabled=false + - xpack.license.self_generated.type=${ELASTIC_LICENSE} + mem_limit: ${ELASTIC_MEM_LIMIT} + ulimits: + memlock: + soft: -1 + hard: -1 + healthcheck: + test: + [ + "CMD-SHELL", + "curl -s --user elastic:${ELASTIC_PASSWORD} -X GET http://localhost:9200/_cluster/health?pretty | grep status | grep -q '\\(green\\|yellow\\)'" + ] + interval: 10s + timeout: 10s + retries: 120 + + redis: + image: 'redis:alpine' + container_name: redis + command: [ "redis-server", "--requirepass", "${REDIS_PASSWORD}" ] + volumes: + - ./data/redis:/data + ports: + - '6379:6379' + + pgsync: + build: + context: ./pgsync + volumes: + - ./data/pgsync:/data + sysctls: + - net.ipv4.tcp_keepalive_time=200 + - net.ipv4.tcp_keepalive_intvl=200 + - net.ipv4.tcp_keepalive_probes=5 + labels: + org.label-schema.name: "pgsync" + org.label-schema.description: "Postgres to Elasticsearch sync" + com.label-schema.service-type: "daemon" + depends_on: + - db + - es01 + - redis + environment: + - PG_USER=repco + - PG_HOST=db + - PG_PORT=5432 + - PG_PASSWORD=repco + - PG_DATABASE=repco + - LOG_LEVEL=DEBUG + - ELASTICSEARCH_PORT=${ELASTIC_PORT} + - ELASTICSEARCH_SCHEME=http + - ELASTICSEARCH_HOST=es01 + - ELASTICSEARCH_CHUNK_SIZE=100 + - ELASTICSEARCH_MAX_CHUNK_BYTES=3242880 + - ELASTICSEARCH_MAX_RETRIES=14 + - ELASTICSEARCH_QUEUE_SIZE=1 + - ELASTICSEARCH_STREAMING_BULK=True + - ELASTICSEARCH_THREAD_COUNT=1 + - ELASTICSEARCH_TIMEOUT=320 + - REDIS_HOST=redis + - REDIS_PORT=6379 + - REDIS_AUTH=${REDIS_PASSWORD} + - REDIS_READ_CHUNK_SIZE=100 + - ELASTICSEARCH=true + - OPENSEARCH=false + - SCHEMA=/data + - CHECKPOINT_PATH=/data \ No newline at end of file diff --git a/pgsync/Dockerfile b/pgsync/Dockerfile new file mode 100644 index 00000000..5fe963b4 --- /dev/null +++ b/pgsync/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.11-slim + +WORKDIR /usr/src/app + +ADD ./src ./ + +RUN chmod +x ./entrypoint.sh + +RUN pip install pgsync==2.5.0 + +RUN apt update \ + && apt install -y moreutils \ + && apt install -y jq \ + && apt install -y wait-for-it + +ENTRYPOINT ["bash", "./entrypoint.sh"] \ No newline at end of file diff --git a/pgsync/README.md b/pgsync/README.md new file mode 100644 index 00000000..b924c38d --- /dev/null +++ b/pgsync/README.md @@ -0,0 +1,32 @@ +# Sync data to elasticsearch + +This folder contains the files needed for [pgsync](https://github.com/toluaina/). pgsync is a no-code solution for replicating data into an elastic search index. + +## Prerequisites + +pgsync requires logical decoding. This can be set in the `postgresql.conf` configuration file or as startup parameters in `docker-compose.yml` + +``` +wal_level=logical +max_replication_slots=4 +``` + +## Configuration + +A working configuration file is located at [config/schema.json](config/schema.json). This schema file should be made available to the pgsync docker container in its `/data` folder. + +## Searching (using the ES server) + +To search for a phrase in the elastic search index you can use the `_search` endpoint using the following example request: + +``` +curl --location --request GET 'localhost:9200/_search' \ +--header 'Content-Type: application/json' \ +--data '{ + "query": { + "query_string": { + "query": "wissensturm-360" + } + } +}' +``` \ No newline at end of file diff --git a/pgsync/config/schema.json b/pgsync/config/schema.json new file mode 100644 index 00000000..9079dc5b --- /dev/null +++ b/pgsync/config/schema.json @@ -0,0 +1,65 @@ +[ + { + "nodes": { + "table": "ContentItem", + "schema": "public", + "columns": [ + "title", + "subtitle", + "pubDate", + "summary", + "content" + ], + "children": [ + { + "table": "MediaAsset", + "schema": "public", + "label": "MediaAsset", + "columns": [ + "title", + "description", + "mediaType", + "teaserImageUid" + ], + "primary_key": [ + "uid" + ], + "relationship": { + "variant": "object", + "type": "one_to_many", + "through_tables": [ + "_ContentItemToMediaAsset" + ] + }, + "children": [ + { + "table": "Translation", + "schema": "public", + "label": "Translation", + "columns": [ + "language", + "text" + ], + "primary_key": [ + "uid" + ], + "relationship": { + "variant": "object", + "type": "one_to_many", + "foreign_key": { + "child": [ + "mediaAssetUid" + ], + "parent": [ + "uid" + ] + } + } + } + ] + } + ] + } + } + ] + \ No newline at end of file diff --git a/pgsync/src/entrypoint.sh b/pgsync/src/entrypoint.sh new file mode 100644 index 00000000..dd43ad7e --- /dev/null +++ b/pgsync/src/entrypoint.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +wait-for-it $PG_HOST:5432 -t 60 +wait-for-it $REDIS_HOST:6379 -t 60 +wait-for-it $ELASTICSEARCH_HOST:9200 -t 60 + +jq '.[].database = env.PG_DATABASE' /data/schema.json | sponge /data/schema.json + +bootstrap --config /data/schema.json +pgsync --config /data/schema.json -d -v \ No newline at end of file diff --git a/sample.env b/sample.env index c6c1b7ba..5b57460f 100644 --- a/sample.env +++ b/sample.env @@ -8,3 +8,13 @@ DATABASE_URL="postgresql://repco:repco@localhost:5432/repco" # GitHub Client ID and Secret # GITHUB_CLIENT_ID= # GITHUB_CLIENT_SECRET= + +# Configuration values for elastic search & pgsync +# Password for the 'elastic' user (at least 6 characters) +ELASTIC_PASSWORD=repco +ELASTIC_VERSION=8.10.4 +ELASTIC_LICENSE=basic +ELASTIC_PORT=9200 +ELASTIC_MEM_LIMIT=1073741824 +ELASTIC_CLUSTER_NAME=es-repco +REDIS_PASSWORD=repco From 58b57f6b1276a6a2cc232bd1e5756d326c3b22ab Mon Sep 17 00:00:00 2001 From: Thomas Wallner Date: Thu, 9 Nov 2023 17:53:41 +0100 Subject: [PATCH 04/10] fixes --- packages/repco-cli/bin.js | 1 - packages/repco-core/src/datasources/cba.ts | 76 +++++-- .../repco-core/src/datasources/cba/types.ts | 8 + packages/repco-frontend/app/graphql/types.ts | 203 ++++++++++++++++++ packages/repco-prisma-generate/bin.js | 1 - pgsync/src/entrypoint.sh | 3 - 6 files changed, 271 insertions(+), 21 deletions(-) diff --git a/packages/repco-cli/bin.js b/packages/repco-cli/bin.js index 2bd7a574..ae69bf83 100755 --- a/packages/repco-cli/bin.js +++ b/packages/repco-cli/bin.js @@ -1,4 +1,3 @@ #!/usr/bin/env node - import 'source-map-support/register.js' import './dist/cli-bundle.js' diff --git a/packages/repco-core/src/datasources/cba.ts b/packages/repco-core/src/datasources/cba.ts index 6e1aa1f6..874b41e4 100644 --- a/packages/repco-core/src/datasources/cba.ts +++ b/packages/repco-core/src/datasources/cba.ts @@ -173,7 +173,15 @@ export class CbaDataSource implements DataSource { const params = new URLSearchParams() params.append('include', slice.map((id) => id.id).join(',')) params.append('per_page', slice.length.toString()) - const url = this._url(`/${endpoint}?${params}`) + var multilingual = '' + if ( + endpoint === 'post' || + endpoint === 'series' || + endpoint === 'station' + ) { + multilingual = 'multilingual' + } + const url = this._url(`/${endpoint}?${params}${multilingual}`) const bodies = await this._fetch(url) res.push( ...bodies.map((body: any, i: number) => { @@ -236,7 +244,15 @@ export class CbaDataSource implements DataSource { ) } - const url = this._url(`/${endpoint}/${id}`) + var params = '' + if ( + endpoint === 'post' || + endpoint === 'series' || + endpoint === 'station' + ) { + params = '?multilingual' + } + const url = this._url(`/${endpoint}/${id}${params}`) const [body] = await Promise.all([this._fetch(url)]) return [ @@ -448,11 +464,17 @@ export class CbaDataSource implements DataSource { resolution: null, } - //TODO: find language code var titleJson: { [k: string]: any } = {} - titleJson['de'] = { value: media.title.rendered } + titleJson[media.language_codes[0]] = { value: media.title.rendered } var descriptionJson: { [k: string]: any } = {} - descriptionJson['de'] = { value: media.description?.rendered } + descriptionJson[media.language_codes[0]] = { + value: media.description?.rendered, + } + + Object.entries(media.translations).forEach((entry) => { + titleJson[entry[1]['language']] = { value: entry[1]['title'] } + descriptionJson[entry[1]['language']] = { value: entry[1]['description'] } + }) const asset: form.MediaAssetInput = { title: titleJson, @@ -477,7 +499,7 @@ export class CbaDataSource implements DataSource { headers: { EntityUris: [audioId] }, } - var transcripts = this._mapTranscripts(media, media.transcripts) + var transcripts = this._mapTranscripts(media, media.transcripts, {}) return [fileEntity, mediaEntity, ...transcripts] } @@ -508,11 +530,17 @@ export class CbaDataSource implements DataSource { media.media_details.width.toString() } - //TODO: find language code var titleJson: { [k: string]: any } = {} - titleJson['de'] = { value: media.title.rendered } + titleJson[media.language_codes[0]] = { value: media.title.rendered } var descriptionJson: { [k: string]: any } = {} - descriptionJson['de'] = { value: media.description?.rendered } + descriptionJson[media.language_codes[0]] = { + value: media.description?.rendered, + } + + Object.entries(media.translations).forEach((entry) => { + titleJson[entry[1]['language']] = { value: entry[1]['title'] } + descriptionJson[entry[1]['language']] = { value: entry[1]['description'] } + }) const asset: form.MediaAssetInput = { title: titleJson, @@ -536,7 +564,7 @@ export class CbaDataSource implements DataSource { headers: { EntityUris: [imageId] }, } - var transcripts = this._mapTranscripts(media, media.transcripts) + var transcripts = this._mapTranscripts(media, media.transcripts, {}) return [fileEntity, mediaEntity, ...transcripts] } @@ -611,9 +639,13 @@ export class CbaDataSource implements DataSource { `Missing or invalid title for station with ID ${station.id}`, ) } - //TODO: find language code + var nameJson: { [k: string]: any } = {} - nameJson['de'] = { value: station.title.rendered } + nameJson[station.language_codes[0]] = { value: station.title.rendered } + + Object.entries(station.translations).forEach((entry) => { + nameJson[entry[1]['language']] = { value: entry[1]['title'] } + }) const content: form.PublicationServiceInput = { medium: station.type || '', @@ -642,13 +674,22 @@ export class CbaDataSource implements DataSource { throw new Error('Series title is missing.') } - //TODO: find language code var descriptionJson: { [k: string]: any } = {} - descriptionJson['de'] = { value: series.content.rendered } + descriptionJson[series.language_codes[0]] = { + value: series.content.rendered, + } var summaryJson: { [k: string]: any } = {} - summaryJson['de'] = { value: series.content.rendered } + summaryJson[series.language_codes[0]] = { value: series.content.rendered } var titleJson: { [k: string]: any } = {} - titleJson['de'] = { value: series.title.rendered } + titleJson[series.language_codes[0]] = { value: series.title.rendered } + + Object.entries(series.translations).forEach((entry) => { + titleJson[entry[1]['language']] = { value: entry[1]['title'] } + summaryJson[entry[1]['language']] = { value: entry[1]['content'] } + descriptionJson[entry[1]['language']] = { + value: entry[1]['content'], + } + }) const content: form.ContentGroupingInput = { title: titleJson, @@ -778,6 +819,9 @@ export class CbaDataSource implements DataSource { text: transcript['transcript'], engine: '', MediaAsset: mediaAssetLinks, + license: '', + subtitleUrl: '', + author: '', //TODO: refresh zod client and add new fields } entities.push({ diff --git a/packages/repco-core/src/datasources/cba/types.ts b/packages/repco-core/src/datasources/cba/types.ts index b0bb9799..981a0cb7 100644 --- a/packages/repco-core/src/datasources/cba/types.ts +++ b/packages/repco-core/src/datasources/cba/types.ts @@ -92,6 +92,8 @@ export interface CbaSeries { comment_status: string ping_status: string template: string + language_codes: string[] + translations: any[] acf: any[] post_parent: number url: string @@ -218,6 +220,8 @@ export interface CbaStation { comment_status: string ping_status: string template: string + language_codes: string[] + translations: any[] acf: any[] livestream_urls: any[] _links: StationLinks @@ -243,6 +247,8 @@ export interface CbaAudio { station_id: number } media_tag: any[] + language_codes: string[] + translations: any[] acf: any[] originators: any[] transcripts: any[] @@ -306,6 +312,8 @@ export interface CbaImage { station_id: number } media_tag: any[] + language_codes: string[] + translations: any[] acf: any[] originators: any[] transcripts: any[] diff --git a/packages/repco-frontend/app/graphql/types.ts b/packages/repco-frontend/app/graphql/types.ts index 1ba6e474..0aed938c 100644 --- a/packages/repco-frontend/app/graphql/types.ts +++ b/packages/repco-frontend/app/graphql/types.ts @@ -3121,6 +3121,112 @@ export type FloatFilter = { notIn?: InputMaybe> } +/** All input for the `getChapterByLanguage` mutation. */ +export type GetChapterByLanguageInput = { + /** + * An arbitrary string value with no semantic meaning. Will be included in the + * payload verbatim. May be used to track mutations by the client. + */ + clientMutationId?: InputMaybe + languageCode?: InputMaybe +} + +/** The output of our `getChapterByLanguage` mutation. */ +export type GetChapterByLanguagePayload = { + /** + * The exact same `clientMutationId` that was provided in the mutation input, + * unchanged and unused. May be used by a client to track mutations. + */ + clientMutationId?: Maybe + /** Our root query field type. Allows us to run any query from our mutation payload. */ + query?: Maybe + results?: Maybe>> +} + +/** The return type of our `getChapterByLanguage` mutation. */ +export type GetChapterByLanguageRecord = { + duration?: Maybe + revisionid?: Maybe + start?: Maybe + title?: Maybe + type?: Maybe + uid?: Maybe +} + +/** All input for the `getConceptByLanguage` mutation. */ +export type GetConceptByLanguageInput = { + /** + * An arbitrary string value with no semantic meaning. Will be included in the + * payload verbatim. May be used to track mutations by the client. + */ + clientMutationId?: InputMaybe + languageCode?: InputMaybe +} + +/** The output of our `getConceptByLanguage` mutation. */ +export type GetConceptByLanguagePayload = { + /** + * The exact same `clientMutationId` that was provided in the mutation input, + * unchanged and unused. May be used by a client to track mutations. + */ + clientMutationId?: Maybe + /** Our root query field type. Allows us to run any query from our mutation payload. */ + query?: Maybe + results?: Maybe>> +} + +/** The return type of our `getConceptByLanguage` mutation. */ +export type GetConceptByLanguageRecord = { + description?: Maybe + kind?: Maybe + name?: Maybe + originnamespace?: Maybe + parentuid?: Maybe + revisionid?: Maybe + sameasuid?: Maybe + summary?: Maybe + uid?: Maybe + wikidataidentifier?: Maybe +} + +/** All input for the `getContentGroupingsByLanguage` mutation. */ +export type GetContentGroupingsByLanguageInput = { + /** + * An arbitrary string value with no semantic meaning. Will be included in the + * payload verbatim. May be used to track mutations by the client. + */ + clientMutationId?: InputMaybe + languageCode?: InputMaybe +} + +/** The output of our `getContentGroupingsByLanguage` mutation. */ +export type GetContentGroupingsByLanguagePayload = { + /** + * The exact same `clientMutationId` that was provided in the mutation input, + * unchanged and unused. May be used by a client to track mutations. + */ + clientMutationId?: Maybe + /** Our root query field type. Allows us to run any query from our mutation payload. */ + query?: Maybe + results?: Maybe>> +} + +/** The return type of our `getContentGroupingsByLanguage` mutation. */ +export type GetContentGroupingsByLanguageRecord = { + broadcastschedule?: Maybe + description?: Maybe + groupingtype?: Maybe + licenseuid?: Maybe + revisionid?: Maybe + startingdate?: Maybe + subtitle?: Maybe + summary?: Maybe + terminationdate?: Maybe + title?: Maybe + uid?: Maybe + variant?: Maybe +} + /** All input for the `getContentItemsByLanguage` mutation. */ export type GetContentItemsByLanguageInput = { /** @@ -3158,6 +3264,73 @@ export type GetContentItemsByLanguageRecord = { uid?: Maybe } +/** All input for the `getMediaAssetByLanguage` mutation. */ +export type GetMediaAssetByLanguageInput = { + /** + * An arbitrary string value with no semantic meaning. Will be included in the + * payload verbatim. May be used to track mutations by the client. + */ + clientMutationId?: InputMaybe + languageCode?: InputMaybe +} + +/** The output of our `getMediaAssetByLanguage` mutation. */ +export type GetMediaAssetByLanguagePayload = { + /** + * The exact same `clientMutationId` that was provided in the mutation input, + * unchanged and unused. May be used by a client to track mutations. + */ + clientMutationId?: Maybe + /** Our root query field type. Allows us to run any query from our mutation payload. */ + query?: Maybe + results?: Maybe>> +} + +/** The return type of our `getMediaAssetByLanguage` mutation. */ +export type GetMediaAssetByLanguageRecord = { + description?: Maybe + duration?: Maybe + fileuid?: Maybe + licenseuid?: Maybe + mediatype?: Maybe + revisionid?: Maybe + teaserimageuid?: Maybe + title?: Maybe + uid?: Maybe +} + +/** All input for the `getPublicationServiceByLanguage` mutation. */ +export type GetPublicationServiceByLanguageInput = { + /** + * An arbitrary string value with no semantic meaning. Will be included in the + * payload verbatim. May be used to track mutations by the client. + */ + clientMutationId?: InputMaybe + languageCode?: InputMaybe +} + +/** The output of our `getPublicationServiceByLanguage` mutation. */ +export type GetPublicationServiceByLanguagePayload = { + /** + * The exact same `clientMutationId` that was provided in the mutation input, + * unchanged and unused. May be used by a client to track mutations. + */ + clientMutationId?: Maybe + /** Our root query field type. Allows us to run any query from our mutation payload. */ + query?: Maybe + results?: Maybe>> +} + +/** The return type of our `getPublicationServiceByLanguage` mutation. */ +export type GetPublicationServiceByLanguageRecord = { + address?: Maybe + medium?: Maybe + publisheruid?: Maybe + revisionid?: Maybe + title?: Maybe + uid?: Maybe +} + /** A filter to be used against Int fields. All fields are combined with a logical ‘and.’ */ export type IntFilter = { /** Not equal to the specified value, treating null like an ordinary value. */ @@ -4095,7 +4268,27 @@ export type MetadatumFilter = { /** The root mutation type which contains root level fields which mutate data. */ export type Mutation = { + getChapterByLanguage?: Maybe + getConceptByLanguage?: Maybe + getContentGroupingsByLanguage?: Maybe getContentItemsByLanguage?: Maybe + getMediaAssetByLanguage?: Maybe + getPublicationServiceByLanguage?: Maybe +} + +/** The root mutation type which contains root level fields which mutate data. */ +export type MutationGetChapterByLanguageArgs = { + input: GetChapterByLanguageInput +} + +/** The root mutation type which contains root level fields which mutate data. */ +export type MutationGetConceptByLanguageArgs = { + input: GetConceptByLanguageInput +} + +/** The root mutation type which contains root level fields which mutate data. */ +export type MutationGetContentGroupingsByLanguageArgs = { + input: GetContentGroupingsByLanguageInput } /** The root mutation type which contains root level fields which mutate data. */ @@ -4103,6 +4296,16 @@ export type MutationGetContentItemsByLanguageArgs = { input: GetContentItemsByLanguageInput } +/** The root mutation type which contains root level fields which mutate data. */ +export type MutationGetMediaAssetByLanguageArgs = { + input: GetMediaAssetByLanguageInput +} + +/** The root mutation type which contains root level fields which mutate data. */ +export type MutationGetPublicationServiceByLanguageArgs = { + input: GetPublicationServiceByLanguageInput +} + /** Information about pagination in a connection. */ export type PageInfo = { /** When paginating forwards, the cursor to continue. */ diff --git a/packages/repco-prisma-generate/bin.js b/packages/repco-prisma-generate/bin.js index 5824a0a1..8f79b97d 100755 --- a/packages/repco-prisma-generate/bin.js +++ b/packages/repco-prisma-generate/bin.js @@ -1,3 +1,2 @@ #!/usr/bin/env node - import './dist/main.js' diff --git a/pgsync/src/entrypoint.sh b/pgsync/src/entrypoint.sh index dd43ad7e..6870726b 100644 --- a/pgsync/src/entrypoint.sh +++ b/pgsync/src/entrypoint.sh @@ -1,10 +1,7 @@ #!/usr/bin/env bash - wait-for-it $PG_HOST:5432 -t 60 wait-for-it $REDIS_HOST:6379 -t 60 wait-for-it $ELASTICSEARCH_HOST:9200 -t 60 - jq '.[].database = env.PG_DATABASE' /data/schema.json | sponge /data/schema.json - bootstrap --config /data/schema.json pgsync --config /data/schema.json -d -v \ No newline at end of file From 9f3f3346c532db244ccd86fdc71113ff2c9e0d88 Mon Sep 17 00:00:00 2001 From: Thomas Wallner Date: Fri, 1 Dec 2023 11:01:47 +0100 Subject: [PATCH 05/10] frontend fixes --- packages/repco-core/src/datasources/cba.ts | 2 +- .../fixtures/datasource-cba/entities.json | 49 +- packages/repco-frontend/app/graphql/types.ts | 1819 +++++++- .../app/routes/__layout/index.tsx | 8 +- .../app/routes/__layout/items/index.tsx | 9 +- .../repco-graphql/generated/schema.graphql | 4075 ++++++++++++++++- packages/repco-graphql/package.json | 5 + packages/repco-graphql/src/lib.ts | 32 +- .../src/plugins/custom-filter.ts | 4 +- .../src/plugins/export-schema.ts | 4 +- .../src/plugins/wrap-resolver.ts | 2 +- 11 files changed, 5695 insertions(+), 314 deletions(-) diff --git a/packages/repco-core/src/datasources/cba.ts b/packages/repco-core/src/datasources/cba.ts index 874b41e4..cafef701 100644 --- a/packages/repco-core/src/datasources/cba.ts +++ b/packages/repco-core/src/datasources/cba.ts @@ -325,7 +325,7 @@ export class CbaDataSource implements DataSource { const { posts: postsCursor = '1970-01-01T01:00:00' } = cursor const perPage = this.config.pageLimit const url = this._url( - `/posts?page=1&per_page=${perPage}&_embed&orderby=modified&order=asc&modified_after=${postsCursor}`, + `/posts?multilingual&page=1&per_page=${perPage}&_embed&orderby=modified&order=asc&modified_after=${postsCursor}`, ) const posts = await this._fetch(url) diff --git a/packages/repco-core/test/fixtures/datasource-cba/entities.json b/packages/repco-core/test/fixtures/datasource-cba/entities.json index 020fddd4..b78755d7 100644 --- a/packages/repco-core/test/fixtures/datasource-cba/entities.json +++ b/packages/repco-core/test/fixtures/datasource-cba/entities.json @@ -1 +1,48 @@ -[{"title":"Radio FRO Beeps","pubDate":"1998-10-16T22:00:00.000Z","PrimaryGrouping":{"title":"Musikredaktion"},"Concepts":[{"name":"Jingle"},{"name":"Jingle"},{"name":"Radio FRO"},{"name":"Signation"}],"MediaAssets":[{"mediaType":"audio","title":"Radio FRO Beeps","File":{"contentUrl":"https://cba.fro.at/wp-content/uploads/9/0/0000021209/musikredaktion-09-12-2003-16-34-35.mp3"}},{"mediaType":"image","title":"fro_logo_w_os","File":{"contentUrl":"https://cba.fro.at/wp-content/uploads/3/0/0000348503/fro-logo-w-os.jpg"}}]},{"title":"1959: Revolution in Kuba. Teil 2","pubDate":"1999-05-12T22:00:00.000Z","PrimaryGrouping":{"title":"Context XXI"},"Concepts":[{"name":"Gesellschaftspolitik"},{"name":"Geschichte wird gemacht"},{"name":"Kuba"}],"MediaAssets":[{"mediaType":"image","title":"Radio Orange Logo","File":{"contentUrl":"https://cba.fro.at/wp-content/uploads/7/0/0000474207/orange.gif"}}]}] \ No newline at end of file +[ + { + "title": "Radio FRO Beeps", + "pubDate": "1998-10-16T22:00:00.000Z", + "PrimaryGrouping": { "title": "Musikredaktion" }, + "Concepts": [ + { "name": "Jingle" }, + { "name": "Jingle" }, + { "name": "Radio FRO" }, + { "name": "Signation" } + ], + "MediaAssets": [ + { + "mediaType": "audio", + "title": "Radio FRO Beeps", + "File": { + "contentUrl": "https://cba.fro.at/wp-content/uploads/9/0/0000021209/musikredaktion-09-12-2003-16-34-35.mp3" + } + }, + { + "mediaType": "image", + "title": "fro_logo_w_os", + "File": { + "contentUrl": "https://cba.fro.at/wp-content/uploads/3/0/0000348503/fro-logo-w-os.jpg" + } + } + ] + }, + { + "title": "1959: Revolution in Kuba. Teil 2", + "pubDate": "1999-05-12T22:00:00.000Z", + "PrimaryGrouping": { "title": "Context XXI" }, + "Concepts": [ + { "name": "Gesellschaftspolitik" }, + { "name": "Geschichte wird gemacht" }, + { "name": "Kuba" } + ], + "MediaAssets": [ + { + "mediaType": "image", + "title": "Radio Orange Logo", + "File": { + "contentUrl": "https://cba.fro.at/wp-content/uploads/7/0/0000474207/orange.gif" + } + } + ] + } +] diff --git a/packages/repco-frontend/app/graphql/types.ts b/packages/repco-frontend/app/graphql/types.ts index 0aed938c..b6685f00 100644 --- a/packages/repco-frontend/app/graphql/types.ts +++ b/packages/repco-frontend/app/graphql/types.ts @@ -2525,6 +2525,1695 @@ export type DatetimeFilter = { notIn?: InputMaybe> } +export type ElasticApi_Default = { + /** Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-bulk.html) request */ + bulk?: Maybe + cat?: Maybe + /** Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-request-body.html#_clear_scroll_api) request */ + clearScroll?: Maybe + cluster?: Maybe + /** Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-count.html) request */ + count?: Maybe + /** Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-index_.html) request */ + create?: Maybe + /** Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-delete.html) request */ + delete?: Maybe + /** Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-delete-by-query.html) request */ + deleteByQuery?: Maybe + /** Perform a [deleteByQueryRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-delete-by-query.html) request */ + deleteByQueryRethrottle?: Maybe + /** Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-scripting.html) request */ + deleteScript?: Maybe + /** Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-get.html) request */ + exists?: Maybe + /** Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-get.html) request */ + existsSource?: Maybe + /** Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-explain.html) request */ + explain?: Maybe + /** Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-field-caps.html) request */ + fieldCaps?: Maybe + /** Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-get.html) request */ + get?: Maybe + /** Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-scripting.html) request */ + getScript?: Maybe + /** Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-get.html) request */ + getSource?: Maybe + /** Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-index_.html) request */ + index?: Maybe + indices?: Maybe + /** Perform a [info](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/index.html) request */ + info?: Maybe + ingest?: Maybe + /** Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-multi-get.html) request */ + mget?: Maybe + /** Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-multi-search.html) request */ + msearch?: Maybe + /** Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-multi-search.html) request */ + msearchTemplate?: Maybe + /** Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-multi-termvectors.html) request */ + mtermvectors?: Maybe + nodes?: Maybe + /** Perform a [ping](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/index.html) request */ + ping?: Maybe + /** Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-scripting.html) request */ + putScript?: Maybe + /** Perform a [rankEval](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-rank-eval.html) request */ + rankEval?: Maybe + /** Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-reindex.html) request */ + reindex?: Maybe + /** Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-reindex.html) request */ + reindexRethrottle?: Maybe + /** Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-template.html#_validating_templates) request */ + renderSearchTemplate?: Maybe + /** Perform a [scriptsPainlessExecute](https://www.elastic.co/guide/en/elasticsearch/painless/7.6/painless-execute-api.html) request */ + scriptsPainlessExecute?: Maybe + /** Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-request-body.html#request-body-search-scroll) request */ + scroll?: Maybe + /** Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-search.html) request */ + search?: Maybe + /** Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-shards.html) request */ + searchShards?: Maybe + /** Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-template.html) request */ + searchTemplate?: Maybe + snapshot?: Maybe + tasks?: Maybe + /** Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-termvectors.html) request */ + termvectors?: Maybe + /** Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-update.html) request */ + update?: Maybe + /** Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-update-by-query.html) request */ + updateByQuery?: Maybe + /** Perform a [updateByQueryRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-update-by-query.html) request */ + updateByQueryRethrottle?: Maybe +} + +export type ElasticApi_DefaultBulkArgs = { + _source: InputMaybe + _sourceExcludes: InputMaybe + _sourceIncludes: InputMaybe + body: Scalars['JSON'] + index: InputMaybe + pipeline: InputMaybe + refresh: InputMaybe + routing: InputMaybe + timeout: InputMaybe + type: InputMaybe + waitForActiveShards: InputMaybe +} + +export type ElasticApi_DefaultCountArgs = { + allowNoIndices: InputMaybe + analyzeWildcard: InputMaybe + analyzer: InputMaybe + body: InputMaybe + defaultOperator?: InputMaybe + df: InputMaybe + expandWildcards?: InputMaybe + ignoreThrottled: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + lenient: InputMaybe + minScore: InputMaybe + preference: InputMaybe + q: InputMaybe + routing: InputMaybe + terminateAfter: InputMaybe +} + +export type ElasticApi_DefaultCreateArgs = { + body: Scalars['JSON'] + id: InputMaybe + index: InputMaybe + pipeline: InputMaybe + refresh: InputMaybe + routing: InputMaybe + timeout: InputMaybe + version: InputMaybe + versionType: InputMaybe + waitForActiveShards: InputMaybe +} + +export type ElasticApi_DefaultDeleteArgs = { + id: InputMaybe + ifPrimaryTerm: InputMaybe + ifSeqNo: InputMaybe + index: InputMaybe + refresh: InputMaybe + routing: InputMaybe + timeout: InputMaybe + version: InputMaybe + versionType: InputMaybe + waitForActiveShards: InputMaybe +} + +export type ElasticApi_DefaultDeleteByQueryArgs = { + _source: InputMaybe + _sourceExcludes: InputMaybe + _sourceIncludes: InputMaybe + allowNoIndices: InputMaybe + analyzeWildcard: InputMaybe + analyzer: InputMaybe + body: Scalars['JSON'] + conflicts?: InputMaybe + defaultOperator?: InputMaybe + df: InputMaybe + expandWildcards?: InputMaybe + from: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + lenient: InputMaybe + maxDocs: InputMaybe + preference: InputMaybe + q: InputMaybe + refresh: InputMaybe + requestCache: InputMaybe + requestsPerSecond: InputMaybe + routing: InputMaybe + scroll: InputMaybe + scrollSize: InputMaybe + searchTimeout: InputMaybe + searchType: InputMaybe + size: InputMaybe + slices?: InputMaybe + sort: InputMaybe + stats: InputMaybe + terminateAfter: InputMaybe + timeout?: InputMaybe + version: InputMaybe + waitForActiveShards: InputMaybe + waitForCompletion?: InputMaybe +} + +export type ElasticApi_DefaultDeleteByQueryRethrottleArgs = { + body: InputMaybe + requestsPerSecond: InputMaybe + taskId: InputMaybe +} + +export type ElasticApi_DefaultDeleteScriptArgs = { + id: InputMaybe + masterTimeout: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_DefaultExistsArgs = { + _source: InputMaybe + _sourceExcludes: InputMaybe + _sourceIncludes: InputMaybe + id: InputMaybe + index: InputMaybe + preference: InputMaybe + realtime: InputMaybe + refresh: InputMaybe + routing: InputMaybe + storedFields: InputMaybe + version: InputMaybe + versionType: InputMaybe +} + +export type ElasticApi_DefaultExistsSourceArgs = { + _source: InputMaybe + _sourceExcludes: InputMaybe + _sourceIncludes: InputMaybe + id: InputMaybe + index: InputMaybe + preference: InputMaybe + realtime: InputMaybe + refresh: InputMaybe + routing: InputMaybe + version: InputMaybe + versionType: InputMaybe +} + +export type ElasticApi_DefaultExplainArgs = { + _source: InputMaybe + _sourceExcludes: InputMaybe + _sourceIncludes: InputMaybe + analyzeWildcard: InputMaybe + analyzer: InputMaybe + body: InputMaybe + defaultOperator?: InputMaybe + df: InputMaybe + id: InputMaybe + index: InputMaybe + lenient: InputMaybe + preference: InputMaybe + q: InputMaybe + routing: InputMaybe + storedFields: InputMaybe +} + +export type ElasticApi_DefaultFieldCapsArgs = { + allowNoIndices: InputMaybe + body: InputMaybe + expandWildcards?: InputMaybe + fields: InputMaybe + ignoreUnavailable: InputMaybe + includeUnmapped: InputMaybe + index: InputMaybe +} + +export type ElasticApi_DefaultGetArgs = { + _source: InputMaybe + _sourceExcludes: InputMaybe + _sourceIncludes: InputMaybe + id: InputMaybe + index: InputMaybe + preference: InputMaybe + realtime: InputMaybe + refresh: InputMaybe + routing: InputMaybe + storedFields: InputMaybe + version: InputMaybe + versionType: InputMaybe +} + +export type ElasticApi_DefaultGetScriptArgs = { + id: InputMaybe + masterTimeout: InputMaybe +} + +export type ElasticApi_DefaultGetSourceArgs = { + _source: InputMaybe + _sourceExcludes: InputMaybe + _sourceIncludes: InputMaybe + id: InputMaybe + index: InputMaybe + preference: InputMaybe + realtime: InputMaybe + refresh: InputMaybe + routing: InputMaybe + version: InputMaybe + versionType: InputMaybe +} + +export type ElasticApi_DefaultIndexArgs = { + body: Scalars['JSON'] + id: InputMaybe + ifPrimaryTerm: InputMaybe + ifSeqNo: InputMaybe + index: InputMaybe + opType?: InputMaybe + pipeline: InputMaybe + refresh: InputMaybe + routing: InputMaybe + timeout: InputMaybe + version: InputMaybe + versionType: InputMaybe + waitForActiveShards: InputMaybe +} + +export type ElasticApi_DefaultMgetArgs = { + _source: InputMaybe + _sourceExcludes: InputMaybe + _sourceIncludes: InputMaybe + body: Scalars['JSON'] + index: InputMaybe + preference: InputMaybe + realtime: InputMaybe + refresh: InputMaybe + routing: InputMaybe + storedFields: InputMaybe +} + +export type ElasticApi_DefaultMsearchArgs = { + body: Scalars['JSON'] + ccsMinimizeRoundtrips?: InputMaybe + index: InputMaybe + maxConcurrentSearches: InputMaybe + maxConcurrentShardRequests?: InputMaybe + preFilterShardSize?: InputMaybe + restTotalHitsAsInt: InputMaybe + searchType: InputMaybe + typedKeys: InputMaybe +} + +export type ElasticApi_DefaultMsearchTemplateArgs = { + body: Scalars['JSON'] + ccsMinimizeRoundtrips?: InputMaybe + index: InputMaybe + maxConcurrentSearches: InputMaybe + restTotalHitsAsInt: InputMaybe + searchType: InputMaybe + typedKeys: InputMaybe +} + +export type ElasticApi_DefaultMtermvectorsArgs = { + body: InputMaybe + fieldStatistics?: InputMaybe + fields: InputMaybe + ids: InputMaybe + index: InputMaybe + offsets?: InputMaybe + payloads?: InputMaybe + positions?: InputMaybe + preference: InputMaybe + realtime: InputMaybe + routing: InputMaybe + termStatistics: InputMaybe + version: InputMaybe + versionType: InputMaybe +} + +export type ElasticApi_DefaultPutScriptArgs = { + body: Scalars['JSON'] + context: InputMaybe + id: InputMaybe + masterTimeout: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_DefaultRankEvalArgs = { + allowNoIndices: InputMaybe + body: Scalars['JSON'] + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe +} + +export type ElasticApi_DefaultReindexArgs = { + body: Scalars['JSON'] + maxDocs: InputMaybe + refresh: InputMaybe + requestsPerSecond: InputMaybe + scroll?: InputMaybe + slices?: InputMaybe + timeout?: InputMaybe + waitForActiveShards: InputMaybe + waitForCompletion?: InputMaybe +} + +export type ElasticApi_DefaultReindexRethrottleArgs = { + body: InputMaybe + requestsPerSecond: InputMaybe + taskId: InputMaybe +} + +export type ElasticApi_DefaultRenderSearchTemplateArgs = { + body: InputMaybe + id: InputMaybe +} + +export type ElasticApi_DefaultScriptsPainlessExecuteArgs = { + body: InputMaybe +} + +export type ElasticApi_DefaultScrollArgs = { + body: InputMaybe + restTotalHitsAsInt: InputMaybe + scroll: InputMaybe + scrollId: InputMaybe +} + +export type ElasticApi_DefaultSearchArgs = { + _source: InputMaybe + _sourceExcludes: InputMaybe + _sourceIncludes: InputMaybe + allowNoIndices: InputMaybe + allowPartialSearchResults?: InputMaybe + analyzeWildcard: InputMaybe + analyzer: InputMaybe + batchedReduceSize?: InputMaybe + body: InputMaybe + ccsMinimizeRoundtrips?: InputMaybe + defaultOperator?: InputMaybe + df: InputMaybe + docvalueFields: InputMaybe + expandWildcards?: InputMaybe + explain: InputMaybe + from: InputMaybe + ignoreThrottled: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + lenient: InputMaybe + maxConcurrentShardRequests?: InputMaybe + preFilterShardSize?: InputMaybe + preference: InputMaybe + q: InputMaybe + requestCache: InputMaybe + restTotalHitsAsInt: InputMaybe + routing: InputMaybe + scroll: InputMaybe + searchType: InputMaybe + seqNoPrimaryTerm: InputMaybe + size: InputMaybe + sort: InputMaybe + stats: InputMaybe + storedFields: InputMaybe + suggestField: InputMaybe + suggestMode?: InputMaybe + suggestSize: InputMaybe + suggestText: InputMaybe + terminateAfter: InputMaybe + timeout: InputMaybe + trackScores: InputMaybe + trackTotalHits: InputMaybe + typedKeys: InputMaybe + version: InputMaybe +} + +export type ElasticApi_DefaultSearchShardsArgs = { + allowNoIndices: InputMaybe + body: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + local: InputMaybe + preference: InputMaybe + routing: InputMaybe +} + +export type ElasticApi_DefaultSearchTemplateArgs = { + allowNoIndices: InputMaybe + body: Scalars['JSON'] + ccsMinimizeRoundtrips?: InputMaybe + expandWildcards?: InputMaybe + explain: InputMaybe + ignoreThrottled: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + preference: InputMaybe + profile: InputMaybe + restTotalHitsAsInt: InputMaybe + routing: InputMaybe + scroll: InputMaybe + searchType: InputMaybe + typedKeys: InputMaybe +} + +export type ElasticApi_DefaultTermvectorsArgs = { + body: InputMaybe + fieldStatistics?: InputMaybe + fields: InputMaybe + id: InputMaybe + index: InputMaybe + offsets?: InputMaybe + payloads?: InputMaybe + positions?: InputMaybe + preference: InputMaybe + realtime: InputMaybe + routing: InputMaybe + termStatistics: InputMaybe + version: InputMaybe + versionType: InputMaybe +} + +export type ElasticApi_DefaultUpdateArgs = { + _source: InputMaybe + _sourceExcludes: InputMaybe + _sourceIncludes: InputMaybe + body: Scalars['JSON'] + id: InputMaybe + ifPrimaryTerm: InputMaybe + ifSeqNo: InputMaybe + index: InputMaybe + lang: InputMaybe + refresh: InputMaybe + retryOnConflict: InputMaybe + routing: InputMaybe + timeout: InputMaybe + waitForActiveShards: InputMaybe +} + +export type ElasticApi_DefaultUpdateByQueryArgs = { + _source: InputMaybe + _sourceExcludes: InputMaybe + _sourceIncludes: InputMaybe + allowNoIndices: InputMaybe + analyzeWildcard: InputMaybe + analyzer: InputMaybe + body: InputMaybe + conflicts?: InputMaybe + defaultOperator?: InputMaybe + df: InputMaybe + expandWildcards?: InputMaybe + from: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + lenient: InputMaybe + maxDocs: InputMaybe + pipeline: InputMaybe + preference: InputMaybe + q: InputMaybe + refresh: InputMaybe + requestCache: InputMaybe + requestsPerSecond: InputMaybe + routing: InputMaybe + scroll: InputMaybe + scrollSize: InputMaybe + searchTimeout: InputMaybe + searchType: InputMaybe + size: InputMaybe + slices?: InputMaybe + sort: InputMaybe + stats: InputMaybe + terminateAfter: InputMaybe + timeout?: InputMaybe + version: InputMaybe + versionType: InputMaybe + waitForActiveShards: InputMaybe + waitForCompletion?: InputMaybe +} + +export type ElasticApi_DefaultUpdateByQueryRethrottleArgs = { + body: InputMaybe + requestsPerSecond: InputMaybe + taskId: InputMaybe +} + +export enum ElasticApi_DefaultEnum_Bytes { + B = 'b', + G = 'g', + Gb = 'gb', + K = 'k', + Kb = 'kb', + M = 'm', + Mb = 'mb', + P = 'p', + Pb = 'pb', + T = 't', + Tb = 'tb', +} + +export enum ElasticApi_DefaultEnum_Bytes_1 { + B = 'b', + G = 'g', + K = 'k', + M = 'm', +} + +export enum ElasticApi_DefaultEnum_Conflicts { + Abort = 'abort', + Proceed = 'proceed', +} + +export enum ElasticApi_DefaultEnum_DefaultOperator { + And = 'AND', + Or = 'OR', +} + +export enum ElasticApi_DefaultEnum_ExpandWildcards { + All = 'all', + Closed = 'closed', + None = 'none', + Open = 'open', +} + +export enum ElasticApi_DefaultEnum_GroupBy { + Nodes = 'nodes', + None = 'none', + Parents = 'parents', +} + +export enum ElasticApi_DefaultEnum_Health { + Green = 'green', + Red = 'red', + Yellow = 'yellow', +} + +export enum ElasticApi_DefaultEnum_Level { + Cluster = 'cluster', + Indices = 'indices', + Shards = 'shards', +} + +export enum ElasticApi_DefaultEnum_Level_1 { + Indices = 'indices', + Node = 'node', + Shards = 'shards', +} + +export enum ElasticApi_DefaultEnum_OpType { + Create = 'create', + Index = 'index', +} + +export enum ElasticApi_DefaultEnum_Refresh { + EmptyString = 'empty_string', + FalseString = 'false_string', + TrueString = 'true_string', + WaitFor = 'wait_for', +} + +export enum ElasticApi_DefaultEnum_SearchType { + DfsQueryThenFetch = 'dfs_query_then_fetch', + QueryThenFetch = 'query_then_fetch', +} + +export enum ElasticApi_DefaultEnum_SearchType_1 { + DfsQueryAndFetch = 'dfs_query_and_fetch', + DfsQueryThenFetch = 'dfs_query_then_fetch', + QueryAndFetch = 'query_and_fetch', + QueryThenFetch = 'query_then_fetch', +} + +export enum ElasticApi_DefaultEnum_Size { + EmptyString = 'empty_string', + G = 'g', + K = 'k', + M = 'm', + P = 'p', + T = 't', +} + +export enum ElasticApi_DefaultEnum_SuggestMode { + Always = 'always', + Missing = 'missing', + Popular = 'popular', +} + +export enum ElasticApi_DefaultEnum_Type { + Block = 'block', + Cpu = 'cpu', + Wait = 'wait', +} + +export enum ElasticApi_DefaultEnum_VersionType { + External = 'external', + ExternalGte = 'external_gte', + Force = 'force', + Internal = 'internal', +} + +export enum ElasticApi_DefaultEnum_WaitForEvents { + High = 'high', + Immediate = 'immediate', + Languid = 'languid', + Low = 'low', + Normal = 'normal', + Urgent = 'urgent', +} + +export enum ElasticApi_DefaultEnum_WaitForStatus { + Green = 'green', + Red = 'red', + Yellow = 'yellow', +} + +export type ElasticApi_Default_Cat = { + /** Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat.html) request */ + aliases?: Maybe + /** Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-allocation.html) request */ + allocation?: Maybe + /** Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-count.html) request */ + count?: Maybe + /** Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-fielddata.html) request */ + fielddata?: Maybe + /** Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-health.html) request */ + health?: Maybe + /** Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat.html) request */ + help?: Maybe + /** Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-indices.html) request */ + indices?: Maybe + /** Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-master.html) request */ + master?: Maybe + /** Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-nodeattrs.html) request */ + nodeattrs?: Maybe + /** Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-nodes.html) request */ + nodes?: Maybe + /** Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-pending-tasks.html) request */ + pendingTasks?: Maybe + /** Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-plugins.html) request */ + plugins?: Maybe + /** Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-recovery.html) request */ + recovery?: Maybe + /** Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-repositories.html) request */ + repositories?: Maybe + /** Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-segments.html) request */ + segments?: Maybe + /** Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-shards.html) request */ + shards?: Maybe + /** Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-snapshots.html) request */ + snapshots?: Maybe + /** Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/tasks.html) request */ + tasks?: Maybe + /** Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-templates.html) request */ + templates?: Maybe + /** Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-thread-pool.html) request */ + threadPool?: Maybe +} + +export type ElasticApi_Default_CatAliasesArgs = { + format?: InputMaybe + h: InputMaybe + help: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + name: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatAllocationArgs = { + bytes: InputMaybe + format?: InputMaybe + h: InputMaybe + help: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + nodeId: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatCountArgs = { + format?: InputMaybe + h: InputMaybe + help: InputMaybe + index: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatFielddataArgs = { + bytes: InputMaybe + fields: InputMaybe + format?: InputMaybe + h: InputMaybe + help: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatHealthArgs = { + format?: InputMaybe + h: InputMaybe + help: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + s: InputMaybe + ts?: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatHelpArgs = { + help: InputMaybe + s: InputMaybe +} + +export type ElasticApi_Default_CatIndicesArgs = { + bytes: InputMaybe + format?: InputMaybe + h: InputMaybe + health: InputMaybe + help: InputMaybe + includeUnloadedSegments: InputMaybe + index: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + pri: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatMasterArgs = { + format?: InputMaybe + h: InputMaybe + help: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatNodeattrsArgs = { + format?: InputMaybe + h: InputMaybe + help: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatNodesArgs = { + format?: InputMaybe + fullId: InputMaybe + h: InputMaybe + help: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatPendingTasksArgs = { + format?: InputMaybe + h: InputMaybe + help: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatPluginsArgs = { + format?: InputMaybe + h: InputMaybe + help: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatRecoveryArgs = { + bytes: InputMaybe + format?: InputMaybe + h: InputMaybe + help: InputMaybe + index: InputMaybe + masterTimeout: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatRepositoriesArgs = { + format?: InputMaybe + h: InputMaybe + help: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatSegmentsArgs = { + bytes: InputMaybe + format?: InputMaybe + h: InputMaybe + help: InputMaybe + index: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatShardsArgs = { + bytes: InputMaybe + format?: InputMaybe + h: InputMaybe + help: InputMaybe + index: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatSnapshotsArgs = { + format?: InputMaybe + h: InputMaybe + help: InputMaybe + ignoreUnavailable: InputMaybe + masterTimeout: InputMaybe + repository: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatTasksArgs = { + actions: InputMaybe + detailed: InputMaybe + format?: InputMaybe + h: InputMaybe + help: InputMaybe + nodeId: InputMaybe + parentTask: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatTemplatesArgs = { + format?: InputMaybe + h: InputMaybe + help: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + name: InputMaybe + s: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_CatThreadPoolArgs = { + format?: InputMaybe + h: InputMaybe + help: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + s: InputMaybe + size: InputMaybe + threadPoolPatterns: InputMaybe + v: InputMaybe +} + +export type ElasticApi_Default_Cluster = { + /** Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-allocation-explain.html) request */ + allocationExplain?: Maybe + /** Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-update-settings.html) request */ + getSettings?: Maybe + /** Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-health.html) request */ + health?: Maybe + /** Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-pending.html) request */ + pendingTasks?: Maybe + /** Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-update-settings.html) request */ + putSettings?: Maybe + /** Perform a [cluster.remoteInfo](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-remote-info.html) request */ + remoteInfo?: Maybe + /** Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-reroute.html) request */ + reroute?: Maybe + /** Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-state.html) request */ + state?: Maybe + /** Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-stats.html) request */ + stats?: Maybe +} + +export type ElasticApi_Default_ClusterAllocationExplainArgs = { + body: InputMaybe + includeDiskInfo: InputMaybe + includeYesDecisions: InputMaybe +} + +export type ElasticApi_Default_ClusterGetSettingsArgs = { + flatSettings: InputMaybe + includeDefaults: InputMaybe + masterTimeout: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_ClusterHealthArgs = { + expandWildcards?: InputMaybe + index: InputMaybe + level?: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + timeout: InputMaybe + waitForActiveShards: InputMaybe + waitForEvents: InputMaybe + waitForNoInitializingShards: InputMaybe + waitForNoRelocatingShards: InputMaybe + waitForNodes: InputMaybe + waitForStatus: InputMaybe +} + +export type ElasticApi_Default_ClusterPendingTasksArgs = { + local: InputMaybe + masterTimeout: InputMaybe +} + +export type ElasticApi_Default_ClusterPutSettingsArgs = { + body: Scalars['JSON'] + flatSettings: InputMaybe + masterTimeout: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_ClusterRerouteArgs = { + body: InputMaybe + dryRun: InputMaybe + explain: InputMaybe + masterTimeout: InputMaybe + metric: InputMaybe + retryFailed: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_ClusterStateArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe + flatSettings: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + metric: InputMaybe + waitForMetadataVersion: InputMaybe + waitForTimeout: InputMaybe +} + +export type ElasticApi_Default_ClusterStatsArgs = { + flatSettings: InputMaybe + nodeId: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_Indices = { + /** Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-analyze.html) request */ + analyze?: Maybe + /** Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-clearcache.html) request */ + clearCache?: Maybe + /** Perform a [indices.clone](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-clone-index.html) request */ + clone?: Maybe + /** Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-open-close.html) request */ + close?: Maybe + /** Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-create-index.html) request */ + create?: Maybe + /** Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-delete-index.html) request */ + delete?: Maybe + /** Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-aliases.html) request */ + deleteAlias?: Maybe + /** Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-templates.html) request */ + deleteTemplate?: Maybe + /** Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-exists.html) request */ + exists?: Maybe + /** Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-aliases.html) request */ + existsAlias?: Maybe + /** Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-templates.html) request */ + existsTemplate?: Maybe + /** Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-types-exists.html) request */ + existsType?: Maybe + /** Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-flush.html) request */ + flush?: Maybe + /** Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-synced-flush-api.html) request */ + flushSynced?: Maybe + /** Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-forcemerge.html) request */ + forcemerge?: Maybe + /** Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-get-index.html) request */ + get?: Maybe + /** Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-aliases.html) request */ + getAlias?: Maybe + /** Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-get-field-mapping.html) request */ + getFieldMapping?: Maybe + /** Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-get-mapping.html) request */ + getMapping?: Maybe + /** Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-get-settings.html) request */ + getSettings?: Maybe + /** Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-templates.html) request */ + getTemplate?: Maybe + /** Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-upgrade.html) request */ + getUpgrade?: Maybe + /** Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-open-close.html) request */ + open?: Maybe + /** Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-aliases.html) request */ + putAlias?: Maybe + /** Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-put-mapping.html) request */ + putMapping?: Maybe + /** Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-update-settings.html) request */ + putSettings?: Maybe + /** Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-templates.html) request */ + putTemplate?: Maybe + /** Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-recovery.html) request */ + recovery?: Maybe + /** Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-refresh.html) request */ + refresh?: Maybe + /** Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-rollover-index.html) request */ + rollover?: Maybe + /** Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-segments.html) request */ + segments?: Maybe + /** Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-shards-stores.html) request */ + shardStores?: Maybe + /** Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-shrink-index.html) request */ + shrink?: Maybe + /** Perform a [indices.split](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-split-index.html) request */ + split?: Maybe + /** Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-stats.html) request */ + stats?: Maybe + /** Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-aliases.html) request */ + updateAliases?: Maybe + /** Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-upgrade.html) request */ + upgrade?: Maybe + /** Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-validate.html) request */ + validateQuery?: Maybe +} + +export type ElasticApi_Default_IndicesAnalyzeArgs = { + body: InputMaybe + index: InputMaybe +} + +export type ElasticApi_Default_IndicesClearCacheArgs = { + allowNoIndices: InputMaybe + body: InputMaybe + expandWildcards?: InputMaybe + fielddata: InputMaybe + fields: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + query: InputMaybe + request: InputMaybe +} + +export type ElasticApi_Default_IndicesCloneArgs = { + body: InputMaybe + index: InputMaybe + masterTimeout: InputMaybe + target: InputMaybe + timeout: InputMaybe + waitForActiveShards: InputMaybe +} + +export type ElasticApi_Default_IndicesCloseArgs = { + allowNoIndices: InputMaybe + body: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + masterTimeout: InputMaybe + timeout: InputMaybe + waitForActiveShards: InputMaybe +} + +export type ElasticApi_Default_IndicesCreateArgs = { + body: InputMaybe + includeTypeName: InputMaybe + index: InputMaybe + masterTimeout: InputMaybe + timeout: InputMaybe + waitForActiveShards: InputMaybe +} + +export type ElasticApi_Default_IndicesDeleteArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + masterTimeout: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_IndicesDeleteAliasArgs = { + index: InputMaybe + masterTimeout: InputMaybe + name: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_IndicesDeleteTemplateArgs = { + masterTimeout: InputMaybe + name: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_IndicesExistsArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe + flatSettings: InputMaybe + ignoreUnavailable: InputMaybe + includeDefaults: InputMaybe + index: InputMaybe + local: InputMaybe +} + +export type ElasticApi_Default_IndicesExistsAliasArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + local: InputMaybe + name: InputMaybe +} + +export type ElasticApi_Default_IndicesExistsTemplateArgs = { + flatSettings: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + name: InputMaybe +} + +export type ElasticApi_Default_IndicesExistsTypeArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + local: InputMaybe + type: InputMaybe +} + +export type ElasticApi_Default_IndicesFlushArgs = { + allowNoIndices: InputMaybe + body: InputMaybe + expandWildcards?: InputMaybe + force: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + waitIfOngoing: InputMaybe +} + +export type ElasticApi_Default_IndicesFlushSyncedArgs = { + allowNoIndices: InputMaybe + body: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe +} + +export type ElasticApi_Default_IndicesForcemergeArgs = { + allowNoIndices: InputMaybe + body: InputMaybe + expandWildcards?: InputMaybe + flush: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + maxNumSegments: InputMaybe + onlyExpungeDeletes: InputMaybe +} + +export type ElasticApi_Default_IndicesGetArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe + flatSettings: InputMaybe + ignoreUnavailable: InputMaybe + includeDefaults: InputMaybe + includeTypeName: InputMaybe + index: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe +} + +export type ElasticApi_Default_IndicesGetAliasArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + local: InputMaybe + name: InputMaybe +} + +export type ElasticApi_Default_IndicesGetFieldMappingArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe + fields: InputMaybe + ignoreUnavailable: InputMaybe + includeDefaults: InputMaybe + includeTypeName: InputMaybe + index: InputMaybe + local: InputMaybe +} + +export type ElasticApi_Default_IndicesGetMappingArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + includeTypeName: InputMaybe + index: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe +} + +export type ElasticApi_Default_IndicesGetSettingsArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe< + Array> + > + flatSettings: InputMaybe + ignoreUnavailable: InputMaybe + includeDefaults: InputMaybe + index: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + name: InputMaybe +} + +export type ElasticApi_Default_IndicesGetTemplateArgs = { + flatSettings: InputMaybe + includeTypeName: InputMaybe + local: InputMaybe + masterTimeout: InputMaybe + name: InputMaybe +} + +export type ElasticApi_Default_IndicesGetUpgradeArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe +} + +export type ElasticApi_Default_IndicesOpenArgs = { + allowNoIndices: InputMaybe + body: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + masterTimeout: InputMaybe + timeout: InputMaybe + waitForActiveShards: InputMaybe +} + +export type ElasticApi_Default_IndicesPutAliasArgs = { + body: InputMaybe + index: InputMaybe + masterTimeout: InputMaybe + name: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_IndicesPutMappingArgs = { + allowNoIndices: InputMaybe + body: Scalars['JSON'] + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + includeTypeName: InputMaybe + index: InputMaybe + masterTimeout: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_IndicesPutSettingsArgs = { + allowNoIndices: InputMaybe + body: Scalars['JSON'] + expandWildcards?: InputMaybe + flatSettings: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + masterTimeout: InputMaybe + preserveExisting: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_IndicesPutTemplateArgs = { + body: Scalars['JSON'] + create: InputMaybe + flatSettings: InputMaybe + includeTypeName: InputMaybe + masterTimeout: InputMaybe + name: InputMaybe + order: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_IndicesRecoveryArgs = { + activeOnly: InputMaybe + detailed: InputMaybe + index: InputMaybe +} + +export type ElasticApi_Default_IndicesRefreshArgs = { + allowNoIndices: InputMaybe + body: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe +} + +export type ElasticApi_Default_IndicesRolloverArgs = { + alias: InputMaybe + body: InputMaybe + dryRun: InputMaybe + includeTypeName: InputMaybe + masterTimeout: InputMaybe + newIndex: InputMaybe + timeout: InputMaybe + waitForActiveShards: InputMaybe +} + +export type ElasticApi_Default_IndicesSegmentsArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + verbose: InputMaybe +} + +export type ElasticApi_Default_IndicesShardStoresArgs = { + allowNoIndices: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + status: InputMaybe +} + +export type ElasticApi_Default_IndicesShrinkArgs = { + body: InputMaybe + copySettings: InputMaybe + index: InputMaybe + masterTimeout: InputMaybe + target: InputMaybe + timeout: InputMaybe + waitForActiveShards: InputMaybe +} + +export type ElasticApi_Default_IndicesSplitArgs = { + body: InputMaybe + copySettings: InputMaybe + index: InputMaybe + masterTimeout: InputMaybe + target: InputMaybe + timeout: InputMaybe + waitForActiveShards: InputMaybe +} + +export type ElasticApi_Default_IndicesStatsArgs = { + completionFields: InputMaybe + expandWildcards?: InputMaybe + fielddataFields: InputMaybe + fields: InputMaybe + forbidClosedIndices?: InputMaybe + groups: InputMaybe + includeSegmentFileSizes: InputMaybe + includeUnloadedSegments: InputMaybe + index: InputMaybe + level?: InputMaybe + metric: InputMaybe + types: InputMaybe +} + +export type ElasticApi_Default_IndicesUpdateAliasesArgs = { + body: Scalars['JSON'] + masterTimeout: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_IndicesUpgradeArgs = { + allowNoIndices: InputMaybe + body: InputMaybe + expandWildcards?: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + onlyAncientSegments: InputMaybe + waitForCompletion: InputMaybe +} + +export type ElasticApi_Default_IndicesValidateQueryArgs = { + allShards: InputMaybe + allowNoIndices: InputMaybe + analyzeWildcard: InputMaybe + analyzer: InputMaybe + body: InputMaybe + defaultOperator?: InputMaybe + df: InputMaybe + expandWildcards?: InputMaybe + explain: InputMaybe + ignoreUnavailable: InputMaybe + index: InputMaybe + lenient: InputMaybe + q: InputMaybe + rewrite: InputMaybe +} + +export type ElasticApi_Default_Ingest = { + /** Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/delete-pipeline-api.html) request */ + deletePipeline?: Maybe + /** Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/get-pipeline-api.html) request */ + getPipeline?: Maybe + /** Perform a [ingest.processorGrok](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/grok-processor.html#grok-processor-rest-get) request */ + processorGrok?: Maybe + /** Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/put-pipeline-api.html) request */ + putPipeline?: Maybe + /** Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/simulate-pipeline-api.html) request */ + simulate?: Maybe +} + +export type ElasticApi_Default_IngestDeletePipelineArgs = { + id: InputMaybe + masterTimeout: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_IngestGetPipelineArgs = { + id: InputMaybe + masterTimeout: InputMaybe +} + +export type ElasticApi_Default_IngestPutPipelineArgs = { + body: Scalars['JSON'] + id: InputMaybe + masterTimeout: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_IngestSimulateArgs = { + body: Scalars['JSON'] + id: InputMaybe + verbose: InputMaybe +} + +export type ElasticApi_Default_Nodes = { + /** Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-nodes-hot-threads.html) request */ + hotThreads?: Maybe + /** Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-nodes-info.html) request */ + info?: Maybe + /** Perform a [nodes.reloadSecureSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/secure-settings.html#reloadable-secure-settings) request */ + reloadSecureSettings?: Maybe + /** Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-nodes-stats.html) request */ + stats?: Maybe + /** Perform a [nodes.usage](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-nodes-usage.html) request */ + usage?: Maybe +} + +export type ElasticApi_Default_NodesHotThreadsArgs = { + ignoreIdleThreads: InputMaybe + interval: InputMaybe + snapshots: InputMaybe + threads: InputMaybe + timeout: InputMaybe + type: InputMaybe +} + +export type ElasticApi_Default_NodesInfoArgs = { + flatSettings: InputMaybe + metric: InputMaybe + nodeId: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_NodesReloadSecureSettingsArgs = { + body: InputMaybe + nodeId: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_NodesStatsArgs = { + completionFields: InputMaybe + fielddataFields: InputMaybe + fields: InputMaybe + groups: InputMaybe + includeSegmentFileSizes: InputMaybe + indexMetric: InputMaybe + level?: InputMaybe + metric: InputMaybe + nodeId: InputMaybe + timeout: InputMaybe + types: InputMaybe +} + +export type ElasticApi_Default_NodesUsageArgs = { + metric: InputMaybe + nodeId: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_Snapshot = { + /** Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request */ + create?: Maybe + /** Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request */ + createRepository?: Maybe + /** Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request */ + delete?: Maybe + /** Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request */ + deleteRepository?: Maybe + /** Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request */ + get?: Maybe + /** Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request */ + getRepository?: Maybe + /** Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request */ + restore?: Maybe + /** Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request */ + status?: Maybe + /** Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request */ + verifyRepository?: Maybe +} + +export type ElasticApi_Default_SnapshotCreateArgs = { + body: InputMaybe + masterTimeout: InputMaybe + repository: InputMaybe + snapshot: InputMaybe + waitForCompletion: InputMaybe +} + +export type ElasticApi_Default_SnapshotCreateRepositoryArgs = { + body: Scalars['JSON'] + masterTimeout: InputMaybe + repository: InputMaybe + timeout: InputMaybe + verify: InputMaybe +} + +export type ElasticApi_Default_SnapshotDeleteArgs = { + masterTimeout: InputMaybe + repository: InputMaybe + snapshot: InputMaybe +} + +export type ElasticApi_Default_SnapshotDeleteRepositoryArgs = { + masterTimeout: InputMaybe + repository: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_SnapshotGetArgs = { + ignoreUnavailable: InputMaybe + masterTimeout: InputMaybe + repository: InputMaybe + snapshot: InputMaybe + verbose: InputMaybe +} + +export type ElasticApi_Default_SnapshotGetRepositoryArgs = { + local: InputMaybe + masterTimeout: InputMaybe + repository: InputMaybe +} + +export type ElasticApi_Default_SnapshotRestoreArgs = { + body: InputMaybe + masterTimeout: InputMaybe + repository: InputMaybe + snapshot: InputMaybe + waitForCompletion: InputMaybe +} + +export type ElasticApi_Default_SnapshotStatusArgs = { + ignoreUnavailable: InputMaybe + masterTimeout: InputMaybe + repository: InputMaybe + snapshot: InputMaybe +} + +export type ElasticApi_Default_SnapshotVerifyRepositoryArgs = { + body: InputMaybe + masterTimeout: InputMaybe + repository: InputMaybe + timeout: InputMaybe +} + +export type ElasticApi_Default_Tasks = { + /** Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/tasks.html) request */ + cancel?: Maybe + /** Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/tasks.html) request */ + get?: Maybe + /** Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/tasks.html) request */ + list?: Maybe +} + +export type ElasticApi_Default_TasksCancelArgs = { + actions: InputMaybe + body: InputMaybe + nodes: InputMaybe + parentTaskId: InputMaybe + taskId: InputMaybe +} + +export type ElasticApi_Default_TasksGetArgs = { + taskId: InputMaybe + timeout: InputMaybe + waitForCompletion: InputMaybe +} + +export type ElasticApi_Default_TasksListArgs = { + actions: InputMaybe + detailed: InputMaybe + groupBy?: InputMaybe + nodes: InputMaybe + parentTaskId: InputMaybe + timeout: InputMaybe + waitForCompletion: InputMaybe +} + /** A connection to a list of `Entity` values. */ export type EntitiesConnection = { /** A list of edges which contains the `Entity` and cursor to aid in pagination. */ @@ -3393,109 +5082,6 @@ export type JsonFilter = { notIn?: InputMaybe> } -export type Keypair = { - did: Scalars['String'] - name?: Maybe - scope: KeypairScope - secret: Scalars['String'] -} - -/** A condition to be used against `Keypair` object types. All fields are tested for equality and combined with a logical ‘and.’ */ -export type KeypairCondition = { - /** Checks for equality with the object’s `did` field. */ - did?: InputMaybe - /** Checks for equality with the object’s `name` field. */ - name?: InputMaybe - /** Checks for equality with the object’s `scope` field. */ - scope?: InputMaybe - /** Checks for equality with the object’s `secret` field. */ - secret?: InputMaybe -} - -/** A filter to be used against `Keypair` object types. All fields are combined with a logical ‘and.’ */ -export type KeypairFilter = { - /** Checks for all expressions in this list. */ - and?: InputMaybe> - /** Filter by the object’s `did` field. */ - did?: InputMaybe - /** Filter by the object’s `name` field. */ - name?: InputMaybe - /** Negates the expression. */ - not?: InputMaybe - /** Checks for any expressions in this list. */ - or?: InputMaybe> - /** Filter by the object’s `scope` field. */ - scope?: InputMaybe - /** Filter by the object’s `secret` field. */ - secret?: InputMaybe -} - -export enum KeypairScope { - Instance = 'INSTANCE', - Repo = 'REPO', -} - -/** A filter to be used against KeypairScope fields. All fields are combined with a logical ‘and.’ */ -export type KeypairScopeFilter = { - /** Not equal to the specified value, treating null like an ordinary value. */ - distinctFrom?: InputMaybe - /** Equal to the specified value. */ - equalTo?: InputMaybe - /** Greater than the specified value. */ - greaterThan?: InputMaybe - /** Greater than or equal to the specified value. */ - greaterThanOrEqualTo?: InputMaybe - /** Included in the specified list. */ - in?: InputMaybe> - /** Is null (if `true` is specified) or is not null (if `false` is specified). */ - isNull?: InputMaybe - /** Less than the specified value. */ - lessThan?: InputMaybe - /** Less than or equal to the specified value. */ - lessThanOrEqualTo?: InputMaybe - /** Equal to the specified value, treating null like an ordinary value. */ - notDistinctFrom?: InputMaybe - /** Not equal to the specified value. */ - notEqualTo?: InputMaybe - /** Not included in the specified list. */ - notIn?: InputMaybe> -} - -/** A connection to a list of `Keypair` values. */ -export type KeypairsConnection = { - /** A list of edges which contains the `Keypair` and cursor to aid in pagination. */ - edges: Array - /** A list of `Keypair` objects. */ - nodes: Array - /** Information to aid in pagination. */ - pageInfo: PageInfo - /** The count of *all* `Keypair` you could get from the connection. */ - totalCount: Scalars['Int'] -} - -/** A `Keypair` edge in the connection. */ -export type KeypairsEdge = { - /** A cursor for use in pagination. */ - cursor?: Maybe - /** The `Keypair` at the end of the edge. */ - node: Keypair -} - -/** Methods to use when ordering `Keypair`. */ -export enum KeypairsOrderBy { - DidAsc = 'DID_ASC', - DidDesc = 'DID_DESC', - NameAsc = 'NAME_ASC', - NameDesc = 'NAME_DESC', - Natural = 'NATURAL', - PrimaryKeyAsc = 'PRIMARY_KEY_ASC', - PrimaryKeyDesc = 'PRIMARY_KEY_DESC', - ScopeAsc = 'SCOPE_ASC', - ScopeDesc = 'SCOPE_DESC', - SecretAsc = 'SECRET_ASC', - SecretDesc = 'SECRET_DESC', -} - export type License = { /** Reads and enables pagination through a set of `ContentGrouping`. */ contentGroupings: ContentGroupingsConnection @@ -4659,6 +6245,8 @@ export type Query = { dataSource?: Maybe /** Reads and enables pagination through a set of `DataSource`. */ dataSources?: Maybe + /** Elastic API v_default */ + elastic?: Maybe /** Reads and enables pagination through a set of `Entity`. */ entities?: Maybe entity?: Maybe @@ -4668,9 +6256,6 @@ export type Query = { file?: Maybe /** Reads and enables pagination through a set of `File`. */ files?: Maybe - keypair?: Maybe - /** Reads and enables pagination through a set of `Keypair`. */ - keypairs?: Maybe license?: Maybe /** Reads and enables pagination through a set of `License`. */ licenses?: Maybe @@ -4894,6 +6479,11 @@ export type QueryDataSourcesArgs = { orderBy?: InputMaybe> } +/** The root query type which gives access points into the data universe. */ +export type QueryElasticArgs = { + host?: InputMaybe +} + /** The root query type which gives access points into the data universe. */ export type QueryEntitiesArgs = { after: InputMaybe @@ -4946,23 +6536,6 @@ export type QueryFilesArgs = { orderBy?: InputMaybe> } -/** The root query type which gives access points into the data universe. */ -export type QueryKeypairArgs = { - did: Scalars['String'] -} - -/** The root query type which gives access points into the data universe. */ -export type QueryKeypairsArgs = { - after: InputMaybe - before: InputMaybe - condition: InputMaybe - filter: InputMaybe - first: InputMaybe - last: InputMaybe - offset: InputMaybe - orderBy?: InputMaybe> -} - /** The root query type which gives access points into the data universe. */ export type QueryLicenseArgs = { uid: Scalars['String'] diff --git a/packages/repco-frontend/app/routes/__layout/index.tsx b/packages/repco-frontend/app/routes/__layout/index.tsx index 09908aab..e6cb7653 100644 --- a/packages/repco-frontend/app/routes/__layout/index.tsx +++ b/packages/repco-frontend/app/routes/__layout/index.tsx @@ -83,7 +83,7 @@ export const loader: LoaderFunction = async ({ request }) => { publicationServicesNodes = top10 } - const labels = publicationServicesNodes.map((item) => item.name) + const labels = publicationServicesNodes.map((item) => item.name[Object.keys(item.name)[0]]['value']) const dataPoints = publicationServicesNodes.map( (item) => item.contentItems?.totalCount, ) @@ -176,9 +176,9 @@ export default function Index() { (node: any, index: number) => (
  • - {node.title.length > 20 - ? node.title.slice(0, 45) + '...' - : node.title} + {node.title[Object.keys(node?.title)[0]]['value'].length > 20 + ? node.title[Object.keys(node?.title)[0]]['value'].slice(0, 45) + '...' + : node.title[Object.keys(node?.title)[0]]['value']}
  • ), diff --git a/packages/repco-frontend/app/routes/__layout/items/index.tsx b/packages/repco-frontend/app/routes/__layout/items/index.tsx index 6b2b16ef..eda853b5 100644 --- a/packages/repco-frontend/app/routes/__layout/items/index.tsx +++ b/packages/repco-frontend/app/routes/__layout/items/index.tsx @@ -58,8 +58,8 @@ export const loader: LoaderFunction = async ({ request }) => { data?.contentItems?.nodes.map((node) => { return { ...node, - title: sanitize(node?.title, { allowedTags: [] }), - summary: sanitize(node?.summary || '', { allowedTags: [] }), + title: sanitize(node?.title[Object.keys(node?.title)[0]]['value'], { allowedTags: [] }), + summary: sanitize(node?.summary[Object.keys(node?.title)[0]]['value'] || '', { allowedTags: [] }), } }) || [], pageInfo: data?.contentItems?.pageInfo, @@ -117,11 +117,10 @@ export default function ItemsIndex() {

    {new Date(node.pubDate).toLocaleDateString()} - {node.publicationService?.name && ' - '} - {node.publicationService?.name} + {node.publicationService?.name[Object.keys(node.publicationService?.name)[0]]['value'] && ' - '} + {node.publicationService?.name[Object.keys(node.publicationService?.name)[0]]['value']}

    -

    {node.summary || ''}

    diff --git a/packages/repco-graphql/generated/schema.graphql b/packages/repco-graphql/generated/schema.graphql index 410e9195..aa7510ea 100644 --- a/packages/repco-graphql/generated/schema.graphql +++ b/packages/repco-graphql/generated/schema.graphql @@ -4192,6 +4192,3903 @@ input DatetimeFilter { notIn: [Datetime!] } +type ElasticAPI_default { + """ + Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-bulk.html) request + """ + bulk( + """ + True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request + """ + _source: JSON + + """ + Default list of fields to exclude from the returned _source field, can be overridden on each sub-request + """ + _sourceExcludes: JSON + + """ + Default list of fields to extract and return from the _source field, can be overridden on each sub-request + """ + _sourceIncludes: JSON + body: JSON! + + """Default index for items which don't provide one""" + index: String + + """The pipeline id to preprocess incoming documents with""" + pipeline: String + + """ + If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + """ + refresh: ElasticAPI_defaultEnum_Refresh + + """Specific routing value""" + routing: String + + """Explicit operation timeout""" + timeout: String + + """Default document type for items which don't provide one""" + type: String + + """ + Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + """ + waitForActiveShards: String + ): JSON + cat: ElasticAPI_default_Cat + + """ + Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-request-body.html#_clear_scroll_api) request + """ + clearScroll: JSON + cluster: ElasticAPI_default_Cluster + + """ + Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-count.html) request + """ + count( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + + """ + Specify whether wildcard and prefix queries should be analyzed (default: false) + """ + analyzeWildcard: Boolean + + """The analyzer to use for the query string""" + analyzer: String + body: JSON + defaultOperator: ElasticAPI_defaultEnum_DefaultOperator = OR + + """ + The field to use as default where no field prefix is given in the query string + """ + df: String + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete, expanded or aliased indices should be ignored when throttled + """ + ignoreThrottled: Boolean + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """A comma-separated list of indices to restrict the results""" + index: JSON + + """ + Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + """ + lenient: Boolean + + """Include only documents with a specific `_score` value in the result""" + minScore: Float + + """ + Specify the node or shard the operation should be performed on (default: random) + """ + preference: String + + """Query in the Lucene query string syntax""" + q: String + + """A comma-separated list of specific routing values""" + routing: JSON + + """ + The maximum count for each shard, upon reaching which the query execution will terminate early + """ + terminateAfter: Float + ): JSON + + """ + Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-index_.html) request + """ + create( + body: JSON! + + """Document ID""" + id: String + + """The name of the index""" + index: String + + """The pipeline id to preprocess incoming documents with""" + pipeline: String + + """ + If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + """ + refresh: ElasticAPI_defaultEnum_Refresh + + """Specific routing value""" + routing: String + + """Explicit operation timeout""" + timeout: String + + """Explicit version number for concurrency control""" + version: Float + + """Specific version type""" + versionType: ElasticAPI_defaultEnum_VersionType + + """ + Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + """ + waitForActiveShards: String + ): JSON + + """ + Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-delete.html) request + """ + delete( + """The document ID""" + id: String + + """ + only perform the delete operation if the last operation that has changed the document has the specified primary term + """ + ifPrimaryTerm: Float + + """ + only perform the delete operation if the last operation that has changed the document has the specified sequence number + """ + ifSeqNo: Float + + """The name of the index""" + index: String + + """ + If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + """ + refresh: ElasticAPI_defaultEnum_Refresh + + """Specific routing value""" + routing: String + + """Explicit operation timeout""" + timeout: String + + """Explicit version number for concurrency control""" + version: Float + + """Specific version type""" + versionType: ElasticAPI_defaultEnum_VersionType + + """ + Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + """ + waitForActiveShards: String + ): JSON + + """ + Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-delete-by-query.html) request + """ + deleteByQuery( + """ + True or false to return the _source field or not, or a list of fields to return + """ + _source: JSON + + """A list of fields to exclude from the returned _source field""" + _sourceExcludes: JSON + + """A list of fields to extract and return from the _source field""" + _sourceIncludes: JSON + + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + + """ + Specify whether wildcard and prefix queries should be analyzed (default: false) + """ + analyzeWildcard: Boolean + + """The analyzer to use for the query string""" + analyzer: String + body: JSON! + conflicts: ElasticAPI_defaultEnum_Conflicts = abort + defaultOperator: ElasticAPI_defaultEnum_DefaultOperator = OR + + """ + The field to use as default where no field prefix is given in the query string + """ + df: String + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """Starting offset (default: 0)""" + from: Float + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """ + Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + """ + lenient: Boolean + + """Maximum number of documents to process (default: all documents)""" + maxDocs: Float + + """ + Specify the node or shard the operation should be performed on (default: random) + """ + preference: String + + """Query in the Lucene query string syntax""" + q: String + + """Should the effected indexes be refreshed?""" + refresh: Boolean + + """ + Specify if request cache should be used for this request or not, defaults to index level setting + """ + requestCache: Boolean + + """ + The throttle for this request in sub-requests per second. -1 means no throttle. + """ + requestsPerSecond: Float + + """A comma-separated list of specific routing values""" + routing: JSON + + """ + Specify how long a consistent view of the index should be maintained for scrolled search + """ + scroll: String + + """Size on the scroll request powering the delete by query""" + scrollSize: Float + + """Explicit timeout for each search request. Defaults to no timeout.""" + searchTimeout: String + + """Search operation type""" + searchType: ElasticAPI_defaultEnum_SearchType + + """Deprecated, please use `max_docs` instead""" + size: Float + slices: Float = 1 + + """A comma-separated list of : pairs""" + sort: JSON + + """Specific 'tag' of the request for logging and statistical purposes""" + stats: JSON + + """ + The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + """ + terminateAfter: Float + timeout: String = "1m" + + """Specify whether to return document version as part of a hit""" + version: Boolean + + """ + Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + """ + waitForActiveShards: String + waitForCompletion: Boolean = true + ): JSON + + """ + Perform a [deleteByQueryRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-delete-by-query.html) request + """ + deleteByQueryRethrottle( + body: JSON + + """ + The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + """ + requestsPerSecond: Float + + """The task id to rethrottle""" + taskId: String + ): JSON + + """ + Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-scripting.html) request + """ + deleteScript( + """Script ID""" + id: String + + """Specify timeout for connection to master""" + masterTimeout: String + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-get.html) request + """ + exists( + """ + True or false to return the _source field or not, or a list of fields to return + """ + _source: JSON + + """A list of fields to exclude from the returned _source field""" + _sourceExcludes: JSON + + """A list of fields to extract and return from the _source field""" + _sourceIncludes: JSON + + """The document ID""" + id: String + + """The name of the index""" + index: String + + """ + Specify the node or shard the operation should be performed on (default: random) + """ + preference: String + + """Specify whether to perform the operation in realtime or search mode""" + realtime: Boolean + + """ + Refresh the shard containing the document before performing the operation + """ + refresh: Boolean + + """Specific routing value""" + routing: String + + """A comma-separated list of stored fields to return in the response""" + storedFields: JSON + + """Explicit version number for concurrency control""" + version: Float + + """Specific version type""" + versionType: ElasticAPI_defaultEnum_VersionType + ): JSON + + """ + Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-get.html) request + """ + existsSource( + """ + True or false to return the _source field or not, or a list of fields to return + """ + _source: JSON + + """A list of fields to exclude from the returned _source field""" + _sourceExcludes: JSON + + """A list of fields to extract and return from the _source field""" + _sourceIncludes: JSON + + """The document ID""" + id: String + + """The name of the index""" + index: String + + """ + Specify the node or shard the operation should be performed on (default: random) + """ + preference: String + + """Specify whether to perform the operation in realtime or search mode""" + realtime: Boolean + + """ + Refresh the shard containing the document before performing the operation + """ + refresh: Boolean + + """Specific routing value""" + routing: String + + """Explicit version number for concurrency control""" + version: Float + + """Specific version type""" + versionType: ElasticAPI_defaultEnum_VersionType + ): JSON + + """ + Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-explain.html) request + """ + explain( + """ + True or false to return the _source field or not, or a list of fields to return + """ + _source: JSON + + """A list of fields to exclude from the returned _source field""" + _sourceExcludes: JSON + + """A list of fields to extract and return from the _source field""" + _sourceIncludes: JSON + + """ + Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) + """ + analyzeWildcard: Boolean + + """The analyzer for the query string query""" + analyzer: String + body: JSON + defaultOperator: ElasticAPI_defaultEnum_DefaultOperator = OR + + """The default field for query string query (default: _all)""" + df: String + + """The document ID""" + id: String + + """The name of the index""" + index: String + + """ + Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + """ + lenient: Boolean + + """ + Specify the node or shard the operation should be performed on (default: random) + """ + preference: String + + """Query in the Lucene query string syntax""" + q: String + + """Specific routing value""" + routing: String + + """A comma-separated list of stored fields to return in the response""" + storedFields: JSON + ): JSON + + """ + Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-field-caps.html) request + """ + fieldCaps( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """A comma-separated list of field names""" + fields: JSON + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """Indicates whether unmapped fields should be included in the response.""" + includeUnmapped: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + ): JSON + + """ + Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-get.html) request + """ + get( + """ + True or false to return the _source field or not, or a list of fields to return + """ + _source: JSON + + """A list of fields to exclude from the returned _source field""" + _sourceExcludes: JSON + + """A list of fields to extract and return from the _source field""" + _sourceIncludes: JSON + + """The document ID""" + id: String + + """The name of the index""" + index: String + + """ + Specify the node or shard the operation should be performed on (default: random) + """ + preference: String + + """Specify whether to perform the operation in realtime or search mode""" + realtime: Boolean + + """ + Refresh the shard containing the document before performing the operation + """ + refresh: Boolean + + """Specific routing value""" + routing: String + + """A comma-separated list of stored fields to return in the response""" + storedFields: JSON + + """Explicit version number for concurrency control""" + version: Float + + """Specific version type""" + versionType: ElasticAPI_defaultEnum_VersionType + ): JSON + + """ + Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-scripting.html) request + """ + getScript( + """Script ID""" + id: String + + """Specify timeout for connection to master""" + masterTimeout: String + ): JSON + + """ + Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-get.html) request + """ + getSource( + """ + True or false to return the _source field or not, or a list of fields to return + """ + _source: JSON + + """A list of fields to exclude from the returned _source field""" + _sourceExcludes: JSON + + """A list of fields to extract and return from the _source field""" + _sourceIncludes: JSON + + """The document ID""" + id: String + + """The name of the index""" + index: String + + """ + Specify the node or shard the operation should be performed on (default: random) + """ + preference: String + + """Specify whether to perform the operation in realtime or search mode""" + realtime: Boolean + + """ + Refresh the shard containing the document before performing the operation + """ + refresh: Boolean + + """Specific routing value""" + routing: String + + """Explicit version number for concurrency control""" + version: Float + + """Specific version type""" + versionType: ElasticAPI_defaultEnum_VersionType + ): JSON + + """ + Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-index_.html) request + """ + index( + body: JSON! + + """Document ID""" + id: String + + """ + only perform the index operation if the last operation that has changed the document has the specified primary term + """ + ifPrimaryTerm: Float + + """ + only perform the index operation if the last operation that has changed the document has the specified sequence number + """ + ifSeqNo: Float + + """The name of the index""" + index: String + opType: ElasticAPI_defaultEnum_OpType = index + + """The pipeline id to preprocess incoming documents with""" + pipeline: String + + """ + If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + """ + refresh: ElasticAPI_defaultEnum_Refresh + + """Specific routing value""" + routing: String + + """Explicit operation timeout""" + timeout: String + + """Explicit version number for concurrency control""" + version: Float + + """Specific version type""" + versionType: ElasticAPI_defaultEnum_VersionType + + """ + Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + """ + waitForActiveShards: String + ): JSON + indices: ElasticAPI_default_Indices + + """ + Perform a [info](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/index.html) request + """ + info: JSON + ingest: ElasticAPI_default_Ingest + + """ + Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-multi-get.html) request + """ + mget( + """ + True or false to return the _source field or not, or a list of fields to return + """ + _source: JSON + + """A list of fields to exclude from the returned _source field""" + _sourceExcludes: JSON + + """A list of fields to extract and return from the _source field""" + _sourceIncludes: JSON + body: JSON! + + """The name of the index""" + index: String + + """ + Specify the node or shard the operation should be performed on (default: random) + """ + preference: String + + """Specify whether to perform the operation in realtime or search mode""" + realtime: Boolean + + """ + Refresh the shard containing the document before performing the operation + """ + refresh: Boolean + + """Specific routing value""" + routing: String + + """A comma-separated list of stored fields to return in the response""" + storedFields: JSON + ): JSON + + """ + Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-multi-search.html) request + """ + msearch( + body: JSON! + ccsMinimizeRoundtrips: Boolean = true + + """A comma-separated list of index names to use as default""" + index: JSON + + """ + Controls the maximum number of concurrent searches the multi search api will execute + """ + maxConcurrentSearches: Float + maxConcurrentShardRequests: Float = 5 + preFilterShardSize: Float = 128 + + """ + Indicates whether hits.total should be rendered as an integer or an object in the rest search response + """ + restTotalHitsAsInt: Boolean + + """Search operation type""" + searchType: ElasticAPI_defaultEnum_SearchType_1 + + """ + Specify whether aggregation and suggester names should be prefixed by their respective types in the response + """ + typedKeys: Boolean + ): JSON + + """ + Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-multi-search.html) request + """ + msearchTemplate( + body: JSON! + ccsMinimizeRoundtrips: Boolean = true + + """A comma-separated list of index names to use as default""" + index: JSON + + """ + Controls the maximum number of concurrent searches the multi search api will execute + """ + maxConcurrentSearches: Float + + """ + Indicates whether hits.total should be rendered as an integer or an object in the rest search response + """ + restTotalHitsAsInt: Boolean + + """Search operation type""" + searchType: ElasticAPI_defaultEnum_SearchType_1 + + """ + Specify whether aggregation and suggester names should be prefixed by their respective types in the response + """ + typedKeys: Boolean + ): JSON + + """ + Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-multi-termvectors.html) request + """ + mtermvectors( + body: JSON + fieldStatistics: Boolean = true + + """ + A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". + """ + fields: JSON + + """ + A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body + """ + ids: JSON + + """The index in which the document resides.""" + index: String + offsets: Boolean = true + payloads: Boolean = true + positions: Boolean = true + + """ + Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". + """ + preference: String + + """ + Specifies if requests are real-time as opposed to near-real-time (default: true). + """ + realtime: Boolean + + """ + Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". + """ + routing: String + + """ + Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". + """ + termStatistics: Boolean + + """Explicit version number for concurrency control""" + version: Float + + """Specific version type""" + versionType: ElasticAPI_defaultEnum_VersionType + ): JSON + nodes: ElasticAPI_default_Nodes + + """ + Perform a [ping](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/index.html) request + """ + ping: JSON + + """ + Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-scripting.html) request + """ + putScript( + body: JSON! + + """Script context""" + context: String + + """Script ID""" + id: String + + """Specify timeout for connection to master""" + masterTimeout: String + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [rankEval](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-rank-eval.html) request + """ + rankEval( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON! + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + ): JSON + + """ + Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-reindex.html) request + """ + reindex( + body: JSON! + + """Maximum number of documents to process (default: all documents)""" + maxDocs: Float + + """Should the effected indexes be refreshed?""" + refresh: Boolean + + """ + The throttle to set on this request in sub-requests per second. -1 means no throttle. + """ + requestsPerSecond: Float + scroll: String = "5m" + slices: Float = 1 + timeout: String = "1m" + + """ + Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + """ + waitForActiveShards: String + waitForCompletion: Boolean = true + ): JSON + + """ + Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-reindex.html) request + """ + reindexRethrottle( + body: JSON + + """ + The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + """ + requestsPerSecond: Float + + """The task id to rethrottle""" + taskId: String + ): JSON + + """ + Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-template.html#_validating_templates) request + """ + renderSearchTemplate( + body: JSON + + """The id of the stored search template""" + id: String + ): JSON + + """ + Perform a [scriptsPainlessExecute](https://www.elastic.co/guide/en/elasticsearch/painless/7.6/painless-execute-api.html) request + """ + scriptsPainlessExecute(body: JSON): JSON + + """ + Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-request-body.html#request-body-search-scroll) request + """ + scroll( + body: JSON + + """ + Indicates whether hits.total should be rendered as an integer or an object in the rest search response + """ + restTotalHitsAsInt: Boolean + + """ + Specify how long a consistent view of the index should be maintained for scrolled search + """ + scroll: String + + """The scroll ID""" + scrollId: String + ): JSON + + """ + Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-search.html) request + """ + search( + """ + True or false to return the _source field or not, or a list of fields to return + """ + _source: JSON + + """A list of fields to exclude from the returned _source field""" + _sourceExcludes: JSON + + """A list of fields to extract and return from the _source field""" + _sourceIncludes: JSON + + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + allowPartialSearchResults: Boolean = true + + """ + Specify whether wildcard and prefix queries should be analyzed (default: false) + """ + analyzeWildcard: Boolean + + """The analyzer to use for the query string""" + analyzer: String + batchedReduceSize: Float = 512 + body: JSON + ccsMinimizeRoundtrips: Boolean = true + defaultOperator: ElasticAPI_defaultEnum_DefaultOperator = OR + + """ + The field to use as default where no field prefix is given in the query string + """ + df: String + + """ + A comma-separated list of fields to return as the docvalue representation of a field for each hit + """ + docvalueFields: JSON + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Specify whether to return detailed information about score computation as part of a hit + """ + explain: Boolean + + """Starting offset (default: 0)""" + from: Float + + """ + Whether specified concrete, expanded or aliased indices should be ignored when throttled + """ + ignoreThrottled: Boolean + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """ + Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + """ + lenient: Boolean + maxConcurrentShardRequests: Float = 5 + preFilterShardSize: Float = 128 + + """ + Specify the node or shard the operation should be performed on (default: random) + """ + preference: String + + """Query in the Lucene query string syntax""" + q: String + + """ + Specify if request cache should be used for this request or not, defaults to index level setting + """ + requestCache: Boolean + + """ + Indicates whether hits.total should be rendered as an integer or an object in the rest search response + """ + restTotalHitsAsInt: Boolean + + """A comma-separated list of specific routing values""" + routing: JSON + + """ + Specify how long a consistent view of the index should be maintained for scrolled search + """ + scroll: String + + """Search operation type""" + searchType: ElasticAPI_defaultEnum_SearchType + + """ + Specify whether to return sequence number and primary term of the last modification of each hit + """ + seqNoPrimaryTerm: Boolean + + """Number of hits to return (default: 10)""" + size: Float + + """A comma-separated list of : pairs""" + sort: JSON + + """Specific 'tag' of the request for logging and statistical purposes""" + stats: JSON + + """A comma-separated list of stored fields to return as part of a hit""" + storedFields: JSON + + """Specify which field to use for suggestions""" + suggestField: String + suggestMode: ElasticAPI_defaultEnum_SuggestMode = missing + + """How many suggestions to return in response""" + suggestSize: Float + + """The source text for which the suggestions should be returned""" + suggestText: String + + """ + The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + """ + terminateAfter: Float + + """Explicit operation timeout""" + timeout: String + + """ + Whether to calculate and return scores even if they are not used for sorting + """ + trackScores: Boolean + + """ + Indicate if the number of documents that match the query should be tracked + """ + trackTotalHits: Boolean + + """ + Specify whether aggregation and suggester names should be prefixed by their respective types in the response + """ + typedKeys: Boolean + + """Specify whether to return document version as part of a hit""" + version: Boolean + ): JSON + + """ + Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-shards.html) request + """ + searchShards( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """ + Specify the node or shard the operation should be performed on (default: random) + """ + preference: String + + """Specific routing value""" + routing: String + ): JSON + + """ + Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-template.html) request + """ + searchTemplate( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON! + ccsMinimizeRoundtrips: Boolean = true + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Specify whether to return detailed information about score computation as part of a hit + """ + explain: Boolean + + """ + Whether specified concrete, expanded or aliased indices should be ignored when throttled + """ + ignoreThrottled: Boolean + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """ + Specify the node or shard the operation should be performed on (default: random) + """ + preference: String + + """Specify whether to profile the query execution""" + profile: Boolean + + """ + Indicates whether hits.total should be rendered as an integer or an object in the rest search response + """ + restTotalHitsAsInt: Boolean + + """A comma-separated list of specific routing values""" + routing: JSON + + """ + Specify how long a consistent view of the index should be maintained for scrolled search + """ + scroll: String + + """Search operation type""" + searchType: ElasticAPI_defaultEnum_SearchType_1 + + """ + Specify whether aggregation and suggester names should be prefixed by their respective types in the response + """ + typedKeys: Boolean + ): JSON + snapshot: ElasticAPI_default_Snapshot + tasks: ElasticAPI_default_Tasks + + """ + Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-termvectors.html) request + """ + termvectors( + body: JSON + fieldStatistics: Boolean = true + + """A comma-separated list of fields to return.""" + fields: JSON + + """ + The id of the document, when not specified a doc param should be supplied. + """ + id: String + + """The index in which the document resides.""" + index: String + offsets: Boolean = true + payloads: Boolean = true + positions: Boolean = true + + """ + Specify the node or shard the operation should be performed on (default: random). + """ + preference: String + + """ + Specifies if request is real-time as opposed to near-real-time (default: true). + """ + realtime: Boolean + + """Specific routing value.""" + routing: String + + """ + Specifies if total term frequency and document frequency should be returned. + """ + termStatistics: Boolean + + """Explicit version number for concurrency control""" + version: Float + + """Specific version type""" + versionType: ElasticAPI_defaultEnum_VersionType + ): JSON + + """ + Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-update.html) request + """ + update( + """ + True or false to return the _source field or not, or a list of fields to return + """ + _source: JSON + + """A list of fields to exclude from the returned _source field""" + _sourceExcludes: JSON + + """A list of fields to extract and return from the _source field""" + _sourceIncludes: JSON + body: JSON! + + """Document ID""" + id: String + + """ + only perform the update operation if the last operation that has changed the document has the specified primary term + """ + ifPrimaryTerm: Float + + """ + only perform the update operation if the last operation that has changed the document has the specified sequence number + """ + ifSeqNo: Float + + """The name of the index""" + index: String + + """The script language (default: painless)""" + lang: String + + """ + If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. + """ + refresh: ElasticAPI_defaultEnum_Refresh + + """ + Specify how many times should the operation be retried when a conflict occurs (default: 0) + """ + retryOnConflict: Float + + """Specific routing value""" + routing: String + + """Explicit operation timeout""" + timeout: String + + """ + Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + """ + waitForActiveShards: String + ): JSON + + """ + Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-update-by-query.html) request + """ + updateByQuery( + """ + True or false to return the _source field or not, or a list of fields to return + """ + _source: JSON + + """A list of fields to exclude from the returned _source field""" + _sourceExcludes: JSON + + """A list of fields to extract and return from the _source field""" + _sourceIncludes: JSON + + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + + """ + Specify whether wildcard and prefix queries should be analyzed (default: false) + """ + analyzeWildcard: Boolean + + """The analyzer to use for the query string""" + analyzer: String + body: JSON + conflicts: ElasticAPI_defaultEnum_Conflicts = abort + defaultOperator: ElasticAPI_defaultEnum_DefaultOperator = OR + + """ + The field to use as default where no field prefix is given in the query string + """ + df: String + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """Starting offset (default: 0)""" + from: Float + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """ + Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + """ + lenient: Boolean + + """Maximum number of documents to process (default: all documents)""" + maxDocs: Float + + """ + Ingest pipeline to set on index requests made by this action. (default: none) + """ + pipeline: String + + """ + Specify the node or shard the operation should be performed on (default: random) + """ + preference: String + + """Query in the Lucene query string syntax""" + q: String + + """Should the effected indexes be refreshed?""" + refresh: Boolean + + """ + Specify if request cache should be used for this request or not, defaults to index level setting + """ + requestCache: Boolean + + """ + The throttle to set on this request in sub-requests per second. -1 means no throttle. + """ + requestsPerSecond: Float + + """A comma-separated list of specific routing values""" + routing: JSON + + """ + Specify how long a consistent view of the index should be maintained for scrolled search + """ + scroll: String + + """Size on the scroll request powering the update by query""" + scrollSize: Float + + """Explicit timeout for each search request. Defaults to no timeout.""" + searchTimeout: String + + """Search operation type""" + searchType: ElasticAPI_defaultEnum_SearchType + + """Deprecated, please use `max_docs` instead""" + size: Float + slices: Float = 1 + + """A comma-separated list of : pairs""" + sort: JSON + + """Specific 'tag' of the request for logging and statistical purposes""" + stats: JSON + + """ + The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + """ + terminateAfter: Float + timeout: String = "1m" + + """Specify whether to return document version as part of a hit""" + version: Boolean + + """ + Should the document increment the version number (internal) on hit or not (reindex) + """ + versionType: Boolean + + """ + Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + """ + waitForActiveShards: String + waitForCompletion: Boolean = true + ): JSON + + """ + Perform a [updateByQueryRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docs-update-by-query.html) request + """ + updateByQueryRethrottle( + body: JSON + + """ + The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + """ + requestsPerSecond: Float + + """The task id to rethrottle""" + taskId: String + ): JSON +} + +enum ElasticAPI_defaultEnum_Bytes { + b + g + gb + k + kb + m + mb + p + pb + t + tb +} + +enum ElasticAPI_defaultEnum_Bytes_1 { + b + g + k + m +} + +enum ElasticAPI_defaultEnum_Conflicts { + abort + proceed +} + +enum ElasticAPI_defaultEnum_DefaultOperator { + AND + OR +} + +enum ElasticAPI_defaultEnum_ExpandWildcards { + all + closed + none + open +} + +enum ElasticAPI_defaultEnum_GroupBy { + nodes + none + parents +} + +enum ElasticAPI_defaultEnum_Health { + green + red + yellow +} + +enum ElasticAPI_defaultEnum_Level { + cluster + indices + shards +} + +enum ElasticAPI_defaultEnum_Level_1 { + indices + node + shards +} + +enum ElasticAPI_defaultEnum_OpType { + create + index +} + +enum ElasticAPI_defaultEnum_Refresh { + empty_string + false_string + true_string + wait_for +} + +enum ElasticAPI_defaultEnum_SearchType { + dfs_query_then_fetch + query_then_fetch +} + +enum ElasticAPI_defaultEnum_SearchType_1 { + dfs_query_and_fetch + dfs_query_then_fetch + query_and_fetch + query_then_fetch +} + +enum ElasticAPI_defaultEnum_Size { + empty_string + g + k + m + p + t +} + +enum ElasticAPI_defaultEnum_SuggestMode { + always + missing + popular +} + +enum ElasticAPI_defaultEnum_Type { + block + cpu + wait +} + +enum ElasticAPI_defaultEnum_VersionType { + external + external_gte + force + internal +} + +enum ElasticAPI_defaultEnum_WaitForEvents { + high + immediate + languid + low + normal + urgent +} + +enum ElasticAPI_defaultEnum_WaitForStatus { + green + red + yellow +} + +type ElasticAPI_default_Cat { + """ + Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat.html) request + """ + aliases( + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """A comma-separated list of alias names to return""" + name: JSON + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-allocation.html) request + """ + allocation( + """The unit in which to display byte values""" + bytes: ElasticAPI_defaultEnum_Bytes + + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """ + A comma-separated list of node IDs or names to limit the returned information + """ + nodeId: JSON + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-count.html) request + """ + count( + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + A comma-separated list of index names to limit the returned information + """ + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-fielddata.html) request + """ + fielddata( + """The unit in which to display byte values""" + bytes: ElasticAPI_defaultEnum_Bytes + + """A comma-separated list of fields to return the fielddata size""" + fields: JSON + + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-health.html) request + """ + health( + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + ts: Boolean = true + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat.html) request + """ + help( + """Return help information""" + help: Boolean + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + ): JSON + + """ + Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-indices.html) request + """ + indices( + """The unit in which to display byte values""" + bytes: ElasticAPI_defaultEnum_Bytes_1 + + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """ + A health status ("green", "yellow", or "red" to filter only indices matching the specified health status + """ + health: ElasticAPI_defaultEnum_Health + + """Return help information""" + help: Boolean + + """ + If set to true segment stats will include stats for segments that are not currently loaded into memory + """ + includeUnloadedSegments: Boolean + + """ + A comma-separated list of index names to limit the returned information + """ + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Set to true to return stats only for primary shards""" + pri: Boolean + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-master.html) request + """ + master( + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-nodeattrs.html) request + """ + nodeattrs( + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-nodes.html) request + """ + nodes( + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """ + Return the full node ID instead of the shortened version (default: false) + """ + fullId: Boolean + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-pending-tasks.html) request + """ + pendingTasks( + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-plugins.html) request + """ + plugins( + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-recovery.html) request + """ + recovery( + """The unit in which to display byte values""" + bytes: ElasticAPI_defaultEnum_Bytes + + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + A comma-separated list of index names to limit the returned information + """ + index: JSON + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-repositories.html) request + """ + repositories( + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """Return local information, do not retrieve the state from master node""" + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-segments.html) request + """ + segments( + """The unit in which to display byte values""" + bytes: ElasticAPI_defaultEnum_Bytes + + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + A comma-separated list of index names to limit the returned information + """ + index: JSON + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-shards.html) request + """ + shards( + """The unit in which to display byte values""" + bytes: ElasticAPI_defaultEnum_Bytes + + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + A comma-separated list of index names to limit the returned information + """ + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-snapshots.html) request + """ + snapshots( + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """Set to true to ignore unavailable snapshots""" + ignoreUnavailable: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Name of repository from which to fetch the snapshot information""" + repository: JSON + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/tasks.html) request + """ + tasks( + """ + A comma-separated list of actions that should be returned. Leave empty to return all. + """ + actions: JSON + + """Return detailed task information (default: false)""" + detailed: Boolean + + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + """ + nodeId: JSON + + """Return tasks with specified parent task id. Set to -1 to return all.""" + parentTask: Float + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-templates.html) request + """ + templates( + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """A pattern that returned template names must match""" + name: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON + + """ + Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cat-thread-pool.html) request + """ + threadPool( + """a short version of the Accept header, e.g. json, yaml""" + format: String = "json" + + """Comma-separated list of column names to display""" + h: JSON + + """Return help information""" + help: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Comma-separated list of column names or column aliases to sort by""" + s: JSON + + """The multiplier in which to display values""" + size: ElasticAPI_defaultEnum_Size + + """ + A comma-separated list of regular-expressions to filter the thread pools in the output + """ + threadPoolPatterns: JSON + + """Verbose mode. Display column headers""" + v: Boolean + ): JSON +} + +type ElasticAPI_default_Cluster { + """ + Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-allocation-explain.html) request + """ + allocationExplain( + body: JSON + + """Return information about disk usage and shard sizes (default: false)""" + includeDiskInfo: Boolean + + """Return 'YES' decisions in explanation (default: false)""" + includeYesDecisions: Boolean + ): JSON + + """ + Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-update-settings.html) request + """ + getSettings( + """Return settings in flat format (default: false)""" + flatSettings: Boolean + + """Whether to return all default clusters setting.""" + includeDefaults: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-health.html) request + """ + health( + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = all + + """Limit the information returned to a specific index""" + index: JSON + level: ElasticAPI_defaultEnum_Level = cluster + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Explicit operation timeout""" + timeout: String + + """Wait until the specified number of shards is active""" + waitForActiveShards: String + + """ + Wait until all currently queued events with the given priority are processed + """ + waitForEvents: ElasticAPI_defaultEnum_WaitForEvents + + """Whether to wait until there are no initializing shards in the cluster""" + waitForNoInitializingShards: Boolean + + """Whether to wait until there are no relocating shards in the cluster""" + waitForNoRelocatingShards: Boolean + + """Wait until the specified number of nodes is available""" + waitForNodes: String + + """Wait until cluster is in a specific state""" + waitForStatus: ElasticAPI_defaultEnum_WaitForStatus + ): JSON + + """ + Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-pending.html) request + """ + pendingTasks( + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Specify timeout for connection to master""" + masterTimeout: String + ): JSON + + """ + Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-update-settings.html) request + """ + putSettings( + body: JSON! + + """Return settings in flat format (default: false)""" + flatSettings: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [cluster.remoteInfo](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-remote-info.html) request + """ + remoteInfo: JSON + + """ + Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-reroute.html) request + """ + reroute( + body: JSON + + """Simulate the operation only and return the resulting state""" + dryRun: Boolean + + """Return an explanation of why the commands can or cannot be executed""" + explain: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """ + Limit the information returned to the specified metrics. Defaults to all but metadata + """ + metric: JSON + + """ + Retries allocation of shards that are blocked due to too many subsequent allocation failures + """ + retryFailed: Boolean + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-state.html) request + """ + state( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """Return settings in flat format (default: false)""" + flatSettings: Boolean + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Specify timeout for connection to master""" + masterTimeout: String + + """Limit the information returned to the specified metrics""" + metric: JSON + + """ + Wait for the metadata version to be equal or greater than the specified metadata version + """ + waitForMetadataVersion: Float + + """ + The maximum time to wait for wait_for_metadata_version before timing out + """ + waitForTimeout: String + ): JSON + + """ + Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-stats.html) request + """ + stats( + """Return settings in flat format (default: false)""" + flatSettings: Boolean + + """ + A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + """ + nodeId: JSON + + """Explicit operation timeout""" + timeout: String + ): JSON +} + +type ElasticAPI_default_Indices { + """ + Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-analyze.html) request + """ + analyze( + body: JSON + + """The name of the index to scope the operation""" + index: String + ): JSON + + """ + Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-clearcache.html) request + """ + clearCache( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """Clear field data""" + fielddata: Boolean + + """ + A comma-separated list of fields to clear when using the `fielddata` parameter (default: all) + """ + fields: JSON + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """A comma-separated list of index name to limit the operation""" + index: JSON + + """Clear query caches""" + query: Boolean + + """Clear request cache""" + request: Boolean + ): JSON + + """ + Perform a [indices.clone](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-clone-index.html) request + """ + clone( + body: JSON + + """The name of the source index to clone""" + index: String + + """Specify timeout for connection to master""" + masterTimeout: String + + """The name of the target index to clone into""" + target: String + + """Explicit operation timeout""" + timeout: String + + """ + Set the number of active shards to wait for on the cloned index before the operation returns. + """ + waitForActiveShards: String + ): JSON + + """ + Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-open-close.html) request + """ + close( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """A comma separated list of indices to close""" + index: JSON + + """Specify timeout for connection to master""" + masterTimeout: String + + """Explicit operation timeout""" + timeout: String + + """ + Sets the number of active shards to wait for before the operation returns. + """ + waitForActiveShards: String + ): JSON + + """ + Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-create-index.html) request + """ + create( + body: JSON + + """Whether a type should be expected in the body of the mappings.""" + includeTypeName: Boolean + + """The name of the index""" + index: String + + """Specify timeout for connection to master""" + masterTimeout: String + + """Explicit operation timeout""" + timeout: String + + """ + Set the number of active shards to wait for before the operation returns. + """ + waitForActiveShards: String + ): JSON + + """ + Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-delete-index.html) request + """ + delete( + """ + Ignore if a wildcard expression resolves to no concrete indices (default: false) + """ + allowNoIndices: Boolean + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """Ignore unavailable indexes (default: false)""" + ignoreUnavailable: Boolean + + """ + A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices + """ + index: JSON + + """Specify timeout for connection to master""" + masterTimeout: String + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-aliases.html) request + """ + deleteAlias( + """ + A comma-separated list of index names (supports wildcards); use `_all` for all indices + """ + index: JSON + + """Specify timeout for connection to master""" + masterTimeout: String + + """ + A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. + """ + name: JSON + + """Explicit timestamp for the document""" + timeout: String + ): JSON + + """ + Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-templates.html) request + """ + deleteTemplate( + """Specify timeout for connection to master""" + masterTimeout: String + + """The name of the template""" + name: String + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-exists.html) request + """ + exists( + """ + Ignore if a wildcard expression resolves to no concrete indices (default: false) + """ + allowNoIndices: Boolean + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """Return settings in flat format (default: false)""" + flatSettings: Boolean + + """Ignore unavailable indexes (default: false)""" + ignoreUnavailable: Boolean + + """Whether to return all default setting for each of the indices.""" + includeDefaults: Boolean + + """A comma-separated list of index names""" + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + ): JSON + + """ + Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-aliases.html) request + """ + existsAlias( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = all + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """A comma-separated list of index names to filter aliases""" + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """A comma-separated list of alias names to return""" + name: JSON + ): JSON + + """ + Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-templates.html) request + """ + existsTemplate( + """Return settings in flat format (default: false)""" + flatSettings: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """The comma separated names of the index templates""" + name: JSON + ): JSON + + """ + Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-types-exists.html) request + """ + existsType( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names; use `_all` to check the types across all indices + """ + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """A comma-separated list of document types to check""" + type: JSON + ): JSON + + """ + Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-flush.html) request + """ + flush( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) + """ + force: Boolean + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string for all indices + """ + index: JSON + + """ + If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. + """ + waitIfOngoing: Boolean + ): JSON + + """ + Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-synced-flush-api.html) request + """ + flushSynced( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string for all indices + """ + index: JSON + ): JSON + + """ + Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-forcemerge.html) request + """ + forcemerge( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Specify whether the index should be flushed after performing the operation (default: true) + """ + flush: Boolean + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """ + The number of segments the index should be merged into (default: dynamic) + """ + maxNumSegments: Float + + """Specify whether the operation should only expunge deleted documents""" + onlyExpungeDeletes: Boolean + ): JSON + + """ + Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-get-index.html) request + """ + get( + """ + Ignore if a wildcard expression resolves to no concrete indices (default: false) + """ + allowNoIndices: Boolean + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """Return settings in flat format (default: false)""" + flatSettings: Boolean + + """Ignore unavailable indexes (default: false)""" + ignoreUnavailable: Boolean + + """Whether to return all default setting for each of the indices.""" + includeDefaults: Boolean + + """Whether to add the type name to the response (default: false)""" + includeTypeName: Boolean + + """A comma-separated list of index names""" + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Specify timeout for connection to master""" + masterTimeout: String + ): JSON + + """ + Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-aliases.html) request + """ + getAlias( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = all + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """A comma-separated list of index names to filter aliases""" + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """A comma-separated list of alias names to return""" + name: JSON + ): JSON + + """ + Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-get-field-mapping.html) request + """ + getFieldMapping( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """A comma-separated list of fields""" + fields: JSON + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """Whether the default mapping values should be returned as well""" + includeDefaults: Boolean + + """Whether a type should be returned in the body of the mappings.""" + includeTypeName: Boolean + + """A comma-separated list of index names""" + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + ): JSON + + """ + Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-get-mapping.html) request + """ + getMapping( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """Whether to add the type name to the response (default: false)""" + includeTypeName: Boolean + + """A comma-separated list of index names""" + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Specify timeout for connection to master""" + masterTimeout: String + ): JSON + + """ + Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-get-settings.html) request + """ + getSettings( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + expandWildcards: [ElasticAPI_defaultEnum_ExpandWildcards] = [open, closed] + + """Return settings in flat format (default: false)""" + flatSettings: Boolean + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """Whether to return all default setting for each of the indices.""" + includeDefaults: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Specify timeout for connection to master""" + masterTimeout: String + + """The name of the settings that should be included""" + name: JSON + ): JSON + + """ + Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-templates.html) request + """ + getTemplate( + """Return settings in flat format (default: false)""" + flatSettings: Boolean + + """Whether a type should be returned in the body of the mappings.""" + includeTypeName: Boolean + + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """The comma separated names of the index templates""" + name: JSON + ): JSON + + """ + Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-upgrade.html) request + """ + getUpgrade( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + ): JSON + + """ + Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-open-close.html) request + """ + open( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = closed + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """A comma separated list of indices to open""" + index: JSON + + """Specify timeout for connection to master""" + masterTimeout: String + + """Explicit operation timeout""" + timeout: String + + """ + Sets the number of active shards to wait for before the operation returns. + """ + waitForActiveShards: String + ): JSON + + """ + Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-aliases.html) request + """ + putAlias( + body: JSON + + """ + A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. + """ + index: JSON + + """Specify timeout for connection to master""" + masterTimeout: String + + """The name of the alias to be created or updated""" + name: String + + """Explicit timestamp for the document""" + timeout: String + ): JSON + + """ + Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-put-mapping.html) request + """ + putMapping( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON! + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """Whether a type should be expected in the body of the mappings.""" + includeTypeName: Boolean + + """ + A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. + """ + index: JSON + + """Specify timeout for connection to master""" + masterTimeout: String + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-update-settings.html) request + """ + putSettings( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON! + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """Return settings in flat format (default: false)""" + flatSettings: Boolean + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """Specify timeout for connection to master""" + masterTimeout: String + + """ + Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` + """ + preserveExisting: Boolean + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-templates.html) request + """ + putTemplate( + body: JSON! + + """ + Whether the index template should only be added if new or can also replace an existing one + """ + create: Boolean + + """Return settings in flat format (default: false)""" + flatSettings: Boolean + + """Whether a type should be returned in the body of the mappings.""" + includeTypeName: Boolean + + """Specify timeout for connection to master""" + masterTimeout: String + + """The name of the template""" + name: String + + """ + The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) + """ + order: Float + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-recovery.html) request + """ + recovery( + """Display only those recoveries that are currently on-going""" + activeOnly: Boolean + + """Whether to display detailed information about shard recovery""" + detailed: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + ): JSON + + """ + Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-refresh.html) request + """ + refresh( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + ): JSON + + """ + Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-rollover-index.html) request + """ + rollover( + """The name of the alias to rollover""" + alias: String + body: JSON + + """ + If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false + """ + dryRun: Boolean + + """Whether a type should be included in the body of the mappings.""" + includeTypeName: Boolean + + """Specify timeout for connection to master""" + masterTimeout: String + + """The name of the rollover index""" + newIndex: String + + """Explicit operation timeout""" + timeout: String + + """ + Set the number of active shards to wait for on the newly created rollover index before the operation returns. + """ + waitForActiveShards: String + ): JSON + + """ + Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-segments.html) request + """ + segments( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """Includes detailed memory usage by Lucene.""" + verbose: Boolean + ): JSON + + """ + Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-shards-stores.html) request + """ + shardStores( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """ + A comma-separated list of statuses used to filter on shards to get store information for + """ + status: JSON + ): JSON + + """ + Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-shrink-index.html) request + """ + shrink( + body: JSON + + """ + whether or not to copy settings from the source index (defaults to false) + """ + copySettings: Boolean + + """The name of the source index to shrink""" + index: String + + """Specify timeout for connection to master""" + masterTimeout: String + + """The name of the target index to shrink into""" + target: String + + """Explicit operation timeout""" + timeout: String + + """ + Set the number of active shards to wait for on the shrunken index before the operation returns. + """ + waitForActiveShards: String + ): JSON + + """ + Perform a [indices.split](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-split-index.html) request + """ + split( + body: JSON + + """ + whether or not to copy settings from the source index (defaults to false) + """ + copySettings: Boolean + + """The name of the source index to split""" + index: String + + """Specify timeout for connection to master""" + masterTimeout: String + + """The name of the target index to split into""" + target: String + + """Explicit operation timeout""" + timeout: String + + """ + Set the number of active shards to wait for on the shrunken index before the operation returns. + """ + waitForActiveShards: String + ): JSON + + """ + Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-stats.html) request + """ + stats( + """ + A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) + """ + completionFields: JSON + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + A comma-separated list of fields for `fielddata` index metric (supports wildcards) + """ + fielddataFields: JSON + + """ + A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) + """ + fields: JSON + forbidClosedIndices: Boolean = true + + """A comma-separated list of search groups for `search` index metric""" + groups: JSON + + """ + Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) + """ + includeSegmentFileSizes: Boolean + + """ + If set to true segment stats will include stats for segments that are not currently loaded into memory + """ + includeUnloadedSegments: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + level: ElasticAPI_defaultEnum_Level = indices + + """Limit the information returned the specific metrics.""" + metric: JSON + + """ + A comma-separated list of document types for the `indexing` index metric + """ + types: JSON + ): JSON + + """ + Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-aliases.html) request + """ + updateAliases( + body: JSON! + + """Specify timeout for connection to master""" + masterTimeout: String + + """Request timeout""" + timeout: String + ): JSON + + """ + Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-upgrade.html) request + """ + upgrade( + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + body: JSON + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """ + If true, only ancient (an older Lucene major release) segments will be upgraded + """ + onlyAncientSegments: Boolean + + """ + Specify whether the request should block until the all segments are upgraded (default: false) + """ + waitForCompletion: Boolean + ): JSON + + """ + Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-validate.html) request + """ + validateQuery( + """Execute validation on all shards instead of one random shard per index""" + allShards: Boolean + + """ + Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + """ + allowNoIndices: Boolean + + """ + Specify whether wildcard and prefix queries should be analyzed (default: false) + """ + analyzeWildcard: Boolean + + """The analyzer to use for the query string""" + analyzer: String + body: JSON + defaultOperator: ElasticAPI_defaultEnum_DefaultOperator = OR + + """ + The field to use as default where no field prefix is given in the query string + """ + df: String + expandWildcards: ElasticAPI_defaultEnum_ExpandWildcards = open + + """Return detailed information about the error""" + explain: Boolean + + """ + Whether specified concrete indices should be ignored when unavailable (missing or closed) + """ + ignoreUnavailable: Boolean + + """ + A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices + """ + index: JSON + + """ + Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + """ + lenient: Boolean + + """Query in the Lucene query string syntax""" + q: String + + """ + Provide a more detailed explanation showing the actual Lucene query that will be executed. + """ + rewrite: Boolean + ): JSON +} + +type ElasticAPI_default_Ingest { + """ + Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/delete-pipeline-api.html) request + """ + deletePipeline( + """Pipeline ID""" + id: String + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/get-pipeline-api.html) request + """ + getPipeline( + """Comma separated list of pipeline ids. Wildcards supported""" + id: String + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + ): JSON + + """ + Perform a [ingest.processorGrok](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/grok-processor.html#grok-processor-rest-get) request + """ + processorGrok: JSON + + """ + Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/put-pipeline-api.html) request + """ + putPipeline( + body: JSON! + + """Pipeline ID""" + id: String + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/simulate-pipeline-api.html) request + """ + simulate( + body: JSON! + + """Pipeline ID""" + id: String + + """ + Verbose mode. Display data output for each processor in executed pipeline + """ + verbose: Boolean + ): JSON +} + +type ElasticAPI_default_Nodes { + """ + Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-nodes-hot-threads.html) request + """ + hotThreads( + """ + Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) + """ + ignoreIdleThreads: Boolean + + """The interval for the second sampling of threads""" + interval: String + + """Number of samples of thread stacktrace (default: 10)""" + snapshots: Float + + """Specify the number of threads to provide information for (default: 3)""" + threads: Float + + """Explicit operation timeout""" + timeout: String + + """The type to sample (default: cpu)""" + type: ElasticAPI_defaultEnum_Type + ): JSON + + """ + Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-nodes-info.html) request + """ + info( + """Return settings in flat format (default: false)""" + flatSettings: Boolean + + """ + A comma-separated list of metrics you wish returned. Leave empty to return all. + """ + metric: JSON + + """ + A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + """ + nodeId: JSON + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [nodes.reloadSecureSettings](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/secure-settings.html#reloadable-secure-settings) request + """ + reloadSecureSettings( + body: JSON + + """ + A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. + """ + nodeId: JSON + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-nodes-stats.html) request + """ + stats( + """ + A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) + """ + completionFields: JSON + + """ + A comma-separated list of fields for `fielddata` index metric (supports wildcards) + """ + fielddataFields: JSON + + """ + A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) + """ + fields: JSON + + """A comma-separated list of search groups for `search` index metric""" + groups: Boolean + + """ + Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) + """ + includeSegmentFileSizes: Boolean + + """ + Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. + """ + indexMetric: JSON + level: ElasticAPI_defaultEnum_Level_1 = node + + """Limit the information returned to the specified metrics""" + metric: JSON + + """ + A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + """ + nodeId: JSON + + """Explicit operation timeout""" + timeout: String + + """ + A comma-separated list of document types for the `indexing` index metric + """ + types: JSON + ): JSON + + """ + Perform a [nodes.usage](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-nodes-usage.html) request + """ + usage( + """Limit the information returned to the specified metrics""" + metric: JSON + + """ + A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + """ + nodeId: JSON + + """Explicit operation timeout""" + timeout: String + ): JSON +} + +type ElasticAPI_default_Snapshot { + """ + Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request + """ + create( + body: JSON + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """A repository name""" + repository: String + + """A snapshot name""" + snapshot: String + + """ + Should this request wait until the operation has completed before returning + """ + waitForCompletion: Boolean + ): JSON + + """ + Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request + """ + createRepository( + body: JSON! + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """A repository name""" + repository: String + + """Explicit operation timeout""" + timeout: String + + """Whether to verify the repository after creation""" + verify: Boolean + ): JSON + + """ + Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request + """ + delete( + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """A repository name""" + repository: String + + """A snapshot name""" + snapshot: String + ): JSON + + """ + Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request + """ + deleteRepository( + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """A comma-separated list of repository names""" + repository: JSON + + """Explicit operation timeout""" + timeout: String + ): JSON + + """ + Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request + """ + get( + """ + Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + """ + ignoreUnavailable: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """A repository name""" + repository: String + + """A comma-separated list of snapshot names""" + snapshot: JSON + + """ + Whether to show verbose snapshot info or only show the basic info found in the repository index blob + """ + verbose: Boolean + ): JSON + + """ + Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request + """ + getRepository( + """ + Return local information, do not retrieve the state from master node (default: false) + """ + local: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """A comma-separated list of repository names""" + repository: JSON + ): JSON + + """ + Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request + """ + restore( + body: JSON + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """A repository name""" + repository: String + + """A snapshot name""" + snapshot: String + + """ + Should this request wait until the operation has completed before returning + """ + waitForCompletion: Boolean + ): JSON + + """ + Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request + """ + status( + """ + Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + """ + ignoreUnavailable: Boolean + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """A repository name""" + repository: String + + """A comma-separated list of snapshot names""" + snapshot: JSON + ): JSON + + """ + Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/modules-snapshots.html) request + """ + verifyRepository( + body: JSON + + """Explicit operation timeout for connection to master node""" + masterTimeout: String + + """A repository name""" + repository: String + + """Explicit operation timeout""" + timeout: String + ): JSON +} + +type ElasticAPI_default_Tasks { + """ + Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/tasks.html) request + """ + cancel( + """ + A comma-separated list of actions that should be cancelled. Leave empty to cancel all. + """ + actions: JSON + body: JSON + + """ + A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + """ + nodes: JSON + + """ + Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. + """ + parentTaskId: String + + """Cancel the task with specified task id (node_id:task_number)""" + taskId: String + ): JSON + + """ + Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/tasks.html) request + """ + get( + """Return the task with specified id (node_id:task_number)""" + taskId: String + + """Explicit operation timeout""" + timeout: String + + """Wait for the matching tasks to complete (default: false)""" + waitForCompletion: Boolean + ): JSON + + """ + Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/tasks.html) request + """ + list( + """ + A comma-separated list of actions that should be returned. Leave empty to return all. + """ + actions: JSON + + """Return detailed task information (default: false)""" + detailed: Boolean + groupBy: ElasticAPI_defaultEnum_GroupBy = nodes + + """ + A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + """ + nodes: JSON + + """ + Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. + """ + parentTaskId: String + + """Explicit operation timeout""" + timeout: String + + """Wait for the matching tasks to complete (default: false)""" + waitForCompletion: Boolean + ): JSON +} + """A connection to a list of `Entity` values.""" type EntitiesConnection { """ @@ -5457,7 +9354,7 @@ input IntFilter { """ The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). """ -scalar JSON +scalar JSON @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf") """ A filter to be used against JSON fields. All fields are combined with a logical ‘and.’ @@ -5516,144 +9413,6 @@ input JSONFilter { notIn: [JSON!] } -type Keypair { - did: String! - name: String - scope: KeypairScope! - secret: String! -} - -""" -A condition to be used against `Keypair` object types. All fields are tested for equality and combined with a logical ‘and.’ -""" -input KeypairCondition { - """Checks for equality with the object’s `did` field.""" - did: String - - """Checks for equality with the object’s `name` field.""" - name: String - - """Checks for equality with the object’s `scope` field.""" - scope: KeypairScope - - """Checks for equality with the object’s `secret` field.""" - secret: String -} - -""" -A filter to be used against `Keypair` object types. All fields are combined with a logical ‘and.’ -""" -input KeypairFilter { - """Checks for all expressions in this list.""" - and: [KeypairFilter!] - - """Filter by the object’s `did` field.""" - did: StringFilter - - """Filter by the object’s `name` field.""" - name: StringFilter - - """Negates the expression.""" - not: KeypairFilter - - """Checks for any expressions in this list.""" - or: [KeypairFilter!] - - """Filter by the object’s `scope` field.""" - scope: KeypairScopeFilter - - """Filter by the object’s `secret` field.""" - secret: StringFilter -} - -enum KeypairScope { - INSTANCE - REPO -} - -""" -A filter to be used against KeypairScope fields. All fields are combined with a logical ‘and.’ -""" -input KeypairScopeFilter { - """ - Not equal to the specified value, treating null like an ordinary value. - """ - distinctFrom: KeypairScope - - """Equal to the specified value.""" - equalTo: KeypairScope - - """Greater than the specified value.""" - greaterThan: KeypairScope - - """Greater than or equal to the specified value.""" - greaterThanOrEqualTo: KeypairScope - - """Included in the specified list.""" - in: [KeypairScope!] - - """ - Is null (if `true` is specified) or is not null (if `false` is specified). - """ - isNull: Boolean - - """Less than the specified value.""" - lessThan: KeypairScope - - """Less than or equal to the specified value.""" - lessThanOrEqualTo: KeypairScope - - """Equal to the specified value, treating null like an ordinary value.""" - notDistinctFrom: KeypairScope - - """Not equal to the specified value.""" - notEqualTo: KeypairScope - - """Not included in the specified list.""" - notIn: [KeypairScope!] -} - -"""A connection to a list of `Keypair` values.""" -type KeypairsConnection { - """ - A list of edges which contains the `Keypair` and cursor to aid in pagination. - """ - edges: [KeypairsEdge!]! - - """A list of `Keypair` objects.""" - nodes: [Keypair!]! - - """Information to aid in pagination.""" - pageInfo: PageInfo! - - """The count of *all* `Keypair` you could get from the connection.""" - totalCount: Int! -} - -"""A `Keypair` edge in the connection.""" -type KeypairsEdge { - """A cursor for use in pagination.""" - cursor: Cursor - - """The `Keypair` at the end of the edge.""" - node: Keypair! -} - -"""Methods to use when ordering `Keypair`.""" -enum KeypairsOrderBy { - DID_ASC - DID_DESC - NAME_ASC - NAME_DESC - NATURAL - PRIMARY_KEY_ASC - PRIMARY_KEY_DESC - SCOPE_ASC - SCOPE_DESC - SECRET_ASC - SECRET_DESC -} - type License { """Reads and enables pagination through a set of `ContentGrouping`.""" contentGroupings( @@ -7994,6 +11753,9 @@ type Query { orderBy: [DataSourcesOrderBy!] = [PRIMARY_KEY_ASC] ): DataSourcesConnection + """Elastic API v_default""" + elastic(host: String = "http://user:pass@localhost:9200"): ElasticAPI_default + """Reads and enables pagination through a set of `Entity`.""" entities( """Read all values in the set after (below) this cursor.""" @@ -8098,41 +11860,6 @@ type Query { """The method to use when ordering `File`.""" orderBy: [FilesOrderBy!] = [PRIMARY_KEY_ASC] ): FilesConnection - keypair(did: String!): Keypair - - """Reads and enables pagination through a set of `Keypair`.""" - keypairs( - """Read all values in the set after (below) this cursor.""" - after: Cursor - - """Read all values in the set before (above) this cursor.""" - before: Cursor - - """ - A condition to be used in determining which values should be returned by the collection. - """ - condition: KeypairCondition - - """ - A filter to be used in determining which values should be returned by the collection. - """ - filter: KeypairFilter - - """Only read the first `n` values of the set.""" - first: Int - - """Only read the last `n` values of the set.""" - last: Int - - """ - Skip the first `n` values from our `after` cursor, an alternative to cursor - based pagination. May not be used with `last`. - """ - offset: Int - - """The method to use when ordering `Keypair`.""" - orderBy: [KeypairsOrderBy!] = [PRIMARY_KEY_ASC] - ): KeypairsConnection license(uid: String!): License """Reads and enables pagination through a set of `License`.""" diff --git a/packages/repco-graphql/package.json b/packages/repco-graphql/package.json index bf5355e6..c790c4af 100644 --- a/packages/repco-graphql/package.json +++ b/packages/repco-graphql/package.json @@ -16,15 +16,20 @@ "export-schema": "node dist/scripts/export-schema.js" }, "dependencies": { + "@elastic/elasticsearch": "^8.10.0", "@graphile-contrib/pg-many-to-many": "^1.0.1", "@graphile-contrib/pg-simplify-inflector": "^6.1.0", + "@graphql-tools/schema": "^10.0.0", "cors": "^2.8.5", "dotenv": "^16.0.1", + "elasticsearch": "^16.7.3", "express": "^4.18.1", "express-async-errors": "^3.1.1", "graphile-build": "^4.12.3", "graphile-utils": "^4.12.3", "graphql": "^15.8.0", + "graphql-compose": "^9.0.10", + "graphql-compose-elasticsearch": "^5.2.3", "pg": "^8.8.0", "postgraphile": "^4.12.11", "postgraphile-plugin-connection-filter": "^2.3.0" diff --git a/packages/repco-graphql/src/lib.ts b/packages/repco-graphql/src/lib.ts index a04aecc1..44a16ffd 100644 --- a/packages/repco-graphql/src/lib.ts +++ b/packages/repco-graphql/src/lib.ts @@ -2,8 +2,15 @@ import PgManyToManyPlugin from '@graphile-contrib/pg-many-to-many' import SimplifyInflectorPlugin from '@graphile-contrib/pg-simplify-inflector' import pg from 'pg' import ConnectionFilterPlugin from 'postgraphile-plugin-connection-filter' +import { Client } from '@elastic/elasticsearch' +import { mergeSchemas } from '@graphql-tools/schema' import { NodePlugin } from 'graphile-build' -import { lexicographicSortSchema } from 'graphql' +import { + GraphQLObjectType, + GraphQLSchema, + lexicographicSortSchema, +} from 'graphql' +import { elasticApiFieldConfig } from 'graphql-compose-elasticsearch' import { createPostGraphileSchema, postgraphile } from 'postgraphile' import ExportSchemaPlugin from './plugins/export-schema.js' // Change some inflection rules to better match our schema. @@ -32,7 +39,28 @@ export async function createGraphQlSchema(databaseUrl: string) { PG_SCHEMA, getPostGraphileOptions(), ) - const sorted = lexicographicSortSchema(schema) + const schemaElastic = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'Query', + fields: { + elastic: elasticApiFieldConfig( + new Client({ + node: 'http://localhost:9200', + auth: { + username: 'elastic', + password: 'repco', + }, + }), + ), + }, + }), + }) + + const mergedSchema = mergeSchemas({ + schemas: [schema, schemaElastic], + }) + + const sorted = lexicographicSortSchema(mergedSchema) return sorted } diff --git a/packages/repco-graphql/src/plugins/custom-filter.ts b/packages/repco-graphql/src/plugins/custom-filter.ts index 90b75cee..826cde35 100644 --- a/packages/repco-graphql/src/plugins/custom-filter.ts +++ b/packages/repco-graphql/src/plugins/custom-filter.ts @@ -7,7 +7,9 @@ const CustomFilterPlugin = makeAddPgTableConditionPlugin( 'language', (build) => ({ description: 'Filters the list to Revisions that have a specific language.', - type: new build.graphql.GraphQLList(new GraphQLNonNull(GraphQLString)), + type: new build.graphql.GraphQLList( + new GraphQLNonNull(GraphQLString) as any, + ), }), (value, helpers, build) => { const { sql, sqlTableAlias } = helpers diff --git a/packages/repco-graphql/src/plugins/export-schema.ts b/packages/repco-graphql/src/plugins/export-schema.ts index 26d6002f..33d94e61 100644 --- a/packages/repco-graphql/src/plugins/export-schema.ts +++ b/packages/repco-graphql/src/plugins/export-schema.ts @@ -5,8 +5,8 @@ let SCHEMA: GraphQLSchema | null = null let SDL: string | null = null const ExportSchemaPlugin = makeProcessSchemaPlugin((schema) => { - SCHEMA = schema - SDL = printSchema(schema) + SCHEMA = schema as any + SDL = printSchema(schema as any) return schema }) diff --git a/packages/repco-graphql/src/plugins/wrap-resolver.ts b/packages/repco-graphql/src/plugins/wrap-resolver.ts index f4d46fe3..22e84d30 100644 --- a/packages/repco-graphql/src/plugins/wrap-resolver.ts +++ b/packages/repco-graphql/src/plugins/wrap-resolver.ts @@ -22,7 +22,7 @@ const WrapResolversPlugin = makeWrapResolversPlugin( const rootField = resolveInfo.schema.getQueryType()?.getFields()[ fieldName ] - if (rootField && hasPaginationArgs(rootField)) { + if (rootField && hasPaginationArgs(rootField as any)) { if (args.first >= 100) { throw new Error('Argument `first` may not be larger than 100') } From 9699dd94669ab2ea406fbe55548e4c942466a4a9 Mon Sep 17 00:00:00 2001 From: Thomas Wallner Date: Fri, 1 Dec 2023 11:47:31 +0100 Subject: [PATCH 06/10] fix lineending --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4efbbedf..ce125417 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ yarn cli repo create default # add datasource yarn cli ds add -r # for example the cba plugin - need to define the api key for cba in .env file -yarn cli ds add -r default urn:repco:datasource:cba https://cba.fro.at/wp-json/wp/v2 +yarn cli ds add -r default urn:repco:datasource:cba https://cba.media/wp-json/wp/v2 # ingest updates from all datasources yarn cli ds ingest # print all revisions in a repo @@ -41,6 +41,25 @@ http://localhost:3000 ## Development notes +## Prod Deployment + +```sh +# fetch changes +git pull +# check container status +docker compose -f "docker/docker-compose.build.yml" ps +# build new docker image +docker compose -f "docker/docker-compose.build.yml" build +# deploy docker image +docker compose -f "docker/docker-compose.build.yml" up +# create default repo +docker compose -f "docker/docker-compose.build.yml" exec app yarn repco repo create default +# add cba datasource +docker compose -f "docker/docker-compose.build.yml" exec app yarn repco ds add -r default urn:repco:datasource:cba https://cba.media/wp-json/wp/v2 +# restart app container so it runs in a loop +docker compose -f "docker/docker-compose.build.yml" restart app +``` + ### Logging To enable debug output, set `LOG_LEVEL=debug` environment variable. From 2fd5d4f4f41a186c554cb2f713bf14d8a9520d97 Mon Sep 17 00:00:00 2001 From: Thomas Wallner Date: Fri, 1 Dec 2023 13:20:25 +0100 Subject: [PATCH 07/10] fixed param --- packages/repco-core/src/datasources/cba.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/repco-core/src/datasources/cba.ts b/packages/repco-core/src/datasources/cba.ts index cafef701..31661a89 100644 --- a/packages/repco-core/src/datasources/cba.ts +++ b/packages/repco-core/src/datasources/cba.ts @@ -179,7 +179,7 @@ export class CbaDataSource implements DataSource { endpoint === 'series' || endpoint === 'station' ) { - multilingual = 'multilingual' + multilingual = '&multilingual' } const url = this._url(`/${endpoint}?${params}${multilingual}`) const bodies = await this._fetch(url) From 482d28d088c95d77c61d24365f6fc75529f9e6e1 Mon Sep 17 00:00:00 2001 From: Thomas Wallner Date: Fri, 1 Dec 2023 14:44:20 +0100 Subject: [PATCH 08/10] fixed contentgrouping and revision in transcript --- packages/repco-core/src/datasources/cba.ts | 21 +- packages/repco-core/src/repo.ts | 3 +- packages/repco-frontend/app/graphql/types.ts | 109 ++++++++++ .../repco-graphql/generated/schema.graphql | 198 ++++++++++++++++++ .../migration.sql | 24 +++ packages/repco-prisma/prisma/schema.prisma | 3 + 6 files changed, 349 insertions(+), 9 deletions(-) create mode 100644 packages/repco-prisma/prisma/migrations/20231201131437_add_revision_to_transcript/migration.sql diff --git a/packages/repco-core/src/datasources/cba.ts b/packages/repco-core/src/datasources/cba.ts index 31661a89..d696fe10 100644 --- a/packages/repco-core/src/datasources/cba.ts +++ b/packages/repco-core/src/datasources/cba.ts @@ -498,8 +498,12 @@ export class CbaDataSource implements DataSource { content: asset, headers: { EntityUris: [audioId] }, } - - var transcripts = this._mapTranscripts(media, media.transcripts, {}) + var transcripts: Array = [] + if (media.transcripts.length > 0) { + transcripts = this._mapTranscripts(media, media.transcripts, { + uri: audioId, + }) + } return [fileEntity, mediaEntity, ...transcripts] } @@ -564,7 +568,9 @@ export class CbaDataSource implements DataSource { headers: { EntityUris: [imageId] }, } - var transcripts = this._mapTranscripts(media, media.transcripts, {}) + var transcripts = this._mapTranscripts(media, media.transcripts, { + uri: imageId, + }) return [fileEntity, mediaEntity, ...transcripts] } @@ -817,12 +823,11 @@ export class CbaDataSource implements DataSource { const content: form.TranscriptInput = { language: transcript['language'], text: transcript['transcript'], - engine: '', + engine: 'engine', MediaAsset: mediaAssetLinks, - license: '', - subtitleUrl: '', - author: '', - //TODO: refresh zod client and add new fields + license: transcript['license'], + subtitleUrl: transcript['subtitles'], + author: transcript['author'], } entities.push({ type: 'Transcript', diff --git a/packages/repco-core/src/repo.ts b/packages/repco-core/src/repo.ts index ec2b7887..73ac705b 100644 --- a/packages/repco-core/src/repo.ts +++ b/packages/repco-core/src/repo.ts @@ -1,6 +1,7 @@ import * as ucans from '@ucans/ucans' import * as common from 'repco-common/zod' import { CID } from 'multiformats/cid.js' +import { EventEmitter } from 'node:events' import { createLogger, Logger } from 'repco-common' import { CommitBundle, @@ -53,7 +54,6 @@ import { ParseError } from './util/error.js' import { createEntityId } from './util/id.js' import { notEmpty } from './util/misc.js' import { Mutex } from './util/mutex.js' -import { EventEmitter } from 'node:events' // export * from './repo/types.js' @@ -570,6 +570,7 @@ export class Repo extends EventEmitter { } private async updateDomainView(entity: EntityInputWithRevision) { + console.log(entity) const domainUpsertPromise = repco.upsertEntity( this.prisma, entity.revision.uid, diff --git a/packages/repco-frontend/app/graphql/types.ts b/packages/repco-frontend/app/graphql/types.ts index b6685f00..61ef727e 100644 --- a/packages/repco-frontend/app/graphql/types.ts +++ b/packages/repco-frontend/app/graphql/types.ts @@ -6998,6 +6998,8 @@ export type Revision = { mediaAssets: MediaAssetsConnection /** Reads and enables pagination through a set of `MediaAsset`. */ mediaAssetsByChapterRevisionIdAndMediaAssetUid: RevisionMediaAssetsByChapterRevisionIdAndMediaAssetUidManyToManyConnection + /** Reads and enables pagination through a set of `MediaAsset`. */ + mediaAssetsByTranscriptRevisionIdAndMediaAssetUid: RevisionMediaAssetsByTranscriptRevisionIdAndMediaAssetUidManyToManyConnection /** Reads and enables pagination through a set of `Metadatum`. */ metadata: MetadataConnection /** Reads a single `Revision` that is related to this `Revision`. */ @@ -7016,6 +7018,8 @@ export type Revision = { revisionUris?: Maybe>> /** Reads and enables pagination through a set of `Revision`. */ revisionsByPrevRevisionId: RevisionsConnection + /** Reads and enables pagination through a set of `Transcript`. */ + transcripts: TranscriptsConnection uid: Scalars['String'] } @@ -7297,6 +7301,17 @@ export type RevisionMediaAssetsByChapterRevisionIdAndMediaAssetUidArgs = { orderBy?: InputMaybe> } +export type RevisionMediaAssetsByTranscriptRevisionIdAndMediaAssetUidArgs = { + after: InputMaybe + before: InputMaybe + condition: InputMaybe + filter: InputMaybe + first: InputMaybe + last: InputMaybe + offset: InputMaybe + orderBy?: InputMaybe> +} + export type RevisionMetadataArgs = { after: InputMaybe before: InputMaybe @@ -7354,6 +7369,17 @@ export type RevisionRevisionsByPrevRevisionIdArgs = { orderBy?: InputMaybe> } +export type RevisionTranscriptsArgs = { + after: InputMaybe + before: InputMaybe + condition: InputMaybe + filter: InputMaybe + first: InputMaybe + last: InputMaybe + offset: InputMaybe + orderBy?: InputMaybe> +} + /** A connection to a list of `Commit` values, with data from `_RevisionToCommit`. */ export type RevisionCommitsByRevisionToCommitBAndAManyToManyConnection = { /** A list of edges which contains the `Commit`, info from the `_RevisionToCommit`, and the cursor to aid in pagination. */ @@ -7855,6 +7881,10 @@ export type RevisionFilter = { revisionsByPrevRevisionId?: InputMaybe /** Some related `revisionsByPrevRevisionId` exist. */ revisionsByPrevRevisionIdExist?: InputMaybe + /** Filter by the object’s `transcripts` relation. */ + transcripts?: InputMaybe + /** Some related `transcripts` exist. */ + transcriptsExist?: InputMaybe /** Filter by the object’s `uid` field. */ uid?: InputMaybe } @@ -8007,6 +8037,43 @@ export type RevisionMediaAssetsByChapterRevisionIdAndMediaAssetUidManyToManyEdge orderBy?: InputMaybe> } +/** A connection to a list of `MediaAsset` values, with data from `Transcript`. */ +export type RevisionMediaAssetsByTranscriptRevisionIdAndMediaAssetUidManyToManyConnection = + { + /** A list of edges which contains the `MediaAsset`, info from the `Transcript`, and the cursor to aid in pagination. */ + edges: Array + /** A list of `MediaAsset` objects. */ + nodes: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** The count of *all* `MediaAsset` you could get from the connection. */ + totalCount: Scalars['Int'] + } + +/** A `MediaAsset` edge in the connection, with data from `Transcript`. */ +export type RevisionMediaAssetsByTranscriptRevisionIdAndMediaAssetUidManyToManyEdge = + { + /** A cursor for use in pagination. */ + cursor?: Maybe + /** The `MediaAsset` at the end of the edge. */ + node: MediaAsset + /** Reads and enables pagination through a set of `Transcript`. */ + transcripts: TranscriptsConnection + } + +/** A `MediaAsset` edge in the connection, with data from `Transcript`. */ +export type RevisionMediaAssetsByTranscriptRevisionIdAndMediaAssetUidManyToManyEdgeTranscriptsArgs = + { + after: InputMaybe + before: InputMaybe + condition: InputMaybe + filter: InputMaybe + first: InputMaybe + last: InputMaybe + offset: InputMaybe + orderBy?: InputMaybe> + } + /** A connection to a list of `PublicationService` values, with data from `BroadcastEvent`. */ export type RevisionPublicationServicesByBroadcastEventRevisionIdAndBroadcastServiceUidManyToManyConnection = { @@ -8221,6 +8288,16 @@ export type RevisionToManyRevisionFilter = { some?: InputMaybe } +/** A filter to be used against many `Transcript` object types. All fields are combined with a logical ‘and.’ */ +export type RevisionToManyTranscriptFilter = { + /** Every related `Transcript` matches the filter criteria. All fields are combined with a logical ‘and.’ */ + every?: InputMaybe + /** No related `Transcript` matches the filter criteria. All fields are combined with a logical ‘and.’ */ + none?: InputMaybe + /** Some related `Transcript` matches the filter criteria. All fields are combined with a logical ‘and.’ */ + some?: InputMaybe +} + /** A connection to a list of `Revision` values. */ export type RevisionsConnection = { /** A list of edges which contains the `Revision` and cursor to aid in pagination. */ @@ -8513,11 +8590,17 @@ export type StringListFilter = { } export type Transcript = { + author: Scalars['String'] engine: Scalars['String'] language: Scalars['String'] + license: Scalars['String'] /** Reads a single `MediaAsset` that is related to this `Transcript`. */ mediaAsset?: Maybe mediaAssetUid: Scalars['String'] + /** Reads a single `Revision` that is related to this `Transcript`. */ + revision?: Maybe + revisionId: Scalars['String'] + subtitleUrl: Scalars['String'] text: Scalars['String'] uid: Scalars['String'] } @@ -8527,12 +8610,20 @@ export type Transcript = { * for equality and combined with a logical ‘and.’ */ export type TranscriptCondition = { + /** Checks for equality with the object’s `author` field. */ + author?: InputMaybe /** Checks for equality with the object’s `engine` field. */ engine?: InputMaybe /** Checks for equality with the object’s `language` field. */ language?: InputMaybe + /** Checks for equality with the object’s `license` field. */ + license?: InputMaybe /** Checks for equality with the object’s `mediaAssetUid` field. */ mediaAssetUid?: InputMaybe + /** Checks for equality with the object’s `revisionId` field. */ + revisionId?: InputMaybe + /** Checks for equality with the object’s `subtitleUrl` field. */ + subtitleUrl?: InputMaybe /** Checks for equality with the object’s `text` field. */ text?: InputMaybe /** Checks for equality with the object’s `uid` field. */ @@ -8543,10 +8634,14 @@ export type TranscriptCondition = { export type TranscriptFilter = { /** Checks for all expressions in this list. */ and?: InputMaybe> + /** Filter by the object’s `author` field. */ + author?: InputMaybe /** Filter by the object’s `engine` field. */ engine?: InputMaybe /** Filter by the object’s `language` field. */ language?: InputMaybe + /** Filter by the object’s `license` field. */ + license?: InputMaybe /** Filter by the object’s `mediaAsset` relation. */ mediaAsset?: InputMaybe /** Filter by the object’s `mediaAssetUid` field. */ @@ -8555,6 +8650,12 @@ export type TranscriptFilter = { not?: InputMaybe /** Checks for any expressions in this list. */ or?: InputMaybe> + /** Filter by the object’s `revision` relation. */ + revision?: InputMaybe + /** Filter by the object’s `revisionId` field. */ + revisionId?: InputMaybe + /** Filter by the object’s `subtitleUrl` field. */ + subtitleUrl?: InputMaybe /** Filter by the object’s `text` field. */ text?: InputMaybe /** Filter by the object’s `uid` field. */ @@ -8583,15 +8684,23 @@ export type TranscriptsEdge = { /** Methods to use when ordering `Transcript`. */ export enum TranscriptsOrderBy { + AuthorAsc = 'AUTHOR_ASC', + AuthorDesc = 'AUTHOR_DESC', EngineAsc = 'ENGINE_ASC', EngineDesc = 'ENGINE_DESC', LanguageAsc = 'LANGUAGE_ASC', LanguageDesc = 'LANGUAGE_DESC', + LicenseAsc = 'LICENSE_ASC', + LicenseDesc = 'LICENSE_DESC', MediaAssetUidAsc = 'MEDIA_ASSET_UID_ASC', MediaAssetUidDesc = 'MEDIA_ASSET_UID_DESC', Natural = 'NATURAL', PrimaryKeyAsc = 'PRIMARY_KEY_ASC', PrimaryKeyDesc = 'PRIMARY_KEY_DESC', + RevisionIdAsc = 'REVISION_ID_ASC', + RevisionIdDesc = 'REVISION_ID_DESC', + SubtitleUrlAsc = 'SUBTITLE_URL_ASC', + SubtitleUrlDesc = 'SUBTITLE_URL_DESC', TextAsc = 'TEXT_ASC', TextDesc = 'TEXT_DESC', UidAsc = 'UID_ASC', diff --git a/packages/repco-graphql/generated/schema.graphql b/packages/repco-graphql/generated/schema.graphql index aa7510ea..2bafb62c 100644 --- a/packages/repco-graphql/generated/schema.graphql +++ b/packages/repco-graphql/generated/schema.graphql @@ -13497,6 +13497,40 @@ type Revision { orderBy: [MediaAssetsOrderBy!] = [PRIMARY_KEY_ASC] ): RevisionMediaAssetsByChapterRevisionIdAndMediaAssetUidManyToManyConnection! + """Reads and enables pagination through a set of `MediaAsset`.""" + mediaAssetsByTranscriptRevisionIdAndMediaAssetUid( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """ + A condition to be used in determining which values should be returned by the collection. + """ + condition: MediaAssetCondition + + """ + A filter to be used in determining which values should be returned by the collection. + """ + filter: MediaAssetFilter + + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """The method to use when ordering `MediaAsset`.""" + orderBy: [MediaAssetsOrderBy!] = [PRIMARY_KEY_ASC] + ): RevisionMediaAssetsByTranscriptRevisionIdAndMediaAssetUidManyToManyConnection! + """Reads and enables pagination through a set of `Metadatum`.""" metadata( """Read all values in the set after (below) this cursor.""" @@ -13676,6 +13710,40 @@ type Revision { """The method to use when ordering `Revision`.""" orderBy: [RevisionsOrderBy!] = [PRIMARY_KEY_ASC] ): RevisionsConnection! + + """Reads and enables pagination through a set of `Transcript`.""" + transcripts( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """ + A condition to be used in determining which values should be returned by the collection. + """ + condition: TranscriptCondition + + """ + A filter to be used in determining which values should be returned by the collection. + """ + filter: TranscriptFilter + + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """The method to use when ordering `Transcript`.""" + orderBy: [TranscriptsOrderBy!] = [PRIMARY_KEY_ASC] + ): TranscriptsConnection! uid: String! } @@ -14497,6 +14565,12 @@ input RevisionFilter { """Some related `revisionsByPrevRevisionId` exist.""" revisionsByPrevRevisionIdExist: Boolean + """Filter by the object’s `transcripts` relation.""" + transcripts: RevisionToManyTranscriptFilter + + """Some related `transcripts` exist.""" + transcriptsExist: Boolean + """Filter by the object’s `uid` field.""" uid: StringFilter } @@ -14749,6 +14823,68 @@ type RevisionMediaAssetsByChapterRevisionIdAndMediaAssetUidManyToManyEdge { node: MediaAsset! } +""" +A connection to a list of `MediaAsset` values, with data from `Transcript`. +""" +type RevisionMediaAssetsByTranscriptRevisionIdAndMediaAssetUidManyToManyConnection { + """ + A list of edges which contains the `MediaAsset`, info from the `Transcript`, and the cursor to aid in pagination. + """ + edges: [RevisionMediaAssetsByTranscriptRevisionIdAndMediaAssetUidManyToManyEdge!]! + + """A list of `MediaAsset` objects.""" + nodes: [MediaAsset!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `MediaAsset` you could get from the connection.""" + totalCount: Int! +} + +"""A `MediaAsset` edge in the connection, with data from `Transcript`.""" +type RevisionMediaAssetsByTranscriptRevisionIdAndMediaAssetUidManyToManyEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `MediaAsset` at the end of the edge.""" + node: MediaAsset! + + """Reads and enables pagination through a set of `Transcript`.""" + transcripts( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """ + A condition to be used in determining which values should be returned by the collection. + """ + condition: TranscriptCondition + + """ + A filter to be used in determining which values should be returned by the collection. + """ + filter: TranscriptFilter + + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """The method to use when ordering `Transcript`.""" + orderBy: [TranscriptsOrderBy!] = [PRIMARY_KEY_ASC] + ): TranscriptsConnection! +} + """ A connection to a list of `PublicationService` values, with data from `BroadcastEvent`. """ @@ -15161,6 +15297,26 @@ input RevisionToManyRevisionFilter { some: RevisionFilter } +""" +A filter to be used against many `Transcript` object types. All fields are combined with a logical ‘and.’ +""" +input RevisionToManyTranscriptFilter { + """ + Every related `Transcript` matches the filter criteria. All fields are combined with a logical ‘and.’ + """ + every: TranscriptFilter + + """ + No related `Transcript` matches the filter criteria. All fields are combined with a logical ‘and.’ + """ + none: TranscriptFilter + + """ + Some related `Transcript` matches the filter criteria. All fields are combined with a logical ‘and.’ + """ + some: TranscriptFilter +} + """A connection to a list of `Revision` values.""" type RevisionsConnection { """ @@ -15566,12 +15722,19 @@ input StringListFilter { } type Transcript { + author: String! engine: String! language: String! + license: String! """Reads a single `MediaAsset` that is related to this `Transcript`.""" mediaAsset: MediaAsset mediaAssetUid: String! + + """Reads a single `Revision` that is related to this `Transcript`.""" + revision: Revision + revisionId: String! + subtitleUrl: String! text: String! uid: String! } @@ -15581,15 +15744,27 @@ A condition to be used against `Transcript` object types. All fields are tested for equality and combined with a logical ‘and.’ """ input TranscriptCondition { + """Checks for equality with the object’s `author` field.""" + author: String + """Checks for equality with the object’s `engine` field.""" engine: String """Checks for equality with the object’s `language` field.""" language: String + """Checks for equality with the object’s `license` field.""" + license: String + """Checks for equality with the object’s `mediaAssetUid` field.""" mediaAssetUid: String + """Checks for equality with the object’s `revisionId` field.""" + revisionId: String + + """Checks for equality with the object’s `subtitleUrl` field.""" + subtitleUrl: String + """Checks for equality with the object’s `text` field.""" text: String @@ -15604,12 +15779,18 @@ input TranscriptFilter { """Checks for all expressions in this list.""" and: [TranscriptFilter!] + """Filter by the object’s `author` field.""" + author: StringFilter + """Filter by the object’s `engine` field.""" engine: StringFilter """Filter by the object’s `language` field.""" language: StringFilter + """Filter by the object’s `license` field.""" + license: StringFilter + """Filter by the object’s `mediaAsset` relation.""" mediaAsset: MediaAssetFilter @@ -15622,6 +15803,15 @@ input TranscriptFilter { """Checks for any expressions in this list.""" or: [TranscriptFilter!] + """Filter by the object’s `revision` relation.""" + revision: RevisionFilter + + """Filter by the object’s `revisionId` field.""" + revisionId: StringFilter + + """Filter by the object’s `subtitleUrl` field.""" + subtitleUrl: StringFilter + """Filter by the object’s `text` field.""" text: StringFilter @@ -15657,15 +15847,23 @@ type TranscriptsEdge { """Methods to use when ordering `Transcript`.""" enum TranscriptsOrderBy { + AUTHOR_ASC + AUTHOR_DESC ENGINE_ASC ENGINE_DESC LANGUAGE_ASC LANGUAGE_DESC + LICENSE_ASC + LICENSE_DESC MEDIA_ASSET_UID_ASC MEDIA_ASSET_UID_DESC NATURAL PRIMARY_KEY_ASC PRIMARY_KEY_DESC + REVISION_ID_ASC + REVISION_ID_DESC + SUBTITLE_URL_ASC + SUBTITLE_URL_DESC TEXT_ASC TEXT_DESC UID_ASC diff --git a/packages/repco-prisma/prisma/migrations/20231201131437_add_revision_to_transcript/migration.sql b/packages/repco-prisma/prisma/migrations/20231201131437_add_revision_to_transcript/migration.sql new file mode 100644 index 00000000..d12f2bd0 --- /dev/null +++ b/packages/repco-prisma/prisma/migrations/20231201131437_add_revision_to_transcript/migration.sql @@ -0,0 +1,24 @@ +/* + Warnings: + + - A unique constraint covering the columns `[revisionId]` on the table `Transcript` will be added. If there are existing duplicate values, this will fail. + - Added the required column `author` to the `Transcript` table without a default value. This is not possible if the table is not empty. + - Added the required column `license` to the `Transcript` table without a default value. This is not possible if the table is not empty. + - Added the required column `revisionId` to the `Transcript` table without a default value. This is not possible if the table is not empty. + - Added the required column `subtitleUrl` to the `Transcript` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "PublicationService" ALTER COLUMN "name" DROP DEFAULT; + +-- AlterTable +ALTER TABLE "Transcript" ADD COLUMN "author" TEXT NOT NULL, +ADD COLUMN "license" TEXT NOT NULL, +ADD COLUMN "revisionId" TEXT NOT NULL, +ADD COLUMN "subtitleUrl" TEXT NOT NULL; + +-- CreateIndex +CREATE UNIQUE INDEX "Transcript_revisionId_key" ON "Transcript"("revisionId"); + +-- AddForeignKey +ALTER TABLE "Transcript" ADD CONSTRAINT "Transcript_revisionId_fkey" FOREIGN KEY ("revisionId") REFERENCES "Revision"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/packages/repco-prisma/prisma/schema.prisma b/packages/repco-prisma/prisma/schema.prisma index 4166c2b2..e56599a3 100644 --- a/packages/repco-prisma/prisma/schema.prisma +++ b/packages/repco-prisma/prisma/schema.prisma @@ -195,6 +195,7 @@ model Revision { Chapter Chapter? Contribution Contribution? Metadata Metadata? + Transcript Transcript? } model SourceRecord { @@ -386,6 +387,7 @@ model PublicationService { /// @repco(Entity) model Transcript { uid String @id @unique + revisionId String @unique language String text String engine String @@ -397,6 +399,7 @@ model Transcript { //TODO: Contributor relation MediaAsset MediaAsset @relation(fields: [mediaAssetUid], references: [uid]) + Revision Revision @relation(fields: [revisionId], references: [id]) } // might not be needed? From 9f00bd3b0607734336cc43ca73dabe96285f8ac4 Mon Sep 17 00:00:00 2001 From: Thomas Wallner Date: Fri, 1 Dec 2023 15:02:35 +0100 Subject: [PATCH 09/10] removed verbose logging --- packages/repco-core/src/repo.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/repco-core/src/repo.ts b/packages/repco-core/src/repo.ts index 73ac705b..0774ca90 100644 --- a/packages/repco-core/src/repo.ts +++ b/packages/repco-core/src/repo.ts @@ -570,7 +570,6 @@ export class Repo extends EventEmitter { } private async updateDomainView(entity: EntityInputWithRevision) { - console.log(entity) const domainUpsertPromise = repco.upsertEntity( this.prisma, entity.revision.uid, From 38178ade9e0fb9ade190ca9b7d43a1284de2e025 Mon Sep 17 00:00:00 2001 From: Thomas Wallner Date: Mon, 11 Dec 2023 16:34:32 +0100 Subject: [PATCH 10/10] added json plugin --- .../repco-graphql/generated/schema.graphql | 5 +++++ packages/repco-graphql/src/lib.ts | 2 ++ .../repco-graphql/src/plugins/json-filter.ts | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 packages/repco-graphql/src/plugins/json-filter.ts diff --git a/packages/repco-graphql/generated/schema.graphql b/packages/repco-graphql/generated/schema.graphql index 2bafb62c..52ddd245 100644 --- a/packages/repco-graphql/generated/schema.graphql +++ b/packages/repco-graphql/generated/schema.graphql @@ -2882,6 +2882,11 @@ input ContentItemCondition { """Checks for equality with the object’s `revisionId` field.""" revisionId: String + """ + Filters the list to ContentItems that have a specific keyword in title. + """ + searchTitle: String = "" + """Checks for equality with the object’s `subtitle` field.""" subtitle: String diff --git a/packages/repco-graphql/src/lib.ts b/packages/repco-graphql/src/lib.ts index 44a16ffd..bdf8f74e 100644 --- a/packages/repco-graphql/src/lib.ts +++ b/packages/repco-graphql/src/lib.ts @@ -15,6 +15,7 @@ import { createPostGraphileSchema, postgraphile } from 'postgraphile' import ExportSchemaPlugin from './plugins/export-schema.js' // Change some inflection rules to better match our schema. import CustomInflector from './plugins/inflector.js' +import JsonFilterPlugin from './plugins/json-filter.js' // Add custom tags to omit all queries for the relation tables import CustomTags from './plugins/tags.js' // Add a resolver wrapper to add default pagination args @@ -80,6 +81,7 @@ export function getPostGraphileOptions() { CustomInflector, WrapResolversPlugin, ExportSchemaPlugin, + JsonFilterPlugin, // CustomFilterPlugin, ], dynamicJson: true, diff --git a/packages/repco-graphql/src/plugins/json-filter.ts b/packages/repco-graphql/src/plugins/json-filter.ts new file mode 100644 index 00000000..6213749a --- /dev/null +++ b/packages/repco-graphql/src/plugins/json-filter.ts @@ -0,0 +1,19 @@ +import { makeAddPgTableConditionPlugin } from 'graphile-utils' + +const JsonFilterPlugin = makeAddPgTableConditionPlugin( + 'public', + 'ContentItem', + 'searchTitle', + (build) => ({ + description: + 'Filters the list to ContentItems that have a specific keyword in title.', + type: build.graphql.GraphQLString, + defaultValue: '', + }), + (value, helpers, build) => { + const { sql, sqlTableAlias } = helpers + return sql.raw(`title::text LIKE '%${value}%'`) + }, +) + +export default JsonFilterPlugin