1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | "use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); const snconfigbehavior_1 = require("./snconfigbehavior"); const snconfigfielddecorator_1 = require("./snconfigfielddecorator"); class SnConfigModel { constructor(config) { this.RepositoryUrl = SnConfigModel.DEFAULT_BASE_URL; this.ODataToken = SnConfigModel.DEFAULT_SERVICE_TOKEN; this.JwtTokenKeyTemplate = 'sn-${siteName}-${tokenName}'; this.JwtTokenPersist = 'session'; this.DefaultSelect = ['DisplayName', 'Description', 'Icon']; this.RequiredSelect = ['Id', 'Path', 'Name', 'Type']; this.DefaultMetadata = 'no'; this.DefaultInlineCount = 'allpages'; this.DefaultExpand = undefined; this.DefaultTop = 1000; this.ChunkSize = 10485760; if (config) { for (const key in config) { if (config[key]) { this[key] = config[key]; } } } } static get DEFAULT_BASE_URL() { if (typeof window !== 'undefined') { return (window && window.location && window.location.origin) || ''; } return ''; } } SnConfigModel.DEFAULT_SERVICE_TOKEN = 'odata.svc'; __decorate([ snconfigfielddecorator_1.SnConfigField({ Behavior: snconfigbehavior_1.SnConfigBehavior.AllowFromConfig | snconfigbehavior_1.SnConfigBehavior.AllowFromCommandLine, FieldDescription: 'URL to the repository (e.g.: demo.sensenet.com)', Question: 'Please enter your Sense/Net Site URL(e.g.:demo.sensenet.com):', }), __metadata("design:type", String) ], SnConfigModel.prototype, "RepositoryUrl", void 0); __decorate([ snconfigfielddecorator_1.SnConfigField({ Behavior: snconfigbehavior_1.SnConfigBehavior.AllowFromConfig | snconfigbehavior_1.SnConfigBehavior.AllowFromCommandLine, FieldDescription: 'The service token for the OData Endpoint', Question: 'Please enter your Sense/Net Site URL(e.g.:demo.sensenet.com):', }), __metadata("design:type", String) ], SnConfigModel.prototype, "ODataToken", void 0); __decorate([ snconfigfielddecorator_1.SnConfigField({ Behavior: snconfigbehavior_1.SnConfigBehavior.AllowFromConfig, FieldDescription: 'Template will be stored in that format', Question: 'Please specify the template format for the key of the JWT Web Token in the localStorage (e.g.: sn-${siteName}-${tokenName})' }), __metadata("design:type", String) ], SnConfigModel.prototype, "JwtTokenKeyTemplate", void 0); __decorate([ snconfigfielddecorator_1.SnConfigField({ Behavior: snconfigbehavior_1.SnConfigBehavior.AllowFromConfig, FieldDescription: 'The behavoir how long the JWT tokens should be persisted, can be "session" or "expiration"', Question: '' }), __metadata("design:type", String) ], SnConfigModel.prototype, "JwtTokenPersist", void 0); __decorate([ snconfigfielddecorator_1.SnConfigField({ Behavior: snconfigbehavior_1.SnConfigBehavior.AllowFromConfig, FieldDescription: 'The default values to select when triggering an OData Action', Question: '' }), __metadata("design:type", Object) ], SnConfigModel.prototype, "DefaultSelect", void 0); __decorate([ snconfigfielddecorator_1.SnConfigField({ Behavior: snconfigbehavior_1.SnConfigBehavior.AllowFromConfig, FieldDescription: 'The values are required when triggering an OData Action and will be always included in Select statements', Question: '' }), __metadata("design:type", Object) ], SnConfigModel.prototype, "RequiredSelect", void 0); __decorate([ snconfigfielddecorator_1.SnConfigField({ Behavior: snconfigbehavior_1.SnConfigBehavior.AllowFromConfig, FieldDescription: 'The default OData metadata option', Question: '' }), __metadata("design:type", String) ], SnConfigModel.prototype, "DefaultMetadata", void 0); __decorate([ snconfigfielddecorator_1.SnConfigField({ Behavior: snconfigbehavior_1.SnConfigBehavior.AllowFromConfig, FieldDescription: 'The default OData inline count option', Question: '' }), __metadata("design:type", String) ], SnConfigModel.prototype, "DefaultInlineCount", void 0); __decorate([ snconfigfielddecorator_1.SnConfigField({ Behavior: snconfigbehavior_1.SnConfigBehavior.AllowFromConfig, FieldDescription: 'The default OData references to expand', Question: '' }), __metadata("design:type", Object) ], SnConfigModel.prototype, "DefaultExpand", void 0); __decorate([ snconfigfielddecorator_1.SnConfigField({ Behavior: snconfigbehavior_1.SnConfigBehavior.AllowFromConfig, FieldDescription: 'The default OData $top parameter for querying / fetching content', Question: '' }), __metadata("design:type", Number) ], SnConfigModel.prototype, "DefaultTop", void 0); __decorate([ snconfigfielddecorator_1.SnConfigField({ Behavior: snconfigbehavior_1.SnConfigBehavior.AllowFromConfig, FieldDescription: 'Chunk size for chunked uploads, must be equal to BinaryChunkSize setting at the backend', Question: '' }), __metadata("design:type", Number) ], SnConfigModel.prototype, "ChunkSize", void 0); exports.SnConfigModel = SnConfigModel; //# sourceMappingURL=snconfigmodel.js.map |