Skip to content

Commit

Permalink
feat(specs): add ga4BigqueryExport, streaming and append options to t…
Browse files Browse the repository at this point in the history
…ask inputs (#2858)
  • Loading branch information
JasonBerry committed Mar 13, 2024
1 parent c27282b commit c324c06
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 7 deletions.
26 changes: 25 additions & 1 deletion specs/ingestion/common/schemas/source.yml
Expand Up @@ -94,7 +94,7 @@ SourceSearch:

SourceType:
type: string
enum: ['bigcommerce', 'commercetools', 'json', 'csv', 'bigquery', 'docker']
enum: ['bigcommerce', 'commercetools', 'json', 'csv', 'bigquery', 'docker', 'ga4BigqueryExport']

SourceCommercetools:
type: object
Expand Down Expand Up @@ -261,6 +261,28 @@ SourceCSV:
required:
- url

SourceGA4BigQueryExport:
type: object
additionalProperties: false
properties:
projectID:
type: string
description: GCP project ID that the BigQuery Export writes to.
datasetID:
type: string
description: BigQuery dataset ID that the BigQuery Export writes to.
tablePrefix:
type: string
description: Prefix of the tables that the BigQuery Export writes to (i.e. events_intraday_ for streaming, events_ for daily).
required:
- projectID
- datasetID
- tablePrefix
x-discriminator-fields:
- projectID
- datasetID
- tablePrefix

SourceBigQuery:
type: object
additionalProperties: false
Expand Down Expand Up @@ -356,6 +378,7 @@ SourceInput:
- $ref: '#/SourceJSON'
- $ref: '#/SourceCSV'
- $ref: '#/SourceBigQuery'
- $ref: '#/SourceGA4BigQueryExport'
- $ref: '#/SourceDocker'

SourceUpdateCommercetools:
Expand Down Expand Up @@ -388,6 +411,7 @@ SourceUpdateInput:
- $ref: '#/SourceJSON'
- $ref: '#/SourceCSV'
- $ref: '#/SourceBigQuery'
- $ref: '#/SourceGA4BigQueryExport'
- $ref: '#/SourceUpdateDocker'

DockerSourceStream:
Expand Down
35 changes: 33 additions & 2 deletions specs/ingestion/common/schemas/task.yml
Expand Up @@ -41,6 +41,7 @@ Trigger:
- $ref: '#/OnDemandTrigger'
- $ref: '#/ScheduleTrigger'
- $ref: '#/SubscriptionTrigger'
- $ref: '#/StreamingTrigger'

TaskCreate:
type: object
Expand Down Expand Up @@ -76,6 +77,7 @@ TaskCreateTrigger:
- $ref: '#/OnDemandTriggerInput'
- $ref: '#/ScheduleTriggerInput'
- $ref: '#/SubscriptionTrigger'
- $ref: '#/StreamingTrigger'

TaskCreateResponse:
type: object
Expand Down Expand Up @@ -134,12 +136,13 @@ TaskSearch:
ActionType:
type: string
description: The action to perform on the Algolia index.
enum: ['replace', 'save', 'partial']
enum: ['replace', 'save', 'partial', 'append']

TaskInput:
oneOf:
- $ref: '#/OnDemandDateUtilsInput'
- $ref: '#/ScheduleDateUtilsInput'
- $ref: '#/StreamingUtilsInput'

TriggerInput:
type: object
Expand Down Expand Up @@ -168,7 +171,8 @@ TriggerType:
- onDemand: a task that runs manually
- schedule: a task that runs regularly, following a given cron expression
- subscription: a task that runs after a subscription event is received from an integration (e.g. Webhook).
enum: ['onDemand', 'schedule', 'subscription']
- streaming: a task that runs continuously.
enum: ['onDemand', 'schedule', 'subscription', 'streaming']

# schedule trigger

Expand Down Expand Up @@ -264,6 +268,23 @@ SubscriptionTrigger:
required:
- type

# streaming trigger

StreamingTriggerType:
type: string
description: A task that runs continuously.
enum: ['streaming']

StreamingTrigger:
type: object
additionalProperties: false
description: The trigger input for a task of type 'streaming'.
properties:
type:
$ref: '#/StreamingTriggerType'
required:
- type

# Task input

MappingFieldDirective:
Expand Down Expand Up @@ -353,6 +374,16 @@ ScheduleDateUtilsInput:
required:
- timeframe

StreamingUtilsInput:
type: object
additionalProperties: false
description: The input for a `streaming` task whose source is of type `ga4BigqueryExport` and for which extracted data is continuously streamed.
properties:
mapping:
$ref: '#/MappingInput'
required:
- mapping

failureThreshold:
type: integer
minimum: 0
Expand Down
8 changes: 4 additions & 4 deletions specs/ingestion/common/taskParameters.yml
Expand Up @@ -18,12 +18,12 @@ action:
description: An array of actions to perform on the Algolia index.
items:
$ref: './schemas/task.yml#/ActionType'
example: save,replace
example: save,replace,partial,append

sourceID:
name: sourceID
in: query
description: The sourceIDs of the tasks to retrive.
description: The sourceIDs of the tasks to retrieve.
required: false
style: form
explode: false
Expand All @@ -35,7 +35,7 @@ sourceID:
destinationID:
name: destinationID
in: query
description: The destinationIDs of the tasks to retrive.
description: The destinationIDs of the tasks to retrieve.
required: false
style: form
explode: false
Expand All @@ -55,7 +55,7 @@ triggerType:
type: array
items:
$ref: './schemas/task.yml#/TriggerType'
example: onDemand,schedule
example: onDemand,schedule,subscription,streaming

sort:
name: sort
Expand Down

1 comment on commit c324c06

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.