-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: distribute JSON schema for DatapackExportDefinition object
- Loading branch information
Showing
3 changed files
with
383 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
244 changes: 244 additions & 0 deletions
244
packages/vlocity-deploy/src/export/exportDefinitions.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,244 @@ | ||
{ | ||
"$ref": "#/definitions/DatapackExportDefinition", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"definitions": { | ||
"DatapackExportDefinition": { | ||
"additionalProperties": false, | ||
"properties": { | ||
"autoGeneratedMatchingKey": { | ||
"description": "When true the matching key is auto-generated random number instead of a value based on the object data. autogenerated matching keys only work for none-lookup fields.", | ||
"type": "boolean" | ||
}, | ||
"embeddedLookupFields": { | ||
"description": "List of lookup fields that are embedded as part of the object export in the parent datapack.", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"fields": { | ||
"additionalProperties": { | ||
"$ref": "#/definitions/ExportFieldDefinition" | ||
}, | ||
"description": "Optional object with specific export settings for fields in the object.", | ||
"type": "object" | ||
}, | ||
"fileName": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
} | ||
], | ||
"description": "The name of the file to export the object data to. The name can be a string which is evaluated as a template to include values from the dtapaack: ```yaml fileName: \"account_{Name}\" ``` All exported fields are written to this file in JSON format and '.json' is appended to the file name if no extension is provided." | ||
}, | ||
"filter": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"additionalProperties": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/alias-1030797743-2611-2701-1030797743-0-3796" | ||
}, | ||
{ | ||
"type": "number" | ||
}, | ||
{ | ||
"type": "boolean" | ||
}, | ||
{ | ||
"type": "null" | ||
} | ||
] | ||
}, | ||
"type": "object" | ||
} | ||
], | ||
"description": "Where condition to filter the object data to export by. Can be a string or an object. When an object, the key is the field name and the value is the value to filter by. Accesing fields from the parent datapack using bracket syntax `{}` is supported: ``` relatedObjectFilter: AccountId: $parent.Id IsActive: true ```\n\nWhen defined as a string, the string is used as the where condition and interpolated this allows for more complex where conditions: ```yaml filter: \"AccountId = '{parent.Id}' AND IsActive = 'true'\" ```" | ||
}, | ||
"ignoreFields": { | ||
"description": "List of fields to exclude from the export.", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"matchingKeyFields": { | ||
"description": "List of fields which uniquely identify the object and are used for matching the object when importing and for generating the external lookup reference.", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"objectType": { | ||
"description": "Type of SObject to export", | ||
"type": "string" | ||
}, | ||
"relatedObjects": { | ||
"additionalProperties": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/ObjectFilter" | ||
}, | ||
{ | ||
"$ref": "#/definitions/ObjectRelationship" | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
}, | ||
"description": "List of objects that are related to this object and who's data should be included in the export. The key is the name under which related records are exported.", | ||
"type": "object" | ||
}, | ||
"sortFields": { | ||
"description": "List of fields by which to sort the exported data when exporting\tas a related object.", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
} | ||
}, | ||
"required": ["objectType", "matchingKeyFields"], | ||
"type": "object" | ||
}, | ||
"ExportFieldDefinition": { | ||
"additionalProperties": false, | ||
"properties": { | ||
"expandArray": { | ||
"description": "When true expands an array value in the datapack to individual files.", | ||
"type": "boolean" | ||
}, | ||
"fileName": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
} | ||
], | ||
"description": "When set the data in the field is exported into a separate file with the specified name. The name can be a string which is evaluated as a template to include values from the datapack: ```yaml fileName: \"data_{Name}.json\" ``` If no extension is provided the extension is inferred from the field type:\n- json: .json\n- binary: .bin" | ||
}, | ||
"processor": { | ||
"description": "Processor function snippet to use for processing the field data before exporting.", | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"ObjectFilter": { | ||
"additionalProperties": false, | ||
"properties": { | ||
"filter": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"additionalProperties": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/alias-1030797743-2611-2701-1030797743-0-3796" | ||
}, | ||
{ | ||
"type": "number" | ||
}, | ||
{ | ||
"type": "boolean" | ||
}, | ||
{ | ||
"type": "null" | ||
} | ||
] | ||
}, | ||
"type": "object" | ||
} | ||
], | ||
"description": "Where condition to filter the object data to export by. Can be a string or an object. When an object, the key is the field name and the value is the value to filter by. Accesing fields from the parent datapack using bracket syntax `{}` is supported: ``` relatedObjectFilter: AccountId: $parent.Id IsActive: true ```\n\nWhen defined as a string, the string is used as the where condition and interpolated this allows for more complex where conditions: ```yaml filter: \"AccountId = '{parent.Id}' AND IsActive = 'true'\" ```" | ||
}, | ||
"objectType": { | ||
"description": "Type of SObject to which this filter applies", | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["objectType", "filter"], | ||
"type": "object" | ||
}, | ||
"ObjectRelationship": { | ||
"additionalProperties": false, | ||
"properties": { | ||
"filter": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"additionalProperties": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/alias-1030797743-2611-2701-1030797743-0-3796" | ||
}, | ||
{ | ||
"type": "number" | ||
}, | ||
{ | ||
"type": "boolean" | ||
}, | ||
{ | ||
"type": "null" | ||
} | ||
] | ||
}, | ||
"type": "object" | ||
} | ||
], | ||
"description": "Optional filter to apply to the related object data to export." | ||
}, | ||
"relationshipName": { | ||
"description": "Name of the relationship field on the parent object", | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["relationshipName"], | ||
"type": "object" | ||
}, | ||
"alias-1030797743-2611-2701-1030797743-0-3796": { | ||
"anyOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"additionalProperties": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/alias-1030797743-2611-2701-1030797743-0-3796" | ||
}, | ||
{ | ||
"type": "number" | ||
}, | ||
{ | ||
"type": "boolean" | ||
}, | ||
{ | ||
"type": "null" | ||
} | ||
] | ||
}, | ||
"type": "object" | ||
} | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.