@spinajs/intl-orm 2.0.180 → 2.0.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/decorators.d.ts +1 -1
- package/lib/cjs/decorators.js +18 -18
- package/lib/cjs/index.d.ts +61 -61
- package/lib/cjs/index.js +215 -215
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/migrations/IntlOrm_2022_06_28_01_13_00.d.ts +5 -5
- package/lib/cjs/migrations/IntlOrm_2022_06_28_01_13_00.js +37 -37
- package/lib/cjs/migrations/IntlOrm_2022_06_28_01_13_00.js.map +1 -1
- package/lib/cjs/model.d.ts +12 -12
- package/lib/cjs/model.js +70 -70
- package/lib/cjs/models/IntlResource.d.ts +13 -13
- package/lib/cjs/models/IntlResource.js +22 -22
- package/lib/cjs/models/IntlResource.js.map +1 -1
- package/lib/cjs/models/IntlTranslation.d.ts +12 -12
- package/lib/cjs/models/IntlTranslation.js +29 -29
- package/lib/cjs/models/IntlTranslation.js.map +1 -1
- package/lib/mjs/decorators.d.ts +1 -1
- package/lib/mjs/decorators.js +14 -14
- package/lib/mjs/index.d.ts +61 -61
- package/lib/mjs/index.js +194 -194
- package/lib/mjs/index.js.map +1 -1
- package/lib/mjs/migrations/IntlOrm_2022_06_28_01_13_00.d.ts +5 -5
- package/lib/mjs/migrations/IntlOrm_2022_06_28_01_13_00.js +34 -34
- package/lib/mjs/migrations/IntlOrm_2022_06_28_01_13_00.js.map +1 -1
- package/lib/mjs/model.d.ts +12 -12
- package/lib/mjs/model.js +63 -63
- package/lib/mjs/models/IntlResource.d.ts +13 -13
- package/lib/mjs/models/IntlResource.js +19 -19
- package/lib/mjs/models/IntlResource.js.map +1 -1
- package/lib/mjs/models/IntlTranslation.d.ts +12 -12
- package/lib/mjs/models/IntlTranslation.js +26 -26
- package/lib/mjs/models/IntlTranslation.js.map +1 -1
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/tsconfig.mjs.tsbuildinfo +1 -1
- package/package.json +9 -9
package/lib/mjs/index.js
CHANGED
|
@@ -1,195 +1,195 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
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;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { Container, DI, Inject, Injectable, NewInstance } from '@spinajs/di';
|
|
11
|
-
import { SelectQueryBuilder as SQB, extractModelDescriptor, Orm, OrmRelation, RelationType, QueryMiddleware, BelongsToRelation } from '@spinajs/orm';
|
|
12
|
-
import { TranslationSource, guessLanguage, defaultLanguage } from '@spinajs/intl';
|
|
13
|
-
import _ from 'lodash';
|
|
14
|
-
import { IntlTranslation } from './models/IntlTranslation.js';
|
|
15
|
-
import { IntlResource } from './models/IntlResource.js';
|
|
16
|
-
import { Configuration } from '@spinajs/configuration-common';
|
|
17
|
-
import { AsyncLocalStorage } from 'async_hooks';
|
|
18
|
-
export * from './decorators.js';
|
|
19
|
-
export * from './migrations/IntlOrm_2022_06_28_01_13_00.js';
|
|
20
|
-
export * from './models/IntlResource.js';
|
|
21
|
-
export * from './models/IntlTranslation.js';
|
|
22
|
-
export * from './model.js';
|
|
23
|
-
let IntlModelRelation = class IntlModelRelation extends OrmRelation {
|
|
24
|
-
constructor(_container, _lang, _query, _mDescriptor, _parentRelation) {
|
|
25
|
-
super(_container, _query, {
|
|
26
|
-
TargetModel: IntlResource,
|
|
27
|
-
TargetModelType: IntlResource,
|
|
28
|
-
Name: 'Translations',
|
|
29
|
-
Type: RelationType.Many,
|
|
30
|
-
SourceModel: null,
|
|
31
|
-
ForeignKey: '',
|
|
32
|
-
PrimaryKey: '',
|
|
33
|
-
Recursive: false,
|
|
34
|
-
}, _parentRelation);
|
|
35
|
-
this._lang = _lang;
|
|
36
|
-
this._mDescriptor = _mDescriptor;
|
|
37
|
-
this._relationQuery.from('intl_resources', this.Alias);
|
|
38
|
-
}
|
|
39
|
-
execute() {
|
|
40
|
-
this._query.middleware(new IntlModelMiddleware(this._lang, this._relationQuery, this._mDescriptor, this.parentRelation));
|
|
41
|
-
}
|
|
42
|
-
translate(_lang) {
|
|
43
|
-
// empty, cannot translate translation relation!
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
IntlModelRelation = __decorate([
|
|
47
|
-
NewInstance(),
|
|
48
|
-
Inject(Container),
|
|
49
|
-
__metadata("design:paramtypes", [Container, String, Object, Object, OrmRelation])
|
|
50
|
-
], IntlModelRelation);
|
|
51
|
-
export { IntlModelRelation };
|
|
52
|
-
export class IntlModelMiddleware {
|
|
53
|
-
constructor(_lang, _relationQuery, _description, _owner) {
|
|
54
|
-
this._lang = _lang;
|
|
55
|
-
this._relationQuery = _relationQuery;
|
|
56
|
-
this._description = _description;
|
|
57
|
-
this._owner = _owner;
|
|
58
|
-
}
|
|
59
|
-
afterQueryCreation(_query) { }
|
|
60
|
-
afterQuery(data) {
|
|
61
|
-
return data;
|
|
62
|
-
}
|
|
63
|
-
modelCreation(_) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
async afterHydration(data) {
|
|
67
|
-
const self = this;
|
|
68
|
-
const pks = data.map((d) => {
|
|
69
|
-
// do this as one pass
|
|
70
|
-
return d[this._description.PrimaryKey];
|
|
71
|
-
});
|
|
72
|
-
const hydrateMiddleware = {
|
|
73
|
-
afterQuery(data) {
|
|
74
|
-
return data;
|
|
75
|
-
},
|
|
76
|
-
modelCreation() {
|
|
77
|
-
return null;
|
|
78
|
-
},
|
|
79
|
-
async afterHydration(relationData) {
|
|
80
|
-
data.forEach((d) => {
|
|
81
|
-
let val = d;
|
|
82
|
-
const relData = relationData.filter((rd) => {
|
|
83
|
-
return rd['ResourceId'] === val[self._description.PrimaryKey];
|
|
84
|
-
});
|
|
85
|
-
relData.forEach((rd) => {
|
|
86
|
-
if (self._owner && self._owner instanceof BelongsToRelation) {
|
|
87
|
-
val[rd.Column] = rd.Value;
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
d[rd.Column] = rd.Value;
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
val.setLanguage(self._lang);
|
|
94
|
-
});
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
if (pks.length !== 0) {
|
|
98
|
-
this._relationQuery.whereIn('ResourceId', pks);
|
|
99
|
-
this._relationQuery.where('Resource', this._description.Name);
|
|
100
|
-
this._relationQuery.where('Lang', this._lang);
|
|
101
|
-
this._relationQuery.middleware(hydrateMiddleware);
|
|
102
|
-
return await this._relationQuery;
|
|
103
|
-
}
|
|
104
|
-
return [];
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
SQB.prototype['translate'] = function (lang) {
|
|
108
|
-
/**
|
|
109
|
-
* Cannot translate query that cames from translation middleware !
|
|
110
|
-
*/
|
|
111
|
-
if (this.Owner !== null && this.Owner instanceof IntlModelRelation) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (!this.Model) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
this.translated = true;
|
|
118
|
-
const descriptor = extractModelDescriptor(this._model);
|
|
119
|
-
const relInstance = this._container.resolve(IntlModelRelation, [lang, this._container.get(Orm), this, descriptor, this._owner]);
|
|
120
|
-
relInstance.execute();
|
|
121
|
-
// translate all other relations automatically
|
|
122
|
-
this._relations.forEach((r) => {
|
|
123
|
-
r.executeOnQuery(function () {
|
|
124
|
-
this.translate(lang);
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
this._relations.push(relInstance);
|
|
128
|
-
return this;
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* Middleware for automatic query translations
|
|
132
|
-
* for modes. If query is standalone ( not created by model related function )
|
|
133
|
-
* skips translation completely.
|
|
134
|
-
* When AsyncStorage is set & language property is present
|
|
135
|
-
*
|
|
136
|
-
*/
|
|
137
|
-
let IntlQueryMiddleware = class IntlQueryMiddleware extends QueryMiddleware {
|
|
138
|
-
beforeQueryExecution(builder) {
|
|
139
|
-
// if we dont have configuration module
|
|
140
|
-
// we cannot guess default language
|
|
141
|
-
// so skip trying to translate
|
|
142
|
-
if (!DI.has(Configuration)) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
// if async storage is avaible ( node env)
|
|
146
|
-
// on browser and electron skip this, as we dont have async storage
|
|
147
|
-
if (typeof AsyncLocalStorage === 'function') {
|
|
148
|
-
// if something has set to no translate
|
|
149
|
-
// eg route decorator
|
|
150
|
-
const store = DI.get(AsyncLocalStorage);
|
|
151
|
-
if (store && store.noTranslate === false) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
// something has set to not translate manually for query
|
|
156
|
-
if (builder.AllowTranslate === false) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
// finaly, if its not query for model
|
|
160
|
-
if (!builder.Model) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
// and translate only selects
|
|
164
|
-
if (builder instanceof SQB && !builder.translated) {
|
|
165
|
-
const lang = guessLanguage();
|
|
166
|
-
const dLang = defaultLanguage();
|
|
167
|
-
// if we requested non-default language ?
|
|
168
|
-
// if not we should translate
|
|
169
|
-
if (lang && dLang !== lang) {
|
|
170
|
-
builder.translate(lang);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
afterQueryCreation(_builder) { }
|
|
175
|
-
};
|
|
176
|
-
IntlQueryMiddleware = __decorate([
|
|
177
|
-
Injectable(QueryMiddleware)
|
|
178
|
-
], IntlQueryMiddleware);
|
|
179
|
-
export { IntlQueryMiddleware };
|
|
180
|
-
let DbTranslationSource = class DbTranslationSource extends TranslationSource {
|
|
181
|
-
async load() {
|
|
182
|
-
const translations = await IntlTranslation.all();
|
|
183
|
-
return _.mapValues(_.groupBy(translations, 'Lang'), (t) => {
|
|
184
|
-
const vals = t.map((tt) => {
|
|
185
|
-
return { [tt.Key]: tt.Value };
|
|
186
|
-
});
|
|
187
|
-
return _.assign.apply(_, vals);
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
DbTranslationSource = __decorate([
|
|
192
|
-
Injectable(TranslationSource)
|
|
193
|
-
], DbTranslationSource);
|
|
194
|
-
export { DbTranslationSource };
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Container, DI, Inject, Injectable, NewInstance } from '@spinajs/di';
|
|
11
|
+
import { SelectQueryBuilder as SQB, extractModelDescriptor, Orm, OrmRelation, RelationType, QueryMiddleware, BelongsToRelation } from '@spinajs/orm';
|
|
12
|
+
import { TranslationSource, guessLanguage, defaultLanguage } from '@spinajs/intl';
|
|
13
|
+
import _ from 'lodash';
|
|
14
|
+
import { IntlTranslation } from './models/IntlTranslation.js';
|
|
15
|
+
import { IntlResource } from './models/IntlResource.js';
|
|
16
|
+
import { Configuration } from '@spinajs/configuration-common';
|
|
17
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
18
|
+
export * from './decorators.js';
|
|
19
|
+
export * from './migrations/IntlOrm_2022_06_28_01_13_00.js';
|
|
20
|
+
export * from './models/IntlResource.js';
|
|
21
|
+
export * from './models/IntlTranslation.js';
|
|
22
|
+
export * from './model.js';
|
|
23
|
+
let IntlModelRelation = class IntlModelRelation extends OrmRelation {
|
|
24
|
+
constructor(_container, _lang, _query, _mDescriptor, _parentRelation) {
|
|
25
|
+
super(_container, _query, {
|
|
26
|
+
TargetModel: IntlResource,
|
|
27
|
+
TargetModelType: IntlResource,
|
|
28
|
+
Name: 'Translations',
|
|
29
|
+
Type: RelationType.Many,
|
|
30
|
+
SourceModel: null,
|
|
31
|
+
ForeignKey: '',
|
|
32
|
+
PrimaryKey: '',
|
|
33
|
+
Recursive: false,
|
|
34
|
+
}, _parentRelation);
|
|
35
|
+
this._lang = _lang;
|
|
36
|
+
this._mDescriptor = _mDescriptor;
|
|
37
|
+
this._relationQuery.from('intl_resources', this.Alias);
|
|
38
|
+
}
|
|
39
|
+
execute() {
|
|
40
|
+
this._query.middleware(new IntlModelMiddleware(this._lang, this._relationQuery, this._mDescriptor, this.parentRelation));
|
|
41
|
+
}
|
|
42
|
+
translate(_lang) {
|
|
43
|
+
// empty, cannot translate translation relation!
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
IntlModelRelation = __decorate([
|
|
47
|
+
NewInstance(),
|
|
48
|
+
Inject(Container),
|
|
49
|
+
__metadata("design:paramtypes", [Container, String, Object, Object, OrmRelation])
|
|
50
|
+
], IntlModelRelation);
|
|
51
|
+
export { IntlModelRelation };
|
|
52
|
+
export class IntlModelMiddleware {
|
|
53
|
+
constructor(_lang, _relationQuery, _description, _owner) {
|
|
54
|
+
this._lang = _lang;
|
|
55
|
+
this._relationQuery = _relationQuery;
|
|
56
|
+
this._description = _description;
|
|
57
|
+
this._owner = _owner;
|
|
58
|
+
}
|
|
59
|
+
afterQueryCreation(_query) { }
|
|
60
|
+
afterQuery(data) {
|
|
61
|
+
return data;
|
|
62
|
+
}
|
|
63
|
+
modelCreation(_) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
async afterHydration(data) {
|
|
67
|
+
const self = this;
|
|
68
|
+
const pks = data.map((d) => {
|
|
69
|
+
// do this as one pass
|
|
70
|
+
return d[this._description.PrimaryKey];
|
|
71
|
+
});
|
|
72
|
+
const hydrateMiddleware = {
|
|
73
|
+
afterQuery(data) {
|
|
74
|
+
return data;
|
|
75
|
+
},
|
|
76
|
+
modelCreation() {
|
|
77
|
+
return null;
|
|
78
|
+
},
|
|
79
|
+
async afterHydration(relationData) {
|
|
80
|
+
data.forEach((d) => {
|
|
81
|
+
let val = d;
|
|
82
|
+
const relData = relationData.filter((rd) => {
|
|
83
|
+
return rd['ResourceId'] === val[self._description.PrimaryKey];
|
|
84
|
+
});
|
|
85
|
+
relData.forEach((rd) => {
|
|
86
|
+
if (self._owner && self._owner instanceof BelongsToRelation) {
|
|
87
|
+
val[rd.Column] = rd.Value;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
d[rd.Column] = rd.Value;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
val.setLanguage(self._lang);
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
if (pks.length !== 0) {
|
|
98
|
+
this._relationQuery.whereIn('ResourceId', pks);
|
|
99
|
+
this._relationQuery.where('Resource', this._description.Name);
|
|
100
|
+
this._relationQuery.where('Lang', this._lang);
|
|
101
|
+
this._relationQuery.middleware(hydrateMiddleware);
|
|
102
|
+
return await this._relationQuery;
|
|
103
|
+
}
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
SQB.prototype['translate'] = function (lang) {
|
|
108
|
+
/**
|
|
109
|
+
* Cannot translate query that cames from translation middleware !
|
|
110
|
+
*/
|
|
111
|
+
if (this.Owner !== null && this.Owner instanceof IntlModelRelation) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (!this.Model) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
this.translated = true;
|
|
118
|
+
const descriptor = extractModelDescriptor(this._model);
|
|
119
|
+
const relInstance = this._container.resolve(IntlModelRelation, [lang, this._container.get(Orm), this, descriptor, this._owner]);
|
|
120
|
+
relInstance.execute();
|
|
121
|
+
// translate all other relations automatically
|
|
122
|
+
this._relations.forEach((r) => {
|
|
123
|
+
r.executeOnQuery(function () {
|
|
124
|
+
this.translate(lang);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
this._relations.push(relInstance);
|
|
128
|
+
return this;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Middleware for automatic query translations
|
|
132
|
+
* for modes. If query is standalone ( not created by model related function )
|
|
133
|
+
* skips translation completely.
|
|
134
|
+
* When AsyncStorage is set & language property is present
|
|
135
|
+
*
|
|
136
|
+
*/
|
|
137
|
+
let IntlQueryMiddleware = class IntlQueryMiddleware extends QueryMiddleware {
|
|
138
|
+
beforeQueryExecution(builder) {
|
|
139
|
+
// if we dont have configuration module
|
|
140
|
+
// we cannot guess default language
|
|
141
|
+
// so skip trying to translate
|
|
142
|
+
if (!DI.has(Configuration)) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
// if async storage is avaible ( node env)
|
|
146
|
+
// on browser and electron skip this, as we dont have async storage
|
|
147
|
+
if (typeof AsyncLocalStorage === 'function') {
|
|
148
|
+
// if something has set to no translate
|
|
149
|
+
// eg route decorator
|
|
150
|
+
const store = DI.get(AsyncLocalStorage);
|
|
151
|
+
if (store && store.noTranslate === false) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// something has set to not translate manually for query
|
|
156
|
+
if (builder.AllowTranslate === false) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
// finaly, if its not query for model
|
|
160
|
+
if (!builder.Model) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
// and translate only selects
|
|
164
|
+
if (builder instanceof SQB && !builder.translated) {
|
|
165
|
+
const lang = guessLanguage();
|
|
166
|
+
const dLang = defaultLanguage();
|
|
167
|
+
// if we requested non-default language ?
|
|
168
|
+
// if not we should translate
|
|
169
|
+
if (lang && dLang !== lang) {
|
|
170
|
+
builder.translate(lang);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
afterQueryCreation(_builder) { }
|
|
175
|
+
};
|
|
176
|
+
IntlQueryMiddleware = __decorate([
|
|
177
|
+
Injectable(QueryMiddleware)
|
|
178
|
+
], IntlQueryMiddleware);
|
|
179
|
+
export { IntlQueryMiddleware };
|
|
180
|
+
let DbTranslationSource = class DbTranslationSource extends TranslationSource {
|
|
181
|
+
async load() {
|
|
182
|
+
const translations = await IntlTranslation.all();
|
|
183
|
+
return _.mapValues(_.groupBy(translations, 'Lang'), (t) => {
|
|
184
|
+
const vals = t.map((tt) => {
|
|
185
|
+
return { [tt.Key]: tt.Value };
|
|
186
|
+
});
|
|
187
|
+
return _.assign.apply(_, vals);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
DbTranslationSource = __decorate([
|
|
192
|
+
Injectable(TranslationSource)
|
|
193
|
+
], DbTranslationSource);
|
|
194
|
+
export { DbTranslationSource };
|
|
195
195
|
//# sourceMappingURL=index.js.map
|
package/lib/mjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EA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AAC,GAAG,EAAE,CAAC;QAEjD,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;YACxD,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;gBACxB,OAAO,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAZY,mBAAmB;IAD/B,UAAU,CAAC,iBAAiB,CAAC;GACjB,mBAAmB,CAY/B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OrmMigration, OrmDriver } from '@spinajs/orm';
|
|
2
|
-
export declare class IntlOrm_2022_06_28_01_13_00 extends OrmMigration {
|
|
3
|
-
up(connection: OrmDriver): Promise<void>;
|
|
4
|
-
down(_connection: OrmDriver): Promise<void>;
|
|
5
|
-
}
|
|
1
|
+
import { OrmMigration, OrmDriver } from '@spinajs/orm';
|
|
2
|
+
export declare class IntlOrm_2022_06_28_01_13_00 extends OrmMigration {
|
|
3
|
+
up(connection: OrmDriver): Promise<void>;
|
|
4
|
+
down(_connection: OrmDriver): Promise<void>;
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=IntlOrm_2022_06_28_01_13_00.d.ts.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
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;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
8
|
-
import { OrmMigration, Migration } from '@spinajs/orm';
|
|
9
|
-
let IntlOrm_2022_06_28_01_13_00 = class IntlOrm_2022_06_28_01_13_00 extends OrmMigration {
|
|
10
|
-
async up(connection) {
|
|
11
|
-
await connection.schema().createTable('intl_resources', (table) => {
|
|
12
|
-
table.int('ResourceId').notNull();
|
|
13
|
-
table.string('Resource', 32).notNull();
|
|
14
|
-
table.string('Column', 16).notNull();
|
|
15
|
-
table.string('Lang', 6).notNull();
|
|
16
|
-
table.text('Value');
|
|
17
|
-
});
|
|
18
|
-
await connection.schema().createTable('intl_translations', (table) => {
|
|
19
|
-
table.int('Id').primaryKey().autoIncrement();
|
|
20
|
-
table.string('Key', 32).notNull();
|
|
21
|
-
table.text('Value');
|
|
22
|
-
table.string('Lang', 6).notNull();
|
|
23
|
-
});
|
|
24
|
-
await connection.index().unique().table('intl_resources').name('intl_resources_idx').columns(['ResourceId', 'Resource', 'Column', 'Lang']);
|
|
25
|
-
await connection.index().unique().table('intl_translations').name('intl_translations_idx').columns(['Key', 'Lang']);
|
|
26
|
-
}
|
|
27
|
-
// tslint:disable-next-line: no-empty
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
29
|
-
async down(_connection) { }
|
|
30
|
-
};
|
|
31
|
-
IntlOrm_2022_06_28_01_13_00 = __decorate([
|
|
32
|
-
Migration('default')
|
|
33
|
-
], IntlOrm_2022_06_28_01_13_00);
|
|
34
|
-
export { IntlOrm_2022_06_28_01_13_00 };
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
8
|
+
import { OrmMigration, Migration } from '@spinajs/orm';
|
|
9
|
+
let IntlOrm_2022_06_28_01_13_00 = class IntlOrm_2022_06_28_01_13_00 extends OrmMigration {
|
|
10
|
+
async up(connection) {
|
|
11
|
+
await connection.schema().createTable('intl_resources', (table) => {
|
|
12
|
+
table.int('ResourceId').notNull();
|
|
13
|
+
table.string('Resource', 32).notNull();
|
|
14
|
+
table.string('Column', 16).notNull();
|
|
15
|
+
table.string('Lang', 6).notNull();
|
|
16
|
+
table.text('Value');
|
|
17
|
+
});
|
|
18
|
+
await connection.schema().createTable('intl_translations', (table) => {
|
|
19
|
+
table.int('Id').primaryKey().autoIncrement();
|
|
20
|
+
table.string('Key', 32).notNull();
|
|
21
|
+
table.text('Value');
|
|
22
|
+
table.string('Lang', 6).notNull();
|
|
23
|
+
});
|
|
24
|
+
await connection.index().unique().table('intl_resources').name('intl_resources_idx').columns(['ResourceId', 'Resource', 'Column', 'Lang']);
|
|
25
|
+
await connection.index().unique().table('intl_translations').name('intl_translations_idx').columns(['Key', 'Lang']);
|
|
26
|
+
}
|
|
27
|
+
// tslint:disable-next-line: no-empty
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
29
|
+
async down(_connection) { }
|
|
30
|
+
};
|
|
31
|
+
IntlOrm_2022_06_28_01_13_00 = __decorate([
|
|
32
|
+
Migration('default')
|
|
33
|
+
], IntlOrm_2022_06_28_01_13_00);
|
|
34
|
+
export { IntlOrm_2022_06_28_01_13_00 };
|
|
35
35
|
//# sourceMappingURL=IntlOrm_2022_06_28_01_13_00.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlOrm_2022_06_28_01_13_00.js","sourceRoot":"","sources":["../../../src/migrations/IntlOrm_2022_06_28_01_13_00.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAsD;AACtD,OAAO,EAAE,YAAY,EAAa,SAAS,EAAE,MAAM,cAAc,CAAC;AAG3D,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,YAAY;IACpD,KAAK,CAAC,EAAE,CAAC,UAAqB;QACnC,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,EAAE;YAChE,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YAClC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;YACvC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;YACrC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;YACnE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC,aAAa,EAAE,CAAC;YAC7C,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACpB,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACpC,CAAC,CAAC,CAA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O,EAAE,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;YACnE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC,aAAa,EAAE,CAAC;YAC7C,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACpB,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;QAC3I,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACtH,CAAC;IAED,qCAAqC;IACrC,gEAAgE;IACzD,KAAK,CAAC,IAAI,CAAC,WAAsB,IAAkB,CAAC;CAC5D,CAAA;AAxBY,2BAA2B;IADvC,SAAS,CAAC,SAAS,CAAC;GACR,2BAA2B,CAwBvC"}
|
package/lib/mjs/model.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ModelBase } from '@spinajs/orm';
|
|
2
|
-
export declare class Translatable extends ModelBase {
|
|
3
|
-
protected Language: string;
|
|
4
|
-
/**
|
|
5
|
-
* Reloads entity with proper translation
|
|
6
|
-
*
|
|
7
|
-
* @param lang - language to load
|
|
8
|
-
*/
|
|
9
|
-
translate(lang?: string): Promise<void>;
|
|
10
|
-
setLanguage(lang: string): void;
|
|
11
|
-
update(): Promise<void>;
|
|
12
|
-
}
|
|
1
|
+
import { ModelBase } from '@spinajs/orm';
|
|
2
|
+
export declare class Translatable extends ModelBase {
|
|
3
|
+
protected Language: string;
|
|
4
|
+
/**
|
|
5
|
+
* Reloads entity with proper translation
|
|
6
|
+
*
|
|
7
|
+
* @param lang - language to load
|
|
8
|
+
*/
|
|
9
|
+
translate(lang?: string): Promise<void>;
|
|
10
|
+
setLanguage(lang: string): void;
|
|
11
|
+
update(): Promise<void>;
|
|
12
|
+
}
|
|
13
13
|
//# sourceMappingURL=model.d.ts.map
|