From f70f5a744b8b56ce3222fb97ac55bdd4e3b9cbbb Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Wed, 22 Mar 2023 15:26:06 +0100 Subject: [PATCH] fix(specs): add commonRequest to ingestion --- specs/ingestion/common/schemas/source.yml | 4 ++-- specs/ingestion/common/schemas/task.yml | 13 +++++++------ specs/ingestion/spec.yml | 8 +++++++- .../javascript/clients/client/api/guards.mustache | 2 -- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/specs/ingestion/common/schemas/source.yml b/specs/ingestion/common/schemas/source.yml index fc1b88bf29..73b1807100 100644 --- a/specs/ingestion/common/schemas/source.yml +++ b/specs/ingestion/common/schemas/source.yml @@ -127,7 +127,7 @@ SourceBigCommerce: type: string description: The store hash identifying the store the shopper is signing in to. channel: - $ref: "#/BigCommerceChannel" + $ref: '#/BigCommerceChannel' required: - store_hash @@ -144,7 +144,7 @@ BigCommerceChannel: example: ['usd','eur'] items: type: string - example: "usd" + example: 'usd' required: - id diff --git a/specs/ingestion/common/schemas/task.yml b/specs/ingestion/common/schemas/task.yml index 50757dd350..df50b0597e 100644 --- a/specs/ingestion/common/schemas/task.yml +++ b/specs/ingestion/common/schemas/task.yml @@ -65,8 +65,9 @@ TaskCreate: TaskCreateTrigger: oneOf: - - $ref: '#/TriggerInput' + - $ref: '#/OnDemandTriggerInput' - $ref: '#/ScheduleTriggerInput' + - $ref: '#/SubscriptionTrigger' TaskCreateResponse: type: object @@ -145,7 +146,7 @@ TriggerType: # schedule trigger LastRun: - description: The last time the scheduled task ran. + description: The last time the scheduled task ran (RFC3339 format). type: string Cron: @@ -183,7 +184,7 @@ ScheduleTrigger: lastRun: $ref: '#/LastRun' nextRun: - description: The next scheduled run of the task. + description: The next scheduled run of the task (RFC3339 format). type: string required: - type @@ -200,7 +201,7 @@ OnDemandTriggerType: OnDemandTriggerInput: type: object additionalProperties: false - description: The trigger information of a task of type `on-demand`. + description: The trigger information of a task of type `onDemand`. properties: type: $ref: '#/OnDemandTriggerType' @@ -210,7 +211,7 @@ OnDemandTriggerInput: OnDemandTrigger: type: object additionalProperties: false - description: The trigger information of a task of type `on-demand`. + description: The trigger information of a task of type `onDemand`. properties: type: $ref: '#/OnDemandTriggerType' @@ -232,6 +233,6 @@ SubscriptionTrigger: description: The trigger input for a task of type 'subscription'. properties: type: - $ref: '#/TriggerType' + $ref: '#/SubscriptionTriggerType' required: - type diff --git a/specs/ingestion/spec.yml b/specs/ingestion/spec.yml index ca3852a79f..1e439f4b55 100644 --- a/specs/ingestion/spec.yml +++ b/specs/ingestion/spec.yml @@ -35,8 +35,14 @@ tags: description: A source describe the platform informations. - name: tasks x-displayName: Tasks - description: A Task describe how we fetch the data (reindex, on-demand, subscription) from a source and how we index it on the Algolia side. + description: A Task describe how we fetch the data (onDemand, schedule, subscription) from a source and how we index it on the Algolia side. paths: + # ###################### + # ### Custom request ### + # ###################### + /1{path}: + $ref: '../common/paths/customRequest.yml' + # authentications API. /1/authentications: $ref: 'paths/authentications/authentications.yml' diff --git a/templates/javascript/clients/client/api/guards.mustache b/templates/javascript/clients/client/api/guards.mustache index 8e13de7567..c524e9091f 100644 --- a/templates/javascript/clients/client/api/guards.mustache +++ b/templates/javascript/clients/client/api/guards.mustache @@ -1,4 +1,3 @@ -{{#isIngestionClient}} /** * Guard: Return strongly typed specific OnDemandTrigger for a given Trigger. * @@ -34,4 +33,3 @@ export function isSubscriptionTrigger( ): trigger is SubscriptionTrigger { return trigger.type === 'subscription'; } -{{/isIngestionClient}}