Skip to content

Commit 835dacc

Browse files
authored
feat(specs): add with transformation helpers (#4931)
1 parent 2b308b1 commit 835dacc

File tree

26 files changed

+220
-91
lines changed

26 files changed

+220
-91
lines changed

generators/src/main/java/com/algolia/codegen/AlgoliaSwiftGenerator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public class AlgoliaSwiftGenerator extends Swift5ClientCodegen {
6363
"edit",
6464
"edittype",
6565
"errorbase",
66+
"event",
67+
"eventstatus",
6668
"eventtype",
6769
"exactonsinglewordquery",
6870
"exhaustive",
@@ -120,6 +122,7 @@ public class AlgoliaSwiftGenerator extends Swift5ClientCodegen {
120122
"typotolerance",
121123
"typotoleranceenum",
122124
"value",
125+
"watchresponse",
123126
"widgets"
124127
);
125128

specs/common/parameters/ingestion.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
RunID:
2+
type: string
3+
# format: uuid
4+
description: Universally unique identifier (UUID) of a task run.
5+
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
6+
7+
EventID:
8+
type: string
9+
# format: uuid
10+
description: Universally unique identifier (UUID) of an event.
11+
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
12+
13+
CreatedAt:
14+
type: string
15+
description: Date of creation in RFC 3339 format.
16+
17+
PublishedAt:
18+
type: string
19+
description: Date of publish RFC 3339 format.
20+
21+
EventStatus:
22+
oneOf:
23+
- type: string
24+
enum: [created, started, retried, failed, succeeded, critical]
25+
- type: 'null'
26+
27+
EventType:
28+
type: string
29+
enum: [fetch, record, log, transform]

specs/ingestion/common/schemas/event.yml renamed to specs/common/schemas/ingestion/Observability.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Event:
44
additionalProperties: false
55
properties:
66
eventID:
7-
$ref: './common.yml#/eventID'
7+
$ref: '../../parameters/ingestion.yml#/EventID'
88
runID:
9-
$ref: './common.yml#/runID'
9+
$ref: '../../parameters/ingestion.yml#/RunID'
1010
status:
11-
$ref: '#/EventStatus'
11+
$ref: '../../parameters/ingestion.yml#/EventStatus'
1212
type:
13-
$ref: '#/EventType'
13+
$ref: '../../parameters/ingestion.yml#/EventType'
1414
batchSize:
1515
type: integer
1616
description: The extracted record batch size.
@@ -23,21 +23,11 @@ Event:
2323
additionalProperties: true
2424
- type: 'null'
2525
publishedAt:
26-
$ref: './common.yml#/publishedAt'
26+
$ref: '../../parameters/ingestion.yml#/PublishedAt'
2727
required:
2828
- eventID
2929
- runID
3030
- status
3131
- type
3232
- batchSize
3333
- publishedAt
34-
35-
EventStatus:
36-
oneOf:
37-
- type: string
38-
enum: [created, started, retried, failed, succeeded, critical]
39-
- type: 'null'
40-
41-
EventType:
42-
type: string
43-
enum: [fetch, record, log, transform]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
type: object
2+
additionalProperties: false
3+
properties:
4+
runID:
5+
$ref: '../../parameters/ingestion.yml#/RunID'
6+
eventID:
7+
$ref: '../../parameters/ingestion.yml#/EventID'
8+
data:
9+
type: array
10+
description: |
11+
This field is always null when used with the Push endpoint.
12+
When used for a source discover or source validate run, it will include the sampled data of the source.
13+
items:
14+
type: object
15+
events:
16+
description: in case of error, observability events will be added to the response.
17+
type: array
18+
items:
19+
$ref: './Observability.yml#/Event'
20+
message:
21+
description: a message describing the outcome of the operation that has been ran (push, discover or validate) run.
22+
type: string
23+
createdAt:
24+
$ref: '../../parameters/ingestion.yml#/CreatedAt'
25+
required:
26+
- runID

specs/ingestion/common/observabilityParameters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ eventStatus:
55
schema:
66
type: array
77
items:
8-
$ref: './schemas/event.yml#/EventStatus'
8+
$ref: '../../common/parameters/ingestion.yml#/EventStatus'
99

1010
eventType:
1111
name: type
@@ -14,7 +14,7 @@ eventType:
1414
schema:
1515
type: array
1616
items:
17-
$ref: './schemas/event.yml#/EventType'
17+
$ref: '../../common/parameters/ingestion.yml#/EventType'
1818

1919
runStatus:
2020
name: status

specs/ingestion/common/parameters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ pathRunID:
4444
required: true
4545
description: Unique identifier of a task run.
4646
schema:
47-
$ref: './schemas/common.yml#/runID'
47+
$ref: '../../common/parameters/ingestion.yml#/RunID'
4848

4949
pathEventID:
5050
name: eventID
5151
in: path
5252
required: true
5353
description: Unique identifier of an event.
5454
schema:
55-
$ref: './schemas/common.yml#/eventID'
55+
$ref: '../../common/parameters/ingestion.yml#/EventID'
5656

5757
itemsPerPage:
5858
name: itemsPerPage

specs/ingestion/common/schemas/authentication.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Authentication:
1616
input:
1717
$ref: '#/AuthInputPartial'
1818
createdAt:
19-
$ref: './common.yml#/createdAt'
19+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
2020
updatedAt:
2121
$ref: './common.yml#/updatedAt'
2222
required:
@@ -55,7 +55,7 @@ AuthenticationCreateResponse:
5555
name:
5656
$ref: './common.yml#/name'
5757
createdAt:
58-
$ref: './common.yml#/createdAt'
58+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
5959
required:
6060
- authenticationID
6161
- name

specs/ingestion/common/schemas/common.yml

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
createdAt:
2-
type: string
3-
description: Date of creation in RFC 3339 format.
4-
51
updatedAt:
62
type: string
73
description: Date of last update in RFC 3339 format.
@@ -14,10 +10,6 @@ finishedAt:
1410
type: string
1511
description: Date of finish in RFC 3339 format.
1612

17-
publishedAt:
18-
type: string
19-
description: Date of publish RFC 3339 format.
20-
2113
cursor:
2214
type: string
2315
description: Date of the last cursor in RFC 3339 format.
@@ -66,18 +58,6 @@ transformationID:
6658
description: Universally unique identifier (UUID) of a transformation.
6759
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
6860

69-
runID:
70-
type: string
71-
# format: uuid
72-
description: Universally unique identifier (UUID) of a task run.
73-
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
74-
75-
eventID:
76-
type: string
77-
# format: uuid
78-
description: Universally unique identifier (UUID) of an event.
79-
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
80-
8161
name:
8262
type: string
8363
description: Descriptive name for the resource.
@@ -102,29 +82,3 @@ Window:
10282
required:
10383
- startDate
10484
- endDate
105-
106-
WatchResponse:
107-
type: object
108-
additionalProperties: false
109-
properties:
110-
runID:
111-
$ref: '#/runID'
112-
eventID:
113-
$ref: '#/eventID'
114-
data:
115-
type: array
116-
description: when used with discovering or validating sources, the sampled data of your source is returned.
117-
items:
118-
type: object
119-
events:
120-
description: in case of error, observability events will be added to the response, if any.
121-
type: array
122-
items:
123-
$ref: '../../common/schemas/event.yml#/Event'
124-
message:
125-
description: a message describing the outcome of a validate run.
126-
type: string
127-
createdAt:
128-
$ref: '#/createdAt'
129-
required:
130-
- runID

specs/ingestion/common/schemas/destination.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Destination:
1414
input:
1515
$ref: '#/DestinationInput'
1616
createdAt:
17-
$ref: './common.yml#/createdAt'
17+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
1818
updatedAt:
1919
$ref: './common.yml#/updatedAt'
2020
authenticationID:
@@ -59,7 +59,7 @@ DestinationCreateResponse:
5959
name:
6060
$ref: './common.yml#/name'
6161
createdAt:
62-
$ref: './common.yml#/createdAt'
62+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
6363
required:
6464
- destinationID
6565
- name

specs/ingestion/common/schemas/run.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ RunResponse:
44
description: API response for running a task.
55
properties:
66
runID:
7-
$ref: './common.yml#/runID'
7+
$ref: '../../../common/parameters/ingestion.yml#/RunID'
88
createdAt:
9-
$ref: './common.yml#/createdAt'
9+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
1010
required:
1111
- runID
1212
- createdAt
@@ -33,7 +33,7 @@ Run:
3333
additionalProperties: false
3434
properties:
3535
runID:
36-
$ref: './common.yml#/runID'
36+
$ref: '../../../common/parameters/ingestion.yml#/RunID'
3737
appID:
3838
type: string
3939
taskID:
@@ -64,7 +64,7 @@ Run:
6464
type:
6565
$ref: '#/RunType'
6666
createdAt:
67-
$ref: './common.yml#/createdAt'
67+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
6868
startedAt:
6969
$ref: './common.yml#/startedAt'
7070
finishedAt:

specs/ingestion/common/schemas/source.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Source:
1515
authenticationID:
1616
$ref: './common.yml#/authenticationID'
1717
createdAt:
18-
$ref: './common.yml#/createdAt'
18+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
1919
updatedAt:
2020
$ref: './common.yml#/updatedAt'
2121
required:
@@ -52,7 +52,7 @@ SourceCreateResponse:
5252
type: string
5353
description: Descriptive name of the source.
5454
createdAt:
55-
$ref: './common.yml#/createdAt'
55+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
5656
required:
5757
- sourceID
5858
- name

specs/ingestion/common/schemas/task.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Task:
3535
policies:
3636
$ref: '#/Policies'
3737
createdAt:
38-
$ref: './common.yml#/createdAt'
38+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
3939
updatedAt:
4040
$ref: './common.yml#/updatedAt'
4141
required:
@@ -77,7 +77,7 @@ TaskV1:
7777
policies:
7878
$ref: '#/Policies'
7979
createdAt:
80-
$ref: './common.yml#/createdAt'
80+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
8181
updatedAt:
8282
$ref: './common.yml#/updatedAt'
8383
required:
@@ -174,7 +174,7 @@ TaskCreateResponse:
174174
taskID:
175175
$ref: './common.yml#/taskID'
176176
createdAt:
177-
$ref: './common.yml#/createdAt'
177+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
178178
required:
179179
- taskID
180180
- createdAt

specs/ingestion/common/schemas/transformation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Transformation:
1919
owner:
2020
$ref: './common.yml#/owner'
2121
createdAt:
22-
$ref: './common.yml#/createdAt'
22+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
2323
updatedAt:
2424
$ref: './common.yml#/updatedAt'
2525
required:
@@ -118,7 +118,7 @@ TransformationCreateResponse:
118118
transformationID:
119119
$ref: './common.yml#/transformationID'
120120
createdAt:
121-
$ref: './common.yml#/createdAt'
121+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
122122
required:
123123
- transformationID
124124
- createdAt

specs/ingestion/paths/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ post:
3232
content:
3333
application/json:
3434
schema:
35-
$ref: '../common/schemas/common.yml#/WatchResponse'
35+
$ref: '../../common/schemas/ingestion/WatchResponse.yml'
3636
'400':
3737
$ref: '../../common/responses/BadRequest.yml'

specs/ingestion/paths/runs/events/eventID.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ get:
1717
content:
1818
application/json:
1919
schema:
20-
$ref: '../../../common/schemas/event.yml#/Event'
20+
$ref: '../../../../common/schemas/ingestion/Observability.yml#/Event'
2121
'400':
2222
$ref: '../../../../common/responses/BadRequest.yml'

specs/ingestion/paths/runs/events/events.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ get:
3939
events:
4040
type: array
4141
items:
42-
$ref: '../../../common/schemas/event.yml#/Event'
42+
$ref: '../../../../common/schemas/ingestion/Observability.yml#/Event'
4343
pagination:
4444
$ref: '../../../common/schemas/pagination.yml#/Pagination'
4545
window:

specs/ingestion/paths/sources/discover.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ post:
2222
content:
2323
application/json:
2424
schema:
25-
$ref: '../../common/schemas/common.yml#/WatchResponse'
25+
$ref: '../../../common/schemas/ingestion/WatchResponse.yml'
2626
'400':
2727
$ref: '../../../common/responses/BadRequest.yml'

specs/ingestion/paths/sources/runSource.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ post:
3131
additionalProperties:
3232
type: string
3333
createdAt:
34-
$ref: '../../common/schemas/common.yml#/createdAt'
34+
$ref: '../../../common/parameters/ingestion.yml#/CreatedAt'
3535
required:
3636
- taskWithRunID
3737
- createdAt

specs/ingestion/paths/sources/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ post:
2525
content:
2626
application/json:
2727
schema:
28-
$ref: '../../common/schemas/common.yml#/WatchResponse'
28+
$ref: '../../../common/schemas/ingestion/WatchResponse.yml'
2929
'400':
3030
$ref: '../../../common/responses/BadRequest.yml'

0 commit comments

Comments
 (0)