How to use the @hpcc-js/common.Platform.version function in @hpcc-js/common

To help you get started, we’ve selected a few @hpcc-js/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hpcc-systems / Visualization / packages / composite / src / Persist.ts View on Github external
export function create(state: any): Promise {
    if (typeof state === "string") {
        state = JSON.parse(state);
    }
    state = retrofit_114_serialization(state, Platform.version());
    return requireWidget(state.__class).then((WidgetClass: any) => {
        const widget = new WidgetClass();
        if (state.__id && state.__id.indexOf(widget._idSeed) !== 0 && state.__id.indexOf("_pe") !== 0) {
            widget._id = state.__id;
        }
        return deserializeFromObject(widget, state);
    }).catch(function (e) {
        console.log("Persist.create:  ***exception***");
        console.log(e);
    });
}
github hpcc-systems / Visualization / packages / marshaller / src / ddl1 / HipieDDLMixin.ts View on Github external
generateTestPage() {
        if (this._marshaller) {
            const context = this;
            const state = Persist.serialize(context, function (widget, publishItem) {
                if (publishItem.id === "databomb" || publishItem.id === "ddlUrl") {
                    return true;
                }
                return false;
            });
            const databomb = this._marshaller.createDatabomb();
            const page = tpl
                .replace("{VERSION}", Platform.version())
                .replace("{STATE}", state)
                .replace("{DDL}", context._marshaller._json.replace("WUID", "databomb"))
                .replace("{DATABOMB}", JSON.stringify(databomb))
                ;
            Utility.downloadString("TEXT", page, "test");
        }
    }