@things-factory/figure-service 10.1.312 → 10.1.314
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/routers/figure-import-thumbnail-router.d.ts +5 -0
- package/dist-server/routers/figure-import-thumbnail-router.js +38 -0
- package/dist-server/routes.js +3 -0
- package/dist-server/service/figure/figure-context.js +1 -0
- package/dist-server/service/figure/figure-import-resolver.d.ts +42 -0
- package/dist-server/service/figure/figure-import-resolver.js +240 -0
- package/dist-server/service/figure/figure-import-source.d.ts +53 -0
- package/dist-server/service/figure/figure-import-source.js +144 -0
- package/dist-server/service/figure/figure-import.d.ts +50 -0
- package/dist-server/service/figure/figure-import.js +285 -0
- package/dist-server/service/figure/figure-mutation.js +5 -61
- package/dist-server/service/figure/figure-release.d.ts +24 -0
- package/dist-server/service/figure/figure-release.js +86 -0
- package/dist-server/service/figure/figure-replaced-draft.d.ts +4 -2
- package/dist-server/service/figure/figure-replaced-draft.js +6 -2
- package/dist-server/service/figure/figure-transfer-record.d.ts +35 -0
- package/dist-server/service/figure/figure-transfer-record.js +135 -0
- package/dist-server/service/figure/index.d.ts +4 -2
- package/dist-server/service/figure/index.js +4 -2
- package/dist-server/service/index.d.ts +2 -2
- package/package.json +7 -7
- package/translations/en.json +13 -1
- package/translations/es.json +13 -1
- package/translations/ja.json +13 -1
- package/translations/ko.json +13 -1
- package/translations/ms.json +13 -1
- package/translations/zh.json +13 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The picture of a figure on the other figure server this domain takes figures from (ADR-0231), relayed with this
|
|
3
|
+
* server's key: the browser never holds the key, so it asks here -- as the board server relays its figure server's.
|
|
4
|
+
*/
|
|
5
|
+
export declare const figureImportThumbnailRouter: any;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.figureImportThumbnailRouter = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const koa_router_1 = tslib_1.__importDefault(require("koa-router"));
|
|
6
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const figure_import_source_js_1 = require("../service/figure/figure-import-source.js");
|
|
9
|
+
/**
|
|
10
|
+
* The picture of a figure on the other figure server this domain takes figures from (ADR-0231), relayed with this
|
|
11
|
+
* server's key: the browser never holds the key, so it asks here -- as the board server relays its figure server's.
|
|
12
|
+
*/
|
|
13
|
+
exports.figureImportThumbnailRouter = new koa_router_1.default();
|
|
14
|
+
exports.figureImportThumbnailRouter.get('/figure-import-source/thumbnail/:figureId', async (context) => {
|
|
15
|
+
const { domain, user, unsafeIP, prohibitedPrivileges } = context.state;
|
|
16
|
+
const allowed = await (0, auth_base_1.checkPermission)({ category: 'figure', privilege: 'query', owner: true }, user, domain, unsafeIP, prohibitedPrivileges);
|
|
17
|
+
if (!allowed) {
|
|
18
|
+
context.status = 403;
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
const picture = await (0, figure_import_source_js_1.sourceThumbnail)(await (0, figure_import_source_js_1.importSourceOf)(domain, (0, shell_1.getDataSource)().manager), context.params.figureId);
|
|
23
|
+
if (!picture) {
|
|
24
|
+
context.status = 404;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
/* The caller adds `?v=<release picture hash>`, so a day of private cache never shows an old picture. */
|
|
28
|
+
context.set('Cache-Control', 'private, max-age=86400');
|
|
29
|
+
context.type = picture.contentType;
|
|
30
|
+
context.body = picture.bytes;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
if (!(error instanceof shell_1.Refusal))
|
|
34
|
+
throw error;
|
|
35
|
+
context.status = error.code === 'figure-import-source-not-set' ? 404 : 502;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=figure-import-thumbnail-router.js.map
|
package/dist-server/routes.js
CHANGED
|
@@ -6,6 +6,7 @@ const figure_thumbnail_router_js_1 = require("./routers/figure-thumbnail-router.
|
|
|
6
6
|
const figure_package_router_js_1 = require("./routers/figure-package-router.js");
|
|
7
7
|
const figure_mesh_router_js_1 = require("./routers/figure-mesh-router.js");
|
|
8
8
|
const figure_capability_module_router_js_1 = require("./routers/figure-capability-module-router.js");
|
|
9
|
+
const figure_import_thumbnail_router_js_1 = require("./routers/figure-import-thumbnail-router.js");
|
|
9
10
|
/**
|
|
10
11
|
* 도메인 경로가 주소에 들어가는 배치인가.
|
|
11
12
|
*
|
|
@@ -19,12 +20,14 @@ process.on('bootstrap-module-domain-private-route', (app, domainPrivateRouter) =
|
|
|
19
20
|
domainPrivateRouter.use(`/${(0, shell_1.getRoutePrefixForDomainType)()}/:domain`, figure_package_router_js_1.figurePackageRouter.routes(), figure_package_router_js_1.figurePackageRouter.allowedMethods());
|
|
20
21
|
domainPrivateRouter.use(`/${(0, shell_1.getRoutePrefixForDomainType)()}/:domain`, figure_mesh_router_js_1.figureMeshRouter.routes(), figure_mesh_router_js_1.figureMeshRouter.allowedMethods());
|
|
21
22
|
domainPrivateRouter.use(`/${(0, shell_1.getRoutePrefixForDomainType)()}/:domain`, figure_capability_module_router_js_1.figureCapabilityModuleRouter.routes(), figure_capability_module_router_js_1.figureCapabilityModuleRouter.allowedMethods());
|
|
23
|
+
domainPrivateRouter.use(`/${(0, shell_1.getRoutePrefixForDomainType)()}/:domain`, figure_import_thumbnail_router_js_1.figureImportThumbnailRouter.routes(), figure_import_thumbnail_router_js_1.figureImportThumbnailRouter.allowedMethods());
|
|
22
24
|
}
|
|
23
25
|
else {
|
|
24
26
|
domainPrivateRouter.use('', figure_thumbnail_router_js_1.figureThumbnailRouter.routes(), figure_thumbnail_router_js_1.figureThumbnailRouter.allowedMethods());
|
|
25
27
|
domainPrivateRouter.use('', figure_package_router_js_1.figurePackageRouter.routes(), figure_package_router_js_1.figurePackageRouter.allowedMethods());
|
|
26
28
|
domainPrivateRouter.use('', figure_mesh_router_js_1.figureMeshRouter.routes(), figure_mesh_router_js_1.figureMeshRouter.allowedMethods());
|
|
27
29
|
domainPrivateRouter.use('', figure_capability_module_router_js_1.figureCapabilityModuleRouter.routes(), figure_capability_module_router_js_1.figureCapabilityModuleRouter.allowedMethods());
|
|
30
|
+
domainPrivateRouter.use('', figure_import_thumbnail_router_js_1.figureImportThumbnailRouter.routes(), figure_import_thumbnail_router_js_1.figureImportThumbnailRouter.allowedMethods());
|
|
28
31
|
}
|
|
29
32
|
});
|
|
30
33
|
//# sourceMappingURL=routes.js.map
|
|
@@ -385,6 +385,7 @@ const SUBJECT = {
|
|
|
385
385
|
'set-capabilities': () => undefined,
|
|
386
386
|
'set-capability-settings': () => undefined,
|
|
387
387
|
'set-state-input': () => undefined,
|
|
388
|
+
'remove-state-input': () => undefined,
|
|
388
389
|
'set-state-defaults': () => undefined,
|
|
389
390
|
'set-driver': () => undefined,
|
|
390
391
|
'remove-driver': () => undefined,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FigureTransferRecord } from './figure-transfer-record.js';
|
|
2
|
+
export declare class FigureImportSourceSetting {
|
|
3
|
+
url?: string;
|
|
4
|
+
domain?: string;
|
|
5
|
+
tokenSet: boolean;
|
|
6
|
+
tokenHint?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class FigureImportSourceCheck {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
total?: number;
|
|
11
|
+
code?: string;
|
|
12
|
+
message?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class FigureImportPage {
|
|
15
|
+
page: number;
|
|
16
|
+
limit: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class FigureImportSourcePatch {
|
|
19
|
+
url?: string;
|
|
20
|
+
domain?: string;
|
|
21
|
+
token?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class FigureImportChoice {
|
|
24
|
+
ref: string;
|
|
25
|
+
figureId: string;
|
|
26
|
+
}
|
|
27
|
+
export declare class FigureImportCatalog {
|
|
28
|
+
items: unknown;
|
|
29
|
+
total: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Taking figures from another figure server (ADR-0231): set it in Settings with the key it issued, then pick from its
|
|
33
|
+
* figures. Every call to it is made here, so the key stays on this server.
|
|
34
|
+
*/
|
|
35
|
+
export declare class FigureImportResolver {
|
|
36
|
+
figureImportSource(context: ResolverContext): Promise<FigureImportSourceSetting>;
|
|
37
|
+
updateFigureImportSource(patch: FigureImportSourcePatch, context: ResolverContext): Promise<FigureImportSourceSetting>;
|
|
38
|
+
checkFigureImportSource(context: ResolverContext): Promise<FigureImportSourceCheck>;
|
|
39
|
+
figureImportCatalog(search: string, pagination: FigureImportPage, context: ResolverContext): Promise<FigureImportCatalog>;
|
|
40
|
+
importFigures(chosen: FigureImportChoice[], context: ResolverContext): Promise<unknown>;
|
|
41
|
+
figureTransferOrigin(figureId: string, context: ResolverContext): Promise<FigureTransferRecord | null>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FigureImportResolver = exports.FigureImportCatalog = exports.FigureImportChoice = exports.FigureImportSourcePatch = exports.FigureImportPage = exports.FigureImportSourceCheck = exports.FigureImportSourceSetting = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const graphql_scalars_1 = require("graphql-scalars");
|
|
7
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
|
+
const shell_1 = require("@things-factory/shell");
|
|
9
|
+
const figure_transfer_record_js_1 = require("./figure-transfer-record.js");
|
|
10
|
+
const figure_import_source_js_1 = require("./figure-import-source.js");
|
|
11
|
+
const figure_import_js_1 = require("./figure-import.js");
|
|
12
|
+
let FigureImportSourceSetting = class FigureImportSourceSetting {
|
|
13
|
+
};
|
|
14
|
+
exports.FigureImportSourceSetting = FigureImportSourceSetting;
|
|
15
|
+
tslib_1.__decorate([
|
|
16
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Its address.' }),
|
|
17
|
+
tslib_1.__metadata("design:type", String)
|
|
18
|
+
], FigureImportSourceSetting.prototype, "url", void 0);
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The domain on it.' }),
|
|
21
|
+
tslib_1.__metadata("design:type", String)
|
|
22
|
+
], FigureImportSourceSetting.prototype, "domain", void 0);
|
|
23
|
+
tslib_1.__decorate([
|
|
24
|
+
(0, type_graphql_1.Field)({ description: 'Whether its key is set.' }),
|
|
25
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
26
|
+
], FigureImportSourceSetting.prototype, "tokenSet", void 0);
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The key as a secret is shown: enough to tell which it is, never the key.' }),
|
|
29
|
+
tslib_1.__metadata("design:type", String)
|
|
30
|
+
], FigureImportSourceSetting.prototype, "tokenHint", void 0);
|
|
31
|
+
exports.FigureImportSourceSetting = FigureImportSourceSetting = tslib_1.__decorate([
|
|
32
|
+
(0, type_graphql_1.ObjectType)({ description: 'The other figure server this domain takes figures from - never its key.' })
|
|
33
|
+
], FigureImportSourceSetting);
|
|
34
|
+
let FigureImportSourceCheck = class FigureImportSourceCheck {
|
|
35
|
+
};
|
|
36
|
+
exports.FigureImportSourceCheck = FigureImportSourceCheck;
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, type_graphql_1.Field)({ description: 'Whether it answered.' }),
|
|
39
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
40
|
+
], FigureImportSourceCheck.prototype, "ok", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'How many figures it offers.' }),
|
|
43
|
+
tslib_1.__metadata("design:type", Number)
|
|
44
|
+
], FigureImportSourceCheck.prototype, "total", void 0);
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The refusal code, when it did not answer.' }),
|
|
47
|
+
tslib_1.__metadata("design:type", String)
|
|
48
|
+
], FigureImportSourceCheck.prototype, "code", void 0);
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The refusal in the asker\'s words.' }),
|
|
51
|
+
tslib_1.__metadata("design:type", String)
|
|
52
|
+
], FigureImportSourceCheck.prototype, "message", void 0);
|
|
53
|
+
exports.FigureImportSourceCheck = FigureImportSourceCheck = tslib_1.__decorate([
|
|
54
|
+
(0, type_graphql_1.ObjectType)({ description: 'What the other figure server answered with the connection as it is.' })
|
|
55
|
+
], FigureImportSourceCheck);
|
|
56
|
+
let FigureImportPage = class FigureImportPage {
|
|
57
|
+
};
|
|
58
|
+
exports.FigureImportPage = FigureImportPage;
|
|
59
|
+
tslib_1.__decorate([
|
|
60
|
+
(0, type_graphql_1.Field)({ description: 'The page, from 1.' }),
|
|
61
|
+
tslib_1.__metadata("design:type", Number)
|
|
62
|
+
], FigureImportPage.prototype, "page", void 0);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, type_graphql_1.Field)({ description: 'How many on a page.' }),
|
|
65
|
+
tslib_1.__metadata("design:type", Number)
|
|
66
|
+
], FigureImportPage.prototype, "limit", void 0);
|
|
67
|
+
exports.FigureImportPage = FigureImportPage = tslib_1.__decorate([
|
|
68
|
+
(0, type_graphql_1.InputType)({ description: 'Which page of the other server\'s figures.' })
|
|
69
|
+
], FigureImportPage);
|
|
70
|
+
let FigureImportSourcePatch = class FigureImportSourcePatch {
|
|
71
|
+
};
|
|
72
|
+
exports.FigureImportSourcePatch = FigureImportSourcePatch;
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Its address.' }),
|
|
75
|
+
tslib_1.__metadata("design:type", String)
|
|
76
|
+
], FigureImportSourcePatch.prototype, "url", void 0);
|
|
77
|
+
tslib_1.__decorate([
|
|
78
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The domain on it.' }),
|
|
79
|
+
tslib_1.__metadata("design:type", String)
|
|
80
|
+
], FigureImportSourcePatch.prototype, "domain", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The key it issued.' }),
|
|
83
|
+
tslib_1.__metadata("design:type", String)
|
|
84
|
+
], FigureImportSourcePatch.prototype, "token", void 0);
|
|
85
|
+
exports.FigureImportSourcePatch = FigureImportSourcePatch = tslib_1.__decorate([
|
|
86
|
+
(0, type_graphql_1.InputType)({ description: 'A change to the other figure server: a field left out stays, an empty one is cleared.' })
|
|
87
|
+
], FigureImportSourcePatch);
|
|
88
|
+
let FigureImportChoice = class FigureImportChoice {
|
|
89
|
+
};
|
|
90
|
+
exports.FigureImportChoice = FigureImportChoice;
|
|
91
|
+
tslib_1.__decorate([
|
|
92
|
+
(0, type_graphql_1.Field)({ description: 'Its release reference {namespace}/{type}@{version}.' }),
|
|
93
|
+
tslib_1.__metadata("design:type", String)
|
|
94
|
+
], FigureImportChoice.prototype, "ref", void 0);
|
|
95
|
+
tslib_1.__decorate([
|
|
96
|
+
(0, type_graphql_1.Field)({ description: 'Its figure id on that server, as its catalog gave it.' }),
|
|
97
|
+
tslib_1.__metadata("design:type", String)
|
|
98
|
+
], FigureImportChoice.prototype, "figureId", void 0);
|
|
99
|
+
exports.FigureImportChoice = FigureImportChoice = tslib_1.__decorate([
|
|
100
|
+
(0, type_graphql_1.InputType)({ description: 'A release chosen from the other figure server.' })
|
|
101
|
+
], FigureImportChoice);
|
|
102
|
+
let FigureImportCatalog = class FigureImportCatalog {
|
|
103
|
+
};
|
|
104
|
+
exports.FigureImportCatalog = FigureImportCatalog;
|
|
105
|
+
tslib_1.__decorate([
|
|
106
|
+
(0, type_graphql_1.Field)(type => graphql_scalars_1.GraphQLJSON, { description: 'Each figure as its latest release, with namespaceHere and plan (create, overwrite, modified-here, unchanged).' }),
|
|
107
|
+
tslib_1.__metadata("design:type", Object)
|
|
108
|
+
], FigureImportCatalog.prototype, "items", void 0);
|
|
109
|
+
tslib_1.__decorate([
|
|
110
|
+
(0, type_graphql_1.Field)({ description: 'How many figures that server offers.' }),
|
|
111
|
+
tslib_1.__metadata("design:type", Number)
|
|
112
|
+
], FigureImportCatalog.prototype, "total", void 0);
|
|
113
|
+
exports.FigureImportCatalog = FigureImportCatalog = tslib_1.__decorate([
|
|
114
|
+
(0, type_graphql_1.ObjectType)({ description: "The other figure server's figures, each with what taking it would do here." })
|
|
115
|
+
], FigureImportCatalog);
|
|
116
|
+
/**
|
|
117
|
+
* Taking figures from another figure server (ADR-0231): set it in Settings with the key it issued, then pick from its
|
|
118
|
+
* figures. Every call to it is made here, so the key stays on this server.
|
|
119
|
+
*/
|
|
120
|
+
let FigureImportResolver = class FigureImportResolver {
|
|
121
|
+
async figureImportSource(context) {
|
|
122
|
+
const { domain, tx } = context.state;
|
|
123
|
+
const attributes = await (0, figure_import_source_js_1.sourceAttributes)(domain, tx ?? (0, shell_1.getDataSource)().manager);
|
|
124
|
+
const token = attributes['FigureService::source::token'];
|
|
125
|
+
return {
|
|
126
|
+
url: attributes['FigureService::source::url'],
|
|
127
|
+
domain: attributes['FigureService::source::domain'],
|
|
128
|
+
tokenSet: !!token,
|
|
129
|
+
tokenHint: token ? ((0, shell_1.secretHint)(token) ?? undefined) : undefined
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
async updateFigureImportSource(patch, context) {
|
|
133
|
+
const { domain, tx } = context.state;
|
|
134
|
+
const repository = tx.getRepository(shell_1.EnvVar);
|
|
135
|
+
for (const { name, value } of (0, figure_import_source_js_1.sourceSettingWrites)(patch)) {
|
|
136
|
+
const own = await repository.findOne({ where: { domain: { id: domain.id }, name } });
|
|
137
|
+
if (value === null) {
|
|
138
|
+
if (own)
|
|
139
|
+
await repository.delete(own.id);
|
|
140
|
+
}
|
|
141
|
+
else if (own)
|
|
142
|
+
await repository.save({ ...own, value, active: true });
|
|
143
|
+
else
|
|
144
|
+
await repository.save({ domain, name, value, active: true, description: 'Figure server to take figures from (ADR-0231) - set on the Settings screen' });
|
|
145
|
+
}
|
|
146
|
+
return await this.figureImportSource(context);
|
|
147
|
+
}
|
|
148
|
+
async checkFigureImportSource(context) {
|
|
149
|
+
const { domain, tx } = context.state;
|
|
150
|
+
try {
|
|
151
|
+
const { total } = await (0, figure_import_source_js_1.sourceCatalog)(await (0, figure_import_source_js_1.importSourceOf)(domain, tx), { page: 1, limit: 1 });
|
|
152
|
+
return { ok: true, total };
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
if (!(error instanceof shell_1.Refusal))
|
|
156
|
+
throw error;
|
|
157
|
+
const t = context.t;
|
|
158
|
+
return { ok: false, code: error.code, message: t ? t(`error.${error.code}`, { ...error.params, defaultValue: error.message }) : error.message };
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
async figureImportCatalog(search, pagination, context) {
|
|
162
|
+
const { domain, tx } = context.state;
|
|
163
|
+
const manager = tx ?? (0, shell_1.getDataSource)().manager;
|
|
164
|
+
const source = await (0, figure_import_source_js_1.importSourceOf)(domain, manager);
|
|
165
|
+
const page = await (0, figure_import_source_js_1.sourceCatalog)(source, { search, page: pagination?.page, limit: pagination?.limit });
|
|
166
|
+
return { items: await (0, figure_import_js_1.withImportPlan)(manager, domain, source, page.items), total: page.total };
|
|
167
|
+
}
|
|
168
|
+
async importFigures(chosen, context) {
|
|
169
|
+
const { domain, user, unsafeIP, prohibitedPrivileges } = context.state;
|
|
170
|
+
const source = await (0, figure_import_source_js_1.importSourceOf)(domain, (0, shell_1.getDataSource)().manager);
|
|
171
|
+
/* Released there, released here only for someone who may release (LV figure-server design G6). */
|
|
172
|
+
const mayRelease = !!(await (0, auth_base_1.checkPermission)({ category: 'figure-release', privilege: 'mutation', owner: true }, user, domain, unsafeIP, prohibitedPrivileges));
|
|
173
|
+
return await (0, figure_import_js_1.importFromSource)(work => (0, shell_1.getDataSource)().transaction(work), domain, user, source, chosen, { t: context.t, lng: context.lng, mayRelease });
|
|
174
|
+
}
|
|
175
|
+
async figureTransferOrigin(figureId, context) {
|
|
176
|
+
const { domain, tx } = context.state;
|
|
177
|
+
return await (0, figure_import_js_1.transferOriginOf)(tx ?? (0, shell_1.getDataSource)().manager, domain, figureId);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
exports.FigureImportResolver = FigureImportResolver;
|
|
181
|
+
tslib_1.__decorate([
|
|
182
|
+
(0, type_graphql_1.Directive)('@privilege(category: "env-var", privilege: "query", domainOwnerGranted: true)'),
|
|
183
|
+
(0, type_graphql_1.Query)(returns => FigureImportSourceSetting, { description: 'The other figure server this domain takes figures from - never its key.' }),
|
|
184
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
185
|
+
tslib_1.__metadata("design:type", Function),
|
|
186
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
187
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
188
|
+
], FigureImportResolver.prototype, "figureImportSource", null);
|
|
189
|
+
tslib_1.__decorate([
|
|
190
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
191
|
+
(0, type_graphql_1.Directive)('@privilege(category: "env-var", privilege: "mutation", domainOwnerGranted: true)'),
|
|
192
|
+
(0, type_graphql_1.Mutation)(returns => FigureImportSourceSetting, { description: 'Sets the other figure server this domain takes figures from.' }),
|
|
193
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patch')),
|
|
194
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
195
|
+
tslib_1.__metadata("design:type", Function),
|
|
196
|
+
tslib_1.__metadata("design:paramtypes", [FigureImportSourcePatch, Object]),
|
|
197
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
198
|
+
], FigureImportResolver.prototype, "updateFigureImportSource", null);
|
|
199
|
+
tslib_1.__decorate([
|
|
200
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
201
|
+
(0, type_graphql_1.Directive)('@privilege(category: "env-var", privilege: "mutation", domainOwnerGranted: true)'),
|
|
202
|
+
(0, type_graphql_1.Mutation)(returns => FigureImportSourceCheck, { description: 'Asks the other figure server for one figure with the connection as it is.' }),
|
|
203
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
204
|
+
tslib_1.__metadata("design:type", Function),
|
|
205
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
206
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
207
|
+
], FigureImportResolver.prototype, "checkFigureImportSource", null);
|
|
208
|
+
tslib_1.__decorate([
|
|
209
|
+
(0, type_graphql_1.Directive)('@privilege(category: "figure", privilege: "query", domainOwnerGranted: true)'),
|
|
210
|
+
(0, type_graphql_1.Query)(returns => FigureImportCatalog, { description: "The other figure server's figures, each with what taking it would do here." }),
|
|
211
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('search', { nullable: true })),
|
|
212
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('pagination', type => FigureImportPage, { nullable: true })),
|
|
213
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
214
|
+
tslib_1.__metadata("design:type", Function),
|
|
215
|
+
tslib_1.__metadata("design:paramtypes", [String, FigureImportPage, Object]),
|
|
216
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
217
|
+
], FigureImportResolver.prototype, "figureImportCatalog", null);
|
|
218
|
+
tslib_1.__decorate([
|
|
219
|
+
(0, type_graphql_1.Directive)('@privilege(category: "figure", privilege: "mutation", domainOwnerGranted: true)'),
|
|
220
|
+
(0, type_graphql_1.Mutation)(returns => graphql_scalars_1.GraphQLJSON, { description: 'Takes the chosen figures from the other figure server; a figure of the same type here is written over, its draft kept.' }),
|
|
221
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('chosen', type => [FigureImportChoice])),
|
|
222
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
223
|
+
tslib_1.__metadata("design:type", Function),
|
|
224
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
225
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
226
|
+
], FigureImportResolver.prototype, "importFigures", null);
|
|
227
|
+
tslib_1.__decorate([
|
|
228
|
+
(0, type_graphql_1.Directive)('@privilege(category: "figure", privilege: "query", domainOwnerGranted: true)'),
|
|
229
|
+
(0, type_graphql_1.Query)(returns => figure_transfer_record_js_1.FigureTransferRecord, { nullable: true, description: 'Where a figure was last taken from, if it came from another figure server.' }),
|
|
230
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('figureId')),
|
|
231
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
232
|
+
tslib_1.__metadata("design:type", Function),
|
|
233
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
234
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
235
|
+
], FigureImportResolver.prototype, "figureTransferOrigin", null);
|
|
236
|
+
exports.FigureImportResolver = FigureImportResolver = tslib_1.__decorate([
|
|
237
|
+
(0, type_graphql_1.Resolver)(),
|
|
238
|
+
(0, type_graphql_1.UseMiddleware)(shell_1.SpeakRefusals)
|
|
239
|
+
], FigureImportResolver);
|
|
240
|
+
//# sourceMappingURL=figure-import-resolver.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { EntityManager } from 'typeorm';
|
|
2
|
+
export declare const SOURCE_PARAMS: readonly ["url", "domain", "token"];
|
|
3
|
+
export type SourceParam = (typeof SOURCE_PARAMS)[number];
|
|
4
|
+
export declare const sourceAttributeOf: (param: SourceParam) => string;
|
|
5
|
+
export interface FigureImportSource {
|
|
6
|
+
url: string;
|
|
7
|
+
domain: string;
|
|
8
|
+
token: string;
|
|
9
|
+
}
|
|
10
|
+
/** The three values, this domain's or the closest parent's (as the board server's connection reads them). */
|
|
11
|
+
export declare function sourceAttributes(domain: any, manager: EntityManager): Promise<Record<string, string | undefined>>;
|
|
12
|
+
/** The server to take from, or null while any of the three is missing. */
|
|
13
|
+
export declare function sourceOf(attributes: Record<string, string | undefined>): FigureImportSource | null;
|
|
14
|
+
export declare function importSourceOf(domain: {
|
|
15
|
+
id: string;
|
|
16
|
+
}, manager: EntityManager): Promise<FigureImportSource>;
|
|
17
|
+
/** The attribute writes of a patch: a field left out stays, an empty one is cleared. */
|
|
18
|
+
export declare function sourceSettingWrites(patch: Partial<Record<SourceParam, string | null>>): {
|
|
19
|
+
name: string;
|
|
20
|
+
value: string | null;
|
|
21
|
+
}[];
|
|
22
|
+
/** One row of the other server's catalog: a figure as its latest release (ADR-0114 decision 24). */
|
|
23
|
+
export interface SourceCatalogRow {
|
|
24
|
+
figureId: string;
|
|
25
|
+
fullName: string;
|
|
26
|
+
ref: string;
|
|
27
|
+
namespace: string;
|
|
28
|
+
type: string;
|
|
29
|
+
version: number;
|
|
30
|
+
name?: string | null;
|
|
31
|
+
names?: Record<string, string> | null;
|
|
32
|
+
description?: string | null;
|
|
33
|
+
category?: string | null;
|
|
34
|
+
deprecated: boolean;
|
|
35
|
+
releasedAt?: string | null;
|
|
36
|
+
/** The hash of its release picture; none when it has no picture. */
|
|
37
|
+
thumbnailHash?: string | null;
|
|
38
|
+
}
|
|
39
|
+
export declare function sourceCatalog(source: FigureImportSource, params: {
|
|
40
|
+
search?: string | null;
|
|
41
|
+
page?: number;
|
|
42
|
+
limit?: number;
|
|
43
|
+
}, doFetch?: typeof fetch): Promise<{
|
|
44
|
+
items: SourceCatalogRow[];
|
|
45
|
+
total: number;
|
|
46
|
+
}>;
|
|
47
|
+
/** These releases from the other server's release door, as the bytes of its package. */
|
|
48
|
+
export declare function sourceReleases(source: FigureImportSource, refs: readonly string[], max: number, doFetch?: typeof fetch): Promise<Buffer>;
|
|
49
|
+
/** The picture of a figure's latest release on the other server, through its release picture door; null when it has none. */
|
|
50
|
+
export declare function sourceThumbnail(source: FigureImportSource, figureId: string, doFetch?: typeof fetch): Promise<{
|
|
51
|
+
bytes: Buffer;
|
|
52
|
+
contentType: string;
|
|
53
|
+
} | null>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sourceAttributeOf = exports.SOURCE_PARAMS = void 0;
|
|
4
|
+
exports.sourceAttributes = sourceAttributes;
|
|
5
|
+
exports.sourceOf = sourceOf;
|
|
6
|
+
exports.importSourceOf = importSourceOf;
|
|
7
|
+
exports.sourceSettingWrites = sourceSettingWrites;
|
|
8
|
+
exports.sourceCatalog = sourceCatalog;
|
|
9
|
+
exports.sourceReleases = sourceReleases;
|
|
10
|
+
exports.sourceThumbnail = sourceThumbnail;
|
|
11
|
+
const typeorm_1 = require("typeorm");
|
|
12
|
+
const shell_1 = require("@things-factory/shell");
|
|
13
|
+
/*
|
|
14
|
+
* Another figure server this domain takes figures from (ADR-0231): its address, the domain on it and the key that
|
|
15
|
+
* server issued. The same connection a board server makes to install from a figure server (ADR-0114 decisions 21 · 25 ·
|
|
16
|
+
* 26) -- that server is not changed: its catalog (`figureReleaseCatalog`) and its release door (`/figure-package`) are
|
|
17
|
+
* read with its install key. Every call is made here, never by the browser, so the key stays on this server.
|
|
18
|
+
*/
|
|
19
|
+
exports.SOURCE_PARAMS = ['url', 'domain', 'token'];
|
|
20
|
+
const sourceAttributeOf = (param) => `FigureService::source::${param}`;
|
|
21
|
+
exports.sourceAttributeOf = sourceAttributeOf;
|
|
22
|
+
const TIMEOUT_MS = 30_000;
|
|
23
|
+
const host = (source) => new URL(source.url).host;
|
|
24
|
+
const headersOf = (source, extra = {}) => ({
|
|
25
|
+
authorization: `Bearer ${source.token}`,
|
|
26
|
+
'x-things-factory-domain': source.domain,
|
|
27
|
+
...extra
|
|
28
|
+
});
|
|
29
|
+
/** The three values, this domain's or the closest parent's (as the board server's connection reads them). */
|
|
30
|
+
async function sourceAttributes(domain, manager) {
|
|
31
|
+
const ids = await (0, shell_1.getDomainIdsWithAncestors)(domain);
|
|
32
|
+
const rows = await manager.getRepository(shell_1.EnvVar).find({ where: { domain: { id: (0, typeorm_1.In)(ids) }, name: (0, typeorm_1.In)(exports.SOURCE_PARAMS.map(exports.sourceAttributeOf)), active: true } });
|
|
33
|
+
return Object.fromEntries((0, shell_1.dedupByClosestDomain)(rows, ids, one => one.name).map(one => [one.name, one.value]));
|
|
34
|
+
}
|
|
35
|
+
/** The server to take from, or null while any of the three is missing. */
|
|
36
|
+
function sourceOf(attributes) {
|
|
37
|
+
const [url, domain, token] = exports.SOURCE_PARAMS.map(param => attributes[(0, exports.sourceAttributeOf)(param)] || null);
|
|
38
|
+
return url && domain && token ? { url, domain, token } : null;
|
|
39
|
+
}
|
|
40
|
+
async function importSourceOf(domain, manager) {
|
|
41
|
+
const source = sourceOf(await sourceAttributes(domain, manager));
|
|
42
|
+
if (!source)
|
|
43
|
+
throw new shell_1.Refusal('figure-import-source-not-set', {}, 'No figure server to take figures from is set. Set it in Settings.');
|
|
44
|
+
return source;
|
|
45
|
+
}
|
|
46
|
+
/** The attribute writes of a patch: a field left out stays, an empty one is cleared. */
|
|
47
|
+
function sourceSettingWrites(patch) {
|
|
48
|
+
const writes = [];
|
|
49
|
+
for (const param of exports.SOURCE_PARAMS) {
|
|
50
|
+
if (patch[param] === undefined)
|
|
51
|
+
continue;
|
|
52
|
+
const raw = String(patch[param] ?? '').trim();
|
|
53
|
+
writes.push({ name: (0, exports.sourceAttributeOf)(param), value: raw ? checked(param, raw) : null });
|
|
54
|
+
}
|
|
55
|
+
return writes;
|
|
56
|
+
}
|
|
57
|
+
function checked(param, raw) {
|
|
58
|
+
if (param === 'url') {
|
|
59
|
+
let url;
|
|
60
|
+
try {
|
|
61
|
+
url = new URL(raw);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
throw new shell_1.Refusal('figure-import-source-url-invalid', {}, 'The address is a web address that starts with http:// or https://');
|
|
65
|
+
}
|
|
66
|
+
if (!/^https?:$/.test(url.protocol) || url.username || url.password || url.search || url.hash)
|
|
67
|
+
throw new shell_1.Refusal('figure-import-source-url-invalid', {}, 'The address is a web address that starts with http:// or https://');
|
|
68
|
+
return `${url.origin}${url.pathname.replace(/\/+$/, '')}`;
|
|
69
|
+
}
|
|
70
|
+
if (param === 'domain' && !/^[A-Za-z0-9][A-Za-z0-9_.-]{0,62}$/.test(raw))
|
|
71
|
+
throw new shell_1.Refusal('figure-import-source-domain-invalid', {}, 'The domain is the name in the figure server address, after /domain/');
|
|
72
|
+
if (param === 'token' && /\s/.test(raw))
|
|
73
|
+
throw new shell_1.Refusal('figure-import-source-token-invalid', {}, 'The key has no spaces');
|
|
74
|
+
return raw;
|
|
75
|
+
}
|
|
76
|
+
/** One call to the other server: the key goes to its origin only (no redirect is followed), within a time limit. */
|
|
77
|
+
async function call(source, url, init, doFetch) {
|
|
78
|
+
let response;
|
|
79
|
+
try {
|
|
80
|
+
response = await doFetch(url, { ...init, redirect: 'manual', signal: AbortSignal.timeout(TIMEOUT_MS) });
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
throw new shell_1.Refusal('figure-import-source-unreachable', { host: host(source) }, 'Cannot connect to the figure server {host}.');
|
|
84
|
+
}
|
|
85
|
+
if (response.status === 401)
|
|
86
|
+
throw new shell_1.Refusal('figure-import-source-unauthorized', { host: host(source) }, 'The figure server {host} did not accept the key.');
|
|
87
|
+
if (response.status === 403)
|
|
88
|
+
throw new shell_1.Refusal('figure-import-source-forbidden', { host: host(source), domain: source.domain }, 'The key has no right to read released figures of {domain} on {host}.');
|
|
89
|
+
if (response.status >= 300 && response.status < 400)
|
|
90
|
+
throw new shell_1.Refusal('figure-import-source-unreachable', { host: host(source) }, 'Cannot connect to the figure server {host}.');
|
|
91
|
+
return response;
|
|
92
|
+
}
|
|
93
|
+
const CATALOG = `query ($pagination: Pagination, $search: String) {
|
|
94
|
+
figureReleaseCatalog(pagination: $pagination, search: $search) {
|
|
95
|
+
items { figureId fullName ref namespace type version name names description category deprecated releasedAt thumbnailHash }
|
|
96
|
+
total
|
|
97
|
+
}
|
|
98
|
+
}`;
|
|
99
|
+
async function sourceCatalog(source, params, doFetch = fetch) {
|
|
100
|
+
const response = await call(source, `${source.url}/graphql`, {
|
|
101
|
+
method: 'POST',
|
|
102
|
+
headers: headersOf(source, { 'content-type': 'application/json' }),
|
|
103
|
+
body: JSON.stringify({ query: CATALOG, variables: { pagination: { page: params.page ?? 1, limit: params.limit ?? 50 }, search: params.search || null } })
|
|
104
|
+
}, doFetch);
|
|
105
|
+
const body = (await response.json().catch(() => ({})));
|
|
106
|
+
if (body.errors?.length) {
|
|
107
|
+
const message = body.errors[0]?.message ?? '';
|
|
108
|
+
if (/unauthori[sz]ed|permission|privilege/i.test(message))
|
|
109
|
+
throw new shell_1.Refusal('figure-import-source-forbidden', { host: host(source), domain: source.domain }, 'The key has no right to read released figures of {domain} on {host}.');
|
|
110
|
+
throw new shell_1.Refusal('figure-import-source-failed', { host: host(source), message }, 'The figure server {host} refused: {message}');
|
|
111
|
+
}
|
|
112
|
+
if (!response.ok || !body.data)
|
|
113
|
+
throw new shell_1.Refusal('figure-import-source-failed', { host: host(source), message: String(response.status) }, 'The figure server {host} refused: {message}');
|
|
114
|
+
return body.data.figureReleaseCatalog;
|
|
115
|
+
}
|
|
116
|
+
/** These releases from the other server's release door, as the bytes of its package. */
|
|
117
|
+
async function sourceReleases(source, refs, max, doFetch = fetch) {
|
|
118
|
+
const url = `${source.url}/domain/${encodeURIComponent(source.domain)}/figure-package?refs=${refs.map(encodeURIComponent).join(',')}`;
|
|
119
|
+
const response = await call(source, url, { method: 'GET', headers: headersOf(source) }, doFetch);
|
|
120
|
+
if (!response.ok) {
|
|
121
|
+
const body = (await response.json().catch(() => null));
|
|
122
|
+
if (body?.code)
|
|
123
|
+
throw new shell_1.Refusal(body.code, body.params ?? {}, body.message ?? body.code);
|
|
124
|
+
throw new shell_1.Refusal('figure-import-source-failed', { host: host(source), message: String(response.status) }, 'The figure server {host} refused: {message}');
|
|
125
|
+
}
|
|
126
|
+
const bytes = Buffer.from(await response.arrayBuffer());
|
|
127
|
+
if (bytes.length > max)
|
|
128
|
+
throw new shell_1.Refusal('figure-import-source-too-large', { max }, 'What the figure server sent is over {max} bytes.');
|
|
129
|
+
return bytes;
|
|
130
|
+
}
|
|
131
|
+
/** The picture of a figure's latest release on the other server, through its release picture door; null when it has none. */
|
|
132
|
+
async function sourceThumbnail(source, figureId, doFetch = fetch) {
|
|
133
|
+
const url = `${source.url}/domain/${encodeURIComponent(source.domain)}/figure-release-thumbnail/${encodeURIComponent(figureId)}`;
|
|
134
|
+
const response = await call(source, url, { method: 'GET', headers: headersOf(source) }, doFetch);
|
|
135
|
+
if (response.status === 404)
|
|
136
|
+
return null;
|
|
137
|
+
if (!response.ok)
|
|
138
|
+
throw new shell_1.Refusal('figure-import-source-failed', { host: host(source), message: String(response.status) }, 'The figure server {host} refused: {message}');
|
|
139
|
+
const bytes = Buffer.from(await response.arrayBuffer());
|
|
140
|
+
if (bytes.length > 4 * 1024 * 1024)
|
|
141
|
+
return null;
|
|
142
|
+
return { bytes, contentType: response.headers.get('content-type') ?? 'application/octet-stream' };
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=figure-import-source.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type EntityManager } from 'typeorm';
|
|
2
|
+
import { FigureTransferRecord } from './figure-transfer-record.js';
|
|
3
|
+
import { type ThumbnailFiles } from './figure-thumbnail-store.js';
|
|
4
|
+
import { type FigureImportSource, type SourceCatalogRow } from './figure-import-source.js';
|
|
5
|
+
/** The most releases asked of the other server at once (its package door's limit). */
|
|
6
|
+
export declare const IMPORT_BATCH = 200;
|
|
7
|
+
/** The most bytes taken from it at once. */
|
|
8
|
+
export declare const IMPORT_MAX_BYTES: number;
|
|
9
|
+
/** What taking one figure would do here. */
|
|
10
|
+
export type FigureImportPlan = 'create' | 'overwrite' | 'modified-here' | 'unchanged';
|
|
11
|
+
export interface FigureImportRow extends SourceCatalogRow {
|
|
12
|
+
/** The namespace it has, or would have, here. */
|
|
13
|
+
namespaceHere: string;
|
|
14
|
+
plan: FigureImportPlan;
|
|
15
|
+
}
|
|
16
|
+
export interface FigureImportNotice {
|
|
17
|
+
code: string;
|
|
18
|
+
params?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
export interface FigureImportOutcome {
|
|
21
|
+
ref: string;
|
|
22
|
+
type: string;
|
|
23
|
+
outcome: 'created' | 'overwritten' | 'unchanged' | 'refused';
|
|
24
|
+
state?: 'draft' | 'released';
|
|
25
|
+
version?: number;
|
|
26
|
+
code?: string;
|
|
27
|
+
message?: string;
|
|
28
|
+
notices: FigureImportNotice[];
|
|
29
|
+
}
|
|
30
|
+
export type InTransaction = <T>(work: (tx: EntityManager) => Promise<T>) => Promise<T>;
|
|
31
|
+
/** The other server's figures with what taking each would do here. Nothing is written. */
|
|
32
|
+
export declare function withImportPlan(tx: EntityManager, domain: any, source: FigureImportSource, rows: SourceCatalogRow[]): Promise<FigureImportRow[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Takes the chosen releases from the other server (`refs`, {namespace}/{type}@{version}, with the figure id the catalog
|
|
35
|
+
* gave each). Each figure in a transaction of its own: one refused, the others go on.
|
|
36
|
+
*/
|
|
37
|
+
export declare function importFromSource(run: InTransaction, domain: any, user: any, source: FigureImportSource, chosen: readonly {
|
|
38
|
+
ref: string;
|
|
39
|
+
figureId: string;
|
|
40
|
+
}[], options?: {
|
|
41
|
+
t?: (key: string, options?: any) => string;
|
|
42
|
+
lng?: string;
|
|
43
|
+
mayRelease?: boolean;
|
|
44
|
+
files?: ThumbnailFiles;
|
|
45
|
+
doFetch?: typeof fetch;
|
|
46
|
+
}): Promise<FigureImportOutcome[]>;
|
|
47
|
+
/** The last time a figure was taken from another figure server, for its detail panel ("taken from"). */
|
|
48
|
+
export declare function transferOriginOf(tx: EntityManager, domain: {
|
|
49
|
+
id: string;
|
|
50
|
+
}, figureId: string): Promise<FigureTransferRecord | null>;
|