Platform Release 21 April 2020

Extensions can now be queried, created, updated, and deleted using the GraphQL API.

Introduced the following changes to the GraphQL schema (in SDL format):

extend type Query {
  extension(
    "Queries with specified ID"
    id: String,

    "Queries with specified key"
    key: String): Extension
  extensions(where: String, sort: [String!], limit: Int, offset: Int): ExtensionQueryResult!
}

extend type Mutation {
  createExtension(draft: ExtensionDraft!): Extension
  deleteExtension(version: Long!,

    "Queries with specified ID"
    id: String,

    "Queries with specified key"
    key: String): Extension
  updateExtension(version: Long!, actions: [ExtensionUpdateAction!]!,

    "Queries with specified ID"
    id: String,

    "Queries with specified key"
    key: String): Extension
}

type AWSLambdaDestination implements ExtensionDestination {
  arn: String!
  accessKey: String!
  accessSecret: String!
  type: String!
}

input AWSLambdaDestinationInput {
  arn: String!
  accessKey: String!
  accessSecret: String!
}

enum ActionType {
  Update
  Create
}

type AuthorizationHeader implements HttpDestinationAuthentication {
  headerValue: String!
  type: String!
}

input AuthorizationHeaderInput {
  headerValue: String!
}

type AzureFunctionsAuthentication implements HttpDestinationAuthentication {
  key: String!
  type: String!
}

input AzureFunctionsAuthenticationInput {
  key: String!
}

input ChangeExtensionDestination {
  destination: ExtensionDestinationInput!
}

input ChangeExtensionTriggers {
  triggers: [TriggerInput!]!
}

type Extension implements Versioned {
  key: String
  destination: ExtensionDestination!
  triggers: [Trigger!]!
  timeoutInMs: Int
  id: String!
  version: Long!
  createdAt: DateTime!
  lastModifiedAt: DateTime!
  createdBy: Initiator
  lastModifiedBy: Initiator
}

interface ExtensionDestination {
  type: String!
}

input ExtensionDestinationInput {
  HTTP: HttpDestinationInput
  AWSLambda: AWSLambdaDestinationInput
}

input ExtensionDraft {
  key: String
  destination: ExtensionDestinationInput!
  triggers: [TriggerInput!]!
  timeoutInMs: Int
}

type ExtensionQueryResult {
  offset: Int!
  count: Int!
  total: Long!
  results: [Extension!]!
}

input ExtensionUpdateAction {
  changeDestination: ChangeExtensionDestination
  changeTriggers: ChangeExtensionTriggers
  setKey: SetExtensionKey
  setTimeoutInMs: SetExtensionTimeoutInMs
}

type HttpDestination implements ExtensionDestination {
  type: String!
  url: String!
  authentication: HttpDestinationAuthentication
}

interface HttpDestinationAuthentication {
  type: String!
}

input HttpDestinationAuthenticationInput {
  AuthorizationHeader: AuthorizationHeaderInput
  AzureFunctions: AzureFunctionsAuthenticationInput
}

input HttpDestinationInput {
  url: String!
  authentication: HttpDestinationAuthenticationInput
}

input SetExtensionKey {
  key: String
}

input SetExtensionTimeoutInMs {
  timeoutInMs: Int
}

input SetStoreDistributionChannels {
  channels: [ResourceIdentifierInput!]
}

type Trigger {
  resourceTypeId: String!
  actions: [ActionType!]!
}

input TriggerInput {
  resourceTypeId: String!
  actions: [ActionType!]
}