Version
Version defines component information for the service.
Structure
|- version
|- actions.json
|- conditions.json
|- data.json
|- events.json
|- oauth.js(optional)
|- triggers.json
data.json defines auth, webhook type, and service variables.
Version configuration on data.json
requires following basic structure
{
"auth": {
"accessToken": {
"form": {
"client_id": {
"@type": "reference",
"operation": "platformServiceVariable",
"variable": "oauth_client_id"
},
"client_secret": {
"@type": "reference",
"operation": "platformServiceVariable",
"variable": "oauth_client_secret"
},
"code": {
"@type": "reference",
"operation": "source",
"path": [
"code"
]
},
"grant_type": "authorization_code",
"redirect_uri": {
"@type": "reference",
"operation": "source",
"path": [
"redirect_uri"
]
}
},
"headers": {
"accept": "application/json",
"content-type": "application/x-www-form-urlencoded"
},
"method": "post",
"url": "https://oauth2.googleapis.com/token"
},
"authorization": {
"method": "get",
"parameter": {
"client_id": {
"@type": "reference",
"operation": "platformServiceVariable",
"variable": "oauth_client_id"
},
"scope": "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/calendar.readonly https://www.googleapis.com/auth/calendar.events"
},
"url": "https://accounts.google.com/o/oauth2/v2/auth?prompt=consent&access_type=offline&include_granted_scopes=true&response_type=code"
},
"refreshToken": {
"form": {
"client_id": {
"@type": "reference",
"operation": "platformServiceVariable",
"variable": "oauth_client_id"
},
"client_secret": {
"@type": "reference",
"operation": "platformServiceVariable",
"variable": "oauth_client_secret"
},
"grant_type": "refresh_token",
"refresh_token": {
"@type": "reference",
"operation": "source",
"path": [
"refresh_token"
]
}
},
"headers": {
"accept": "application/json",
"content-type": "application/x-www-form-urlencoded"
},
"method": "post",
"url": "https://oauth2.googleapis.com/token"
},
"userInfo": {
"headers": {
"Authorization": ""
},
"method": "get",
"namePath": [
"email"
],
"url": "https://www.googleapis.com/oauth2/v3/tokeninfo"
}
},
"auth_type": "oauthv2",
"id": "93ae2586-5ad3-4b18-93dc-3b41aa2f0721",
"name": "0",
"setting": {
"webhook": {
"input": {
"Content type": "application/json",
"Payload URL": {
"@type": "reference",
"operation": "webhookService"
},
"Secret": {
"@type": "reference",
"operation": "webhookSecret"
}
},
"type": "automation"
}
},
"variables": {
"oauth_client_id": {
"type": "string"
},
"oauth_client_secret": {
"type": "string"
}
}
}
If `id` is not provided, CLI will autogenerate it and insert it into the file before creating a new version.
If `id` is provided, CLI will update the version with that `id`.
Helpful?