diff --git a/index.d.ts b/index.d.ts index 1bad834..49d9600 100644 --- a/index.d.ts +++ b/index.d.ts @@ -46,6 +46,11 @@ export interface SyncResult { total_count: number; } +interface ReleasePreview { + release_id: string; + preview_timestamp: string; +} + // Contentstack Config export interface Config { api_key: string; @@ -56,7 +61,8 @@ export interface Config { live_preview?: LivePreview; plugins?: ContentstackPlugin[]; fetchOptions?: FetchOptions; - early_access?: string[] + early_access?: string[]; + release_preview?: ReleasePreview; } // Stack Config export interface StackConfig { diff --git a/src/core/stack.js b/src/core/stack.js index 04d7f6c..f287dab 100755 --- a/src/core/stack.js +++ b/src/core/stack.js @@ -69,7 +69,7 @@ export default class Stack { } }; this.config = JSON.parse(JSON.stringify(config)); - this.plugins = [] + this.plugins = []; if (stack_arguments[0].live_preview && stack_arguments[0].live_preview.enable === true && stack_arguments[0].live_preview.management_token !== null) { if (stack_arguments[0].live_preview.management_token) { @@ -118,6 +118,10 @@ export default class Stack { if (typeof stack_arguments[0].early_access == "object" && Array.isArray(stack_arguments[0].early_access) && stack_arguments[0].early_access.length > 0) { this.headers['x-header-ea'] = stack_arguments[0].early_access.join(',') } + if (typeof stack_arguments[0].release_preview == "object" && stack_arguments[0].release_preview !== null && Object.keys(stack_arguments[0].release_preview).length > 0) { + this.headers['release_id'] = stack_arguments[0].release_preview.release_id; + this.headers['preview_timestamp'] = stack_arguments[0].release_preview.preview_timestamp; + } this.environment = stack_arguments[0].environment; return this; } else {