@infrab4a/connect 4.24.1-beta.0 → 4.24.1-beta.2
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/index.cjs.js +1556 -1522
- package/index.esm.js +1553 -1522
- package/package.json +1 -1
- package/src/domain/catalog/models/product-errors.d.ts +1 -1
- package/src/infra/hasura-graphql/models/product-errors-hasura-graphql.d.ts +4 -1
- package/src/utils/circular-dependencies.d.ts +7 -0
- package/src/utils/index.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -103,1681 +103,1708 @@ class PaymentProviderFactory {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
exports.GenderDestination = void 0;
|
|
130
|
-
(function (GenderDestination) {
|
|
131
|
-
GenderDestination["FEMALE"] = "female";
|
|
132
|
-
GenderDestination["MALE"] = "male";
|
|
133
|
-
GenderDestination["UNISEX"] = "unisex";
|
|
134
|
-
})(exports.GenderDestination || (exports.GenderDestination = {}));
|
|
135
|
-
|
|
136
|
-
exports.ProductLabelEnum = void 0;
|
|
137
|
-
(function (ProductLabelEnum) {
|
|
138
|
-
ProductLabelEnum["ON_SALE"] = "on-sale";
|
|
139
|
-
ProductLabelEnum["OUTLET"] = "outlet";
|
|
140
|
-
ProductLabelEnum["LAST_UNITS"] = "last-units";
|
|
141
|
-
ProductLabelEnum["GLAMSTAR"] = "glamstar";
|
|
142
|
-
})(exports.ProductLabelEnum || (exports.ProductLabelEnum = {}));
|
|
143
|
-
|
|
144
|
-
exports.Shops = void 0;
|
|
145
|
-
(function (Shops) {
|
|
146
|
-
Shops["MENSMARKET"] = "mensmarket";
|
|
147
|
-
Shops["GLAMSHOP"] = "Glamshop";
|
|
148
|
-
Shops["GLAMPOINTS"] = "Glampoints";
|
|
149
|
-
Shops["ALL"] = "ALL";
|
|
150
|
-
})(exports.Shops || (exports.Shops = {}));
|
|
151
|
-
|
|
152
|
-
exports.WishlistLogType = void 0;
|
|
153
|
-
(function (WishlistLogType) {
|
|
154
|
-
WishlistLogType["CREATE"] = "create";
|
|
155
|
-
WishlistLogType["UPDATE"] = "update";
|
|
156
|
-
WishlistLogType["DELETE"] = "delete";
|
|
157
|
-
WishlistLogType["ADD_PRODUCT"] = "add_product";
|
|
158
|
-
WishlistLogType["REMOVE_PRODUCT"] = "remove_product";
|
|
159
|
-
})(exports.WishlistLogType || (exports.WishlistLogType = {}));
|
|
160
|
-
|
|
161
|
-
class Category extends BaseModel {
|
|
162
|
-
static get identifiersFields() {
|
|
163
|
-
return ['id'];
|
|
164
|
-
}
|
|
165
|
-
get glamImages() {
|
|
166
|
-
return this.images && this.images[exports.Shops.GLAMSHOP]
|
|
167
|
-
? this.images[exports.Shops.GLAMSHOP]
|
|
168
|
-
: {
|
|
169
|
-
brandBanner: null,
|
|
170
|
-
brandBannerMobile: null,
|
|
171
|
-
image: null,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
get mensImages() {
|
|
175
|
-
return this.images && this.images[exports.Shops.MENSMARKET]
|
|
176
|
-
? this.images[exports.Shops.MENSMARKET]
|
|
177
|
-
: {
|
|
178
|
-
brandBanner: null,
|
|
179
|
-
brandBannerMobile: null,
|
|
180
|
-
image: null,
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
get glamMetadata() {
|
|
184
|
-
return this.metadatas.find((metadata) => metadata.shop === exports.Shops.GLAMSHOP);
|
|
185
|
-
}
|
|
186
|
-
get mensMetadata() {
|
|
187
|
-
return this.metadatas.find((metadata) => metadata.shop === exports.Shops.MENSMARKET);
|
|
188
|
-
}
|
|
189
|
-
getMostRelevantByShop(shop) {
|
|
190
|
-
return this.mostRelevants && this.mostRelevants[shop] ? this.mostRelevants[shop] : [];
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
tslib.__decorate([
|
|
194
|
-
classTransformer.Type(() => Category),
|
|
195
|
-
tslib.__metadata("design:type", Category)
|
|
196
|
-
], Category.prototype, "parent", void 0);
|
|
197
|
-
tslib.__decorate([
|
|
198
|
-
classTransformer.Type(() => require('./product')['Product']),
|
|
199
|
-
tslib.__metadata("design:type", Array)
|
|
200
|
-
], Category.prototype, "childrenProducts", void 0);
|
|
201
|
-
tslib.__decorate([
|
|
202
|
-
classTransformer.Type(() => require('./filter')['Filter']),
|
|
203
|
-
tslib.__metadata("design:type", Array)
|
|
204
|
-
], Category.prototype, "filters", void 0);
|
|
205
|
-
|
|
206
|
-
class CategoryCollectionChildren extends BaseModel {
|
|
207
|
-
static get identifiersFields() {
|
|
208
|
-
return ['collectionId', 'categoryId'];
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
tslib.__decorate([
|
|
212
|
-
classTransformer.Type(() => CategoryCollectionChildren),
|
|
213
|
-
tslib.__metadata("design:type", CategoryCollectionChildren)
|
|
214
|
-
], CategoryCollectionChildren.prototype, "parent", void 0);
|
|
215
|
-
|
|
216
|
-
class Filter extends BaseModel {
|
|
217
|
-
static get identifiersFields() {
|
|
218
|
-
return ['id'];
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
tslib.__decorate([
|
|
222
|
-
classTransformer.Type(() => Category),
|
|
223
|
-
tslib.__metadata("design:type", Array)
|
|
224
|
-
], Filter.prototype, "categories", void 0);
|
|
225
|
-
|
|
226
|
-
class CategoryFilter extends BaseModel {
|
|
227
|
-
static get identifiersFields() {
|
|
228
|
-
return ['id'];
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
tslib.__decorate([
|
|
232
|
-
classTransformer.Type(() => Filter),
|
|
233
|
-
tslib.__metadata("design:type", Filter)
|
|
234
|
-
], CategoryFilter.prototype, "filter", void 0);
|
|
235
|
-
tslib.__decorate([
|
|
236
|
-
classTransformer.Type(() => Category),
|
|
237
|
-
tslib.__metadata("design:type", Category)
|
|
238
|
-
], CategoryFilter.prototype, "category", void 0);
|
|
239
|
-
|
|
240
|
-
class CategoryProduct extends BaseModel {
|
|
241
|
-
static get identifiersFields() {
|
|
242
|
-
return ['categoryId', 'productId'];
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
class FilterOption extends BaseModel {
|
|
247
|
-
static get identifiersFields() {
|
|
248
|
-
return ['id'];
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
class KitProduct extends BaseModel {
|
|
253
|
-
static get identifiersFields() {
|
|
254
|
-
return ['productId', 'kitProductId'];
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
tslib.__decorate([
|
|
258
|
-
classTransformer.Type(() => require('./product')['Product']),
|
|
259
|
-
tslib.__metadata("design:type", Function)
|
|
260
|
-
], KitProduct.prototype, "kit", void 0);
|
|
261
|
-
tslib.__decorate([
|
|
262
|
-
classTransformer.Type(() => require('./product')['Product']),
|
|
263
|
-
tslib.__metadata("design:type", Function)
|
|
264
|
-
], KitProduct.prototype, "product", void 0);
|
|
265
|
-
|
|
266
|
-
class ProductReview extends BaseModel {
|
|
267
|
-
static get identifiersFields() {
|
|
268
|
-
return ['id'];
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
class ProductBase extends BaseModel {
|
|
273
|
-
get evaluation() {
|
|
274
|
-
return {
|
|
275
|
-
reviews: this.reviews,
|
|
276
|
-
count: this.reviewsTotal,
|
|
277
|
-
rating: this.rate,
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
set evaluation(evaluation) {
|
|
281
|
-
if (!evaluation) {
|
|
282
|
-
this.reviews = null;
|
|
283
|
-
this.reviewsTotal = null;
|
|
284
|
-
this.rate = null;
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
this.reviews = evaluation.reviews || this.reviews;
|
|
288
|
-
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
289
|
-
this.rate = evaluation.rating || this.rate;
|
|
290
|
-
}
|
|
291
|
-
static get identifiersFields() {
|
|
292
|
-
return ['id'];
|
|
293
|
-
}
|
|
106
|
+
/**
|
|
107
|
+
* Este arquivo define funções para resolver dependências circulares
|
|
108
|
+
* em ambiente ESM, onde não podemos usar require()
|
|
109
|
+
*/
|
|
110
|
+
// Armazenamento global para classes registradas
|
|
111
|
+
const registry = new Map();
|
|
112
|
+
// Registrar uma classe na resolução de dependências circulares
|
|
113
|
+
function registerClass(name, classConstructor) {
|
|
114
|
+
registry.set(name, classConstructor);
|
|
115
|
+
}
|
|
116
|
+
// Obter uma classe registrada
|
|
117
|
+
function getClass(name) {
|
|
118
|
+
return registry.get(name);
|
|
119
|
+
}
|
|
120
|
+
// Função de resolução para class-transformer
|
|
121
|
+
function resolveClass(name) {
|
|
122
|
+
return () => {
|
|
123
|
+
// Forçamos o retorno de uma função que retorna a classe
|
|
124
|
+
// ao invés da classe diretamente para evitar problemas com o decorator
|
|
125
|
+
return getClass(name);
|
|
126
|
+
};
|
|
294
127
|
}
|
|
295
|
-
tslib.__decorate([
|
|
296
|
-
classTransformer.Type(() => Category),
|
|
297
|
-
tslib.__metadata("design:type", Category)
|
|
298
|
-
], ProductBase.prototype, "category", void 0);
|
|
299
|
-
tslib.__decorate([
|
|
300
|
-
classTransformer.Type(() => KitProduct),
|
|
301
|
-
tslib.__metadata("design:type", Array)
|
|
302
|
-
], ProductBase.prototype, "kitProducts", void 0);
|
|
303
|
-
tslib.__decorate([
|
|
304
|
-
classTransformer.Type(() => ProductReview),
|
|
305
|
-
tslib.__metadata("design:type", Array)
|
|
306
|
-
], ProductBase.prototype, "reviews", void 0);
|
|
307
128
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
return ['id', 'productId'];
|
|
311
|
-
}
|
|
129
|
+
function isFunction(value) {
|
|
130
|
+
return typeof value === 'function';
|
|
312
131
|
}
|
|
313
132
|
|
|
314
|
-
|
|
133
|
+
function createErrorClass(createImpl) {
|
|
134
|
+
var _super = function (instance) {
|
|
135
|
+
Error.call(instance);
|
|
136
|
+
instance.stack = new Error().stack;
|
|
137
|
+
};
|
|
138
|
+
var ctorFunc = createImpl(_super);
|
|
139
|
+
ctorFunc.prototype = Object.create(Error.prototype);
|
|
140
|
+
ctorFunc.prototype.constructor = ctorFunc;
|
|
141
|
+
return ctorFunc;
|
|
315
142
|
}
|
|
316
|
-
tslib.__decorate([
|
|
317
|
-
classTransformer.Type(() => Variant),
|
|
318
|
-
tslib.__metadata("design:type", Array)
|
|
319
|
-
], Product.prototype, "variants", void 0);
|
|
320
143
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
tslib.__metadata("design:type", Object)
|
|
332
|
-
], ProductErrors.prototype, "product", void 0);
|
|
144
|
+
var UnsubscriptionError = createErrorClass(function (_super) {
|
|
145
|
+
return function UnsubscriptionErrorImpl(errors) {
|
|
146
|
+
_super(this);
|
|
147
|
+
this.message = errors
|
|
148
|
+
? errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ')
|
|
149
|
+
: '';
|
|
150
|
+
this.name = 'UnsubscriptionError';
|
|
151
|
+
this.errors = errors;
|
|
152
|
+
};
|
|
153
|
+
});
|
|
333
154
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
155
|
+
function arrRemove(arr, item) {
|
|
156
|
+
if (arr) {
|
|
157
|
+
var index = arr.indexOf(item);
|
|
158
|
+
0 <= index && arr.splice(index, 1);
|
|
337
159
|
}
|
|
338
160
|
}
|
|
339
161
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
162
|
+
var Subscription$1 = (function () {
|
|
163
|
+
function Subscription(initialTeardown) {
|
|
164
|
+
this.initialTeardown = initialTeardown;
|
|
165
|
+
this.closed = false;
|
|
166
|
+
this._parentage = null;
|
|
167
|
+
this._finalizers = null;
|
|
343
168
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
169
|
+
Subscription.prototype.unsubscribe = function () {
|
|
170
|
+
var e_1, _a, e_2, _b;
|
|
171
|
+
var errors;
|
|
172
|
+
if (!this.closed) {
|
|
173
|
+
this.closed = true;
|
|
174
|
+
var _parentage = this._parentage;
|
|
175
|
+
if (_parentage) {
|
|
176
|
+
this._parentage = null;
|
|
177
|
+
if (Array.isArray(_parentage)) {
|
|
178
|
+
try {
|
|
179
|
+
for (var _parentage_1 = tslib.__values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {
|
|
180
|
+
var parent_1 = _parentage_1_1.value;
|
|
181
|
+
parent_1.remove(this);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
185
|
+
finally {
|
|
186
|
+
try {
|
|
187
|
+
if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);
|
|
188
|
+
}
|
|
189
|
+
finally { if (e_1) throw e_1.error; }
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
_parentage.remove(this);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
var initialFinalizer = this.initialTeardown;
|
|
197
|
+
if (isFunction(initialFinalizer)) {
|
|
198
|
+
try {
|
|
199
|
+
initialFinalizer();
|
|
200
|
+
}
|
|
201
|
+
catch (e) {
|
|
202
|
+
errors = e instanceof UnsubscriptionError ? e.errors : [e];
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
var _finalizers = this._finalizers;
|
|
206
|
+
if (_finalizers) {
|
|
207
|
+
this._finalizers = null;
|
|
208
|
+
try {
|
|
209
|
+
for (var _finalizers_1 = tslib.__values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {
|
|
210
|
+
var finalizer = _finalizers_1_1.value;
|
|
211
|
+
try {
|
|
212
|
+
execFinalizer(finalizer);
|
|
213
|
+
}
|
|
214
|
+
catch (err) {
|
|
215
|
+
errors = errors !== null && errors !== void 0 ? errors : [];
|
|
216
|
+
if (err instanceof UnsubscriptionError) {
|
|
217
|
+
errors = tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(errors)), tslib.__read(err.errors));
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
errors.push(err);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
226
|
+
finally {
|
|
227
|
+
try {
|
|
228
|
+
if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);
|
|
229
|
+
}
|
|
230
|
+
finally { if (e_2) throw e_2.error; }
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (errors) {
|
|
234
|
+
throw new UnsubscriptionError(errors);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
Subscription.prototype.add = function (teardown) {
|
|
239
|
+
var _a;
|
|
240
|
+
if (teardown && teardown !== this) {
|
|
241
|
+
if (this.closed) {
|
|
242
|
+
execFinalizer(teardown);
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
if (teardown instanceof Subscription) {
|
|
246
|
+
if (teardown.closed || teardown._hasParent(this)) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
teardown._addParent(this);
|
|
250
|
+
}
|
|
251
|
+
(this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
Subscription.prototype._hasParent = function (parent) {
|
|
256
|
+
var _parentage = this._parentage;
|
|
257
|
+
return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));
|
|
258
|
+
};
|
|
259
|
+
Subscription.prototype._addParent = function (parent) {
|
|
260
|
+
var _parentage = this._parentage;
|
|
261
|
+
this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
|
|
262
|
+
};
|
|
263
|
+
Subscription.prototype._removeParent = function (parent) {
|
|
264
|
+
var _parentage = this._parentage;
|
|
265
|
+
if (_parentage === parent) {
|
|
266
|
+
this._parentage = null;
|
|
267
|
+
}
|
|
268
|
+
else if (Array.isArray(_parentage)) {
|
|
269
|
+
arrRemove(_parentage, parent);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
Subscription.prototype.remove = function (teardown) {
|
|
273
|
+
var _finalizers = this._finalizers;
|
|
274
|
+
_finalizers && arrRemove(_finalizers, teardown);
|
|
275
|
+
if (teardown instanceof Subscription) {
|
|
276
|
+
teardown._removeParent(this);
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
Subscription.EMPTY = (function () {
|
|
280
|
+
var empty = new Subscription();
|
|
281
|
+
empty.closed = true;
|
|
282
|
+
return empty;
|
|
283
|
+
})();
|
|
284
|
+
return Subscription;
|
|
285
|
+
}());
|
|
286
|
+
var EMPTY_SUBSCRIPTION = Subscription$1.EMPTY;
|
|
287
|
+
function isSubscription(value) {
|
|
288
|
+
return (value instanceof Subscription$1 ||
|
|
289
|
+
(value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));
|
|
290
|
+
}
|
|
291
|
+
function execFinalizer(finalizer) {
|
|
292
|
+
if (isFunction(finalizer)) {
|
|
293
|
+
finalizer();
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
finalizer.unsubscribe();
|
|
349
297
|
}
|
|
350
298
|
}
|
|
351
|
-
tslib.__decorate([
|
|
352
|
-
classTransformer.Type(() => Category),
|
|
353
|
-
tslib.__metadata("design:type", Array)
|
|
354
|
-
], Buy2Win.prototype, "categories", void 0);
|
|
355
299
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
Where["NOTIN"] = "not in";
|
|
364
|
-
Where["LT"] = "<";
|
|
365
|
-
Where["LTE"] = "<=";
|
|
366
|
-
Where["LIKE"] = "like";
|
|
367
|
-
Where["NOTLIKE"] = "not like";
|
|
368
|
-
Where["ISNULL"] = "is null";
|
|
369
|
-
Where["ISNOTNULL"] = "is not null";
|
|
370
|
-
Where["IREGEX"] = "iregex";
|
|
371
|
-
})(exports.Where || (exports.Where = {}));
|
|
300
|
+
var config = {
|
|
301
|
+
onUnhandledError: null,
|
|
302
|
+
onStoppedNotification: null,
|
|
303
|
+
Promise: undefined,
|
|
304
|
+
useDeprecatedSynchronousErrorHandling: false,
|
|
305
|
+
useDeprecatedNextContext: false,
|
|
306
|
+
};
|
|
372
307
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
308
|
+
var timeoutProvider = {
|
|
309
|
+
setTimeout: function (handler, timeout) {
|
|
310
|
+
var args = [];
|
|
311
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
312
|
+
args[_i - 2] = arguments[_i];
|
|
313
|
+
}
|
|
314
|
+
var delegate = timeoutProvider.delegate;
|
|
315
|
+
if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
|
|
316
|
+
return delegate.setTimeout.apply(delegate, tslib.__spreadArray([handler, timeout], tslib.__read(args)));
|
|
317
|
+
}
|
|
318
|
+
return setTimeout.apply(void 0, tslib.__spreadArray([handler, timeout], tslib.__read(args)));
|
|
319
|
+
},
|
|
320
|
+
clearTimeout: function (handle) {
|
|
321
|
+
var delegate = timeoutProvider.delegate;
|
|
322
|
+
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
|
|
323
|
+
},
|
|
324
|
+
delegate: undefined,
|
|
325
|
+
};
|
|
381
326
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
327
|
+
function reportUnhandledError(err) {
|
|
328
|
+
timeoutProvider.setTimeout(function () {
|
|
329
|
+
{
|
|
330
|
+
throw err;
|
|
331
|
+
}
|
|
332
|
+
});
|
|
386
333
|
}
|
|
387
334
|
|
|
388
|
-
|
|
389
|
-
static get identifiersFields() {
|
|
390
|
-
return ['id'];
|
|
391
|
-
}
|
|
392
|
-
}
|
|
335
|
+
function noop() { }
|
|
393
336
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
337
|
+
var context = null;
|
|
338
|
+
function errorContext(cb) {
|
|
339
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
340
|
+
var isRoot = !context;
|
|
341
|
+
if (isRoot) {
|
|
342
|
+
context = { errorThrown: false, error: null };
|
|
343
|
+
}
|
|
344
|
+
cb();
|
|
345
|
+
if (isRoot) {
|
|
346
|
+
var _a = context, errorThrown = _a.errorThrown, error = _a.error;
|
|
347
|
+
context = null;
|
|
348
|
+
if (errorThrown) {
|
|
349
|
+
throw error;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
399
352
|
}
|
|
400
|
-
|
|
401
|
-
|
|
353
|
+
else {
|
|
354
|
+
cb();
|
|
402
355
|
}
|
|
403
356
|
}
|
|
404
357
|
|
|
405
|
-
|
|
406
|
-
(
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
(
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
Area["Sales"] = "Comercial";
|
|
421
|
-
Area["Finantial"] = "Financeiro";
|
|
422
|
-
Area["HR"] = "RH";
|
|
423
|
-
})(exports.Area || (exports.Area = {}));
|
|
424
|
-
|
|
425
|
-
exports.BeardProblems = void 0;
|
|
426
|
-
(function (BeardProblems) {
|
|
427
|
-
BeardProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
428
|
-
BeardProblems["DRY"] = "Barba Seca";
|
|
429
|
-
BeardProblems["OILY"] = "Barba Oleaosa";
|
|
430
|
-
BeardProblems["DANCRUFF"] = "Barba com Caspa";
|
|
431
|
-
BeardProblems["INGROWN_HAIRS"] = "P\u00EAlos Encravados";
|
|
432
|
-
BeardProblems["DOESNT_GROW"] = "N\u00E3o Cresce";
|
|
433
|
-
BeardProblems["SPARSE_BEARD"] = "Barba Rala";
|
|
434
|
-
})(exports.BeardProblems || (exports.BeardProblems = {}));
|
|
435
|
-
|
|
436
|
-
exports.BeardSizes = void 0;
|
|
437
|
-
(function (BeardSizes) {
|
|
438
|
-
BeardSizes["BIG"] = "Grande";
|
|
439
|
-
BeardSizes["MEDIUM"] = "M\u00E9dia";
|
|
440
|
-
BeardSizes["SHORT"] = "Curta";
|
|
441
|
-
BeardSizes["MUSTACHE"] = "Bigode";
|
|
442
|
-
BeardSizes["NOTHING"] = "Sem Barba";
|
|
443
|
-
})(exports.BeardSizes || (exports.BeardSizes = {}));
|
|
444
|
-
|
|
445
|
-
exports.BeautyProductImportances = void 0;
|
|
446
|
-
(function (BeautyProductImportances) {
|
|
447
|
-
BeautyProductImportances["KNOW_LITTLE_ABOUT"] = "Conhe\u00E7o bem pouco de produtos de beleza e rotinas de cuidados";
|
|
448
|
-
BeautyProductImportances["ALREADY_BOUGHT_NOTHING_SPECIALIZED"] = "J\u00E1 comprei alguns produtos b\u00E1sicos para cuidar de mim, mas nada muito especializado";
|
|
449
|
-
BeautyProductImportances["GOOD_CARE_MYSELF"] = "Me considero um homem que se cuida bem. Conhe\u00E7o sobre produtos especializados e me preocupo em ter uma rotina de cuidados";
|
|
450
|
-
BeautyProductImportances["PERSONAL_CARE_EXPERT"] = "Sou um expert em cuidados pessoais";
|
|
451
|
-
})(exports.BeautyProductImportances || (exports.BeautyProductImportances = {}));
|
|
452
|
-
|
|
453
|
-
exports.BodyProblems = void 0;
|
|
454
|
-
(function (BodyProblems) {
|
|
455
|
-
BodyProblems["NO_WORRIES"] = "Sem preocupa\u00E7\u00F5es";
|
|
456
|
-
BodyProblems["FLACCIDITY"] = "Flacidez";
|
|
457
|
-
BodyProblems["LOCALIZED_FAT"] = "Gordura Localizada";
|
|
458
|
-
BodyProblems["STRETCH_MARKS"] = "Estrias";
|
|
459
|
-
BodyProblems["SENSITIVE_SKIN"] = "Pele Sens\u00EDvel";
|
|
460
|
-
BodyProblems["DRY_SKIN"] = "Pele Seca";
|
|
461
|
-
BodyProblems["OILY_ACNE"] = "Oleosa/Acne";
|
|
462
|
-
BodyProblems["SKIN_FRECKLES"] = "Pele com Sardas";
|
|
463
|
-
BodyProblems["PHOTOSENSITIVE_SKIN"] = "Pele Fotossens\u00EDvel";
|
|
464
|
-
})(exports.BodyProblems || (exports.BodyProblems = {}));
|
|
465
|
-
|
|
466
|
-
exports.BodyShapes = void 0;
|
|
467
|
-
(function (BodyShapes) {
|
|
468
|
-
BodyShapes["LEAN"] = "Magro";
|
|
469
|
-
BodyShapes["REGULAR"] = "Regular";
|
|
470
|
-
BodyShapes["OVERWEIGHT"] = "Acima do Peso";
|
|
471
|
-
BodyShapes["ATHLETIC"] = "Atl\u00E9tico";
|
|
472
|
-
BodyShapes["MUSCULAR"] = "Musculoso";
|
|
473
|
-
})(exports.BodyShapes || (exports.BodyShapes = {}));
|
|
474
|
-
|
|
475
|
-
exports.BodyTattoos = void 0;
|
|
476
|
-
(function (BodyTattoos) {
|
|
477
|
-
BodyTattoos["NONE"] = "Nenhuma";
|
|
478
|
-
BodyTattoos["HAS_DOESNT_CARE"] = "Tenho mas n\u00E3o cuido";
|
|
479
|
-
BodyTattoos["HAS_CARE_LOT"] = "Tenho e cuido bastante";
|
|
480
|
-
})(exports.BodyTattoos || (exports.BodyTattoos = {}));
|
|
481
|
-
|
|
482
|
-
exports.FaceSkinOilinesses = void 0;
|
|
483
|
-
(function (FaceSkinOilinesses) {
|
|
484
|
-
FaceSkinOilinesses["DRY"] = "Seca";
|
|
485
|
-
FaceSkinOilinesses["OILY"] = "Oleaosa";
|
|
486
|
-
FaceSkinOilinesses["MIXED"] = "Mista";
|
|
487
|
-
FaceSkinOilinesses["NORMAL"] = "Normal";
|
|
488
|
-
FaceSkinOilinesses["DONT_KNOW"] = "Eu n\u00E3o sei como dizer";
|
|
489
|
-
})(exports.FaceSkinOilinesses || (exports.FaceSkinOilinesses = {}));
|
|
490
|
-
|
|
491
|
-
exports.FaceSkinProblems = void 0;
|
|
492
|
-
(function (FaceSkinProblems) {
|
|
493
|
-
FaceSkinProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
494
|
-
FaceSkinProblems["DARK_CIRCLES"] = "Olheiras";
|
|
495
|
-
FaceSkinProblems["WRINKLES"] = "Rugas";
|
|
496
|
-
FaceSkinProblems["BLACKHEADS_PIMPLES"] = "Cravos e Espinhas";
|
|
497
|
-
FaceSkinProblems["STAINS"] = "Manchas";
|
|
498
|
-
FaceSkinProblems["FRECKLES"] = "Sardas";
|
|
499
|
-
FaceSkinProblems["SENSITIVE"] = "Sens\u00EDvel";
|
|
500
|
-
FaceSkinProblems["PHOTOSENSITIVE"] = "Fotossens\u00EDvel";
|
|
501
|
-
})(exports.FaceSkinProblems || (exports.FaceSkinProblems = {}));
|
|
502
|
-
|
|
503
|
-
exports.FaceSkinTones = void 0;
|
|
504
|
-
(function (FaceSkinTones) {
|
|
505
|
-
FaceSkinTones["VERY_CLEAR"] = "Muito Clara";
|
|
506
|
-
FaceSkinTones["CLEAR"] = "Clara";
|
|
507
|
-
FaceSkinTones["MEDIUM_LIGHT"] = "Clara M\u00E9dia";
|
|
508
|
-
FaceSkinTones["MEDIUM_DARK"] = "Escura M\u00E9dia";
|
|
509
|
-
FaceSkinTones["DARK"] = "Escura";
|
|
510
|
-
FaceSkinTones["VERY_DARK"] = "Muito Escura";
|
|
511
|
-
})(exports.FaceSkinTones || (exports.FaceSkinTones = {}));
|
|
512
|
-
|
|
513
|
-
exports.FamilyIncomes = void 0;
|
|
514
|
-
(function (FamilyIncomes) {
|
|
515
|
-
FamilyIncomes["UNTIL_3000"] = "At\u00E9 R$3.000";
|
|
516
|
-
FamilyIncomes["SINCE_3001_TO_7000"] = "De R$3.001 a R$7.000";
|
|
517
|
-
FamilyIncomes["SINCE_7001_TO_10000"] = "De R$7.001 a R$10.000";
|
|
518
|
-
FamilyIncomes["SINCE_10001_TO_15000"] = "De R$10.001 a R$15.000";
|
|
519
|
-
FamilyIncomes["GRAN_THAN_15000"] = "Mais de R$15.000";
|
|
520
|
-
FamilyIncomes["NOW_ANSWER"] = "Prefiro nao responder";
|
|
521
|
-
})(exports.FamilyIncomes || (exports.FamilyIncomes = {}));
|
|
522
|
-
|
|
523
|
-
exports.FragranceImportances = void 0;
|
|
524
|
-
(function (FragranceImportances) {
|
|
525
|
-
FragranceImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
|
|
526
|
-
FragranceImportances["LIKE_ALWAYS_USE_SAME"] = "Gosto de perfumes, mas uso sempre os mesmos";
|
|
527
|
-
FragranceImportances["LIKE_INNOVATE"] = "Gosto de inovar e conhecer novas fragr\u00E2ncias";
|
|
528
|
-
})(exports.FragranceImportances || (exports.FragranceImportances = {}));
|
|
529
|
-
|
|
530
|
-
exports.HairColors = void 0;
|
|
531
|
-
(function (HairColors) {
|
|
532
|
-
HairColors["BLACK"] = "Preto";
|
|
533
|
-
HairColors["DARK_BROWN"] = "Castanho Escuro";
|
|
534
|
-
HairColors["LIGHT_BROWN"] = "Castanho Claro";
|
|
535
|
-
HairColors["DARK_BLONDE"] = "Loiro Escuro";
|
|
536
|
-
HairColors["LIGHT_BLONDE"] = "Loiro Claro";
|
|
537
|
-
HairColors["WHITE_GRAY"] = "Branco/Grisalho";
|
|
538
|
-
HairColors["REDHEAD"] = "Ruivo";
|
|
539
|
-
HairColors["OTHER"] = "RuiOutroo";
|
|
540
|
-
})(exports.HairColors || (exports.HairColors = {}));
|
|
541
|
-
|
|
542
|
-
exports.HairProblems = void 0;
|
|
543
|
-
(function (HairProblems) {
|
|
544
|
-
HairProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
545
|
-
HairProblems["DANCRUFF"] = "Caspa";
|
|
546
|
-
HairProblems["LOSS"] = "Queda";
|
|
547
|
-
HairProblems["OILY"] = "Oleosidade";
|
|
548
|
-
HairProblems["DRYNESS"] = "Ressecamento";
|
|
549
|
-
HairProblems["CHEMICAL"] = "Quimica";
|
|
550
|
-
HairProblems["WHITE_HAIR"] = "Cabelos Brancos";
|
|
551
|
-
HairProblems["REBEL_WIRES"] = "Fios Rebeldes";
|
|
552
|
-
})(exports.HairProblems || (exports.HairProblems = {}));
|
|
553
|
-
|
|
554
|
-
exports.HairStrands = void 0;
|
|
555
|
-
(function (HairStrands) {
|
|
556
|
-
HairStrands["NORMAL"] = "Fio Normal";
|
|
557
|
-
HairStrands["DRY"] = "Fio Seco";
|
|
558
|
-
HairStrands["OILY"] = "Fio Oleoso";
|
|
559
|
-
HairStrands["MIXED"] = "Fio Misto";
|
|
560
|
-
HairStrands["FINE"] = "Fio Fino";
|
|
561
|
-
HairStrands["THICK"] = "Fio Grosso";
|
|
562
|
-
})(exports.HairStrands || (exports.HairStrands = {}));
|
|
563
|
-
|
|
564
|
-
exports.HairTypes = void 0;
|
|
565
|
-
(function (HairTypes) {
|
|
566
|
-
HairTypes["Smooth"] = "Liso";
|
|
567
|
-
HairTypes["WAVY"] = "Ondulado";
|
|
568
|
-
HairTypes["CURLY"] = "Cacheado";
|
|
569
|
-
HairTypes["FRIZZY"] = "Crespo";
|
|
570
|
-
HairTypes["BALD"] = "Sou careca";
|
|
571
|
-
})(exports.HairTypes || (exports.HairTypes = {}));
|
|
572
|
-
|
|
573
|
-
exports.OfficePosition = void 0;
|
|
574
|
-
(function (OfficePosition) {
|
|
575
|
-
OfficePosition["Intern"] = "Estagi\u00E1rio";
|
|
576
|
-
OfficePosition["Analyst"] = "Analista";
|
|
577
|
-
OfficePosition["Manager"] = "Gerente";
|
|
578
|
-
OfficePosition["Director"] = "Diretor";
|
|
579
|
-
})(exports.OfficePosition || (exports.OfficePosition = {}));
|
|
580
|
-
|
|
581
|
-
exports.PersonTypes = void 0;
|
|
582
|
-
(function (PersonTypes) {
|
|
583
|
-
PersonTypes["GLAMGIRL"] = "glamgirl";
|
|
584
|
-
PersonTypes["BFLU"] = "bflu";
|
|
585
|
-
PersonTypes["NONE"] = "none";
|
|
586
|
-
})(exports.PersonTypes || (exports.PersonTypes = {}));
|
|
587
|
-
|
|
588
|
-
exports.ProductSpents = void 0;
|
|
589
|
-
(function (ProductSpents) {
|
|
590
|
-
ProductSpents["UNTIL_50"] = "At\u00E9 R$50";
|
|
591
|
-
ProductSpents["SINCE_51_TO_100"] = "De R$51 a R$100";
|
|
592
|
-
ProductSpents["SINCE_101_TO_200"] = "De R$101 a R$200";
|
|
593
|
-
ProductSpents["SINCE_201_TO_300"] = "De R$201 a R$300";
|
|
594
|
-
ProductSpents["GRAN_THAN_300"] = "Mais de R$300";
|
|
595
|
-
ProductSpents["NOW_ANSWER"] = "Prefiro nao responder";
|
|
596
|
-
})(exports.ProductSpents || (exports.ProductSpents = {}));
|
|
597
|
-
|
|
598
|
-
exports.UserType = void 0;
|
|
599
|
-
(function (UserType) {
|
|
600
|
-
UserType["B2C"] = "Cliente Transacional";
|
|
601
|
-
UserType["GlamGirl"] = "Glamgirl";
|
|
602
|
-
UserType["MensBoy"] = "Mensboy";
|
|
603
|
-
UserType["B2B"] = "Company";
|
|
604
|
-
UserType["Collaborator"] = "Funcion\u00E1rio";
|
|
605
|
-
UserType["Influencer"] = "Influencer";
|
|
606
|
-
})(exports.UserType || (exports.UserType = {}));
|
|
607
|
-
|
|
608
|
-
class Lead extends BaseModel {
|
|
609
|
-
static get identifiersFields() {
|
|
610
|
-
return ['id'];
|
|
358
|
+
var Subscriber = (function (_super) {
|
|
359
|
+
tslib.__extends(Subscriber, _super);
|
|
360
|
+
function Subscriber(destination) {
|
|
361
|
+
var _this = _super.call(this) || this;
|
|
362
|
+
_this.isStopped = false;
|
|
363
|
+
if (destination) {
|
|
364
|
+
_this.destination = destination;
|
|
365
|
+
if (isSubscription(destination)) {
|
|
366
|
+
destination.add(_this);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
_this.destination = EMPTY_OBSERVER;
|
|
371
|
+
}
|
|
372
|
+
return _this;
|
|
611
373
|
}
|
|
374
|
+
Subscriber.create = function (next, error, complete) {
|
|
375
|
+
return new SafeSubscriber(next, error, complete);
|
|
376
|
+
};
|
|
377
|
+
Subscriber.prototype.next = function (value) {
|
|
378
|
+
if (this.isStopped) ;
|
|
379
|
+
else {
|
|
380
|
+
this._next(value);
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
Subscriber.prototype.error = function (err) {
|
|
384
|
+
if (this.isStopped) ;
|
|
385
|
+
else {
|
|
386
|
+
this.isStopped = true;
|
|
387
|
+
this._error(err);
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
Subscriber.prototype.complete = function () {
|
|
391
|
+
if (this.isStopped) ;
|
|
392
|
+
else {
|
|
393
|
+
this.isStopped = true;
|
|
394
|
+
this._complete();
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
Subscriber.prototype.unsubscribe = function () {
|
|
398
|
+
if (!this.closed) {
|
|
399
|
+
this.isStopped = true;
|
|
400
|
+
_super.prototype.unsubscribe.call(this);
|
|
401
|
+
this.destination = null;
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
Subscriber.prototype._next = function (value) {
|
|
405
|
+
this.destination.next(value);
|
|
406
|
+
};
|
|
407
|
+
Subscriber.prototype._error = function (err) {
|
|
408
|
+
try {
|
|
409
|
+
this.destination.error(err);
|
|
410
|
+
}
|
|
411
|
+
finally {
|
|
412
|
+
this.unsubscribe();
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
Subscriber.prototype._complete = function () {
|
|
416
|
+
try {
|
|
417
|
+
this.destination.complete();
|
|
418
|
+
}
|
|
419
|
+
finally {
|
|
420
|
+
this.unsubscribe();
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
return Subscriber;
|
|
424
|
+
}(Subscription$1));
|
|
425
|
+
var _bind = Function.prototype.bind;
|
|
426
|
+
function bind(fn, thisArg) {
|
|
427
|
+
return _bind.call(fn, thisArg);
|
|
612
428
|
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
return ['id', 'subscriptionId'];
|
|
429
|
+
var ConsumerObserver = (function () {
|
|
430
|
+
function ConsumerObserver(partialObserver) {
|
|
431
|
+
this.partialObserver = partialObserver;
|
|
617
432
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
(
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
433
|
+
ConsumerObserver.prototype.next = function (value) {
|
|
434
|
+
var partialObserver = this.partialObserver;
|
|
435
|
+
if (partialObserver.next) {
|
|
436
|
+
try {
|
|
437
|
+
partialObserver.next(value);
|
|
438
|
+
}
|
|
439
|
+
catch (error) {
|
|
440
|
+
handleUnhandledError(error);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
ConsumerObserver.prototype.error = function (err) {
|
|
445
|
+
var partialObserver = this.partialObserver;
|
|
446
|
+
if (partialObserver.error) {
|
|
447
|
+
try {
|
|
448
|
+
partialObserver.error(err);
|
|
449
|
+
}
|
|
450
|
+
catch (error) {
|
|
451
|
+
handleUnhandledError(error);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
handleUnhandledError(err);
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
ConsumerObserver.prototype.complete = function () {
|
|
459
|
+
var partialObserver = this.partialObserver;
|
|
460
|
+
if (partialObserver.complete) {
|
|
461
|
+
try {
|
|
462
|
+
partialObserver.complete();
|
|
463
|
+
}
|
|
464
|
+
catch (error) {
|
|
465
|
+
handleUnhandledError(error);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
return ConsumerObserver;
|
|
470
|
+
}());
|
|
471
|
+
var SafeSubscriber = (function (_super) {
|
|
472
|
+
tslib.__extends(SafeSubscriber, _super);
|
|
473
|
+
function SafeSubscriber(observerOrNext, error, complete) {
|
|
474
|
+
var _this = _super.call(this) || this;
|
|
475
|
+
var partialObserver;
|
|
476
|
+
if (isFunction(observerOrNext) || !observerOrNext) {
|
|
477
|
+
partialObserver = {
|
|
478
|
+
next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),
|
|
479
|
+
error: error !== null && error !== void 0 ? error : undefined,
|
|
480
|
+
complete: complete !== null && complete !== void 0 ? complete : undefined,
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
var context_1;
|
|
485
|
+
if (_this && config.useDeprecatedNextContext) {
|
|
486
|
+
context_1 = Object.create(observerOrNext);
|
|
487
|
+
context_1.unsubscribe = function () { return _this.unsubscribe(); };
|
|
488
|
+
partialObserver = {
|
|
489
|
+
next: observerOrNext.next && bind(observerOrNext.next, context_1),
|
|
490
|
+
error: observerOrNext.error && bind(observerOrNext.error, context_1),
|
|
491
|
+
complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
partialObserver = observerOrNext;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
_this.destination = new ConsumerObserver(partialObserver);
|
|
499
|
+
return _this;
|
|
658
500
|
}
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
class SubscriptionPayment extends BaseModel {
|
|
666
|
-
static get identifiersFields() {
|
|
667
|
-
return ['id', 'subscriptionId'];
|
|
501
|
+
return SafeSubscriber;
|
|
502
|
+
}(Subscriber));
|
|
503
|
+
function handleUnhandledError(error) {
|
|
504
|
+
{
|
|
505
|
+
reportUnhandledError(error);
|
|
668
506
|
}
|
|
669
507
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
tslib.__metadata("design:type", Payment)
|
|
673
|
-
], SubscriptionPayment.prototype, "payment", void 0);
|
|
674
|
-
|
|
675
|
-
function isFunction(value) {
|
|
676
|
-
return typeof value === 'function';
|
|
508
|
+
function defaultErrorHandler(err) {
|
|
509
|
+
throw err;
|
|
677
510
|
}
|
|
511
|
+
var EMPTY_OBSERVER = {
|
|
512
|
+
closed: true,
|
|
513
|
+
next: noop,
|
|
514
|
+
error: defaultErrorHandler,
|
|
515
|
+
complete: noop,
|
|
516
|
+
};
|
|
678
517
|
|
|
679
|
-
function
|
|
680
|
-
var _super = function (instance) {
|
|
681
|
-
Error.call(instance);
|
|
682
|
-
instance.stack = new Error().stack;
|
|
683
|
-
};
|
|
684
|
-
var ctorFunc = createImpl(_super);
|
|
685
|
-
ctorFunc.prototype = Object.create(Error.prototype);
|
|
686
|
-
ctorFunc.prototype.constructor = ctorFunc;
|
|
687
|
-
return ctorFunc;
|
|
688
|
-
}
|
|
518
|
+
var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();
|
|
689
519
|
|
|
690
|
-
|
|
691
|
-
return
|
|
692
|
-
|
|
693
|
-
this.message = errors
|
|
694
|
-
? errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ')
|
|
695
|
-
: '';
|
|
696
|
-
this.name = 'UnsubscriptionError';
|
|
697
|
-
this.errors = errors;
|
|
698
|
-
};
|
|
699
|
-
});
|
|
520
|
+
function identity(x) {
|
|
521
|
+
return x;
|
|
522
|
+
}
|
|
700
523
|
|
|
701
|
-
function
|
|
702
|
-
if (
|
|
703
|
-
|
|
704
|
-
|
|
524
|
+
function pipeFromArray(fns) {
|
|
525
|
+
if (fns.length === 0) {
|
|
526
|
+
return identity;
|
|
527
|
+
}
|
|
528
|
+
if (fns.length === 1) {
|
|
529
|
+
return fns[0];
|
|
705
530
|
}
|
|
531
|
+
return function piped(input) {
|
|
532
|
+
return fns.reduce(function (prev, fn) { return fn(prev); }, input);
|
|
533
|
+
};
|
|
706
534
|
}
|
|
707
535
|
|
|
708
|
-
var
|
|
709
|
-
function
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
this._finalizers = null;
|
|
536
|
+
var Observable = (function () {
|
|
537
|
+
function Observable(subscribe) {
|
|
538
|
+
if (subscribe) {
|
|
539
|
+
this._subscribe = subscribe;
|
|
540
|
+
}
|
|
714
541
|
}
|
|
715
|
-
|
|
716
|
-
var
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
542
|
+
Observable.prototype.lift = function (operator) {
|
|
543
|
+
var observable = new Observable();
|
|
544
|
+
observable.source = this;
|
|
545
|
+
observable.operator = operator;
|
|
546
|
+
return observable;
|
|
547
|
+
};
|
|
548
|
+
Observable.prototype.subscribe = function (observerOrNext, error, complete) {
|
|
549
|
+
var _this = this;
|
|
550
|
+
var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
|
|
551
|
+
errorContext(function () {
|
|
552
|
+
var _a = _this, operator = _a.operator, source = _a.source;
|
|
553
|
+
subscriber.add(operator
|
|
554
|
+
?
|
|
555
|
+
operator.call(subscriber, source)
|
|
556
|
+
: source
|
|
557
|
+
?
|
|
558
|
+
_this._subscribe(subscriber)
|
|
559
|
+
:
|
|
560
|
+
_this._trySubscribe(subscriber));
|
|
561
|
+
});
|
|
562
|
+
return subscriber;
|
|
563
|
+
};
|
|
564
|
+
Observable.prototype._trySubscribe = function (sink) {
|
|
565
|
+
try {
|
|
566
|
+
return this._subscribe(sink);
|
|
567
|
+
}
|
|
568
|
+
catch (err) {
|
|
569
|
+
sink.error(err);
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
Observable.prototype.forEach = function (next, promiseCtor) {
|
|
573
|
+
var _this = this;
|
|
574
|
+
promiseCtor = getPromiseCtor(promiseCtor);
|
|
575
|
+
return new promiseCtor(function (resolve, reject) {
|
|
576
|
+
var subscriber = new SafeSubscriber({
|
|
577
|
+
next: function (value) {
|
|
724
578
|
try {
|
|
725
|
-
|
|
726
|
-
var parent_1 = _parentage_1_1.value;
|
|
727
|
-
parent_1.remove(this);
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
731
|
-
finally {
|
|
732
|
-
try {
|
|
733
|
-
if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);
|
|
734
|
-
}
|
|
735
|
-
finally { if (e_1) throw e_1.error; }
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
else {
|
|
739
|
-
_parentage.remove(this);
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
var initialFinalizer = this.initialTeardown;
|
|
743
|
-
if (isFunction(initialFinalizer)) {
|
|
744
|
-
try {
|
|
745
|
-
initialFinalizer();
|
|
746
|
-
}
|
|
747
|
-
catch (e) {
|
|
748
|
-
errors = e instanceof UnsubscriptionError ? e.errors : [e];
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
var _finalizers = this._finalizers;
|
|
752
|
-
if (_finalizers) {
|
|
753
|
-
this._finalizers = null;
|
|
754
|
-
try {
|
|
755
|
-
for (var _finalizers_1 = tslib.__values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {
|
|
756
|
-
var finalizer = _finalizers_1_1.value;
|
|
757
|
-
try {
|
|
758
|
-
execFinalizer(finalizer);
|
|
759
|
-
}
|
|
760
|
-
catch (err) {
|
|
761
|
-
errors = errors !== null && errors !== void 0 ? errors : [];
|
|
762
|
-
if (err instanceof UnsubscriptionError) {
|
|
763
|
-
errors = tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(errors)), tslib.__read(err.errors));
|
|
764
|
-
}
|
|
765
|
-
else {
|
|
766
|
-
errors.push(err);
|
|
767
|
-
}
|
|
768
|
-
}
|
|
579
|
+
next(value);
|
|
769
580
|
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
try {
|
|
774
|
-
if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);
|
|
581
|
+
catch (err) {
|
|
582
|
+
reject(err);
|
|
583
|
+
subscriber.unsubscribe();
|
|
775
584
|
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
}
|
|
585
|
+
},
|
|
586
|
+
error: reject,
|
|
587
|
+
complete: resolve,
|
|
588
|
+
});
|
|
589
|
+
_this.subscribe(subscriber);
|
|
590
|
+
});
|
|
783
591
|
};
|
|
784
|
-
|
|
592
|
+
Observable.prototype._subscribe = function (subscriber) {
|
|
785
593
|
var _a;
|
|
786
|
-
|
|
787
|
-
if (this.closed) {
|
|
788
|
-
execFinalizer(teardown);
|
|
789
|
-
}
|
|
790
|
-
else {
|
|
791
|
-
if (teardown instanceof Subscription) {
|
|
792
|
-
if (teardown.closed || teardown._hasParent(this)) {
|
|
793
|
-
return;
|
|
794
|
-
}
|
|
795
|
-
teardown._addParent(this);
|
|
796
|
-
}
|
|
797
|
-
(this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
};
|
|
801
|
-
Subscription.prototype._hasParent = function (parent) {
|
|
802
|
-
var _parentage = this._parentage;
|
|
803
|
-
return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));
|
|
594
|
+
return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
|
|
804
595
|
};
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
|
|
596
|
+
Observable.prototype[observable] = function () {
|
|
597
|
+
return this;
|
|
808
598
|
};
|
|
809
|
-
|
|
810
|
-
var
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
}
|
|
814
|
-
else if (Array.isArray(_parentage)) {
|
|
815
|
-
arrRemove(_parentage, parent);
|
|
599
|
+
Observable.prototype.pipe = function () {
|
|
600
|
+
var operations = [];
|
|
601
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
602
|
+
operations[_i] = arguments[_i];
|
|
816
603
|
}
|
|
604
|
+
return pipeFromArray(operations)(this);
|
|
817
605
|
};
|
|
818
|
-
|
|
819
|
-
var
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
606
|
+
Observable.prototype.toPromise = function (promiseCtor) {
|
|
607
|
+
var _this = this;
|
|
608
|
+
promiseCtor = getPromiseCtor(promiseCtor);
|
|
609
|
+
return new promiseCtor(function (resolve, reject) {
|
|
610
|
+
var value;
|
|
611
|
+
_this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });
|
|
612
|
+
});
|
|
824
613
|
};
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
})();
|
|
830
|
-
return Subscription;
|
|
614
|
+
Observable.create = function (subscribe) {
|
|
615
|
+
return new Observable(subscribe);
|
|
616
|
+
};
|
|
617
|
+
return Observable;
|
|
831
618
|
}());
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
return (
|
|
835
|
-
(value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));
|
|
619
|
+
function getPromiseCtor(promiseCtor) {
|
|
620
|
+
var _a;
|
|
621
|
+
return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
|
|
836
622
|
}
|
|
837
|
-
function
|
|
838
|
-
|
|
839
|
-
finalizer();
|
|
840
|
-
}
|
|
841
|
-
else {
|
|
842
|
-
finalizer.unsubscribe();
|
|
843
|
-
}
|
|
623
|
+
function isObserver(value) {
|
|
624
|
+
return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
|
|
844
625
|
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
onUnhandledError: null,
|
|
848
|
-
onStoppedNotification: null,
|
|
849
|
-
Promise: undefined,
|
|
850
|
-
useDeprecatedSynchronousErrorHandling: false,
|
|
851
|
-
useDeprecatedNextContext: false,
|
|
852
|
-
};
|
|
853
|
-
|
|
854
|
-
var timeoutProvider = {
|
|
855
|
-
setTimeout: function (handler, timeout) {
|
|
856
|
-
var args = [];
|
|
857
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
858
|
-
args[_i - 2] = arguments[_i];
|
|
859
|
-
}
|
|
860
|
-
var delegate = timeoutProvider.delegate;
|
|
861
|
-
if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
|
|
862
|
-
return delegate.setTimeout.apply(delegate, tslib.__spreadArray([handler, timeout], tslib.__read(args)));
|
|
863
|
-
}
|
|
864
|
-
return setTimeout.apply(void 0, tslib.__spreadArray([handler, timeout], tslib.__read(args)));
|
|
865
|
-
},
|
|
866
|
-
clearTimeout: function (handle) {
|
|
867
|
-
var delegate = timeoutProvider.delegate;
|
|
868
|
-
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
|
|
869
|
-
},
|
|
870
|
-
delegate: undefined,
|
|
871
|
-
};
|
|
872
|
-
|
|
873
|
-
function reportUnhandledError(err) {
|
|
874
|
-
timeoutProvider.setTimeout(function () {
|
|
875
|
-
{
|
|
876
|
-
throw err;
|
|
877
|
-
}
|
|
878
|
-
});
|
|
626
|
+
function isSubscriber(value) {
|
|
627
|
+
return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
|
|
879
628
|
}
|
|
880
629
|
|
|
881
|
-
function
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
context = { errorThrown: false, error: null };
|
|
889
|
-
}
|
|
890
|
-
cb();
|
|
891
|
-
if (isRoot) {
|
|
892
|
-
var _a = context, errorThrown = _a.errorThrown, error = _a.error;
|
|
893
|
-
context = null;
|
|
894
|
-
if (errorThrown) {
|
|
895
|
-
throw error;
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
else {
|
|
900
|
-
cb();
|
|
901
|
-
}
|
|
902
|
-
}
|
|
630
|
+
var ObjectUnsubscribedError = createErrorClass(function (_super) {
|
|
631
|
+
return function ObjectUnsubscribedErrorImpl() {
|
|
632
|
+
_super(this);
|
|
633
|
+
this.name = 'ObjectUnsubscribedError';
|
|
634
|
+
this.message = 'object unsubscribed';
|
|
635
|
+
};
|
|
636
|
+
});
|
|
903
637
|
|
|
904
|
-
var
|
|
905
|
-
tslib.__extends(
|
|
906
|
-
function
|
|
638
|
+
var Subject = (function (_super) {
|
|
639
|
+
tslib.__extends(Subject, _super);
|
|
640
|
+
function Subject() {
|
|
907
641
|
var _this = _super.call(this) || this;
|
|
642
|
+
_this.closed = false;
|
|
643
|
+
_this.currentObservers = null;
|
|
644
|
+
_this.observers = [];
|
|
908
645
|
_this.isStopped = false;
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
if (isSubscription(destination)) {
|
|
912
|
-
destination.add(_this);
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
else {
|
|
916
|
-
_this.destination = EMPTY_OBSERVER;
|
|
917
|
-
}
|
|
646
|
+
_this.hasError = false;
|
|
647
|
+
_this.thrownError = null;
|
|
918
648
|
return _this;
|
|
919
649
|
}
|
|
920
|
-
|
|
921
|
-
|
|
650
|
+
Subject.prototype.lift = function (operator) {
|
|
651
|
+
var subject = new AnonymousSubject(this, this);
|
|
652
|
+
subject.operator = operator;
|
|
653
|
+
return subject;
|
|
654
|
+
};
|
|
655
|
+
Subject.prototype._throwIfClosed = function () {
|
|
656
|
+
if (this.closed) {
|
|
657
|
+
throw new ObjectUnsubscribedError();
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
Subject.prototype.next = function (value) {
|
|
661
|
+
var _this = this;
|
|
662
|
+
errorContext(function () {
|
|
663
|
+
var e_1, _a;
|
|
664
|
+
_this._throwIfClosed();
|
|
665
|
+
if (!_this.isStopped) {
|
|
666
|
+
if (!_this.currentObservers) {
|
|
667
|
+
_this.currentObservers = Array.from(_this.observers);
|
|
668
|
+
}
|
|
669
|
+
try {
|
|
670
|
+
for (var _b = tslib.__values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
671
|
+
var observer = _c.value;
|
|
672
|
+
observer.next(value);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
676
|
+
finally {
|
|
677
|
+
try {
|
|
678
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
679
|
+
}
|
|
680
|
+
finally { if (e_1) throw e_1.error; }
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
});
|
|
922
684
|
};
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
685
|
+
Subject.prototype.error = function (err) {
|
|
686
|
+
var _this = this;
|
|
687
|
+
errorContext(function () {
|
|
688
|
+
_this._throwIfClosed();
|
|
689
|
+
if (!_this.isStopped) {
|
|
690
|
+
_this.hasError = _this.isStopped = true;
|
|
691
|
+
_this.thrownError = err;
|
|
692
|
+
var observers = _this.observers;
|
|
693
|
+
while (observers.length) {
|
|
694
|
+
observers.shift().error(err);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
});
|
|
928
698
|
};
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
699
|
+
Subject.prototype.complete = function () {
|
|
700
|
+
var _this = this;
|
|
701
|
+
errorContext(function () {
|
|
702
|
+
_this._throwIfClosed();
|
|
703
|
+
if (!_this.isStopped) {
|
|
704
|
+
_this.isStopped = true;
|
|
705
|
+
var observers = _this.observers;
|
|
706
|
+
while (observers.length) {
|
|
707
|
+
observers.shift().complete();
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
});
|
|
935
711
|
};
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
this.isStopped = true;
|
|
940
|
-
this._complete();
|
|
941
|
-
}
|
|
712
|
+
Subject.prototype.unsubscribe = function () {
|
|
713
|
+
this.isStopped = this.closed = true;
|
|
714
|
+
this.observers = this.currentObservers = null;
|
|
942
715
|
};
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
716
|
+
Object.defineProperty(Subject.prototype, "observed", {
|
|
717
|
+
get: function () {
|
|
718
|
+
var _a;
|
|
719
|
+
return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
720
|
+
},
|
|
721
|
+
enumerable: false,
|
|
722
|
+
configurable: true
|
|
723
|
+
});
|
|
724
|
+
Subject.prototype._trySubscribe = function (subscriber) {
|
|
725
|
+
this._throwIfClosed();
|
|
726
|
+
return _super.prototype._trySubscribe.call(this, subscriber);
|
|
949
727
|
};
|
|
950
|
-
|
|
951
|
-
this.
|
|
728
|
+
Subject.prototype._subscribe = function (subscriber) {
|
|
729
|
+
this._throwIfClosed();
|
|
730
|
+
this._checkFinalizedStatuses(subscriber);
|
|
731
|
+
return this._innerSubscribe(subscriber);
|
|
952
732
|
};
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
this.unsubscribe();
|
|
733
|
+
Subject.prototype._innerSubscribe = function (subscriber) {
|
|
734
|
+
var _this = this;
|
|
735
|
+
var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;
|
|
736
|
+
if (hasError || isStopped) {
|
|
737
|
+
return EMPTY_SUBSCRIPTION;
|
|
959
738
|
}
|
|
739
|
+
this.currentObservers = null;
|
|
740
|
+
observers.push(subscriber);
|
|
741
|
+
return new Subscription$1(function () {
|
|
742
|
+
_this.currentObservers = null;
|
|
743
|
+
arrRemove(observers, subscriber);
|
|
744
|
+
});
|
|
960
745
|
};
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
746
|
+
Subject.prototype._checkFinalizedStatuses = function (subscriber) {
|
|
747
|
+
var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;
|
|
748
|
+
if (hasError) {
|
|
749
|
+
subscriber.error(thrownError);
|
|
964
750
|
}
|
|
965
|
-
|
|
966
|
-
|
|
751
|
+
else if (isStopped) {
|
|
752
|
+
subscriber.complete();
|
|
967
753
|
}
|
|
968
754
|
};
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
755
|
+
Subject.prototype.asObservable = function () {
|
|
756
|
+
var observable = new Observable();
|
|
757
|
+
observable.source = this;
|
|
758
|
+
return observable;
|
|
759
|
+
};
|
|
760
|
+
Subject.create = function (destination, source) {
|
|
761
|
+
return new AnonymousSubject(destination, source);
|
|
762
|
+
};
|
|
763
|
+
return Subject;
|
|
764
|
+
}(Observable));
|
|
765
|
+
var AnonymousSubject = (function (_super) {
|
|
766
|
+
tslib.__extends(AnonymousSubject, _super);
|
|
767
|
+
function AnonymousSubject(destination, source) {
|
|
768
|
+
var _this = _super.call(this) || this;
|
|
769
|
+
_this.destination = destination;
|
|
770
|
+
_this.source = source;
|
|
771
|
+
return _this;
|
|
978
772
|
}
|
|
979
|
-
|
|
980
|
-
var
|
|
981
|
-
|
|
982
|
-
try {
|
|
983
|
-
partialObserver.next(value);
|
|
984
|
-
}
|
|
985
|
-
catch (error) {
|
|
986
|
-
handleUnhandledError(error);
|
|
987
|
-
}
|
|
988
|
-
}
|
|
773
|
+
AnonymousSubject.prototype.next = function (value) {
|
|
774
|
+
var _a, _b;
|
|
775
|
+
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
|
|
989
776
|
};
|
|
990
|
-
|
|
991
|
-
var
|
|
992
|
-
|
|
993
|
-
try {
|
|
994
|
-
partialObserver.error(err);
|
|
995
|
-
}
|
|
996
|
-
catch (error) {
|
|
997
|
-
handleUnhandledError(error);
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
else {
|
|
1001
|
-
handleUnhandledError(err);
|
|
1002
|
-
}
|
|
777
|
+
AnonymousSubject.prototype.error = function (err) {
|
|
778
|
+
var _a, _b;
|
|
779
|
+
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
|
|
1003
780
|
};
|
|
1004
|
-
|
|
1005
|
-
var
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
781
|
+
AnonymousSubject.prototype.complete = function () {
|
|
782
|
+
var _a, _b;
|
|
783
|
+
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
784
|
+
};
|
|
785
|
+
AnonymousSubject.prototype._subscribe = function (subscriber) {
|
|
786
|
+
var _a, _b;
|
|
787
|
+
return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
|
|
788
|
+
};
|
|
789
|
+
return AnonymousSubject;
|
|
790
|
+
}(Subject));
|
|
791
|
+
|
|
792
|
+
exports.DebugNamespaces = void 0;
|
|
793
|
+
(function (DebugNamespaces) {
|
|
794
|
+
DebugNamespaces["ROOT"] = "connect";
|
|
795
|
+
DebugNamespaces["TRACE"] = "trace";
|
|
796
|
+
DebugNamespaces["ERROR"] = "error";
|
|
797
|
+
})(exports.DebugNamespaces || (exports.DebugNamespaces = {}));
|
|
798
|
+
const Logger = debug.debug(exports.DebugNamespaces.ROOT);
|
|
799
|
+
|
|
800
|
+
class ReflectHelper {
|
|
801
|
+
static get items() {
|
|
802
|
+
return this._items;
|
|
803
|
+
}
|
|
804
|
+
static get keys() {
|
|
805
|
+
return Object.keys(ReflectHelper.items);
|
|
806
|
+
}
|
|
807
|
+
static has(key, target, property) {
|
|
808
|
+
return (!lodash.isNil(key) &&
|
|
809
|
+
!lodash.isNil(ReflectHelper.items[key]) &&
|
|
810
|
+
(lodash.isNil(target) ||
|
|
811
|
+
(!lodash.isNil(ReflectHelper.items[key][target]) &&
|
|
812
|
+
(lodash.isNil(property) || !lodash.isNil(ReflectHelper.items[key][target][String(property)])))));
|
|
813
|
+
}
|
|
814
|
+
static get({ key, target, property, own = true }) {
|
|
815
|
+
try {
|
|
816
|
+
if (own) {
|
|
817
|
+
return Reflect.getOwnMetadata(key, target, property) || null;
|
|
1009
818
|
}
|
|
1010
|
-
|
|
1011
|
-
|
|
819
|
+
else {
|
|
820
|
+
return Reflect.getMetadata(key, target, property) || null;
|
|
1012
821
|
}
|
|
1013
822
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
823
|
+
catch (_err) {
|
|
824
|
+
return null;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
static first({ key, target, property, own = true }) {
|
|
828
|
+
const values = ReflectHelper.get({ key, target, property, own });
|
|
829
|
+
return lodash.isArray(values) ? lodash.first(values) : values;
|
|
830
|
+
}
|
|
831
|
+
static last({ key, target, property, own = true }) {
|
|
832
|
+
const values = ReflectHelper.get({ key, target, property, own });
|
|
833
|
+
return lodash.isArray(values) ? lodash.last(values) : values;
|
|
834
|
+
}
|
|
835
|
+
static set({ key, target, property, value, propertyDescriptor }) {
|
|
836
|
+
Reflect.defineMetadata(key, value, target, property);
|
|
837
|
+
ReflectHelper.put({ key, target, property, value, propertyDescriptor });
|
|
838
|
+
}
|
|
839
|
+
static add({ key, target, property, value, propertyDescriptor }) {
|
|
840
|
+
let values = ReflectHelper.get({ key, target, property }) || new Array();
|
|
841
|
+
if (!Array.isArray(values))
|
|
842
|
+
values = [values];
|
|
843
|
+
values.push(value);
|
|
844
|
+
ReflectHelper.set({ key, target, property, value: values, propertyDescriptor });
|
|
845
|
+
}
|
|
846
|
+
static all({ key }) {
|
|
847
|
+
const items = ReflectHelper.items[key] || {};
|
|
848
|
+
return lodash.flatten(Object.keys(items).map((item) => lodash.flatten(this.allFrom(key, items[item]))));
|
|
849
|
+
}
|
|
850
|
+
static allFrom(key, target) {
|
|
851
|
+
return Object.keys(target)
|
|
852
|
+
.filter((property) => property !== 'object')
|
|
853
|
+
.map((property) => this.allValuesFrom(key, target, property));
|
|
854
|
+
}
|
|
855
|
+
static allValuesFrom(key, target, property) {
|
|
856
|
+
const values = target[property];
|
|
857
|
+
let value = values.value;
|
|
858
|
+
const propertyDescriptor = values.propertyDescriptor;
|
|
859
|
+
if (!lodash.isArray(value))
|
|
860
|
+
value = [value];
|
|
861
|
+
return lodash.flatten(value.map((val) => {
|
|
862
|
+
return {
|
|
863
|
+
key,
|
|
864
|
+
target: target.object,
|
|
865
|
+
property,
|
|
866
|
+
value: val,
|
|
867
|
+
propertyDescriptor,
|
|
1027
868
|
};
|
|
869
|
+
}));
|
|
870
|
+
}
|
|
871
|
+
static delete({ key, target, property }) {
|
|
872
|
+
Reflect.deleteMetadata(key, target, property);
|
|
873
|
+
return ReflectHelper.remove(key, target, property);
|
|
874
|
+
}
|
|
875
|
+
static clear(key) {
|
|
876
|
+
if (!key) {
|
|
877
|
+
ReflectHelper.keys.forEach((storedKey) => {
|
|
878
|
+
ReflectHelper.clear(storedKey);
|
|
879
|
+
});
|
|
1028
880
|
}
|
|
1029
881
|
else {
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
882
|
+
if (ReflectHelper.keys.includes(key)) {
|
|
883
|
+
Object.values(ReflectHelper.items[key]).forEach((target) => {
|
|
884
|
+
if (ReflectHelper.has(key, target)) {
|
|
885
|
+
Object.values(ReflectHelper.items[key][target.toString()]).forEach((property) => {
|
|
886
|
+
ReflectHelper.delete({
|
|
887
|
+
key,
|
|
888
|
+
target: target.object,
|
|
889
|
+
property: String(property),
|
|
890
|
+
});
|
|
891
|
+
ReflectHelper.remove(key, target, String(property));
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
ReflectHelper.delete({ key, target: target.object });
|
|
895
|
+
ReflectHelper.remove(key, target);
|
|
896
|
+
});
|
|
1042
897
|
}
|
|
1043
898
|
}
|
|
1044
|
-
_this.destination = new ConsumerObserver(partialObserver);
|
|
1045
|
-
return _this;
|
|
1046
|
-
}
|
|
1047
|
-
return SafeSubscriber;
|
|
1048
|
-
}(Subscriber));
|
|
1049
|
-
function handleUnhandledError(error) {
|
|
1050
|
-
{
|
|
1051
|
-
reportUnhandledError(error);
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
function defaultErrorHandler(err) {
|
|
1055
|
-
throw err;
|
|
1056
|
-
}
|
|
1057
|
-
var EMPTY_OBSERVER = {
|
|
1058
|
-
closed: true,
|
|
1059
|
-
next: noop,
|
|
1060
|
-
error: defaultErrorHandler,
|
|
1061
|
-
complete: noop,
|
|
1062
|
-
};
|
|
1063
|
-
|
|
1064
|
-
var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();
|
|
1065
|
-
|
|
1066
|
-
function identity(x) {
|
|
1067
|
-
return x;
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
function pipeFromArray(fns) {
|
|
1071
|
-
if (fns.length === 0) {
|
|
1072
|
-
return identity;
|
|
1073
899
|
}
|
|
1074
|
-
|
|
1075
|
-
return
|
|
900
|
+
static getType({ target, propertyKey }) {
|
|
901
|
+
return Reflect.getMetadata('design:type', target, propertyKey);
|
|
1076
902
|
}
|
|
1077
|
-
|
|
1078
|
-
return
|
|
1079
|
-
};
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
var Observable = (function () {
|
|
1083
|
-
function Observable(subscribe) {
|
|
1084
|
-
if (subscribe) {
|
|
1085
|
-
this._subscribe = subscribe;
|
|
1086
|
-
}
|
|
903
|
+
static getReturntype({ target, propertyKey }) {
|
|
904
|
+
return Reflect.getMetadata('design:returntype', target, propertyKey);
|
|
1087
905
|
}
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
906
|
+
static getAllMethods(target) {
|
|
907
|
+
const props = [];
|
|
908
|
+
let obj = target;
|
|
909
|
+
do {
|
|
910
|
+
props.push(...Object.getOwnPropertyNames(obj));
|
|
911
|
+
} while ((obj = Object.getPrototypeOf(obj)));
|
|
912
|
+
return props.sort().filter((e, i, arr) => {
|
|
913
|
+
if ([
|
|
914
|
+
'__defineGetter__',
|
|
915
|
+
'__defineSetter__',
|
|
916
|
+
'__lookupGetter__',
|
|
917
|
+
'__lookupSetter__',
|
|
918
|
+
'constructor',
|
|
919
|
+
'hasOwnProperty',
|
|
920
|
+
'isPrototypeOf',
|
|
921
|
+
'propertyIsEnumerable',
|
|
922
|
+
'toLocaleString',
|
|
923
|
+
'toString',
|
|
924
|
+
'valueOf',
|
|
925
|
+
].includes(e))
|
|
926
|
+
return false;
|
|
927
|
+
if (e != arr[i + 1] && typeof target[e] === 'function')
|
|
928
|
+
return true;
|
|
1107
929
|
});
|
|
1108
|
-
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
930
|
+
}
|
|
931
|
+
static put({ key, target, property, value, propertyDescriptor }) {
|
|
932
|
+
const index = target.constructor.name;
|
|
933
|
+
ReflectHelper.items[key] = ReflectHelper.items[key] || {};
|
|
934
|
+
ReflectHelper.items[key][index] = ReflectHelper.items[key][index] || {};
|
|
935
|
+
ReflectHelper.items[key][index].object = target;
|
|
936
|
+
if (lodash.isNil(property)) {
|
|
937
|
+
ReflectHelper.items[key][index].value = {
|
|
938
|
+
value,
|
|
939
|
+
propertyDescriptor,
|
|
940
|
+
};
|
|
1113
941
|
}
|
|
1114
|
-
|
|
1115
|
-
|
|
942
|
+
else {
|
|
943
|
+
ReflectHelper.items[key][index][String(property)] = ReflectHelper.items[key][index][String(property)] || {};
|
|
944
|
+
ReflectHelper.items[key][index][String(property)] = {
|
|
945
|
+
value,
|
|
946
|
+
propertyDescriptor,
|
|
947
|
+
};
|
|
1116
948
|
}
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
949
|
+
}
|
|
950
|
+
static remove(key, target, property) {
|
|
951
|
+
if (ReflectHelper.has(key, target, property))
|
|
952
|
+
return delete ReflectHelper.items[key][target][String(property)];
|
|
953
|
+
else if (ReflectHelper.has(key, target))
|
|
954
|
+
return delete ReflectHelper.items[key][target];
|
|
955
|
+
else if (ReflectHelper.has(key))
|
|
956
|
+
return delete ReflectHelper.items[key];
|
|
957
|
+
else
|
|
958
|
+
return false;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
ReflectHelper._items = {};
|
|
962
|
+
|
|
963
|
+
class DebugDecoratorHelper {
|
|
964
|
+
static set(target, options) {
|
|
965
|
+
ReflectHelper.add({
|
|
966
|
+
key: DebugDecoratorHelper.DebugNamingMetadataKey,
|
|
967
|
+
target,
|
|
968
|
+
value: options,
|
|
1136
969
|
});
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
Observable.prototype[observable] = function () {
|
|
1143
|
-
return this;
|
|
1144
|
-
};
|
|
1145
|
-
Observable.prototype.pipe = function () {
|
|
1146
|
-
var operations = [];
|
|
1147
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1148
|
-
operations[_i] = arguments[_i];
|
|
1149
|
-
}
|
|
1150
|
-
return pipeFromArray(operations)(this);
|
|
1151
|
-
};
|
|
1152
|
-
Observable.prototype.toPromise = function (promiseCtor) {
|
|
1153
|
-
var _this = this;
|
|
1154
|
-
promiseCtor = getPromiseCtor(promiseCtor);
|
|
1155
|
-
return new promiseCtor(function (resolve, reject) {
|
|
1156
|
-
var value;
|
|
1157
|
-
_this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });
|
|
970
|
+
}
|
|
971
|
+
static get(target) {
|
|
972
|
+
return ReflectHelper.first({
|
|
973
|
+
key: DebugDecoratorHelper.DebugNamingMetadataKey,
|
|
974
|
+
target,
|
|
1158
975
|
});
|
|
1159
|
-
}
|
|
1160
|
-
Observable.create = function (subscribe) {
|
|
1161
|
-
return new Observable(subscribe);
|
|
1162
|
-
};
|
|
1163
|
-
return Observable;
|
|
1164
|
-
}());
|
|
1165
|
-
function getPromiseCtor(promiseCtor) {
|
|
1166
|
-
var _a;
|
|
1167
|
-
return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
|
|
1168
|
-
}
|
|
1169
|
-
function isObserver(value) {
|
|
1170
|
-
return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
|
|
1171
|
-
}
|
|
1172
|
-
function isSubscriber(value) {
|
|
1173
|
-
return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
|
|
976
|
+
}
|
|
1174
977
|
}
|
|
978
|
+
DebugDecoratorHelper.DebugNamingMetadataKey = 'model:naming:decorator';
|
|
1175
979
|
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
980
|
+
class ClassNameHelper {
|
|
981
|
+
static get(clazz) {
|
|
982
|
+
if (!clazz)
|
|
983
|
+
return null;
|
|
984
|
+
const prototype = Object.getPrototypeOf(clazz);
|
|
985
|
+
const names = lodash.compact([
|
|
986
|
+
lodash.get(clazz, 'constructor.name'),
|
|
987
|
+
lodash.get(prototype, 'constructor.name'),
|
|
988
|
+
lodash.get(prototype, '__proto__.constructor.name'),
|
|
989
|
+
]);
|
|
990
|
+
return names.find((name) => name !== 'class_1');
|
|
991
|
+
}
|
|
992
|
+
}
|
|
1183
993
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
return
|
|
994
|
+
const isDebuggable = (object) => {
|
|
995
|
+
return 'debug' in object;
|
|
996
|
+
};
|
|
997
|
+
class DebugHelper {
|
|
998
|
+
static namespacesFor(target) {
|
|
999
|
+
if (lodash.isNil(target))
|
|
1000
|
+
return [];
|
|
1001
|
+
const decorator = DebugDecoratorHelper.get(Object.getPrototypeOf(target));
|
|
1002
|
+
const namespaces = lodash.get(decorator, 'namespaces', []);
|
|
1003
|
+
const name = lodash.get(decorator, 'name', ClassNameHelper.get(target));
|
|
1004
|
+
return [...namespaces, name];
|
|
1195
1005
|
}
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1006
|
+
static as(...namespaces) {
|
|
1007
|
+
return new DebugHelper(...namespaces);
|
|
1008
|
+
}
|
|
1009
|
+
static for(target, ...namespaces) {
|
|
1010
|
+
const targetNamespaces = this.namespacesFor(target);
|
|
1011
|
+
return new DebugHelper(...targetNamespaces, ...namespaces);
|
|
1012
|
+
}
|
|
1013
|
+
static from(target, ...namespaces) {
|
|
1014
|
+
if (this.isDebuggable(target)) {
|
|
1015
|
+
const debug = target.debug;
|
|
1016
|
+
if (namespaces)
|
|
1017
|
+
debug.push(...namespaces);
|
|
1018
|
+
return debug;
|
|
1204
1019
|
}
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
_this._throwIfClosed();
|
|
1211
|
-
if (!_this.isStopped) {
|
|
1212
|
-
if (!_this.currentObservers) {
|
|
1213
|
-
_this.currentObservers = Array.from(_this.observers);
|
|
1214
|
-
}
|
|
1215
|
-
try {
|
|
1216
|
-
for (var _b = tslib.__values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1217
|
-
var observer = _c.value;
|
|
1218
|
-
observer.next(value);
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1221
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1222
|
-
finally {
|
|
1223
|
-
try {
|
|
1224
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1225
|
-
}
|
|
1226
|
-
finally { if (e_1) throw e_1.error; }
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
});
|
|
1230
|
-
};
|
|
1231
|
-
Subject.prototype.error = function (err) {
|
|
1232
|
-
var _this = this;
|
|
1233
|
-
errorContext(function () {
|
|
1234
|
-
_this._throwIfClosed();
|
|
1235
|
-
if (!_this.isStopped) {
|
|
1236
|
-
_this.hasError = _this.isStopped = true;
|
|
1237
|
-
_this.thrownError = err;
|
|
1238
|
-
var observers = _this.observers;
|
|
1239
|
-
while (observers.length) {
|
|
1240
|
-
observers.shift().error(err);
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
});
|
|
1244
|
-
};
|
|
1245
|
-
Subject.prototype.complete = function () {
|
|
1246
|
-
var _this = this;
|
|
1247
|
-
errorContext(function () {
|
|
1248
|
-
_this._throwIfClosed();
|
|
1249
|
-
if (!_this.isStopped) {
|
|
1250
|
-
_this.isStopped = true;
|
|
1251
|
-
var observers = _this.observers;
|
|
1252
|
-
while (observers.length) {
|
|
1253
|
-
observers.shift().complete();
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
});
|
|
1257
|
-
};
|
|
1258
|
-
Subject.prototype.unsubscribe = function () {
|
|
1259
|
-
this.isStopped = this.closed = true;
|
|
1260
|
-
this.observers = this.currentObservers = null;
|
|
1261
|
-
};
|
|
1262
|
-
Object.defineProperty(Subject.prototype, "observed", {
|
|
1263
|
-
get: function () {
|
|
1264
|
-
var _a;
|
|
1265
|
-
return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
1266
|
-
},
|
|
1267
|
-
enumerable: false,
|
|
1268
|
-
configurable: true
|
|
1269
|
-
});
|
|
1270
|
-
Subject.prototype._trySubscribe = function (subscriber) {
|
|
1271
|
-
this._throwIfClosed();
|
|
1272
|
-
return _super.prototype._trySubscribe.call(this, subscriber);
|
|
1273
|
-
};
|
|
1274
|
-
Subject.prototype._subscribe = function (subscriber) {
|
|
1275
|
-
this._throwIfClosed();
|
|
1276
|
-
this._checkFinalizedStatuses(subscriber);
|
|
1277
|
-
return this._innerSubscribe(subscriber);
|
|
1278
|
-
};
|
|
1279
|
-
Subject.prototype._innerSubscribe = function (subscriber) {
|
|
1280
|
-
var _this = this;
|
|
1281
|
-
var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;
|
|
1282
|
-
if (hasError || isStopped) {
|
|
1283
|
-
return EMPTY_SUBSCRIPTION;
|
|
1020
|
+
return DebugHelper.for(target, ...namespaces);
|
|
1021
|
+
}
|
|
1022
|
+
static clonedFrom(target, ...namespaces) {
|
|
1023
|
+
if (this.isDebuggable(target)) {
|
|
1024
|
+
namespaces.push(...target.debug.entries);
|
|
1284
1025
|
}
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1026
|
+
else if (!lodash.isNil(target)) {
|
|
1027
|
+
namespaces.push(...this.namespacesFor(target));
|
|
1028
|
+
}
|
|
1029
|
+
return DebugHelper.for(target, ...namespaces);
|
|
1030
|
+
}
|
|
1031
|
+
static clone(target, ...namespaces) {
|
|
1032
|
+
let original;
|
|
1033
|
+
if (this.isDebuggable(target)) {
|
|
1034
|
+
original = target.debug;
|
|
1035
|
+
namespaces.push(...original.entries);
|
|
1036
|
+
}
|
|
1037
|
+
return {
|
|
1038
|
+
original,
|
|
1039
|
+
debug: DebugHelper.for(target, ...namespaces),
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
static replace(target, attrs) {
|
|
1043
|
+
if (this.isDebuggable(target))
|
|
1044
|
+
target.debug = attrs.with;
|
|
1045
|
+
}
|
|
1046
|
+
static mock(target, ...namespaces) {
|
|
1047
|
+
const { original, debug } = DebugHelper.clone(target, ...namespaces);
|
|
1048
|
+
DebugHelper.replace(target, { with: debug });
|
|
1049
|
+
return { original, debug };
|
|
1050
|
+
}
|
|
1051
|
+
constructor(...namespace) {
|
|
1052
|
+
this.namespaces = new Set();
|
|
1053
|
+
this.push(...namespace);
|
|
1054
|
+
}
|
|
1055
|
+
get entries() {
|
|
1056
|
+
return Array.from(lodash.get(this, 'namespaces', []));
|
|
1057
|
+
}
|
|
1058
|
+
get namespace() {
|
|
1059
|
+
return lodash.compact(lodash.flatten(this.entries)).join(':');
|
|
1060
|
+
}
|
|
1061
|
+
log(message, ...args) {
|
|
1062
|
+
this.logger(JSON.stringify(message), ...args.map((element) => JSON.stringify(element)));
|
|
1063
|
+
DebugHelper.logs$.next({ namespace: this.namespace, message, args });
|
|
1064
|
+
return this;
|
|
1065
|
+
}
|
|
1066
|
+
trace(message, ...args) {
|
|
1067
|
+
this.logger.extend(exports.DebugNamespaces.TRACE)(message, ...args);
|
|
1068
|
+
DebugHelper.traces$.next({ namespace: this.namespace, message, args });
|
|
1069
|
+
return this;
|
|
1070
|
+
}
|
|
1071
|
+
error(error, ...args) {
|
|
1072
|
+
this.logger.extend(exports.DebugNamespaces.ERROR)(JSON.stringify(error), ...args.map((element) => JSON.stringify(element)));
|
|
1073
|
+
DebugHelper.errors$.next({ namespace: this.namespace, error, args });
|
|
1074
|
+
return this;
|
|
1075
|
+
}
|
|
1076
|
+
build() {
|
|
1077
|
+
this.logger = Logger;
|
|
1078
|
+
this.tracer = Logger;
|
|
1079
|
+
this.err = Logger;
|
|
1080
|
+
this.entries.forEach((namespace) => {
|
|
1081
|
+
this.logger = this.logger.extend(namespace);
|
|
1082
|
+
this.tracer = this.tracer.extend(namespace);
|
|
1083
|
+
this.err = this.err.extend(namespace);
|
|
1290
1084
|
});
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1085
|
+
return this;
|
|
1086
|
+
}
|
|
1087
|
+
with(...namespace) {
|
|
1088
|
+
return new DebugHelper(...this.entries, ...namespace);
|
|
1089
|
+
}
|
|
1090
|
+
push(...namespace) {
|
|
1091
|
+
if (namespace) {
|
|
1092
|
+
namespace.filter((item) => Boolean(item)).forEach((item) => this.namespaces.add(item));
|
|
1296
1093
|
}
|
|
1297
|
-
|
|
1298
|
-
|
|
1094
|
+
return this.build();
|
|
1095
|
+
}
|
|
1096
|
+
unshift(...namespace) {
|
|
1097
|
+
if (namespace) {
|
|
1098
|
+
return this.reset(...namespace, ...this.entries);
|
|
1299
1099
|
}
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
return
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1100
|
+
return this;
|
|
1101
|
+
}
|
|
1102
|
+
reset(...namespace) {
|
|
1103
|
+
this.namespaces = new Set(lodash.flatten(lodash.compact(namespace)));
|
|
1104
|
+
return this.build();
|
|
1105
|
+
}
|
|
1106
|
+
startWith(...namespace) {
|
|
1107
|
+
const current = this.namespaces;
|
|
1108
|
+
this.namespaces = new Set(lodash.flatten([lodash.compact(namespace), ...current]));
|
|
1109
|
+
return this.build();
|
|
1110
|
+
}
|
|
1111
|
+
shift() {
|
|
1112
|
+
const list = this.entries;
|
|
1113
|
+
list.shift();
|
|
1114
|
+
return this.reset(...list);
|
|
1115
|
+
}
|
|
1116
|
+
pop() {
|
|
1117
|
+
const list = this.entries;
|
|
1118
|
+
list.pop();
|
|
1119
|
+
return this.reset(...list);
|
|
1120
|
+
}
|
|
1121
|
+
clear() {
|
|
1122
|
+
return this.reset();
|
|
1123
|
+
}
|
|
1124
|
+
remove(...namespace) {
|
|
1125
|
+
if (namespace) {
|
|
1126
|
+
namespace.filter((item) => Boolean(item)).forEach((item) => this.namespaces.delete(item));
|
|
1127
|
+
}
|
|
1128
|
+
return this.build();
|
|
1318
1129
|
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1130
|
+
puts(...args) {
|
|
1131
|
+
return [`[${this.namespace}]`, ...args].join(' ');
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
DebugHelper.logs$ = new Subject();
|
|
1135
|
+
DebugHelper.traces$ = new Subject();
|
|
1136
|
+
DebugHelper.errors$ = new Subject();
|
|
1137
|
+
DebugHelper.isDebuggable = isDebuggable;
|
|
1138
|
+
|
|
1139
|
+
function Debug(opts) {
|
|
1140
|
+
return function (target) {
|
|
1141
|
+
DebugDecoratorHelper.set(target.prototype, opts);
|
|
1326
1142
|
};
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
const ASYNC_IDENTIFIER = 'async';
|
|
1146
|
+
function Log(options = {}) {
|
|
1147
|
+
return Trace(Object.assign({ level: 'log' }, options));
|
|
1148
|
+
}
|
|
1149
|
+
function Trace(options = {}) {
|
|
1150
|
+
return function (target, propertyKey, propertyDescriptor) {
|
|
1151
|
+
const method = propertyDescriptor.value;
|
|
1152
|
+
const isPromise = method.toString().includes(ASYNC_IDENTIFIER);
|
|
1153
|
+
const args = {
|
|
1154
|
+
options,
|
|
1155
|
+
method,
|
|
1156
|
+
target,
|
|
1157
|
+
propertyKey,
|
|
1158
|
+
propertyDescriptor,
|
|
1159
|
+
};
|
|
1160
|
+
propertyDescriptor.value = isPromise ? promiseTracer(args) : functionTracer(args);
|
|
1161
|
+
return propertyDescriptor;
|
|
1330
1162
|
};
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1163
|
+
}
|
|
1164
|
+
const traceCall = function ({ target, propertyKey, propertyDescriptor, args }) {
|
|
1165
|
+
if (!target.debug)
|
|
1166
|
+
target.debug = DebugHelper.for(target, propertyKey);
|
|
1167
|
+
return target.debug.push(propertyKey).trace('called', { target, propertyKey, propertyDescriptor, args });
|
|
1168
|
+
};
|
|
1169
|
+
const promiseTracer = function ({ options, method, propertyKey, propertyDescriptor }) {
|
|
1170
|
+
return function (...args) {
|
|
1171
|
+
return new Promise((resolve, reject) => {
|
|
1172
|
+
const debug = traceCall({ target: this, propertyDescriptor, propertyKey, args });
|
|
1173
|
+
return method
|
|
1174
|
+
.apply(this, args)
|
|
1175
|
+
.then((result) => {
|
|
1176
|
+
if (options.callbackFn) {
|
|
1177
|
+
options.callbackFn({ target: this, result, args, namespace: [propertyKey] });
|
|
1178
|
+
}
|
|
1179
|
+
if (lodash.get(options, 'level', '') === 'log') {
|
|
1180
|
+
debug.log({ req: args, res: result === undefined ? 'void' : result });
|
|
1181
|
+
}
|
|
1182
|
+
return resolve(result);
|
|
1183
|
+
})
|
|
1184
|
+
.catch((error) => {
|
|
1185
|
+
debug.error({ req: args, res: error, stack: error.stack });
|
|
1186
|
+
return reject(error);
|
|
1187
|
+
});
|
|
1188
|
+
});
|
|
1334
1189
|
};
|
|
1335
|
-
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
DebugNamespaces["ROOT"] = "connect";
|
|
1341
|
-
DebugNamespaces["TRACE"] = "trace";
|
|
1342
|
-
DebugNamespaces["ERROR"] = "error";
|
|
1343
|
-
})(exports.DebugNamespaces || (exports.DebugNamespaces = {}));
|
|
1344
|
-
const Logger = debug.debug(exports.DebugNamespaces.ROOT);
|
|
1345
|
-
|
|
1346
|
-
class ReflectHelper {
|
|
1347
|
-
static get items() {
|
|
1348
|
-
return this._items;
|
|
1349
|
-
}
|
|
1350
|
-
static get keys() {
|
|
1351
|
-
return Object.keys(ReflectHelper.items);
|
|
1352
|
-
}
|
|
1353
|
-
static has(key, target, property) {
|
|
1354
|
-
return (!lodash.isNil(key) &&
|
|
1355
|
-
!lodash.isNil(ReflectHelper.items[key]) &&
|
|
1356
|
-
(lodash.isNil(target) ||
|
|
1357
|
-
(!lodash.isNil(ReflectHelper.items[key][target]) &&
|
|
1358
|
-
(lodash.isNil(property) || !lodash.isNil(ReflectHelper.items[key][target][String(property)])))));
|
|
1359
|
-
}
|
|
1360
|
-
static get({ key, target, property, own = true }) {
|
|
1190
|
+
};
|
|
1191
|
+
const functionTracer = function ({ options, target, method, propertyKey, propertyDescriptor, }) {
|
|
1192
|
+
return function (...args) {
|
|
1193
|
+
const debug = traceCall({ target: this || target, propertyDescriptor, propertyKey, args });
|
|
1194
|
+
let result;
|
|
1361
1195
|
try {
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1196
|
+
result = method.apply(this, args);
|
|
1197
|
+
if (options.callbackFn)
|
|
1198
|
+
options.callbackFn({ target: this, result, args, namespace: [propertyKey] });
|
|
1199
|
+
if (lodash.get(options, 'level', '') === 'log') {
|
|
1200
|
+
debug.log({ req: args, res: result === undefined ? 'void' : result });
|
|
1367
1201
|
}
|
|
1202
|
+
return result;
|
|
1368
1203
|
}
|
|
1369
|
-
catch (
|
|
1370
|
-
|
|
1204
|
+
catch (error) {
|
|
1205
|
+
if (error instanceof Error)
|
|
1206
|
+
debug.error({ req: args, res: error, stack: error.stack });
|
|
1207
|
+
throw error;
|
|
1371
1208
|
}
|
|
1209
|
+
};
|
|
1210
|
+
};
|
|
1211
|
+
|
|
1212
|
+
function is(value) {
|
|
1213
|
+
return value;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
const isUUID = (value) => lodash.isString(value) && /[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}/.test(value);
|
|
1217
|
+
|
|
1218
|
+
class Base {
|
|
1219
|
+
constructor(...args) {
|
|
1220
|
+
Object.assign(this, ...args);
|
|
1372
1221
|
}
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
const parseDateTime = (value) => {
|
|
1225
|
+
if (!lodash.isString(value))
|
|
1226
|
+
return value;
|
|
1227
|
+
if (!/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.test(value) &&
|
|
1228
|
+
!/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T\d{2}:\d{2}:\d{2}/.test(value))
|
|
1229
|
+
return value;
|
|
1230
|
+
const date = dateFns.parseISO(value);
|
|
1231
|
+
if (isNaN(date.getTime()))
|
|
1232
|
+
return value;
|
|
1233
|
+
return date;
|
|
1234
|
+
};
|
|
1235
|
+
|
|
1236
|
+
class BaseModel {
|
|
1237
|
+
get identifier() {
|
|
1238
|
+
const fields = this.constructor.identifiersFields.filter((field) => field !== 'identifier');
|
|
1239
|
+
const data = this;
|
|
1240
|
+
return fields.reduce((object, field) => (Object.assign(Object.assign({}, object), { [field]: data[field] })), {});
|
|
1384
1241
|
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
if (!Array.isArray(values))
|
|
1388
|
-
values = [values];
|
|
1389
|
-
values.push(value);
|
|
1390
|
-
ReflectHelper.set({ key, target, property, value: values, propertyDescriptor });
|
|
1242
|
+
get identifiersFields() {
|
|
1243
|
+
return this.constructor.identifiersFields;
|
|
1391
1244
|
}
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
return lodash.flatten(Object.keys(items).map((item) => lodash.flatten(this.allFrom(key, items[item]))));
|
|
1245
|
+
constructor(args) {
|
|
1246
|
+
Object.assign(this, args);
|
|
1395
1247
|
}
|
|
1396
|
-
static
|
|
1397
|
-
return
|
|
1398
|
-
.filter((property) => property !== 'object')
|
|
1399
|
-
.map((property) => this.allValuesFrom(key, target, property));
|
|
1248
|
+
static toInstance(data) {
|
|
1249
|
+
return classTransformer.plainToInstance(this, data || {});
|
|
1400
1250
|
}
|
|
1401
|
-
static
|
|
1402
|
-
|
|
1403
|
-
let value = values.value;
|
|
1404
|
-
const propertyDescriptor = values.propertyDescriptor;
|
|
1405
|
-
if (!lodash.isArray(value))
|
|
1406
|
-
value = [value];
|
|
1407
|
-
return lodash.flatten(value.map((val) => {
|
|
1408
|
-
return {
|
|
1409
|
-
key,
|
|
1410
|
-
target: target.object,
|
|
1411
|
-
property,
|
|
1412
|
-
value: val,
|
|
1413
|
-
propertyDescriptor,
|
|
1414
|
-
};
|
|
1415
|
-
}));
|
|
1251
|
+
static isModel(value) {
|
|
1252
|
+
return value instanceof this;
|
|
1416
1253
|
}
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
return ReflectHelper.remove(key, target, property);
|
|
1254
|
+
toPlain() {
|
|
1255
|
+
return classTransformer.instanceToPlain(this);
|
|
1420
1256
|
}
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
exports.GenderDestination = void 0;
|
|
1260
|
+
(function (GenderDestination) {
|
|
1261
|
+
GenderDestination["FEMALE"] = "female";
|
|
1262
|
+
GenderDestination["MALE"] = "male";
|
|
1263
|
+
GenderDestination["UNISEX"] = "unisex";
|
|
1264
|
+
})(exports.GenderDestination || (exports.GenderDestination = {}));
|
|
1265
|
+
|
|
1266
|
+
exports.ProductLabelEnum = void 0;
|
|
1267
|
+
(function (ProductLabelEnum) {
|
|
1268
|
+
ProductLabelEnum["ON_SALE"] = "on-sale";
|
|
1269
|
+
ProductLabelEnum["OUTLET"] = "outlet";
|
|
1270
|
+
ProductLabelEnum["LAST_UNITS"] = "last-units";
|
|
1271
|
+
ProductLabelEnum["GLAMSTAR"] = "glamstar";
|
|
1272
|
+
})(exports.ProductLabelEnum || (exports.ProductLabelEnum = {}));
|
|
1273
|
+
|
|
1274
|
+
exports.Shops = void 0;
|
|
1275
|
+
(function (Shops) {
|
|
1276
|
+
Shops["MENSMARKET"] = "mensmarket";
|
|
1277
|
+
Shops["GLAMSHOP"] = "Glamshop";
|
|
1278
|
+
Shops["GLAMPOINTS"] = "Glampoints";
|
|
1279
|
+
Shops["ALL"] = "ALL";
|
|
1280
|
+
})(exports.Shops || (exports.Shops = {}));
|
|
1281
|
+
|
|
1282
|
+
exports.WishlistLogType = void 0;
|
|
1283
|
+
(function (WishlistLogType) {
|
|
1284
|
+
WishlistLogType["CREATE"] = "create";
|
|
1285
|
+
WishlistLogType["UPDATE"] = "update";
|
|
1286
|
+
WishlistLogType["DELETE"] = "delete";
|
|
1287
|
+
WishlistLogType["ADD_PRODUCT"] = "add_product";
|
|
1288
|
+
WishlistLogType["REMOVE_PRODUCT"] = "remove_product";
|
|
1289
|
+
})(exports.WishlistLogType || (exports.WishlistLogType = {}));
|
|
1290
|
+
|
|
1291
|
+
class Category extends BaseModel {
|
|
1292
|
+
static get identifiersFields() {
|
|
1293
|
+
return ['id'];
|
|
1445
1294
|
}
|
|
1446
|
-
|
|
1447
|
-
return
|
|
1295
|
+
get glamImages() {
|
|
1296
|
+
return this.images && this.images[exports.Shops.GLAMSHOP]
|
|
1297
|
+
? this.images[exports.Shops.GLAMSHOP]
|
|
1298
|
+
: {
|
|
1299
|
+
brandBanner: null,
|
|
1300
|
+
brandBannerMobile: null,
|
|
1301
|
+
image: null,
|
|
1302
|
+
};
|
|
1448
1303
|
}
|
|
1449
|
-
|
|
1450
|
-
return
|
|
1304
|
+
get mensImages() {
|
|
1305
|
+
return this.images && this.images[exports.Shops.MENSMARKET]
|
|
1306
|
+
? this.images[exports.Shops.MENSMARKET]
|
|
1307
|
+
: {
|
|
1308
|
+
brandBanner: null,
|
|
1309
|
+
brandBannerMobile: null,
|
|
1310
|
+
image: null,
|
|
1311
|
+
};
|
|
1451
1312
|
}
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
let obj = target;
|
|
1455
|
-
do {
|
|
1456
|
-
props.push(...Object.getOwnPropertyNames(obj));
|
|
1457
|
-
} while ((obj = Object.getPrototypeOf(obj)));
|
|
1458
|
-
return props.sort().filter((e, i, arr) => {
|
|
1459
|
-
if ([
|
|
1460
|
-
'__defineGetter__',
|
|
1461
|
-
'__defineSetter__',
|
|
1462
|
-
'__lookupGetter__',
|
|
1463
|
-
'__lookupSetter__',
|
|
1464
|
-
'constructor',
|
|
1465
|
-
'hasOwnProperty',
|
|
1466
|
-
'isPrototypeOf',
|
|
1467
|
-
'propertyIsEnumerable',
|
|
1468
|
-
'toLocaleString',
|
|
1469
|
-
'toString',
|
|
1470
|
-
'valueOf',
|
|
1471
|
-
].includes(e))
|
|
1472
|
-
return false;
|
|
1473
|
-
if (e != arr[i + 1] && typeof target[e] === 'function')
|
|
1474
|
-
return true;
|
|
1475
|
-
});
|
|
1313
|
+
get glamMetadata() {
|
|
1314
|
+
return this.metadatas.find((metadata) => metadata.shop === exports.Shops.GLAMSHOP);
|
|
1476
1315
|
}
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
ReflectHelper.items[key] = ReflectHelper.items[key] || {};
|
|
1480
|
-
ReflectHelper.items[key][index] = ReflectHelper.items[key][index] || {};
|
|
1481
|
-
ReflectHelper.items[key][index].object = target;
|
|
1482
|
-
if (lodash.isNil(property)) {
|
|
1483
|
-
ReflectHelper.items[key][index].value = {
|
|
1484
|
-
value,
|
|
1485
|
-
propertyDescriptor,
|
|
1486
|
-
};
|
|
1487
|
-
}
|
|
1488
|
-
else {
|
|
1489
|
-
ReflectHelper.items[key][index][String(property)] = ReflectHelper.items[key][index][String(property)] || {};
|
|
1490
|
-
ReflectHelper.items[key][index][String(property)] = {
|
|
1491
|
-
value,
|
|
1492
|
-
propertyDescriptor,
|
|
1493
|
-
};
|
|
1494
|
-
}
|
|
1316
|
+
get mensMetadata() {
|
|
1317
|
+
return this.metadatas.find((metadata) => metadata.shop === exports.Shops.MENSMARKET);
|
|
1495
1318
|
}
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
return delete ReflectHelper.items[key][target][String(property)];
|
|
1499
|
-
else if (ReflectHelper.has(key, target))
|
|
1500
|
-
return delete ReflectHelper.items[key][target];
|
|
1501
|
-
else if (ReflectHelper.has(key))
|
|
1502
|
-
return delete ReflectHelper.items[key];
|
|
1503
|
-
else
|
|
1504
|
-
return false;
|
|
1319
|
+
getMostRelevantByShop(shop) {
|
|
1320
|
+
return this.mostRelevants && this.mostRelevants[shop] ? this.mostRelevants[shop] : [];
|
|
1505
1321
|
}
|
|
1506
1322
|
}
|
|
1507
|
-
|
|
1323
|
+
tslib.__decorate([
|
|
1324
|
+
classTransformer.Type(() => Category),
|
|
1325
|
+
tslib.__metadata("design:type", Category)
|
|
1326
|
+
], Category.prototype, "parent", void 0);
|
|
1327
|
+
tslib.__decorate([
|
|
1328
|
+
classTransformer.Type(resolveClass('Product')),
|
|
1329
|
+
tslib.__metadata("design:type", Array)
|
|
1330
|
+
], Category.prototype, "childrenProducts", void 0);
|
|
1331
|
+
tslib.__decorate([
|
|
1332
|
+
classTransformer.Type(resolveClass('Filter')),
|
|
1333
|
+
tslib.__metadata("design:type", Array)
|
|
1334
|
+
], Category.prototype, "filters", void 0);
|
|
1335
|
+
registerClass('Category', Category);
|
|
1508
1336
|
|
|
1509
|
-
class
|
|
1510
|
-
static
|
|
1511
|
-
|
|
1512
|
-
key: DebugDecoratorHelper.DebugNamingMetadataKey,
|
|
1513
|
-
target,
|
|
1514
|
-
value: options,
|
|
1515
|
-
});
|
|
1516
|
-
}
|
|
1517
|
-
static get(target) {
|
|
1518
|
-
return ReflectHelper.first({
|
|
1519
|
-
key: DebugDecoratorHelper.DebugNamingMetadataKey,
|
|
1520
|
-
target,
|
|
1521
|
-
});
|
|
1337
|
+
class CategoryCollectionChildren extends BaseModel {
|
|
1338
|
+
static get identifiersFields() {
|
|
1339
|
+
return ['collectionId', 'categoryId'];
|
|
1522
1340
|
}
|
|
1523
1341
|
}
|
|
1524
|
-
|
|
1342
|
+
tslib.__decorate([
|
|
1343
|
+
classTransformer.Type(() => CategoryCollectionChildren),
|
|
1344
|
+
tslib.__metadata("design:type", CategoryCollectionChildren)
|
|
1345
|
+
], CategoryCollectionChildren.prototype, "parent", void 0);
|
|
1525
1346
|
|
|
1526
|
-
class
|
|
1527
|
-
static get(
|
|
1528
|
-
|
|
1529
|
-
return null;
|
|
1530
|
-
const prototype = Object.getPrototypeOf(clazz);
|
|
1531
|
-
const names = lodash.compact([
|
|
1532
|
-
lodash.get(clazz, 'constructor.name'),
|
|
1533
|
-
lodash.get(prototype, 'constructor.name'),
|
|
1534
|
-
lodash.get(prototype, '__proto__.constructor.name'),
|
|
1535
|
-
]);
|
|
1536
|
-
return names.find((name) => name !== 'class_1');
|
|
1347
|
+
class Filter extends BaseModel {
|
|
1348
|
+
static get identifiersFields() {
|
|
1349
|
+
return ['id'];
|
|
1537
1350
|
}
|
|
1538
1351
|
}
|
|
1352
|
+
tslib.__decorate([
|
|
1353
|
+
classTransformer.Type(() => Category),
|
|
1354
|
+
tslib.__metadata("design:type", Array)
|
|
1355
|
+
], Filter.prototype, "categories", void 0);
|
|
1356
|
+
registerClass('Filter', Filter);
|
|
1539
1357
|
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
class DebugHelper {
|
|
1544
|
-
static namespacesFor(target) {
|
|
1545
|
-
if (lodash.isNil(target))
|
|
1546
|
-
return [];
|
|
1547
|
-
const decorator = DebugDecoratorHelper.get(Object.getPrototypeOf(target));
|
|
1548
|
-
const namespaces = lodash.get(decorator, 'namespaces', []);
|
|
1549
|
-
const name = lodash.get(decorator, 'name', ClassNameHelper.get(target));
|
|
1550
|
-
return [...namespaces, name];
|
|
1358
|
+
class CategoryFilter extends BaseModel {
|
|
1359
|
+
static get identifiersFields() {
|
|
1360
|
+
return ['id'];
|
|
1551
1361
|
}
|
|
1552
|
-
|
|
1553
|
-
|
|
1362
|
+
}
|
|
1363
|
+
tslib.__decorate([
|
|
1364
|
+
classTransformer.Type(() => Filter),
|
|
1365
|
+
tslib.__metadata("design:type", Filter)
|
|
1366
|
+
], CategoryFilter.prototype, "filter", void 0);
|
|
1367
|
+
tslib.__decorate([
|
|
1368
|
+
classTransformer.Type(() => Category),
|
|
1369
|
+
tslib.__metadata("design:type", Category)
|
|
1370
|
+
], CategoryFilter.prototype, "category", void 0);
|
|
1371
|
+
|
|
1372
|
+
class CategoryProduct extends BaseModel {
|
|
1373
|
+
static get identifiersFields() {
|
|
1374
|
+
return ['categoryId', 'productId'];
|
|
1554
1375
|
}
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
class FilterOption extends BaseModel {
|
|
1379
|
+
static get identifiersFields() {
|
|
1380
|
+
return ['id'];
|
|
1558
1381
|
}
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
return debug;
|
|
1565
|
-
}
|
|
1566
|
-
return DebugHelper.for(target, ...namespaces);
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
class KitProduct extends BaseModel {
|
|
1385
|
+
static get identifiersFields() {
|
|
1386
|
+
return ['productId', 'kitProductId'];
|
|
1567
1387
|
}
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1388
|
+
}
|
|
1389
|
+
tslib.__decorate([
|
|
1390
|
+
classTransformer.Type(resolveClass('Product')),
|
|
1391
|
+
tslib.__metadata("design:type", Function)
|
|
1392
|
+
], KitProduct.prototype, "kit", void 0);
|
|
1393
|
+
tslib.__decorate([
|
|
1394
|
+
classTransformer.Type(resolveClass('Product')),
|
|
1395
|
+
tslib.__metadata("design:type", Function)
|
|
1396
|
+
], KitProduct.prototype, "product", void 0);
|
|
1397
|
+
registerClass('KitProduct', KitProduct);
|
|
1398
|
+
|
|
1399
|
+
class ProductReview extends BaseModel {
|
|
1400
|
+
static get identifiersFields() {
|
|
1401
|
+
return ['id'];
|
|
1576
1402
|
}
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
namespaces.push(...original.entries);
|
|
1582
|
-
}
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
class ProductBase extends BaseModel {
|
|
1406
|
+
get evaluation() {
|
|
1583
1407
|
return {
|
|
1584
|
-
|
|
1585
|
-
|
|
1408
|
+
reviews: this.reviews,
|
|
1409
|
+
count: this.reviewsTotal,
|
|
1410
|
+
rating: this.rate,
|
|
1586
1411
|
};
|
|
1587
1412
|
}
|
|
1588
|
-
|
|
1589
|
-
if (
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
this.namespaces = new Set();
|
|
1599
|
-
this.push(...namespace);
|
|
1600
|
-
}
|
|
1601
|
-
get entries() {
|
|
1602
|
-
return Array.from(lodash.get(this, 'namespaces', []));
|
|
1603
|
-
}
|
|
1604
|
-
get namespace() {
|
|
1605
|
-
return lodash.compact(lodash.flatten(this.entries)).join(':');
|
|
1606
|
-
}
|
|
1607
|
-
log(message, ...args) {
|
|
1608
|
-
this.logger(JSON.stringify(message), ...args.map((element) => JSON.stringify(element)));
|
|
1609
|
-
DebugHelper.logs$.next({ namespace: this.namespace, message, args });
|
|
1610
|
-
return this;
|
|
1611
|
-
}
|
|
1612
|
-
trace(message, ...args) {
|
|
1613
|
-
this.logger.extend(exports.DebugNamespaces.TRACE)(message, ...args);
|
|
1614
|
-
DebugHelper.traces$.next({ namespace: this.namespace, message, args });
|
|
1615
|
-
return this;
|
|
1413
|
+
set evaluation(evaluation) {
|
|
1414
|
+
if (!evaluation) {
|
|
1415
|
+
this.reviews = null;
|
|
1416
|
+
this.reviewsTotal = null;
|
|
1417
|
+
this.rate = null;
|
|
1418
|
+
return;
|
|
1419
|
+
}
|
|
1420
|
+
this.reviews = evaluation.reviews || this.reviews;
|
|
1421
|
+
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
1422
|
+
this.rate = evaluation.rating || this.rate;
|
|
1616
1423
|
}
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
DebugHelper.errors$.next({ namespace: this.namespace, error, args });
|
|
1620
|
-
return this;
|
|
1424
|
+
static get identifiersFields() {
|
|
1425
|
+
return ['id'];
|
|
1621
1426
|
}
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1427
|
+
}
|
|
1428
|
+
tslib.__decorate([
|
|
1429
|
+
classTransformer.Type(() => Category),
|
|
1430
|
+
tslib.__metadata("design:type", Category)
|
|
1431
|
+
], ProductBase.prototype, "category", void 0);
|
|
1432
|
+
tslib.__decorate([
|
|
1433
|
+
classTransformer.Type(() => KitProduct),
|
|
1434
|
+
tslib.__metadata("design:type", Array)
|
|
1435
|
+
], ProductBase.prototype, "kitProducts", void 0);
|
|
1436
|
+
tslib.__decorate([
|
|
1437
|
+
classTransformer.Type(() => ProductReview),
|
|
1438
|
+
tslib.__metadata("design:type", Array)
|
|
1439
|
+
], ProductBase.prototype, "reviews", void 0);
|
|
1440
|
+
|
|
1441
|
+
class Variant extends ProductBase {
|
|
1442
|
+
static get identifiersFields() {
|
|
1443
|
+
return ['id', 'productId'];
|
|
1632
1444
|
}
|
|
1633
|
-
|
|
1634
|
-
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
class Product extends ProductBase {
|
|
1448
|
+
}
|
|
1449
|
+
tslib.__decorate([
|
|
1450
|
+
classTransformer.Type(() => Variant),
|
|
1451
|
+
tslib.__metadata("design:type", Array)
|
|
1452
|
+
], Product.prototype, "variants", void 0);
|
|
1453
|
+
registerClass('Product', Product);
|
|
1454
|
+
|
|
1455
|
+
class ProductErrors extends BaseModel {
|
|
1456
|
+
static get identifiersFields() {
|
|
1457
|
+
return ['productId', 'source', 'error'];
|
|
1635
1458
|
}
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
namespace.filter((item) => Boolean(item)).forEach((item) => this.namespaces.add(item));
|
|
1639
|
-
}
|
|
1640
|
-
return this.build();
|
|
1459
|
+
getProductId() {
|
|
1460
|
+
return this.product instanceof Product ? this.product.id.toString() : this.product.productId.toString();
|
|
1641
1461
|
}
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1462
|
+
}
|
|
1463
|
+
tslib.__decorate([
|
|
1464
|
+
classTransformer.Type((type) => (+type.object.product.productId ? Variant : Product)),
|
|
1465
|
+
tslib.__metadata("design:type", Object)
|
|
1466
|
+
], ProductErrors.prototype, "product", void 0);
|
|
1467
|
+
|
|
1468
|
+
class ProductStockNotification extends BaseModel {
|
|
1469
|
+
static get identifiersFields() {
|
|
1470
|
+
return ['id'];
|
|
1647
1471
|
}
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
class Wishlist extends Category {
|
|
1475
|
+
static get identifiersFields() {
|
|
1476
|
+
return ['id'];
|
|
1651
1477
|
}
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
class Buy2Win extends BaseModel {
|
|
1481
|
+
static get identifiersFields() {
|
|
1482
|
+
return ['id'];
|
|
1656
1483
|
}
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1484
|
+
}
|
|
1485
|
+
tslib.__decorate([
|
|
1486
|
+
classTransformer.Type(() => Category),
|
|
1487
|
+
tslib.__metadata("design:type", Array)
|
|
1488
|
+
], Buy2Win.prototype, "categories", void 0);
|
|
1489
|
+
|
|
1490
|
+
exports.Where = void 0;
|
|
1491
|
+
(function (Where) {
|
|
1492
|
+
Where["EQUALS"] = "==";
|
|
1493
|
+
Where["NOTEQUALS"] = "!=";
|
|
1494
|
+
Where["GT"] = ">";
|
|
1495
|
+
Where["GTE"] = ">=";
|
|
1496
|
+
Where["IN"] = "in";
|
|
1497
|
+
Where["NOTIN"] = "not in";
|
|
1498
|
+
Where["LT"] = "<";
|
|
1499
|
+
Where["LTE"] = "<=";
|
|
1500
|
+
Where["LIKE"] = "like";
|
|
1501
|
+
Where["NOTLIKE"] = "not like";
|
|
1502
|
+
Where["ISNULL"] = "is null";
|
|
1503
|
+
Where["ISNOTNULL"] = "is not null";
|
|
1504
|
+
Where["IREGEX"] = "iregex";
|
|
1505
|
+
})(exports.Where || (exports.Where = {}));
|
|
1506
|
+
|
|
1507
|
+
exports.UpdateOptionActions = void 0;
|
|
1508
|
+
(function (UpdateOptionActions) {
|
|
1509
|
+
UpdateOptionActions["UPDATE"] = "update";
|
|
1510
|
+
UpdateOptionActions["MERGE"] = "merge";
|
|
1511
|
+
UpdateOptionActions["REMOVE"] = "remove";
|
|
1512
|
+
UpdateOptionActions["REMOVE_FIELD"] = "removeField";
|
|
1513
|
+
UpdateOptionActions["NULL"] = "null";
|
|
1514
|
+
})(exports.UpdateOptionActions || (exports.UpdateOptionActions = {}));
|
|
1515
|
+
|
|
1516
|
+
class CampaignDashboard extends BaseModel {
|
|
1517
|
+
static get identifiersFields() {
|
|
1518
|
+
return ['id'];
|
|
1661
1519
|
}
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
class CampaignHashtag extends BaseModel {
|
|
1523
|
+
static get identifiersFields() {
|
|
1524
|
+
return ['id'];
|
|
1666
1525
|
}
|
|
1667
|
-
|
|
1668
|
-
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
class BeautyProfile extends BaseModel {
|
|
1529
|
+
toPlain() {
|
|
1530
|
+
const plain = super.toPlain();
|
|
1531
|
+
delete plain.id;
|
|
1532
|
+
return plain;
|
|
1669
1533
|
}
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
namespace.filter((item) => Boolean(item)).forEach((item) => this.namespaces.delete(item));
|
|
1673
|
-
}
|
|
1674
|
-
return this.build();
|
|
1534
|
+
static get identifiersFields() {
|
|
1535
|
+
return ['id', 'userId'];
|
|
1675
1536
|
}
|
|
1676
|
-
|
|
1677
|
-
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
exports.AccessoryImportances = void 0;
|
|
1540
|
+
(function (AccessoryImportances) {
|
|
1541
|
+
AccessoryImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
|
|
1542
|
+
AccessoryImportances["LIKE_RARELY_USE"] = "Gosto, mas uso poucos";
|
|
1543
|
+
AccessoryImportances["LIKE_ALWAYS_FOLLOW_FASHION"] = "Gosto muito de acess\u00F3rios e sempre procuro acompanhar a moda";
|
|
1544
|
+
})(exports.AccessoryImportances || (exports.AccessoryImportances = {}));
|
|
1545
|
+
|
|
1546
|
+
exports.Area = void 0;
|
|
1547
|
+
(function (Area) {
|
|
1548
|
+
Area["GP"] = "Geral";
|
|
1549
|
+
Area["CRM"] = "CRM";
|
|
1550
|
+
Area["MediaProd"] = "Media Production";
|
|
1551
|
+
Area["Tech"] = "Tecnologia";
|
|
1552
|
+
Area["Transactional"] = "Transacional";
|
|
1553
|
+
Area["Operations"] = "Opera\u00E7\u00F5es";
|
|
1554
|
+
Area["Sales"] = "Comercial";
|
|
1555
|
+
Area["Finantial"] = "Financeiro";
|
|
1556
|
+
Area["HR"] = "RH";
|
|
1557
|
+
})(exports.Area || (exports.Area = {}));
|
|
1558
|
+
|
|
1559
|
+
exports.BeardProblems = void 0;
|
|
1560
|
+
(function (BeardProblems) {
|
|
1561
|
+
BeardProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
1562
|
+
BeardProblems["DRY"] = "Barba Seca";
|
|
1563
|
+
BeardProblems["OILY"] = "Barba Oleaosa";
|
|
1564
|
+
BeardProblems["DANCRUFF"] = "Barba com Caspa";
|
|
1565
|
+
BeardProblems["INGROWN_HAIRS"] = "P\u00EAlos Encravados";
|
|
1566
|
+
BeardProblems["DOESNT_GROW"] = "N\u00E3o Cresce";
|
|
1567
|
+
BeardProblems["SPARSE_BEARD"] = "Barba Rala";
|
|
1568
|
+
})(exports.BeardProblems || (exports.BeardProblems = {}));
|
|
1569
|
+
|
|
1570
|
+
exports.BeardSizes = void 0;
|
|
1571
|
+
(function (BeardSizes) {
|
|
1572
|
+
BeardSizes["BIG"] = "Grande";
|
|
1573
|
+
BeardSizes["MEDIUM"] = "M\u00E9dia";
|
|
1574
|
+
BeardSizes["SHORT"] = "Curta";
|
|
1575
|
+
BeardSizes["MUSTACHE"] = "Bigode";
|
|
1576
|
+
BeardSizes["NOTHING"] = "Sem Barba";
|
|
1577
|
+
})(exports.BeardSizes || (exports.BeardSizes = {}));
|
|
1578
|
+
|
|
1579
|
+
exports.BeautyProductImportances = void 0;
|
|
1580
|
+
(function (BeautyProductImportances) {
|
|
1581
|
+
BeautyProductImportances["KNOW_LITTLE_ABOUT"] = "Conhe\u00E7o bem pouco de produtos de beleza e rotinas de cuidados";
|
|
1582
|
+
BeautyProductImportances["ALREADY_BOUGHT_NOTHING_SPECIALIZED"] = "J\u00E1 comprei alguns produtos b\u00E1sicos para cuidar de mim, mas nada muito especializado";
|
|
1583
|
+
BeautyProductImportances["GOOD_CARE_MYSELF"] = "Me considero um homem que se cuida bem. Conhe\u00E7o sobre produtos especializados e me preocupo em ter uma rotina de cuidados";
|
|
1584
|
+
BeautyProductImportances["PERSONAL_CARE_EXPERT"] = "Sou um expert em cuidados pessoais";
|
|
1585
|
+
})(exports.BeautyProductImportances || (exports.BeautyProductImportances = {}));
|
|
1586
|
+
|
|
1587
|
+
exports.BodyProblems = void 0;
|
|
1588
|
+
(function (BodyProblems) {
|
|
1589
|
+
BodyProblems["NO_WORRIES"] = "Sem preocupa\u00E7\u00F5es";
|
|
1590
|
+
BodyProblems["FLACCIDITY"] = "Flacidez";
|
|
1591
|
+
BodyProblems["LOCALIZED_FAT"] = "Gordura Localizada";
|
|
1592
|
+
BodyProblems["STRETCH_MARKS"] = "Estrias";
|
|
1593
|
+
BodyProblems["SENSITIVE_SKIN"] = "Pele Sens\u00EDvel";
|
|
1594
|
+
BodyProblems["DRY_SKIN"] = "Pele Seca";
|
|
1595
|
+
BodyProblems["OILY_ACNE"] = "Oleosa/Acne";
|
|
1596
|
+
BodyProblems["SKIN_FRECKLES"] = "Pele com Sardas";
|
|
1597
|
+
BodyProblems["PHOTOSENSITIVE_SKIN"] = "Pele Fotossens\u00EDvel";
|
|
1598
|
+
})(exports.BodyProblems || (exports.BodyProblems = {}));
|
|
1599
|
+
|
|
1600
|
+
exports.BodyShapes = void 0;
|
|
1601
|
+
(function (BodyShapes) {
|
|
1602
|
+
BodyShapes["LEAN"] = "Magro";
|
|
1603
|
+
BodyShapes["REGULAR"] = "Regular";
|
|
1604
|
+
BodyShapes["OVERWEIGHT"] = "Acima do Peso";
|
|
1605
|
+
BodyShapes["ATHLETIC"] = "Atl\u00E9tico";
|
|
1606
|
+
BodyShapes["MUSCULAR"] = "Musculoso";
|
|
1607
|
+
})(exports.BodyShapes || (exports.BodyShapes = {}));
|
|
1608
|
+
|
|
1609
|
+
exports.BodyTattoos = void 0;
|
|
1610
|
+
(function (BodyTattoos) {
|
|
1611
|
+
BodyTattoos["NONE"] = "Nenhuma";
|
|
1612
|
+
BodyTattoos["HAS_DOESNT_CARE"] = "Tenho mas n\u00E3o cuido";
|
|
1613
|
+
BodyTattoos["HAS_CARE_LOT"] = "Tenho e cuido bastante";
|
|
1614
|
+
})(exports.BodyTattoos || (exports.BodyTattoos = {}));
|
|
1615
|
+
|
|
1616
|
+
exports.FaceSkinOilinesses = void 0;
|
|
1617
|
+
(function (FaceSkinOilinesses) {
|
|
1618
|
+
FaceSkinOilinesses["DRY"] = "Seca";
|
|
1619
|
+
FaceSkinOilinesses["OILY"] = "Oleaosa";
|
|
1620
|
+
FaceSkinOilinesses["MIXED"] = "Mista";
|
|
1621
|
+
FaceSkinOilinesses["NORMAL"] = "Normal";
|
|
1622
|
+
FaceSkinOilinesses["DONT_KNOW"] = "Eu n\u00E3o sei como dizer";
|
|
1623
|
+
})(exports.FaceSkinOilinesses || (exports.FaceSkinOilinesses = {}));
|
|
1624
|
+
|
|
1625
|
+
exports.FaceSkinProblems = void 0;
|
|
1626
|
+
(function (FaceSkinProblems) {
|
|
1627
|
+
FaceSkinProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
1628
|
+
FaceSkinProblems["DARK_CIRCLES"] = "Olheiras";
|
|
1629
|
+
FaceSkinProblems["WRINKLES"] = "Rugas";
|
|
1630
|
+
FaceSkinProblems["BLACKHEADS_PIMPLES"] = "Cravos e Espinhas";
|
|
1631
|
+
FaceSkinProblems["STAINS"] = "Manchas";
|
|
1632
|
+
FaceSkinProblems["FRECKLES"] = "Sardas";
|
|
1633
|
+
FaceSkinProblems["SENSITIVE"] = "Sens\u00EDvel";
|
|
1634
|
+
FaceSkinProblems["PHOTOSENSITIVE"] = "Fotossens\u00EDvel";
|
|
1635
|
+
})(exports.FaceSkinProblems || (exports.FaceSkinProblems = {}));
|
|
1636
|
+
|
|
1637
|
+
exports.FaceSkinTones = void 0;
|
|
1638
|
+
(function (FaceSkinTones) {
|
|
1639
|
+
FaceSkinTones["VERY_CLEAR"] = "Muito Clara";
|
|
1640
|
+
FaceSkinTones["CLEAR"] = "Clara";
|
|
1641
|
+
FaceSkinTones["MEDIUM_LIGHT"] = "Clara M\u00E9dia";
|
|
1642
|
+
FaceSkinTones["MEDIUM_DARK"] = "Escura M\u00E9dia";
|
|
1643
|
+
FaceSkinTones["DARK"] = "Escura";
|
|
1644
|
+
FaceSkinTones["VERY_DARK"] = "Muito Escura";
|
|
1645
|
+
})(exports.FaceSkinTones || (exports.FaceSkinTones = {}));
|
|
1646
|
+
|
|
1647
|
+
exports.FamilyIncomes = void 0;
|
|
1648
|
+
(function (FamilyIncomes) {
|
|
1649
|
+
FamilyIncomes["UNTIL_3000"] = "At\u00E9 R$3.000";
|
|
1650
|
+
FamilyIncomes["SINCE_3001_TO_7000"] = "De R$3.001 a R$7.000";
|
|
1651
|
+
FamilyIncomes["SINCE_7001_TO_10000"] = "De R$7.001 a R$10.000";
|
|
1652
|
+
FamilyIncomes["SINCE_10001_TO_15000"] = "De R$10.001 a R$15.000";
|
|
1653
|
+
FamilyIncomes["GRAN_THAN_15000"] = "Mais de R$15.000";
|
|
1654
|
+
FamilyIncomes["NOW_ANSWER"] = "Prefiro nao responder";
|
|
1655
|
+
})(exports.FamilyIncomes || (exports.FamilyIncomes = {}));
|
|
1656
|
+
|
|
1657
|
+
exports.FragranceImportances = void 0;
|
|
1658
|
+
(function (FragranceImportances) {
|
|
1659
|
+
FragranceImportances["NOT_INTERESTED"] = "N\u00E3o tenho interesse";
|
|
1660
|
+
FragranceImportances["LIKE_ALWAYS_USE_SAME"] = "Gosto de perfumes, mas uso sempre os mesmos";
|
|
1661
|
+
FragranceImportances["LIKE_INNOVATE"] = "Gosto de inovar e conhecer novas fragr\u00E2ncias";
|
|
1662
|
+
})(exports.FragranceImportances || (exports.FragranceImportances = {}));
|
|
1663
|
+
|
|
1664
|
+
exports.HairColors = void 0;
|
|
1665
|
+
(function (HairColors) {
|
|
1666
|
+
HairColors["BLACK"] = "Preto";
|
|
1667
|
+
HairColors["DARK_BROWN"] = "Castanho Escuro";
|
|
1668
|
+
HairColors["LIGHT_BROWN"] = "Castanho Claro";
|
|
1669
|
+
HairColors["DARK_BLONDE"] = "Loiro Escuro";
|
|
1670
|
+
HairColors["LIGHT_BLONDE"] = "Loiro Claro";
|
|
1671
|
+
HairColors["WHITE_GRAY"] = "Branco/Grisalho";
|
|
1672
|
+
HairColors["REDHEAD"] = "Ruivo";
|
|
1673
|
+
HairColors["OTHER"] = "RuiOutroo";
|
|
1674
|
+
})(exports.HairColors || (exports.HairColors = {}));
|
|
1675
|
+
|
|
1676
|
+
exports.HairProblems = void 0;
|
|
1677
|
+
(function (HairProblems) {
|
|
1678
|
+
HairProblems["NO_PROBLEMS"] = "Sem problemas";
|
|
1679
|
+
HairProblems["DANCRUFF"] = "Caspa";
|
|
1680
|
+
HairProblems["LOSS"] = "Queda";
|
|
1681
|
+
HairProblems["OILY"] = "Oleosidade";
|
|
1682
|
+
HairProblems["DRYNESS"] = "Ressecamento";
|
|
1683
|
+
HairProblems["CHEMICAL"] = "Quimica";
|
|
1684
|
+
HairProblems["WHITE_HAIR"] = "Cabelos Brancos";
|
|
1685
|
+
HairProblems["REBEL_WIRES"] = "Fios Rebeldes";
|
|
1686
|
+
})(exports.HairProblems || (exports.HairProblems = {}));
|
|
1687
|
+
|
|
1688
|
+
exports.HairStrands = void 0;
|
|
1689
|
+
(function (HairStrands) {
|
|
1690
|
+
HairStrands["NORMAL"] = "Fio Normal";
|
|
1691
|
+
HairStrands["DRY"] = "Fio Seco";
|
|
1692
|
+
HairStrands["OILY"] = "Fio Oleoso";
|
|
1693
|
+
HairStrands["MIXED"] = "Fio Misto";
|
|
1694
|
+
HairStrands["FINE"] = "Fio Fino";
|
|
1695
|
+
HairStrands["THICK"] = "Fio Grosso";
|
|
1696
|
+
})(exports.HairStrands || (exports.HairStrands = {}));
|
|
1697
|
+
|
|
1698
|
+
exports.HairTypes = void 0;
|
|
1699
|
+
(function (HairTypes) {
|
|
1700
|
+
HairTypes["Smooth"] = "Liso";
|
|
1701
|
+
HairTypes["WAVY"] = "Ondulado";
|
|
1702
|
+
HairTypes["CURLY"] = "Cacheado";
|
|
1703
|
+
HairTypes["FRIZZY"] = "Crespo";
|
|
1704
|
+
HairTypes["BALD"] = "Sou careca";
|
|
1705
|
+
})(exports.HairTypes || (exports.HairTypes = {}));
|
|
1706
|
+
|
|
1707
|
+
exports.OfficePosition = void 0;
|
|
1708
|
+
(function (OfficePosition) {
|
|
1709
|
+
OfficePosition["Intern"] = "Estagi\u00E1rio";
|
|
1710
|
+
OfficePosition["Analyst"] = "Analista";
|
|
1711
|
+
OfficePosition["Manager"] = "Gerente";
|
|
1712
|
+
OfficePosition["Director"] = "Diretor";
|
|
1713
|
+
})(exports.OfficePosition || (exports.OfficePosition = {}));
|
|
1714
|
+
|
|
1715
|
+
exports.PersonTypes = void 0;
|
|
1716
|
+
(function (PersonTypes) {
|
|
1717
|
+
PersonTypes["GLAMGIRL"] = "glamgirl";
|
|
1718
|
+
PersonTypes["BFLU"] = "bflu";
|
|
1719
|
+
PersonTypes["NONE"] = "none";
|
|
1720
|
+
})(exports.PersonTypes || (exports.PersonTypes = {}));
|
|
1721
|
+
|
|
1722
|
+
exports.ProductSpents = void 0;
|
|
1723
|
+
(function (ProductSpents) {
|
|
1724
|
+
ProductSpents["UNTIL_50"] = "At\u00E9 R$50";
|
|
1725
|
+
ProductSpents["SINCE_51_TO_100"] = "De R$51 a R$100";
|
|
1726
|
+
ProductSpents["SINCE_101_TO_200"] = "De R$101 a R$200";
|
|
1727
|
+
ProductSpents["SINCE_201_TO_300"] = "De R$201 a R$300";
|
|
1728
|
+
ProductSpents["GRAN_THAN_300"] = "Mais de R$300";
|
|
1729
|
+
ProductSpents["NOW_ANSWER"] = "Prefiro nao responder";
|
|
1730
|
+
})(exports.ProductSpents || (exports.ProductSpents = {}));
|
|
1731
|
+
|
|
1732
|
+
exports.UserType = void 0;
|
|
1733
|
+
(function (UserType) {
|
|
1734
|
+
UserType["B2C"] = "Cliente Transacional";
|
|
1735
|
+
UserType["GlamGirl"] = "Glamgirl";
|
|
1736
|
+
UserType["MensBoy"] = "Mensboy";
|
|
1737
|
+
UserType["B2B"] = "Company";
|
|
1738
|
+
UserType["Collaborator"] = "Funcion\u00E1rio";
|
|
1739
|
+
UserType["Influencer"] = "Influencer";
|
|
1740
|
+
})(exports.UserType || (exports.UserType = {}));
|
|
1741
|
+
|
|
1742
|
+
class Lead extends BaseModel {
|
|
1743
|
+
static get identifiersFields() {
|
|
1744
|
+
return ['id'];
|
|
1678
1745
|
}
|
|
1679
1746
|
}
|
|
1680
|
-
DebugHelper.logs$ = new Subject();
|
|
1681
|
-
DebugHelper.traces$ = new Subject();
|
|
1682
|
-
DebugHelper.errors$ = new Subject();
|
|
1683
|
-
DebugHelper.isDebuggable = isDebuggable;
|
|
1684
1747
|
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
}
|
|
1748
|
+
class Edition extends BaseModel {
|
|
1749
|
+
static get identifiersFields() {
|
|
1750
|
+
return ['id', 'subscriptionId'];
|
|
1751
|
+
}
|
|
1689
1752
|
}
|
|
1690
1753
|
|
|
1691
|
-
|
|
1692
|
-
function
|
|
1693
|
-
|
|
1694
|
-
}
|
|
1695
|
-
function Trace(options = {}) {
|
|
1696
|
-
return function (target, propertyKey, propertyDescriptor) {
|
|
1697
|
-
const method = propertyDescriptor.value;
|
|
1698
|
-
const isPromise = method.toString().includes(ASYNC_IDENTIFIER);
|
|
1699
|
-
const args = {
|
|
1700
|
-
options,
|
|
1701
|
-
method,
|
|
1702
|
-
target,
|
|
1703
|
-
propertyKey,
|
|
1704
|
-
propertyDescriptor,
|
|
1705
|
-
};
|
|
1706
|
-
propertyDescriptor.value = isPromise ? promiseTracer(args) : functionTracer(args);
|
|
1707
|
-
return propertyDescriptor;
|
|
1708
|
-
};
|
|
1709
|
-
}
|
|
1710
|
-
const traceCall = function ({ target, propertyKey, propertyDescriptor, args }) {
|
|
1711
|
-
if (!target.debug)
|
|
1712
|
-
target.debug = DebugHelper.for(target, propertyKey);
|
|
1713
|
-
return target.debug.push(propertyKey).trace('called', { target, propertyKey, propertyDescriptor, args });
|
|
1714
|
-
};
|
|
1715
|
-
const promiseTracer = function ({ options, method, propertyKey, propertyDescriptor }) {
|
|
1716
|
-
return function (...args) {
|
|
1717
|
-
return new Promise((resolve, reject) => {
|
|
1718
|
-
const debug = traceCall({ target: this, propertyDescriptor, propertyKey, args });
|
|
1719
|
-
return method
|
|
1720
|
-
.apply(this, args)
|
|
1721
|
-
.then((result) => {
|
|
1722
|
-
if (options.callbackFn) {
|
|
1723
|
-
options.callbackFn({ target: this, result, args, namespace: [propertyKey] });
|
|
1724
|
-
}
|
|
1725
|
-
if (lodash.get(options, 'level', '') === 'log') {
|
|
1726
|
-
debug.log({ req: args, res: result === undefined ? 'void' : result });
|
|
1727
|
-
}
|
|
1728
|
-
return resolve(result);
|
|
1729
|
-
})
|
|
1730
|
-
.catch((error) => {
|
|
1731
|
-
debug.error({ req: args, res: error, stack: error.stack });
|
|
1732
|
-
return reject(error);
|
|
1733
|
-
});
|
|
1734
|
-
});
|
|
1735
|
-
};
|
|
1736
|
-
};
|
|
1737
|
-
const functionTracer = function ({ options, target, method, propertyKey, propertyDescriptor, }) {
|
|
1738
|
-
return function (...args) {
|
|
1739
|
-
const debug = traceCall({ target: this || target, propertyDescriptor, propertyKey, args });
|
|
1740
|
-
let result;
|
|
1741
|
-
try {
|
|
1742
|
-
result = method.apply(this, args);
|
|
1743
|
-
if (options.callbackFn)
|
|
1744
|
-
options.callbackFn({ target: this, result, args, namespace: [propertyKey] });
|
|
1745
|
-
if (lodash.get(options, 'level', '') === 'log') {
|
|
1746
|
-
debug.log({ req: args, res: result === undefined ? 'void' : result });
|
|
1747
|
-
}
|
|
1748
|
-
return result;
|
|
1749
|
-
}
|
|
1750
|
-
catch (error) {
|
|
1751
|
-
if (error instanceof Error)
|
|
1752
|
-
debug.error({ req: args, res: error, stack: error.stack });
|
|
1753
|
-
throw error;
|
|
1754
|
-
}
|
|
1755
|
-
};
|
|
1756
|
-
};
|
|
1754
|
+
exports.BillingStatus = void 0;
|
|
1755
|
+
(function (BillingStatus) {
|
|
1756
|
+
BillingStatus["PAYED"] = "PAGO";
|
|
1757
|
+
})(exports.BillingStatus || (exports.BillingStatus = {}));
|
|
1757
1758
|
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1759
|
+
exports.EditionStatus = void 0;
|
|
1760
|
+
(function (EditionStatus) {
|
|
1761
|
+
EditionStatus["ALLOCATION_WAITING"] = "Aguardando aloca\u00E7\u00E3o";
|
|
1762
|
+
EditionStatus["SHIPPED"] = "Enviado";
|
|
1763
|
+
})(exports.EditionStatus || (exports.EditionStatus = {}));
|
|
1761
1764
|
|
|
1762
|
-
|
|
1765
|
+
exports.PaymentType = void 0;
|
|
1766
|
+
(function (PaymentType) {
|
|
1767
|
+
PaymentType["AQUISITION"] = "Aquisi\u00E7\u00E3o";
|
|
1768
|
+
PaymentType["RENEWAL"] = "Renova\u00E7\u00E3o";
|
|
1769
|
+
PaymentType["FREIGHT"] = "mudan\u00E7a de endere\u00E7o, Frete";
|
|
1770
|
+
})(exports.PaymentType || (exports.PaymentType = {}));
|
|
1763
1771
|
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1772
|
+
exports.Plans = void 0;
|
|
1773
|
+
(function (Plans) {
|
|
1774
|
+
Plans["SELECT"] = "SELECT";
|
|
1775
|
+
Plans["PRIME"] = "PRIME";
|
|
1776
|
+
Plans["SELECT_MENSAL"] = "SELECT_MENSAL";
|
|
1777
|
+
Plans["PRIME_MENSAL"] = "PRIME_MENSAL";
|
|
1778
|
+
})(exports.Plans || (exports.Plans = {}));
|
|
1779
|
+
|
|
1780
|
+
exports.Status = void 0;
|
|
1781
|
+
(function (Status) {
|
|
1782
|
+
Status["ACTIVE"] = "active";
|
|
1783
|
+
Status["CANCELLED"] = "Cancelado";
|
|
1784
|
+
})(exports.Status || (exports.Status = {}));
|
|
1785
|
+
|
|
1786
|
+
class PaymentTransaction extends BaseModel {
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
class Payment extends BaseModel {
|
|
1790
|
+
static get identifiersFields() {
|
|
1791
|
+
return ['id'];
|
|
1767
1792
|
}
|
|
1768
1793
|
}
|
|
1794
|
+
tslib.__decorate([
|
|
1795
|
+
classTransformer.Type(() => PaymentTransaction),
|
|
1796
|
+
tslib.__metadata("design:type", PaymentTransaction)
|
|
1797
|
+
], Payment.prototype, "transaction", void 0);
|
|
1769
1798
|
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
return
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
return date;
|
|
1780
|
-
};
|
|
1799
|
+
class SubscriptionPayment extends BaseModel {
|
|
1800
|
+
static get identifiersFields() {
|
|
1801
|
+
return ['id', 'subscriptionId'];
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
tslib.__decorate([
|
|
1805
|
+
classTransformer.Type(() => Payment),
|
|
1806
|
+
tslib.__metadata("design:type", Payment)
|
|
1807
|
+
], SubscriptionPayment.prototype, "payment", void 0);
|
|
1781
1808
|
|
|
1782
1809
|
class Coupon extends BaseModel {
|
|
1783
1810
|
get isInfluencer() {
|
|
@@ -5012,9 +5039,6 @@ tslib.__decorate([
|
|
|
5012
5039
|
tslib.__metadata("design:type", Product)
|
|
5013
5040
|
], KitProductHasuraGraphQL.prototype, "product", void 0);
|
|
5014
5041
|
|
|
5015
|
-
class ProductErrorsHasuraGraphQL extends ProductErrors {
|
|
5016
|
-
}
|
|
5017
|
-
|
|
5018
5042
|
class ProductHasuraGraphQL extends Product {
|
|
5019
5043
|
}
|
|
5020
5044
|
tslib.__decorate([
|
|
@@ -5025,6 +5049,13 @@ tslib.__decorate([
|
|
|
5025
5049
|
class VariantHasuraGraphQL extends Variant {
|
|
5026
5050
|
}
|
|
5027
5051
|
|
|
5052
|
+
class ProductErrorsHasuraGraphQL extends ProductErrors {
|
|
5053
|
+
}
|
|
5054
|
+
tslib.__decorate([
|
|
5055
|
+
classTransformer.Type((type) => (+type.object.product.productId ? VariantHasuraGraphQL : ProductHasuraGraphQL)),
|
|
5056
|
+
tslib.__metadata("design:type", Object)
|
|
5057
|
+
], ProductErrorsHasuraGraphQL.prototype, "product", void 0);
|
|
5058
|
+
|
|
5028
5059
|
class CategoryCollectionChildrenHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5029
5060
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5030
5061
|
super({
|
|
@@ -7656,10 +7687,13 @@ exports.VertexAxiosAdapter = VertexAxiosAdapter;
|
|
|
7656
7687
|
exports.WeakPasswordError = WeakPasswordError;
|
|
7657
7688
|
exports.Wishlist = Wishlist;
|
|
7658
7689
|
exports.WishlistHasuraGraphQLRepository = WishlistHasuraGraphQLRepository;
|
|
7690
|
+
exports.getClass = getClass;
|
|
7659
7691
|
exports.is = is;
|
|
7660
7692
|
exports.isDebuggable = isDebuggable;
|
|
7661
7693
|
exports.isUUID = isUUID;
|
|
7662
7694
|
exports.parseDateTime = parseDateTime;
|
|
7695
|
+
exports.registerClass = registerClass;
|
|
7696
|
+
exports.resolveClass = resolveClass;
|
|
7663
7697
|
exports.withCreateFirestore = withCreateFirestore;
|
|
7664
7698
|
exports.withCreateHasuraGraphQL = withCreateHasuraGraphQL;
|
|
7665
7699
|
exports.withCrudFirestore = withCrudFirestore;
|