"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImportBundleBuilder = void 0;
class ImportBundleBuilder {
    static setDsnpUserId(dsnpUserId) {
        ImportBundleBuilder.dsnpUserId = dsnpUserId;
        return this;
    }
    static setSchemaId(schemaId) {
        ImportBundleBuilder.schemaId = schemaId;
        return this;
    }
    static addGraphKeyPair(keyType, publicKey, secretKey) {
        if (!ImportBundleBuilder.keyPairs) {
            ImportBundleBuilder.keyPairs = [];
        }
        ImportBundleBuilder.keyPairs.push({ keyType, publicKey, secretKey });
        return this;
    }
    static setDsnpKeys(dsnpKeys) {
        ImportBundleBuilder.dsnpKeys = dsnpKeys;
        return this;
    }
    static addPageData(pageId, content, contentHash) {
        if (!ImportBundleBuilder.pages) {
            ImportBundleBuilder.pages = [];
        }
        ImportBundleBuilder.pages.push({ pageId, content, contentHash });
        return this;
    }
    static build() {
        const importBundle = {
            dsnpUserId: ImportBundleBuilder.dsnpUserId,
            schemaId: ImportBundleBuilder.schemaId,
            keyPairs: ImportBundleBuilder.keyPairs,
            dsnpKeys: ImportBundleBuilder.dsnpKeys,
            pages: ImportBundleBuilder.pages,
        };
        // Reset the static properties for the next build
        ImportBundleBuilder.dsnpUserId = '';
        ImportBundleBuilder.schemaId = 0;
        ImportBundleBuilder.keyPairs = [];
        ImportBundleBuilder.dsnpKeys = { dsnpUserId: '', keysHash: 0, keys: [] };
        ImportBundleBuilder.pages = [];
        return importBundle;
    }
}
exports.ImportBundleBuilder = ImportBundleBuilder;
//# sourceMappingURL=import-bundle-builder.js.map