UNPKG

delta-store

Version:
102 lines 4.46 kB
"use strict"; var PlatformType; (function (PlatformType) { PlatformType[PlatformType["GOOGLE_DOCS"] = 0] = "GOOGLE_DOCS"; PlatformType[PlatformType["IN_MEMORY"] = 1] = "IN_MEMORY"; PlatformType[PlatformType["OFFLINE"] = 2] = "OFFLINE"; PlatformType[PlatformType["STUB"] = 3] = "STUB"; })(PlatformType = exports.PlatformType || (exports.PlatformType = {})); var deltaStore; (function (deltaStore) { var platform; (function (platform) { platform.GOOGLE = 'GOOGLE'; platform.IN_MEMORY = 'IN_MEMORY'; platform.STUB = 'STUB'; function getName(platformType) { switch (platformType) { case PlatformType.GOOGLE_DOCS: return platform.GOOGLE; case PlatformType.IN_MEMORY: return platform.IN_MEMORY; case PlatformType.STUB: return platform.STUB; default: throw "Unsupported Platform Type: " + deltaStore.distributionStrategy; } } platform.getName = getName; function getValue(platformTypeName) { switch (platformTypeName) { case platform.GOOGLE: return PlatformType.GOOGLE_DOCS; case platform.IN_MEMORY: return PlatformType.IN_MEMORY; case platform.STUB: return PlatformType.STUB; default: throw "Unsupported Platform Type name: " + platformTypeName; } } platform.getValue = getValue; })(platform = deltaStore.platform || (deltaStore.platform = {})); })(deltaStore = exports.deltaStore || (exports.deltaStore = {})); /** * Possible distribution strategies for Change List Federations. * * A common (and only currently supported) basic setup: * * There is always a Single Shared Store (S3). * There are always at least one or more 'Personal' Stores. * * The stores communicate via servers that propagate data from * personal stores to the shared store. * * What differs is how this propagation is accomplished. * * In the future, we'll add a truly distributed setup, without any S3s. */ var DistributionStrategy; (function (DistributionStrategy) { /** * The server is aware of all Personal Stores and it * subscribes to any possible changes in any of these stores. * It is the server's responsibility to update the S3. */ DistributionStrategy[DistributionStrategy["S3_SECURE_POLL"] = 0] = "S3_SECURE_POLL"; /** * There is no need for a server, all clients are aware of S3 * and are responsible for pushing their changes to it. */ DistributionStrategy[DistributionStrategy["S3_DISTIBUTED_PUSH"] = 1] = "S3_DISTIBUTED_PUSH"; })(DistributionStrategy = exports.DistributionStrategy || (exports.DistributionStrategy = {})); (function (deltaStore) { var distributionStrategy; (function (distributionStrategy_1) { distributionStrategy_1.S3_DISTRIBUTED_PUSH = 'S3_DISTRIBUTED_PUSH'; distributionStrategy_1.S3_SECURE_POLL = 'S3_SECURE_POLL'; function getName(distributionStrategy) { switch (distributionStrategy) { case DistributionStrategy.S3_DISTIBUTED_PUSH: return distributionStrategy_1.S3_DISTRIBUTED_PUSH; case DistributionStrategy.S3_SECURE_POLL: return distributionStrategy_1.S3_SECURE_POLL; default: throw "Unsupported Distribution Strategy: " + distributionStrategy; } } distributionStrategy_1.getName = getName; function getValue(distributionStrategyName) { switch (distributionStrategyName) { case distributionStrategy_1.S3_DISTRIBUTED_PUSH: return DistributionStrategy.S3_DISTIBUTED_PUSH; case distributionStrategy_1.S3_SECURE_POLL: return DistributionStrategy.S3_SECURE_POLL; default: throw "Unsupported Distribution Strategy name: " + distributionStrategyName; } } distributionStrategy_1.getValue = getValue; })(distributionStrategy = deltaStore.distributionStrategy || (deltaStore.distributionStrategy = {})); })(deltaStore = exports.deltaStore || (exports.deltaStore = {})); //# sourceMappingURL=SharingAdaptor.js.map