Skip to content

Commit e0b458f

Browse files
authored
Merge branch 'main' into feat-oidc-authentication
2 parents efac038 + feb9ca9 commit e0b458f

File tree

6 files changed

+80
-79
lines changed

6 files changed

+80
-79
lines changed

ctk/features/call.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Feature: Call Task
103103
call: openapi
104104
with:
105105
document:
106-
uri: "https://petstore.swagger.io/v2/swagger.json"
106+
endpoint: "https://petstore.swagger.io/v2/swagger.json"
107107
operation: findPetsByStatus
108108
parameters:
109109
status: ${ .status }
@@ -131,7 +131,7 @@ Feature: Call Task
131131
call: openapi
132132
with:
133133
document:
134-
uri: "https://petstore.swagger.io/v2/swagger.json"
134+
endpoint: "https://petstore.swagger.io/v2/swagger.json"
135135
operation: getPetById
136136
parameters:
137137
petId: ${ .petId }

dsl-reference.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
+ [Export](#export)
5151
+ [Timeout](#timeout)
5252
+ [Duration](#duration)
53+
+ [Endpoint](#endpoint)
5354
+ [HTTP Response](#http-response)
5455
+ [HTTP Request](#http-request)
5556
+ [URI Template](#uri-template)
@@ -178,7 +179,7 @@ use:
178179
call: openapi
179180
with:
180181
document:
181-
uri: https://petstore.swagger.io/v2/swagger.json
182+
endpoint: https://petstore.swagger.io/v2/swagger.json
182183
operationId: findByStatus
183184
parameters:
184185
status: available
@@ -315,7 +316,8 @@ do:
315316
- findPet:
316317
call: asyncapi
317318
with:
318-
document: https://fake.com/docs/asyncapi.json
319+
document:
320+
endpoint: https://fake.com/docs/asyncapi.json
319321
operationRef: findPetsByStatus
320322
server: staging
321323
message: getPetByStatusQuery
@@ -352,7 +354,8 @@ do:
352354
- greet:
353355
call: grpc
354356
with:
355-
proto: file://app/greet.proto
357+
proto:
358+
endpoint: file://app/greet.proto
356359
service:
357360
name: GreeterApi.Greeter
358361
host: localhost
@@ -419,7 +422,8 @@ do:
419422
- findPet:
420423
call: openapi
421424
with:
422-
document: https://petstore.swagger.io/v2/swagger.json
425+
document:
426+
endpoint: https://petstore.swagger.io/v2/swagger.json
423427
operationId: findPetsByStatus
424428
parameters:
425429
status: available
@@ -1080,18 +1084,18 @@ Defines an external resource.
10801084
| Property | Type | Required | Description |
10811085
|----------|:----:|:--------:|-------------|
10821086
| name | `string` | `no` | The name, if any, of the defined resource. |
1083-
| uri | [`uri-template`](#uri-template) | `yes` | The URI at which to get the defined resource. |
1084-
| authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when fecthing the resource. |
1087+
| endpoint | [`endpoint`](#endpoint) | `yes` | The endpoint at which to get the defined resource. |
10851088

10861089
##### Examples
10871090

10881091
```yaml
10891092
name: sample-resource
1090-
uri: https://fake.com/resource/0123
1091-
authentication:
1092-
basic:
1093-
username: admin
1094-
password: 1234
1093+
endpoint:
1094+
uri: https://fake.com/resource/0123
1095+
authentication:
1096+
basic:
1097+
username: admin
1098+
password: 1234
10951099
```
10961100

10971101
### Authentication
@@ -1704,7 +1708,7 @@ document:
17041708
```yaml
17051709
format: json
17061710
resource:
1707-
uri: https://test.com/fake/schema/json/document.json
1711+
endpoint: https://test.com/fake/schema/json/document.json
17081712
```
17091713

17101714
### Timeout

dsl.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,27 @@ This argument contains information about the runtime executing the workflow.
302302
|:-----|:----:|:------------|:--------|
303303
| id | `string` | A unique id of the workflow execution. Now specific format is imposed | UUIDv4: `4a5c8422-5868-4e12-8dd9-220810d2b9ee`, ULID: `0000004JFGDSW1H037G7J7SFB9` |
304304
| definition | `map` | The workflow's definition as a parsed object | `{ "document": { ... }, "do": [...] }` |
305-
| input | `any` | The workflow's *raw* input (i.e *BEFORE* the `input.from` expression). For the result of `input.from` expression use the `$input` argument | - |
306-
| startedAt.iso8601 | `string` | The start time of the execution as a ISO 8601 date time string. It uses `T` as the date-time delimiter, either UTC (`Z`) or a time zone offset (`+01:00`). The precision can be either seconds, milliseconds or nanoseconds | `2022-01-01T12:00:00Z`, `2022-01-01T12:00:00.123456Z`, `2022-01-01T12:00:00.123+01:00` |
307-
| startedAt.epochMillis | `integer` | The start time of the execution as a integer value of milliseconds since midnight of 1970-01-01 UTC | `1641024000123` (="2022-01-01T08:00:00.123Z") |
308-
| startedAt.epochNanos | `integer` | The start time of the execution as a integer value of nanoseconds since midnight of 1970-01-01 UTC | `1641024000123456` (="2022-01-01T08:00:00.123456Z") |
305+
| input | `any` | The workflow's *raw* input (i.e *BEFORE* the `input.from` expression). For the result of `input.from` expression use the `$input` argument | |
306+
| startedAt | [`dateTimeDescriptor`](#datetime-descriptor) | The start time of the execution | |
307+
308+
##### Task Descriptor
309+
310+
| Name | Type | Description | Example |
311+
|:-----|:----:|:------------|:--------|
312+
| name | `string` | The task's name. | `getPet` |
313+
| reference | `string` | The task's reference. | `/do/2/myTask` |
314+
| definition | `map` | The tasks definition (specified under the name) as a parsed object | `{ "call": "http", "with": { ... } }` |
315+
| input | `any` | The task's *raw* input (i.e. *BEFORE* the `input.from` expression). For the result of `input.from` expression use the context of the runtime expression (for jq `.`) | |
316+
| output | `any` | The task's *raw* output (i.e. *BEFORE* the `output.as` expression). | |
317+
| startedAt | [`dateTimeDescriptor`](#datetime-descriptor) | The start time of the task | |
318+
319+
##### DateTime Descriptor
320+
321+
| Name | Type | Description | Example |
322+
|:-----|:----:|:------------|:--------|
323+
| iso8601 | `string` | The date time as a ISO 8601 date time string. It uses `T` as the date-time delimiter, either UTC (`Z`) or a time zone offset (`+01:00`). The precision can be either seconds, milliseconds or nanoseconds | `2022-01-01T12:00:00Z`, `2022-01-01T12:00:00.123456Z`, `2022-01-01T12:00:00.123+01:00` |
324+
| epoch.seconds | `integer` | The date time as a integer value of seconds since midnight of 1970-01-01 UTC (i.e. [the Unix Epoch](https://en.wikipedia.org/wiki/Unix_time)) | `1641024000` (="2022-01-01T08:00:00Z") |
325+
| epoch.milliseconds | `integer` | The date time as a integer value of milliseconds since midnight of 1970-01-01 UTC. This contains the *whole* timestamp, not just the millisecond portion | `1641024000123` (="2022-01-01T08:00:00.123Z") |
309326

310327
The following table shows which arguments are available for each runtime expression:
311328

@@ -319,19 +336,6 @@ The following table shows which arguments are available for each runtime express
319336
| Task `export.as` | Transformed task output | `$context` |||||||
320337
| Workflow `output.as` | Last task's transformed output | Transformed workflow output || | || ||
321338

322-
##### Task Descriptor
323-
324-
| Name | Type | Description | Example |
325-
|:-----|:----:|:------------|:--------|
326-
| name | `string` | The task's name. | `getPet` |
327-
| reference | `string` | The task's reference. | `/do/2/myTask` |
328-
| definition | `map` | The tasks definition (specified under the name) as a parsed object | `{ "call": "http", "with": { ... } }` |
329-
| input | `any` | The task's *raw* input (i.e. *BEFORE* the `input.from` expression). For the result of `input.from` expression use the context of the runtime expression (for jq `.`) | - |
330-
| output | `any` | The task's *raw* output (i.e. *BEFORE* the `output.as` expression). | - |
331-
| startedAt.iso8601 | `string` | The start time of the task as a ISO 8601 date time string. It uses `T` as the date-time delimiter, either UTC (`Z`) or a time zone offset (`+01:00`). The precision can be either seconds, milliseconds or nanoseconds | `2022-01-01T12:00:00Z`, `2022-01-01T12:00:00.123456Z`, `2022-01-01T12:00:00.123+01:00` |
332-
| startedAt.epochMillis | `integer` | The start time of the task as a integer value of milliseconds since midnight of 1970-01-01 UTC | `1641024000123` (="2022-01-01T08:00:00.123Z") |
333-
| startedAt.epochNanos | `integer` | The start time of the task as a integer value of nanoseconds since midnight of 1970-01-01 UTC | `1641024000123456` (="2022-01-01T08:00:00.123456Z") |
334-
335339
### Fault Tolerance
336340

337341
Serverless Workflow is designed with resilience in mind, acknowledging that errors are an inevitable part of any system. The DSL provides robust mechanisms to identify, describe, and handle errors effectively, ensuring the workflow can recover gracefully from failures.

examples/accumulate-room-readings.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ do:
3131
call: openapi
3232
with:
3333
document:
34-
uri: http://myorg.io/ordersservices.json
34+
endpoint: http://myorg.io/ordersservices.json
3535
operationId: logreading
3636
- generateReport:
3737
call: openapi
3838
with:
3939
document:
40-
uri: http://myorg.io/ordersservices.json
40+
endpoint: http://myorg.io/ordersservices.json
4141
operationId: produceReport
4242
timeout:
4343
after:

examples/asyncapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ do:
88
call: asyncapi
99
with:
1010
document:
11-
uri: https://fake.com/docs/asyncapi.json
11+
endpoint: https://fake.com/docs/asyncapi.json
1212
operationRef: findPetsByStatus
1313
server: staging
1414
message: getPetByStatusQuery

schema/workflow.yaml

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,7 @@ $defs:
314314
endpoint:
315315
title: WithHTTPEndpoint
316316
description: The HTTP endpoint to send the request to.
317-
oneOf:
318-
- $ref: '#/$defs/endpoint'
319-
- $ref: '#/$defs/runtimeExpression'
320-
- title: LiteralEndpoint
321-
type: string
322-
format: uri-template
317+
$ref: '#/$defs/endpoint'
323318
headers:
324319
type: object
325320
title: WithHTTPHeaders
@@ -1105,27 +1100,33 @@ $defs:
11051100
description: A human-readable explanation specific to this occurrence of the error.
11061101
required: [ type, status, instance ]
11071102
endpoint:
1108-
type: object
11091103
title: Endpoint
11101104
description: Represents an endpoint.
1111-
unevaluatedProperties: false
1112-
properties:
1113-
uri:
1114-
title: EndpointUri
1115-
description: The endpoint's URI.
1116-
oneOf:
1117-
- title: LiteralEndpointURI
1118-
description: The literal endpoint's URI.
1119-
type: string
1120-
format: uri-template
1121-
- $ref: '#/$defs/runtimeExpression'
1122-
title: ExpressionEndpointURI
1123-
description: An expression based endpoint's URI.
1124-
authentication:
1125-
$ref: '#/$defs/referenceableAuthenticationPolicy'
1126-
title: EndpointAuthentication
1127-
description: The authentication policy to use.
1128-
required: [ uri ]
1105+
oneOf:
1106+
- $ref: '#/$defs/runtimeExpression'
1107+
- title: LiteralEndpoint
1108+
type: string
1109+
format: uri-template
1110+
- title: EndpointConfiguration
1111+
type: object
1112+
unevaluatedProperties: false
1113+
properties:
1114+
uri:
1115+
title: EndpointUri
1116+
description: The endpoint's URI.
1117+
oneOf:
1118+
- title: LiteralEndpointURI
1119+
description: The literal endpoint's URI.
1120+
type: string
1121+
format: uri-template
1122+
- $ref: '#/$defs/runtimeExpression'
1123+
title: ExpressionEndpointURI
1124+
description: An expression based endpoint's URI.
1125+
authentication:
1126+
$ref: '#/$defs/referenceableAuthenticationPolicy'
1127+
title: EndpointAuthentication
1128+
description: The authentication policy to use.
1129+
required: [ uri ]
11291130
eventProperties:
11301131
type: object
11311132
title: EventProperties
@@ -1259,28 +1260,20 @@ $defs:
12591260
description: The task(s) to execute after the extended task, if any.
12601261
required: [ extend ]
12611262
externalResource:
1263+
type: object
12621264
title: ExternalResource
12631265
description: Represents an external resource.
1264-
oneOf:
1265-
- type: string
1266-
format: uri-template
1267-
- title: ExternalResourceURI
1268-
type: object
1269-
unevaluatedProperties: false
1270-
properties:
1271-
uri:
1272-
type: string
1273-
format: uri-template
1274-
title: ExternalResourceURIEndpoint
1275-
description: The endpoint's URI.
1276-
authentication:
1277-
$ref: '#/$defs/referenceableAuthenticationPolicy'
1278-
title: ExternalResourceURIAuthentication
1279-
description: The authentication policy to use.
1280-
name:
1281-
type: string
1282-
description: The external resource's name, if any.
1283-
required: [ uri ]
1266+
unevaluatedProperties: false
1267+
properties:
1268+
name:
1269+
type: string
1270+
title: ExternalResourceName
1271+
description: The name of the external resource, if any.
1272+
endpoint:
1273+
$ref: '#/$defs/endpoint'
1274+
title: ExternalResourceEndpoint
1275+
description: The endpoint of the external resource.
1276+
required: [ endpoint ]
12841277
input:
12851278
type: object
12861279
title: Input

0 commit comments

Comments
 (0)