@things-factory/figure-ui 10.1.246 → 10.1.248
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/client/modeller/figure-history-panel.ts +28 -1
- package/client/modeller/package-download.ts +37 -0
- package/dist-client/modeller/figure-history-panel.d.ts +2 -0
- package/dist-client/modeller/figure-history-panel.js +28 -1
- package/dist-client/modeller/figure-history-panel.js.map +1 -1
- package/dist-client/modeller/package-download.d.ts +17 -0
- package/dist-client/modeller/package-download.js +28 -0
- package/dist-client/modeller/package-download.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/test/package-download.test.ts +43 -0
- package/translations/en.json +3 -0
- package/translations/es.json +3 -0
- package/translations/ja.json +3 -0
- package/translations/ko.json +3 -0
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/figure-ui",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.248",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"@things-factory:registry": "https://registry.npmjs.org"
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"@operato/slot-layout-editor": "^10.29.58",
|
|
43
43
|
"@operato/styles": "^10.0.0",
|
|
44
44
|
"@operato/utils": "^10.29.43",
|
|
45
|
-
"@things-factory/ai-assistant": "^10.1.
|
|
46
|
-
"@things-factory/figure-service": "^10.1.
|
|
47
|
-
"@things-factory/figure-viewer": "^10.1.
|
|
48
|
-
"@things-factory/setting-base": "^10.1.
|
|
45
|
+
"@things-factory/ai-assistant": "^10.1.247",
|
|
46
|
+
"@things-factory/figure-service": "^10.1.247",
|
|
47
|
+
"@things-factory/figure-viewer": "^10.1.247",
|
|
48
|
+
"@things-factory/setting-base": "^10.1.247",
|
|
49
49
|
"three": "^0.185.1"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "ca390a4b791d6e8630388167d3da6031034b5a5e"
|
|
52
52
|
}
|
|
@@ -13,3 +13,46 @@ test('each released version links to the package door by its full reference, onl
|
|
|
13
13
|
assert.equal(packageHrefOf('/domain/x', undefined, 'agv', 3), undefined, 'no namespace yet')
|
|
14
14
|
assert.equal(packageHrefOf('/domain/x', 'acme', null, 3), undefined, 'no type yet')
|
|
15
15
|
})
|
|
16
|
+
|
|
17
|
+
import { packageAnswerOf, packageNameOf } from '../client/modeller/package-download.ts'
|
|
18
|
+
|
|
19
|
+
const words = { forbidden: 'FORBIDDEN', signedOut: 'SIGNED-OUT', failed: (status: number) => `FAILED ${status}` }
|
|
20
|
+
|
|
21
|
+
/* A plain download link saved a refusal as figure-package.txt holding "Forbidden"; the panel now reads the answer first. */
|
|
22
|
+
test('a package answer is saved under the name the server gave', async () => {
|
|
23
|
+
const answer = await packageAnswerOf(
|
|
24
|
+
new Response(new Uint8Array([80, 75, 3, 4]), { headers: { 'content-type': 'application/zip', 'content-disposition': 'attachment; filename="acme_agv_3.figpkg"' } }),
|
|
25
|
+
words
|
|
26
|
+
)
|
|
27
|
+
assert.ok('file' in answer)
|
|
28
|
+
assert.equal(answer.name, 'acme_agv_3.figpkg')
|
|
29
|
+
assert.equal((await answer.file.arrayBuffer()).byteLength, 4)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
test('a refusal is said, never saved: no privilege, ended sign-in, the server sentence, anything else', async () => {
|
|
33
|
+
assert.deepEqual(await packageAnswerOf(new Response('Forbidden', { status: 403, headers: { 'content-type': 'text/plain' } }), words), { refusal: 'FORBIDDEN' })
|
|
34
|
+
assert.deepEqual(await packageAnswerOf(new Response('Unauthorized', { status: 401 }), words), { refusal: 'SIGNED-OUT' })
|
|
35
|
+
const refused = new Response(JSON.stringify({ code: 'figure-package-release-not-found', message: 'acme/agv@9 is not a release this domain can read.' }), {
|
|
36
|
+
status: 400,
|
|
37
|
+
headers: { 'content-type': 'application/json; charset=utf-8' }
|
|
38
|
+
})
|
|
39
|
+
assert.deepEqual(await packageAnswerOf(refused, words), { refusal: 'acme/agv@9 is not a release this domain can read.' })
|
|
40
|
+
assert.deepEqual(await packageAnswerOf(new Response('Not Found', { status: 404, headers: { 'content-type': 'text/plain' } }), words), { refusal: 'FAILED 404' })
|
|
41
|
+
assert.deepEqual(await packageAnswerOf(new Response('{}', { status: 500, headers: { 'content-type': 'application/json' } }), words), { refusal: 'FAILED 500' })
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
test('a package without a file name from the server still saves as a package', () => {
|
|
45
|
+
assert.equal(packageNameOf(null), 'figure-package.figpkg')
|
|
46
|
+
assert.equal(packageNameOf('attachment'), 'figure-package.figpkg')
|
|
47
|
+
assert.equal(packageNameOf('attachment; filename=figures-2.figpkg'), 'figures-2.figpkg')
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
test('every language says the three refusals', async () => {
|
|
51
|
+
const { readFileSync, readdirSync } = await import('node:fs')
|
|
52
|
+
const dir = new URL('../translations/', import.meta.url)
|
|
53
|
+
for (const file of readdirSync(dir)) {
|
|
54
|
+
const table = JSON.parse(readFileSync(new URL(file, dir), 'utf8'))
|
|
55
|
+
for (const key of ['figure.text.package-forbidden', 'figure.text.package-signed-out', 'figure.text.package-failed']) assert.ok(table[key], `${file} ${key}`)
|
|
56
|
+
assert.match(table['figure.text.package-failed'], /\{status\}/, file)
|
|
57
|
+
}
|
|
58
|
+
})
|
package/translations/en.json
CHANGED
|
@@ -998,6 +998,9 @@
|
|
|
998
998
|
"figure.text.detail-unreleased": "Not released yet. Showing the saved draft.",
|
|
999
999
|
"figure.button.detail-edit": "Open editor",
|
|
1000
1000
|
"figure.button.download-package": "download package",
|
|
1001
|
+
"figure.text.package-forbidden": "You may not download this package. Your role needs figure-published query.",
|
|
1002
|
+
"figure.text.package-signed-out": "Your sign-in has ended. Sign in again, then download.",
|
|
1003
|
+
"figure.text.package-failed": "The package could not be downloaded. The server answered {status}.",
|
|
1001
1004
|
"figure.button.import-mesh": "import GLB",
|
|
1002
1005
|
"figure.text.import-mesh-hint": "brings a GLB file in as a part: the whole file, or one part of it.",
|
|
1003
1006
|
"figure.text.mesh-whole-file": "whole file",
|
package/translations/es.json
CHANGED
|
@@ -998,6 +998,9 @@
|
|
|
998
998
|
"figure.text.detail-unreleased": "Aún no publicada. Se muestra el borrador guardado.",
|
|
999
999
|
"figure.button.detail-edit": "Abrir editor",
|
|
1000
1000
|
"figure.button.download-package": "descargar paquete",
|
|
1001
|
+
"figure.text.package-forbidden": "No puede descargar este paquete. Su rol necesita la consulta figure-published.",
|
|
1002
|
+
"figure.text.package-signed-out": "Su sesión ha terminado. Inicie sesión de nuevo y descargue.",
|
|
1003
|
+
"figure.text.package-failed": "No se pudo descargar el paquete. El servidor respondió {status}.",
|
|
1001
1004
|
"figure.button.import-mesh": "importar GLB",
|
|
1002
1005
|
"figure.text.import-mesh-hint": "trae un archivo GLB como pieza: el archivo entero o una parte de él.",
|
|
1003
1006
|
"figure.text.mesh-whole-file": "archivo entero",
|
package/translations/ja.json
CHANGED
|
@@ -998,6 +998,9 @@
|
|
|
998
998
|
"figure.text.detail-unreleased": "まだ公開されていません。保存された下書きを表示します。",
|
|
999
999
|
"figure.button.detail-edit": "編集画面を開く",
|
|
1000
1000
|
"figure.button.download-package": "パッケージをダウンロード",
|
|
1001
|
+
"figure.text.package-forbidden": "このパッケージをダウンロードする権限がありません。ロールに figure-published の照会権限が必要です。",
|
|
1002
|
+
"figure.text.package-signed-out": "サインインが切れました。もう一度サインインしてからダウンロードしてください。",
|
|
1003
|
+
"figure.text.package-failed": "パッケージをダウンロードできませんでした。サーバーの応答 {status}",
|
|
1001
1004
|
"figure.button.import-mesh": "GLB を取り込む",
|
|
1002
1005
|
"figure.text.import-mesh-hint": "GLB ファイルを部品として取り込みます。ファイル全体か、その中の 1 つを選びます。",
|
|
1003
1006
|
"figure.text.mesh-whole-file": "ファイル全体",
|
package/translations/ko.json
CHANGED
|
@@ -998,6 +998,9 @@
|
|
|
998
998
|
"figure.text.detail-unreleased": "아직 발행되지 않았습니다. 저장된 초안을 보여줍니다.",
|
|
999
999
|
"figure.button.detail-edit": "편집 화면 열기",
|
|
1000
1000
|
"figure.button.download-package": "패키지 다운로드",
|
|
1001
|
+
"figure.text.package-forbidden": "이 버전의 패키지를 내려받을 권한이 없습니다. 역할에 figure-published 조회 권한이 필요합니다.",
|
|
1002
|
+
"figure.text.package-signed-out": "로그인이 끝났습니다. 다시 로그인한 뒤 내려받으세요.",
|
|
1003
|
+
"figure.text.package-failed": "패키지를 받지 못했습니다. 서버 응답 {status}",
|
|
1001
1004
|
"figure.button.import-mesh": "GLB 가져오기",
|
|
1002
1005
|
"figure.text.import-mesh-hint": "GLB 파일을 부품으로 가져옵니다. 파일 전체나 그 안의 한 부분을 고릅니다.",
|
|
1003
1006
|
"figure.text.mesh-whole-file": "파일 전체",
|
package/translations/ms.json
CHANGED
|
@@ -998,6 +998,9 @@
|
|
|
998
998
|
"figure.text.detail-unreleased": "Belum diterbitkan. Draf yang disimpan dipaparkan.",
|
|
999
999
|
"figure.button.detail-edit": "Buka editor",
|
|
1000
1000
|
"figure.button.download-package": "muat turun pakej",
|
|
1001
|
+
"figure.text.package-forbidden": "Anda tidak boleh memuat turun pakej ini. Peranan anda memerlukan pertanyaan figure-published.",
|
|
1002
|
+
"figure.text.package-signed-out": "Log masuk anda telah tamat. Log masuk semula, kemudian muat turun.",
|
|
1003
|
+
"figure.text.package-failed": "Pakej tidak dapat dimuat turun. Pelayan menjawab {status}.",
|
|
1001
1004
|
"figure.button.import-mesh": "import GLB",
|
|
1002
1005
|
"figure.text.import-mesh-hint": "membawa masuk fail GLB sebagai bahagian: seluruh fail, atau satu bahagian daripadanya.",
|
|
1003
1006
|
"figure.text.mesh-whole-file": "seluruh fail",
|
package/translations/zh.json
CHANGED
|
@@ -998,6 +998,9 @@
|
|
|
998
998
|
"figure.text.detail-unreleased": "尚未发布。显示已保存的草稿。",
|
|
999
999
|
"figure.button.detail-edit": "打开编辑页面",
|
|
1000
1000
|
"figure.button.download-package": "下载包",
|
|
1001
|
+
"figure.text.package-forbidden": "您无权下载此包。您的角色需要 figure-published 查询权限。",
|
|
1002
|
+
"figure.text.package-signed-out": "登录已过期。请重新登录后下载。",
|
|
1003
|
+
"figure.text.package-failed": "无法下载该包。服务器响应 {status}。",
|
|
1001
1004
|
"figure.button.import-mesh": "导入 GLB",
|
|
1002
1005
|
"figure.text.import-mesh-hint": "将 GLB 文件导入为部件:整个文件,或其中的一部分。",
|
|
1003
1006
|
"figure.text.mesh-whole-file": "整个文件",
|