@skroz/profile-api 1.0.24 → 1.0.26
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.
|
@@ -16,17 +16,23 @@ let TypeOrmBaseEntity = class TypeOrmBaseEntity extends typeorm_1.BaseEntity {
|
|
|
16
16
|
};
|
|
17
17
|
exports.TypeOrmBaseEntity = TypeOrmBaseEntity;
|
|
18
18
|
__decorate([
|
|
19
|
-
(0, type_graphql_1.Field)(() => type_graphql_1.ID
|
|
19
|
+
(0, type_graphql_1.Field)(() => type_graphql_1.ID, {
|
|
20
|
+
description: JSON.stringify({ en: 'The object ID.', ru: 'ID объекта.' }),
|
|
21
|
+
}),
|
|
20
22
|
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
21
23
|
__metadata("design:type", Number)
|
|
22
24
|
], TypeOrmBaseEntity.prototype, "id", void 0);
|
|
23
25
|
__decorate([
|
|
24
|
-
(0, type_graphql_1.Field)(
|
|
26
|
+
(0, type_graphql_1.Field)({
|
|
27
|
+
description: JSON.stringify({ en: 'The date the object was created.', ru: 'Дата создания объекта.' }),
|
|
28
|
+
}),
|
|
25
29
|
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
26
30
|
__metadata("design:type", Date)
|
|
27
31
|
], TypeOrmBaseEntity.prototype, "createdAt", void 0);
|
|
28
32
|
__decorate([
|
|
29
|
-
(0, type_graphql_1.Field)(
|
|
33
|
+
(0, type_graphql_1.Field)({
|
|
34
|
+
description: JSON.stringify({ en: 'The date of the last update of the object.', ru: 'Дата последнего обновления объекта.' }),
|
|
35
|
+
}),
|
|
30
36
|
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz' }),
|
|
31
37
|
__metadata("design:type", Date)
|
|
32
38
|
], TypeOrmBaseEntity.prototype, "updatedAt", void 0);
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { TypeOrmBaseEntity } from './TypeOrmBaseEntity';
|
|
2
|
+
/**
|
|
3
|
+
* Поля БЕЗ @Field() — они чувствительные или требуют access control.
|
|
4
|
+
* Их нужно раскрывать через @FieldResolver в резолвере конкретного проекта,
|
|
5
|
+
* чтобы контролировать доступ (например, отдавать только самому пользователю).
|
|
6
|
+
* Пример: ProfileResolver.ts в vikneska-ai-api.
|
|
7
|
+
*
|
|
8
|
+
* Поля С @Field() — публичные, безопасно раскрывать всем без ограничений.
|
|
9
|
+
*/
|
|
2
10
|
export declare abstract class TypeOrmBaseUser extends TypeOrmBaseEntity {
|
|
3
11
|
static config: {
|
|
4
12
|
isOnlineSeconds: number;
|
|
@@ -14,6 +14,14 @@ exports.TypeOrmBaseUser = void 0;
|
|
|
14
14
|
const typeorm_1 = require("typeorm");
|
|
15
15
|
const type_graphql_1 = require("type-graphql");
|
|
16
16
|
const TypeOrmBaseEntity_1 = require("./TypeOrmBaseEntity");
|
|
17
|
+
/**
|
|
18
|
+
* Поля БЕЗ @Field() — они чувствительные или требуют access control.
|
|
19
|
+
* Их нужно раскрывать через @FieldResolver в резолвере конкретного проекта,
|
|
20
|
+
* чтобы контролировать доступ (например, отдавать только самому пользователю).
|
|
21
|
+
* Пример: ProfileResolver.ts в vikneska-ai-api.
|
|
22
|
+
*
|
|
23
|
+
* Поля С @Field() — публичные, безопасно раскрывать всем без ограничений.
|
|
24
|
+
*/
|
|
17
25
|
let TypeOrmBaseUser = TypeOrmBaseUser_1 = class TypeOrmBaseUser extends TypeOrmBaseEntity_1.TypeOrmBaseEntity {
|
|
18
26
|
checkOnline(seconds) {
|
|
19
27
|
if (!this.lastSeenAt)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skroz/profile-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "git@gitlab.com:skroz/libs/utils.git",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"type-graphql": "^1.1.1",
|
|
45
45
|
"typeorm": "^0.2.45"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "105a08c62e1935692e81544ebb66e0a2b51e594e"
|
|
48
48
|
}
|
|
@@ -8,15 +8,21 @@ import { Field, ID, ObjectType } from 'type-graphql';
|
|
|
8
8
|
|
|
9
9
|
@ObjectType({ isAbstract: true })
|
|
10
10
|
export abstract class TypeOrmBaseEntity extends TypeORMBaseEntity {
|
|
11
|
-
@Field(() => ID
|
|
11
|
+
@Field(() => ID, {
|
|
12
|
+
description: JSON.stringify({ en: 'The object ID.', ru: 'ID объекта.' }),
|
|
13
|
+
})
|
|
12
14
|
@PrimaryGeneratedColumn()
|
|
13
15
|
public id!: number;
|
|
14
16
|
|
|
15
|
-
@Field(
|
|
17
|
+
@Field({
|
|
18
|
+
description: JSON.stringify({ en: 'The date the object was created.', ru: 'Дата создания объекта.' }),
|
|
19
|
+
})
|
|
16
20
|
@CreateDateColumn({ type: 'timestamptz' })
|
|
17
21
|
public createdAt!: Date;
|
|
18
22
|
|
|
19
|
-
@Field(
|
|
23
|
+
@Field({
|
|
24
|
+
description: JSON.stringify({ en: 'The date of the last update of the object.', ru: 'Дата последнего обновления объекта.' }),
|
|
25
|
+
})
|
|
20
26
|
@UpdateDateColumn({ type: 'timestamptz' })
|
|
21
27
|
public updatedAt!: Date;
|
|
22
28
|
}
|
|
@@ -2,6 +2,14 @@ import { Column } from 'typeorm';
|
|
|
2
2
|
import { Field, ObjectType, GraphQLTimestamp } from 'type-graphql';
|
|
3
3
|
import { TypeOrmBaseEntity } from './TypeOrmBaseEntity';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Поля БЕЗ @Field() — они чувствительные или требуют access control.
|
|
7
|
+
* Их нужно раскрывать через @FieldResolver в резолвере конкретного проекта,
|
|
8
|
+
* чтобы контролировать доступ (например, отдавать только самому пользователю).
|
|
9
|
+
* Пример: ProfileResolver.ts в vikneska-ai-api.
|
|
10
|
+
*
|
|
11
|
+
* Поля С @Field() — публичные, безопасно раскрывать всем без ограничений.
|
|
12
|
+
*/
|
|
5
13
|
@ObjectType({ isAbstract: true })
|
|
6
14
|
export abstract class TypeOrmBaseUser extends TypeOrmBaseEntity {
|
|
7
15
|
public static config = {
|