@squiz/dx-json-schema-lib
Advanced tools
Comparing version 1.67.0 to 1.68.0
# Change Log | ||
## 1.68.0 | ||
### Minor Changes | ||
- 932b1fb: Adds dam-image into the schema | ||
## 1.67.0 | ||
@@ -4,0 +10,0 @@ |
@@ -7,3 +7,3 @@ /** | ||
export type FormattedNodes = HigherOrderFormattedNodes | BaseFormattedNodes; | ||
export type HigherOrderFormattedNodes = FormattedTextLinkToMatrixAsset | FormattedTextMatrixImage; | ||
export type HigherOrderFormattedNodes = FormattedTextLinkToMatrixAsset | FormattedTextMatrixImage | FormattedTextDamImage; | ||
export type WithChildrenNode = FormattedNodes[]; | ||
@@ -32,2 +32,14 @@ export type BaseFormattedNodes = FormattedTextTag | TextNode | ComponentNode; | ||
} | ||
export interface FormattedTextDamImage { | ||
type: 'dam-image'; | ||
damSystemType: string; | ||
damSystemIdentifier: string; | ||
damObjectId: string; | ||
damAdditional?: { | ||
directLinkId?: string; | ||
[k: string]: unknown; | ||
}; | ||
damUrl?: string; | ||
formattingOptions?: FormattingOptions; | ||
} | ||
export interface FormattedTextTag { | ||
@@ -34,0 +46,0 @@ children?: WithChildrenNode; |
@@ -16,3 +16,4 @@ { | ||
{ "$ref": "#/definitions/FormattedTextLinkToMatrixAsset" }, | ||
{ "$ref": "#/definitions/FormattedTextMatrixImage" } | ||
{ "$ref": "#/definitions/FormattedTextMatrixImage" }, | ||
{ "$ref": "#/definitions/FormattedTextDamImage" } | ||
] | ||
@@ -129,4 +130,18 @@ }, | ||
"required": ["type", "matrixDomain", "matrixAssetId"] | ||
}, | ||
"FormattedTextDamImage": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"type": { "const": "dam-image" }, | ||
"damSystemType": { "type": "string", "minLength": 1 }, | ||
"damSystemIdentifier": { "type": "string", "minLength": 1 }, | ||
"damObjectId": { "type": "string", "minLength": 1 }, | ||
"damAdditional": { "type": "object", "properties": { "directLinkId": { "type": "string", "minLength": 1 } } }, | ||
"damUrl": { "type": "string", "minLength": 1 }, | ||
"formattingOptions": { "$ref": "#/definitions/FormattingOptions" } | ||
}, | ||
"required": ["type", "damSystemType", "damSystemIdentifier", "damObjectId"] | ||
} | ||
} | ||
} |
@@ -12,2 +12,5 @@ "use strict"; | ||
}), | ||
'dam-image': jest.fn((node) => { | ||
return Promise.resolve({ type: 'text', value: `Image ${node.damObjectId}` }); | ||
}), | ||
}; | ||
@@ -34,2 +37,8 @@ const testFormattedNodes = { | ||
}, | ||
{ | ||
type: 'dam-image', | ||
damObjectId: 'xyz-123', | ||
damSystemType: 'Bynder', | ||
damSystemIdentifier: '123', | ||
}, | ||
{ type: 'text', value: '.' }, | ||
@@ -46,2 +55,3 @@ ], | ||
{ type: 'text', value: 'Image 54321' }, | ||
{ type: 'text', value: 'Image xyz-123' }, | ||
{ type: 'text', value: '.' }, | ||
@@ -62,2 +72,5 @@ ], | ||
}, | ||
'dam-image': jest.fn((node) => { | ||
return Promise.resolve({ type: 'text', value: `Image ${node.damObjectId}` }); | ||
}), | ||
}; | ||
@@ -105,2 +118,8 @@ describe('resolveFormattedNodes', () => { | ||
}, | ||
{ | ||
type: 'dam-image', | ||
damSystemType: 'Bynder', | ||
damSystemIdentifier: '123', | ||
damObjectId: 'xyz-123', | ||
}, | ||
], | ||
@@ -123,2 +142,3 @@ }; | ||
}, | ||
{ type: 'text', value: 'Image xyz-123' }, | ||
], | ||
@@ -125,0 +145,0 @@ }; |
{ | ||
"name": "@squiz/dx-json-schema-lib", | ||
"version": "1.67.0", | ||
"version": "1.68.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -18,3 +18,4 @@ { | ||
{ "$ref": "#/definitions/FormattedTextLinkToMatrixAsset" }, | ||
{ "$ref": "#/definitions/FormattedTextMatrixImage" } | ||
{ "$ref": "#/definitions/FormattedTextMatrixImage" }, | ||
{ "$ref": "#/definitions/FormattedTextDamImage" } | ||
] | ||
@@ -146,4 +147,20 @@ }, | ||
"required": ["type", "matrixDomain", "matrixAssetId"] | ||
}, | ||
"FormattedTextDamImage": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"type": { "const": "dam-image" }, | ||
"damSystemType": { "type": "string", "minLength": 1 }, | ||
"damSystemIdentifier": { "type": "string", "minLength": 1 }, | ||
"damObjectId": { "type": "string", "minLength": 1 }, | ||
"damAdditional": { "type": "object", "properties": { "directLinkId": { "type": "string", "minLength": 1 } } }, | ||
"damUrl": { "type": "string", "minLength": 1 }, | ||
"formattingOptions": { "$ref": "#/definitions/FormattingOptions" } | ||
}, | ||
"required": ["type", "damSystemType", "damSystemIdentifier", "damObjectId"] | ||
} | ||
} | ||
} |
@@ -9,3 +9,6 @@ /* eslint-disable */ | ||
export type FormattedNodes = HigherOrderFormattedNodes | BaseFormattedNodes; | ||
export type HigherOrderFormattedNodes = FormattedTextLinkToMatrixAsset | FormattedTextMatrixImage; | ||
export type HigherOrderFormattedNodes = | ||
| FormattedTextLinkToMatrixAsset | ||
| FormattedTextMatrixImage | ||
| FormattedTextDamImage; | ||
export type WithChildrenNode = FormattedNodes[]; | ||
@@ -35,2 +38,14 @@ export type BaseFormattedNodes = FormattedTextTag | TextNode | ComponentNode; | ||
} | ||
export interface FormattedTextDamImage { | ||
type: 'dam-image'; | ||
damSystemType: string; | ||
damSystemIdentifier: string; | ||
damObjectId: string; | ||
damAdditional?: { | ||
directLinkId?: string; | ||
[k: string]: unknown; | ||
}; | ||
damUrl?: string; | ||
formattingOptions?: FormattingOptions; | ||
} | ||
export interface FormattedTextTag { | ||
@@ -37,0 +52,0 @@ children?: WithChildrenNode; |
@@ -17,2 +17,5 @@ import { FormattedNodes } from './formattedText'; | ||
}), | ||
'dam-image': jest.fn((node) => { | ||
return Promise.resolve({ type: 'text', value: `Image ${node.damObjectId}` }); | ||
}), | ||
}; | ||
@@ -40,2 +43,8 @@ | ||
}, | ||
{ | ||
type: 'dam-image', | ||
damObjectId: 'xyz-123', | ||
damSystemType: 'Bynder', | ||
damSystemIdentifier: '123', | ||
}, | ||
{ type: 'text', value: '.' }, | ||
@@ -53,2 +62,3 @@ ], | ||
{ type: 'text', value: 'Image 54321' }, | ||
{ type: 'text', value: 'Image xyz-123' }, | ||
{ type: 'text', value: '.' }, | ||
@@ -72,2 +82,5 @@ ], | ||
}, | ||
'dam-image': jest.fn((node) => { | ||
return Promise.resolve({ type: 'text', value: `Image ${node.damObjectId}` }); | ||
}), | ||
}; | ||
@@ -115,2 +128,8 @@ describe('resolveFormattedNodes', () => { | ||
}, | ||
{ | ||
type: 'dam-image', | ||
damSystemType: 'Bynder', | ||
damSystemIdentifier: '123', | ||
damObjectId: 'xyz-123', | ||
}, | ||
], | ||
@@ -134,2 +153,3 @@ }; | ||
}, | ||
{ type: 'text', value: 'Image xyz-123' }, | ||
], | ||
@@ -136,0 +156,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
898412
21864