@things-factory/font-base 4.0.0-y.0 → 4.0.5
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/dist-server/service/font/font-mutation.js +25 -2
- package/dist-server/service/font/font-mutation.js.map +1 -1
- package/dist-server/service/font/font.js +2 -2
- package/dist-server/service/font/font.js.map +1 -1
- package/dist-server/service/index.js +6 -4
- package/dist-server/service/index.js.map +1 -1
- package/package.json +4 -4
- package/server/service/font/font-mutation.ts +35 -5
- package/server/service/font/font.ts +6 -6
- package/server/service/index.ts +10 -8
|
@@ -15,13 +15,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.FontMutation = void 0;
|
|
16
16
|
const type_graphql_1 = require("type-graphql");
|
|
17
17
|
const typeorm_1 = require("typeorm");
|
|
18
|
+
const shell_1 = require("@things-factory/shell");
|
|
18
19
|
const font_1 = require("./font");
|
|
19
20
|
const font_type_1 = require("./font-type");
|
|
21
|
+
function notifyChanges(event, domain, font) {
|
|
22
|
+
const { name, provider, uri, path, active } = font;
|
|
23
|
+
const { subdomain } = domain;
|
|
24
|
+
shell_1.pubsub.publish('notify-font-changed', {
|
|
25
|
+
event,
|
|
26
|
+
font: {
|
|
27
|
+
domain: {
|
|
28
|
+
subdomain
|
|
29
|
+
},
|
|
30
|
+
name,
|
|
31
|
+
provider,
|
|
32
|
+
uri,
|
|
33
|
+
path,
|
|
34
|
+
active
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
20
38
|
let FontMutation = class FontMutation {
|
|
21
39
|
async createFont(font, context) {
|
|
22
40
|
const { domain, user } = context.state;
|
|
23
41
|
const repository = (0, typeorm_1.getRepository)(font_1.Font);
|
|
24
|
-
|
|
42
|
+
const created = await repository.save(Object.assign({ domain, creator: user, updater: user }, font));
|
|
43
|
+
notifyChanges('created', domain, created);
|
|
44
|
+
return created;
|
|
25
45
|
}
|
|
26
46
|
async updateFont(id, patch, context) {
|
|
27
47
|
const { domain, user } = context.state;
|
|
@@ -32,7 +52,9 @@ let FontMutation = class FontMutation {
|
|
|
32
52
|
id
|
|
33
53
|
}
|
|
34
54
|
});
|
|
35
|
-
|
|
55
|
+
const updated = await repository.save(Object.assign(Object.assign(Object.assign({}, font), patch), { updater: user }));
|
|
56
|
+
notifyChanges('updated', domain, updated);
|
|
57
|
+
return updated;
|
|
36
58
|
}
|
|
37
59
|
async deleteFont(id, context) {
|
|
38
60
|
const { domain } = context.state;
|
|
@@ -43,6 +65,7 @@ let FontMutation = class FontMutation {
|
|
|
43
65
|
if (font) {
|
|
44
66
|
await repository.remove(font);
|
|
45
67
|
}
|
|
68
|
+
notifyChanges('removed', domain, font);
|
|
46
69
|
return true;
|
|
47
70
|
}
|
|
48
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font-mutation.js","sourceRoot":"","sources":["../../../server/service/font/font-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"font-mutation.js","sourceRoot":"","sources":["../../../server/service/font/font-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA2D;AAC3D,qCAAuC;AAEvC,iDAA8C;AAE9C,iCAA6B;AAC7B,2CAAgD;AAEhD,SAAS,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI;IACxC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAClD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAC5B,cAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE;QACpC,KAAK;QACL,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,SAAS;aACV;YACD,IAAI;YACJ,QAAQ;YACR,GAAG;YACH,IAAI;YACJ,MAAM;SACP;KACF,CAAC,CAAA;AACJ,CAAC;AAED,IAAa,YAAY,GAAzB,MAAa,YA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,IAAI,IAAI,EAAE;YACR,MAAM,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;SAC9B;QAED,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QAEtC,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AAzDC;IADC,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,WAAI,EAAE,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAC/C,WAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,GAAE,CAAA;;qCAAf,mBAAO;;8CAe1C;AAGD;IADC,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,WAAI,EAAE,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;IACvD,WAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IAAoB,WAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,qBAAS;;8CAoBrE;AAGD;IADC,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAC9C,WAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;8CAe7C;AA1DU,YAAY;IADxB,IAAA,uBAAQ,EAAC,WAAI,CAAC;GACF,YAAY,CA2DxB;AA3DY,oCAAY"}
|
|
@@ -11,10 +11,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var _a, _b, _c;
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.Font = void 0;
|
|
14
|
-
const typeorm_1 = require("typeorm");
|
|
15
14
|
const type_graphql_1 = require("type-graphql");
|
|
16
|
-
const
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
17
16
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
17
|
+
const shell_1 = require("@things-factory/shell");
|
|
18
18
|
let Font = class Font {
|
|
19
19
|
};
|
|
20
20
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.js","sourceRoot":"","sources":["../../../server/service/font/font.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCASgB;
|
|
1
|
+
{"version":3,"file":"font.js","sourceRoot":"","sources":["../../../server/service/font/font.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAK9C,IAAa,IAAI,GAAjB,MAAa,IAAI;CA6DhB,CAAA;AA1DC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;gCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDACjB,cAAM,oBAAN,cAAM;oCAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;;sCACvB;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;kCACI;AAIZ;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;sCACQ;AAMhB;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iCACd;AAMZ;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kCACb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portStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.schema = exports.entities = void 0;
|
|
14
|
-
/* EXPORT ENTITY TYPES */
|
|
15
|
-
__exportStar(require("./font/font"), exports);
|
|
16
14
|
/* IMPORT ENTITIES AND RESOLVERS */
|
|
17
15
|
const font_1 = require("./font");
|
|
16
|
+
/* EXPORT ENTITY TYPES */
|
|
17
|
+
__exportStar(require("./font/font"), exports);
|
|
18
|
+
/* EXPORT TYPES */
|
|
19
|
+
__exportStar(require("./font/font-type"), exports);
|
|
18
20
|
exports.entities = [
|
|
19
21
|
/* ENTITIES */
|
|
20
|
-
...font_1.entities
|
|
22
|
+
...font_1.entities
|
|
21
23
|
];
|
|
22
24
|
exports.schema = {
|
|
23
25
|
resolverClasses: [
|
|
24
26
|
/* RESOLVER CLASSES */
|
|
25
|
-
...font_1.resolvers
|
|
27
|
+
...font_1.resolvers
|
|
26
28
|
]
|
|
27
29
|
};
|
|
28
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yBAAyB;AACzB,8CAA2B;AAE3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAAmC;AACnC,iCAA6E;AAE7E,yBAAyB;AACzB,8CAA2B;AAE3B,kBAAkB;AAClB,mDAAgC;AAEnB,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,eAAY;CAChB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,gBAAa;KACjB;CACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/font-base",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@things-factory/auth-base": "^4.0.
|
|
28
|
-
"@things-factory/shell": "^4.0.
|
|
27
|
+
"@things-factory/auth-base": "^4.0.5",
|
|
28
|
+
"@things-factory/shell": "^4.0.5"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "b7b2976818dceab74a34903499d408eed5d45b04"
|
|
31
31
|
}
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getRepository
|
|
1
|
+
import { Arg, Ctx, Mutation, Resolver } from 'type-graphql'
|
|
2
|
+
import { getRepository } from 'typeorm'
|
|
3
|
+
|
|
4
|
+
import { pubsub } from '@things-factory/shell'
|
|
5
|
+
|
|
3
6
|
import { Font } from './font'
|
|
4
|
-
import {
|
|
7
|
+
import { FontPatch, NewFont } from './font-type'
|
|
5
8
|
|
|
9
|
+
function notifyChanges(event, domain, font) {
|
|
10
|
+
const { name, provider, uri, path, active } = font
|
|
11
|
+
const { subdomain } = domain
|
|
12
|
+
pubsub.publish('notify-font-changed', {
|
|
13
|
+
event,
|
|
14
|
+
font: {
|
|
15
|
+
domain: {
|
|
16
|
+
subdomain
|
|
17
|
+
},
|
|
18
|
+
name,
|
|
19
|
+
provider,
|
|
20
|
+
uri,
|
|
21
|
+
path,
|
|
22
|
+
active
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
}
|
|
6
26
|
@Resolver(Font)
|
|
7
27
|
export class FontMutation {
|
|
8
28
|
@Mutation(returns => Font, { description: 'To create new Font' })
|
|
@@ -11,12 +31,16 @@ export class FontMutation {
|
|
|
11
31
|
|
|
12
32
|
const repository = getRepository(Font)
|
|
13
33
|
|
|
14
|
-
|
|
34
|
+
const created = await repository.save({
|
|
15
35
|
domain,
|
|
16
36
|
creator: user,
|
|
17
37
|
updater: user,
|
|
18
38
|
...font
|
|
19
39
|
})
|
|
40
|
+
|
|
41
|
+
notifyChanges('created', domain, created)
|
|
42
|
+
|
|
43
|
+
return created
|
|
20
44
|
}
|
|
21
45
|
|
|
22
46
|
@Mutation(returns => Font, { description: 'To modify Font information' })
|
|
@@ -31,11 +55,15 @@ export class FontMutation {
|
|
|
31
55
|
}
|
|
32
56
|
})
|
|
33
57
|
|
|
34
|
-
|
|
58
|
+
const updated = await repository.save({
|
|
35
59
|
...font,
|
|
36
60
|
...patch,
|
|
37
61
|
updater: user
|
|
38
62
|
})
|
|
63
|
+
|
|
64
|
+
notifyChanges('updated', domain, updated)
|
|
65
|
+
|
|
66
|
+
return updated
|
|
39
67
|
}
|
|
40
68
|
|
|
41
69
|
@Mutation(returns => Boolean, { description: 'To delete Font' })
|
|
@@ -51,6 +79,8 @@ export class FontMutation {
|
|
|
51
79
|
await repository.remove(font)
|
|
52
80
|
}
|
|
53
81
|
|
|
82
|
+
notifyChanges('removed', domain, font)
|
|
83
|
+
|
|
54
84
|
return true
|
|
55
85
|
}
|
|
56
86
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { Field, ID, ObjectType } from 'type-graphql'
|
|
1
2
|
import {
|
|
3
|
+
Column,
|
|
2
4
|
CreateDateColumn,
|
|
3
|
-
UpdateDateColumn,
|
|
4
5
|
Entity,
|
|
5
6
|
Index,
|
|
6
|
-
Column,
|
|
7
|
-
RelationId,
|
|
8
7
|
ManyToOne,
|
|
9
|
-
PrimaryGeneratedColumn
|
|
8
|
+
PrimaryGeneratedColumn,
|
|
9
|
+
RelationId,
|
|
10
|
+
UpdateDateColumn
|
|
10
11
|
} from 'typeorm'
|
|
11
|
-
import { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'
|
|
12
12
|
|
|
13
|
-
import { Domain } from '@things-factory/shell'
|
|
14
13
|
import { User } from '@things-factory/auth-base'
|
|
14
|
+
import { Domain } from '@things-factory/shell'
|
|
15
15
|
|
|
16
16
|
@Entity()
|
|
17
17
|
@Index('ix_font_0', (font: Font) => [font.domain, font.name], { unique: true })
|
package/server/service/index.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
+
/* IMPORT ENTITIES AND RESOLVERS */
|
|
2
|
+
import { entities as FontEntities, resolvers as FontResolvers } from './font'
|
|
3
|
+
|
|
1
4
|
/* EXPORT ENTITY TYPES */
|
|
2
5
|
export * from './font/font'
|
|
3
6
|
|
|
4
|
-
/*
|
|
5
|
-
|
|
7
|
+
/* EXPORT TYPES */
|
|
8
|
+
export * from './font/font-type'
|
|
6
9
|
|
|
7
|
-
export const entities = [
|
|
10
|
+
export const entities = [
|
|
8
11
|
/* ENTITIES */
|
|
9
|
-
|
|
10
|
-
]
|
|
11
|
-
|
|
12
|
+
...FontEntities
|
|
13
|
+
]
|
|
12
14
|
|
|
13
15
|
export const schema = {
|
|
14
16
|
resolverClasses: [
|
|
15
17
|
/* RESOLVER CLASSES */
|
|
16
|
-
|
|
17
|
-
]
|
|
18
|
+
...FontResolvers
|
|
19
|
+
]
|
|
18
20
|
}
|