@things-factory/board-ui 10.0.0-beta.10 → 10.0.0-beta.102

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.
Files changed (109) hide show
  1. package/dist-client/apptools/favorite-tool.js +5 -5
  2. package/dist-client/apptools/favorite-tool.js.map +1 -1
  3. package/dist-client/board-list/board-tile-list.d.ts +6 -3
  4. package/dist-client/board-list/board-tile-list.js +349 -73
  5. package/dist-client/board-list/board-tile-list.js.map +1 -1
  6. package/dist-client/board-list/group-bar-styles.js +1 -1
  7. package/dist-client/board-list/group-bar-styles.js.map +1 -1
  8. package/dist-client/board-list/group-bar.js +3 -3
  9. package/dist-client/board-list/group-bar.js.map +1 -1
  10. package/dist-client/board-list/play-group-bar.d.ts +0 -1
  11. package/dist-client/board-list/play-group-bar.js +3 -6
  12. package/dist-client/board-list/play-group-bar.js.map +1 -1
  13. package/dist-client/board-provider.js +20 -8
  14. package/dist-client/board-provider.js.map +1 -1
  15. package/dist-client/data-grist/board-editor.js +4 -4
  16. package/dist-client/data-grist/board-editor.js.map +1 -1
  17. package/dist-client/data-grist/board-renderer.js +4 -4
  18. package/dist-client/data-grist/board-renderer.js.map +1 -1
  19. package/dist-client/graphql/attachment.d.ts +33 -0
  20. package/dist-client/graphql/attachment.js +87 -0
  21. package/dist-client/graphql/attachment.js.map +1 -0
  22. package/dist-client/graphql/board-import.d.ts +40 -0
  23. package/dist-client/graphql/board-import.js +91 -0
  24. package/dist-client/graphql/board-import.js.map +1 -0
  25. package/dist-client/graphql/board-template.js +1 -1
  26. package/dist-client/graphql/board-template.js.map +1 -1
  27. package/dist-client/graphql/board.d.ts +1 -0
  28. package/dist-client/graphql/board.js +33 -2
  29. package/dist-client/graphql/board.js.map +1 -1
  30. package/dist-client/graphql/group.js +1 -1
  31. package/dist-client/graphql/group.js.map +1 -1
  32. package/dist-client/graphql/play-group.js +3 -3
  33. package/dist-client/graphql/play-group.js.map +1 -1
  34. package/dist-client/pages/attachment-list-page.d.ts +16 -0
  35. package/dist-client/pages/attachment-list-page.js +63 -2
  36. package/dist-client/pages/attachment-list-page.js.map +1 -1
  37. package/dist-client/pages/board-action-dispatch.d.ts +31 -0
  38. package/dist-client/pages/board-action-dispatch.js +80 -0
  39. package/dist-client/pages/board-action-dispatch.js.map +1 -0
  40. package/dist-client/pages/board-action-dispatch.test.d.ts +1 -0
  41. package/dist-client/pages/board-action-dispatch.test.js +235 -0
  42. package/dist-client/pages/board-action-dispatch.test.js.map +1 -0
  43. package/dist-client/pages/board-create-wizard-page.d.ts +157 -0
  44. package/dist-client/pages/board-create-wizard-page.js +2176 -0
  45. package/dist-client/pages/board-create-wizard-page.js.map +1 -0
  46. package/dist-client/pages/board-edit-dispatch.d.ts +74 -0
  47. package/dist-client/pages/board-edit-dispatch.js +299 -0
  48. package/dist-client/pages/board-edit-dispatch.js.map +1 -0
  49. package/dist-client/pages/board-edit-dispatch.test.d.ts +1 -0
  50. package/dist-client/pages/board-edit-dispatch.test.js +858 -0
  51. package/dist-client/pages/board-edit-dispatch.test.js.map +1 -0
  52. package/dist-client/pages/board-list-page.d.ts +23 -3
  53. package/dist-client/pages/board-list-page.js +185 -77
  54. package/dist-client/pages/board-list-page.js.map +1 -1
  55. package/dist-client/pages/board-modeller-page.d.ts +134 -0
  56. package/dist-client/pages/board-modeller-page.js +725 -55
  57. package/dist-client/pages/board-modeller-page.js.map +1 -1
  58. package/dist-client/pages/board-player-by-name-page.js.map +1 -1
  59. package/dist-client/pages/board-player-page.js +14 -26
  60. package/dist-client/pages/board-player-page.js.map +1 -1
  61. package/dist-client/pages/board-viewer-by-name-page.d.ts +8 -1
  62. package/dist-client/pages/board-viewer-by-name-page.js +9 -1
  63. package/dist-client/pages/board-viewer-by-name-page.js.map +1 -1
  64. package/dist-client/pages/board-viewer-page.d.ts +2 -1
  65. package/dist-client/pages/board-viewer-page.js +52 -48
  66. package/dist-client/pages/board-viewer-page.js.map +1 -1
  67. package/dist-client/pages/play-list-page.d.ts +0 -1
  68. package/dist-client/pages/play-list-page.js +26 -33
  69. package/dist-client/pages/play-list-page.js.map +1 -1
  70. package/dist-client/pages/printable-board-viewer-page.js +2 -2
  71. package/dist-client/pages/printable-board-viewer-page.js.map +1 -1
  72. package/dist-client/route.d.ts +1 -1
  73. package/dist-client/route.js +3 -0
  74. package/dist-client/route.js.map +1 -1
  75. package/dist-client/setting-let/board-view-setting-let.js +1 -1
  76. package/dist-client/setting-let/board-view-setting-let.js.map +1 -1
  77. package/dist-client/themes/board-theme.css +4 -1
  78. package/dist-client/tsconfig.tsbuildinfo +1 -1
  79. package/dist-client/utils/notify-helper.d.ts +7 -0
  80. package/dist-client/utils/notify-helper.js +28 -0
  81. package/dist-client/utils/notify-helper.js.map +1 -0
  82. package/dist-client/utils/query-utils.d.ts +1 -0
  83. package/dist-client/utils/query-utils.js +26 -0
  84. package/dist-client/utils/query-utils.js.map +1 -0
  85. package/dist-client/viewparts/board-basic-info.js +9 -13
  86. package/dist-client/viewparts/board-basic-info.js.map +1 -1
  87. package/dist-client/viewparts/board-template-info.d.ts +0 -1
  88. package/dist-client/viewparts/board-template-info.js +5 -13
  89. package/dist-client/viewparts/board-template-info.js.map +1 -1
  90. package/dist-client/viewparts/board-versions.js +1 -1
  91. package/dist-client/viewparts/board-versions.js.map +1 -1
  92. package/dist-client/viewparts/group-info-basic.js +2 -2
  93. package/dist-client/viewparts/group-info-basic.js.map +1 -1
  94. package/dist-client/viewparts/group-info-import.js +2 -2
  95. package/dist-client/viewparts/group-info-import.js.map +1 -1
  96. package/dist-client/viewparts/link-builder.js +1 -1
  97. package/dist-client/viewparts/link-builder.js.map +1 -1
  98. package/dist-client/viewparts/play-group-info-basic.js +2 -2
  99. package/dist-client/viewparts/play-group-info-basic.js.map +1 -1
  100. package/dist-server/tsconfig.tsbuildinfo +1 -1
  101. package/helps/board-modeller/effects/event-handlers.ko.md +125 -0
  102. package/helps/board-modeller/effects/event-handlers.md +127 -0
  103. package/package.json +6 -5
  104. package/things-factory.config.js +1 -0
  105. package/translations/en.json +72 -30
  106. package/translations/ja.json +5 -30
  107. package/translations/ko.json +72 -30
  108. package/translations/ms.json +5 -30
  109. package/translations/zh.json +5 -30
@@ -0,0 +1,40 @@
1
+ export interface ImportBoardAsyncInput {
2
+ attachmentId: string;
3
+ chatSessionId?: string;
4
+ scopes?: string[];
5
+ normalizeOrigin?: boolean;
6
+ flipY?: boolean;
7
+ scale?: number;
8
+ applyBinding?: boolean;
9
+ parseOptions?: any;
10
+ /**
11
+ * 사용자 자유서술 hint — 도면 설명 / 강조 부분 / 카테고리 가이드 등.
12
+ * VLM 의 view type 분류 + entity 추출에 추가 컨텍스트로 합류.
13
+ */
14
+ userPrompt?: string;
15
+ }
16
+ export declare function importBoardAsync(input: ImportBoardAsyncInput): Promise<any>;
17
+ export declare function fetchImportSession(id: string): Promise<any>;
18
+ export interface MaterializeImportSessionInput {
19
+ sessionId: string;
20
+ name: string;
21
+ description?: string;
22
+ groupId?: string;
23
+ type?: 'main' | 'sub' | 'popup';
24
+ thumbnail?: string;
25
+ /** 선택한 시안 id ('as-is' / 'scene' / 'auto-fit' 등). 미지정 시 default. */
26
+ variantId?: string;
27
+ }
28
+ /**
29
+ * 충돌하지 않는 새 Board 의 짧은 이름 + 자세한 description 제안.
30
+ * 서버가 hint / userPrompt / AI importStrategy / 카테고리 분포 등을 합성해
31
+ * 둘 다 만들어준다. 클라이언트는 review 진입 시 한 번 호출.
32
+ */
33
+ export declare function suggestBoardMeta(input: {
34
+ sessionId?: string;
35
+ hint?: string;
36
+ }): Promise<{
37
+ name: string;
38
+ description: string;
39
+ }>;
40
+ export declare function materializeImportSession(input: MaterializeImportSessionInput): Promise<any>;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * board-import GraphQL operation client — wizard page 가 사용.
3
+ *
4
+ * 백엔드 정의: @things-factory/board-import 의 ImportSessionResolver.
5
+ * - importBoardAsync(input: ImportBoardAsyncInput!): ImportSession
6
+ * - importSession(id: String!): ImportSession
7
+ * - materializeImportSession(input: MaterializeImportSessionInput!): Board
8
+ */
9
+ import gql from 'graphql-tag';
10
+ import { client } from '@operato/graphql';
11
+ const IMPORT_SESSION_FIELDS = `
12
+ id
13
+ status
14
+ progress
15
+ message
16
+ totalEntities
17
+ options
18
+ result
19
+ attachmentId
20
+ chatSessionId
21
+ createdAt
22
+ updatedAt
23
+ completedAt
24
+ `;
25
+ export async function importBoardAsync(input) {
26
+ const response = await client.mutate({
27
+ mutation: gql `
28
+ mutation ImportBoardAsync($input: ImportBoardAsyncInput!) {
29
+ importBoardAsync(input: $input) {
30
+ ${IMPORT_SESSION_FIELDS}
31
+ }
32
+ }
33
+ `,
34
+ variables: { input }
35
+ });
36
+ return response.data?.importBoardAsync;
37
+ }
38
+ export async function fetchImportSession(id) {
39
+ const response = await client.query({
40
+ query: gql `
41
+ query ImportSession($id: String!) {
42
+ importSession(id: $id) {
43
+ ${IMPORT_SESSION_FIELDS}
44
+ }
45
+ }
46
+ `,
47
+ variables: { id },
48
+ // polling 시 cache 우회 — 매 호출마다 server fresh.
49
+ fetchPolicy: 'no-cache'
50
+ });
51
+ return response.data?.importSession;
52
+ }
53
+ /**
54
+ * 충돌하지 않는 새 Board 의 짧은 이름 + 자세한 description 제안.
55
+ * 서버가 hint / userPrompt / AI importStrategy / 카테고리 분포 등을 합성해
56
+ * 둘 다 만들어준다. 클라이언트는 review 진입 시 한 번 호출.
57
+ */
58
+ export async function suggestBoardMeta(input) {
59
+ const response = await client.query({
60
+ query: gql `
61
+ query SuggestBoardMeta($input: SuggestBoardNameInput!) {
62
+ suggestBoardMeta(input: $input) {
63
+ name
64
+ description
65
+ }
66
+ }
67
+ `,
68
+ variables: { input },
69
+ fetchPolicy: 'no-cache'
70
+ });
71
+ return response.data?.suggestBoardMeta ?? { name: '', description: '' };
72
+ }
73
+ export async function materializeImportSession(input) {
74
+ const response = await client.mutate({
75
+ mutation: gql `
76
+ mutation MaterializeImportSession($input: MaterializeImportSessionInput!) {
77
+ materializeImportSession(input: $input) {
78
+ id
79
+ name
80
+ description
81
+ state
82
+ sourceImportSessionId
83
+ createdAt
84
+ }
85
+ }
86
+ `,
87
+ variables: { input }
88
+ });
89
+ return response.data?.materializeImportSession;
90
+ }
91
+ //# sourceMappingURL=board-import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"board-import.js","sourceRoot":"","sources":["../../client/graphql/board-import.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;CAa7B,CAAA;AAkBD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAA4B;IACjE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;YAGL,qBAAqB;;;KAG5B;QACD,SAAS,EAAE,EAAE,KAAK,EAAE;KACrB,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EAAU;IACjD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;YAGF,qBAAqB;;;KAG5B;QACD,SAAS,EAAE,EAAE,EAAE,EAAE;QACjB,4CAA4C;QAC5C,WAAW,EAAE,UAAU;KACxB,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;AACrC,CAAC;AAaD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAGtC;IACC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;KAOT;QACD,SAAS,EAAE,EAAE,KAAK,EAAE;QACpB,WAAW,EAAE,UAAU;KACxB,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,IAAI,EAAE,gBAAgB,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAA;AACzE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,KAAoC;IACjF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;KAWZ;QACD,SAAS,EAAE,EAAE,KAAK,EAAE;KACrB,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAA;AAChD,CAAC","sourcesContent":["/**\n * board-import GraphQL operation client — wizard page 가 사용.\n *\n * 백엔드 정의: @things-factory/board-import 의 ImportSessionResolver.\n * - importBoardAsync(input: ImportBoardAsyncInput!): ImportSession\n * - importSession(id: String!): ImportSession\n * - materializeImportSession(input: MaterializeImportSessionInput!): Board\n */\nimport gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\n\nconst IMPORT_SESSION_FIELDS = `\n id\n status\n progress\n message\n totalEntities\n options\n result\n attachmentId\n chatSessionId\n createdAt\n updatedAt\n completedAt\n`\n\nexport interface ImportBoardAsyncInput {\n attachmentId: string\n chatSessionId?: string\n scopes?: string[]\n normalizeOrigin?: boolean\n flipY?: boolean\n scale?: number\n applyBinding?: boolean\n parseOptions?: any\n /**\n * 사용자 자유서술 hint — 도면 설명 / 강조 부분 / 카테고리 가이드 등.\n * VLM 의 view type 분류 + entity 추출에 추가 컨텍스트로 합류.\n */\n userPrompt?: string\n}\n\nexport async function importBoardAsync(input: ImportBoardAsyncInput) {\n const response = await client.mutate({\n mutation: gql`\n mutation ImportBoardAsync($input: ImportBoardAsyncInput!) {\n importBoardAsync(input: $input) {\n ${IMPORT_SESSION_FIELDS}\n }\n }\n `,\n variables: { input }\n })\n return response.data?.importBoardAsync\n}\n\nexport async function fetchImportSession(id: string) {\n const response = await client.query({\n query: gql`\n query ImportSession($id: String!) {\n importSession(id: $id) {\n ${IMPORT_SESSION_FIELDS}\n }\n }\n `,\n variables: { id },\n // polling 시 cache 우회 — 매 호출마다 server fresh.\n fetchPolicy: 'no-cache'\n })\n return response.data?.importSession\n}\n\nexport interface MaterializeImportSessionInput {\n sessionId: string\n name: string\n description?: string\n groupId?: string\n type?: 'main' | 'sub' | 'popup'\n thumbnail?: string\n /** 선택한 시안 id ('as-is' / 'scene' / 'auto-fit' 등). 미지정 시 default. */\n variantId?: string\n}\n\n/**\n * 충돌하지 않는 새 Board 의 짧은 이름 + 자세한 description 제안.\n * 서버가 hint / userPrompt / AI importStrategy / 카테고리 분포 등을 합성해\n * 둘 다 만들어준다. 클라이언트는 review 진입 시 한 번 호출.\n */\nexport async function suggestBoardMeta(input: {\n sessionId?: string\n hint?: string\n}): Promise<{ name: string; description: string }> {\n const response = await client.query({\n query: gql`\n query SuggestBoardMeta($input: SuggestBoardNameInput!) {\n suggestBoardMeta(input: $input) {\n name\n description\n }\n }\n `,\n variables: { input },\n fetchPolicy: 'no-cache'\n })\n return response.data?.suggestBoardMeta ?? { name: '', description: '' }\n}\n\nexport async function materializeImportSession(input: MaterializeImportSessionInput) {\n const response = await client.mutate({\n mutation: gql`\n mutation MaterializeImportSession($input: MaterializeImportSessionInput!) {\n materializeImportSession(input: $input) {\n id\n name\n description\n state\n sourceImportSessionId\n createdAt\n }\n }\n `,\n variables: { input }\n })\n return response.data?.materializeImportSession\n}\n"]}
@@ -89,7 +89,7 @@ export async function updateBoardTemplate(boardTemplate) {
89
89
  visibility : String
90
90
  }
91
91
  */
92
- var { id, name, description, model, visibility } = boardTemplate;
92
+ let { id, name, description, model, visibility } = boardTemplate;
93
93
  model = JSON.stringify(model);
94
94
  const response = await client.mutate({
95
95
  mutation: gql `
@@ -1 +1 @@
1
- {"version":3,"file":"board-template.js","sourceRoot":"","sources":["../../client/graphql/board-template.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,M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,KAAK,CAAC,CAAA;IAE7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;KAYZ;QACD,SAAS,EAAE;YACT,EAAE;YACF,KAAK,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE;SAChD;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EAAE;IAC1C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;KAIZ;QACD,SAAS,EAAE;YACT,EAAE;SACH;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\nimport { gqlBuilder } from '@things-factory/utils'\n\nexport async function fetchBoardTemplateList(listParam = {}) {\n const response = await client.query({\n query: gql`\n {\n boardTemplates(${gqlBuilder.buildArgs(listParam)}) {\n items {\n id\n name\n description\n thumbnail\n visibility\n createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function fetchBoardTemplate(id) {\n const response = await client.query({\n query: gql`\n query FetchBoardTemplate($id: String!) {\n boardTemplate(id: $id) {\n id\n name\n description\n thumbnail\n model\n visibility\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n return response.data\n}\n\nexport async function createBoardTemplate(boardTemplate) {\n /*\n input NewBoard {\n name : String!\n description : String\n model : String!\n visibility : String!\n }\n */\n\n boardTemplate.model = JSON.stringify(boardTemplate.model)\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateBoardTemplate($boardTemplate: NewBoardTemplate!) {\n createBoardTemplate(boardTemplate: $boardTemplate) {\n id\n name\n description\n model\n visibility\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n boardTemplate\n }\n })\n\n return response.data\n}\n\nexport async function updateBoardTemplate(boardTemplate) {\n /*\n input BoardPatch {\n name : String\n description : String\n model : String\n visibility : String\n }\n */\n var { id, name, description, model, visibility } = boardTemplate\n model = JSON.stringify(model)\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBoard($id: String!, $patch: BoardTemplatePatch!) {\n updateBoard(id: $id, patch: $patch) {\n id\n name\n description\n model\n visibility\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description, model, visibility }\n }\n })\n\n return response.data\n}\n\nexport async function deleteBoardTemplate(id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deleteBoardTemplate(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n\n return response.data\n}\n"]}
1
+ {"version":3,"file":"board-template.js","sourceRoot":"","sources":["../../client/graphql/board-template.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,SAAS,GAAG,EAAE;IACzD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;yBAEW,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC;;;;;;;;;;;;;KAanD;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EAAE;IACzC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;KAqBT;QACD,SAAS,EAAE,EAAE,EAAE,EAAE;KAClB,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ilder } from '@things-factory/utils'\n\nexport async function fetchBoardTemplateList(listParam = {}) {\n const response = await client.query({\n query: gql`\n {\n boardTemplates(${gqlBuilder.buildArgs(listParam)}) {\n items {\n id\n name\n description\n thumbnail\n visibility\n createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function fetchBoardTemplate(id) {\n const response = await client.query({\n query: gql`\n query FetchBoardTemplate($id: String!) {\n boardTemplate(id: $id) {\n id\n name\n description\n thumbnail\n model\n visibility\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n return response.data\n}\n\nexport async function createBoardTemplate(boardTemplate) {\n /*\n input NewBoard {\n name : String!\n description : String\n model : String!\n visibility : String!\n }\n */\n\n boardTemplate.model = JSON.stringify(boardTemplate.model)\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateBoardTemplate($boardTemplate: NewBoardTemplate!) {\n createBoardTemplate(boardTemplate: $boardTemplate) {\n id\n name\n description\n model\n visibility\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n boardTemplate\n }\n })\n\n return response.data\n}\n\nexport async function updateBoardTemplate(boardTemplate) {\n /*\n input BoardPatch {\n name : String\n description : String\n model : String\n visibility : String\n }\n */\n let { id, name, description, model, visibility } = boardTemplate\n model = JSON.stringify(model)\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBoard($id: String!, $patch: BoardTemplatePatch!) {\n updateBoard(id: $id, patch: $patch) {\n id\n name\n description\n model\n visibility\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description, model, visibility }\n }\n })\n\n return response.data\n}\n\nexport async function deleteBoardTemplate(id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deleteBoardTemplate(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n\n return response.data\n}\n"]}
@@ -11,6 +11,7 @@ export declare function cloneBoard({ id, name, description, targetSubdomain, tar
11
11
  export declare function releaseBoard(board: any): Promise<any>;
12
12
  export declare function revertBoardVersion(id: any, version: any): Promise<any>;
13
13
  export declare function updateBoard(board: any): Promise<any>;
14
+ export declare function fetchBoardsUpdatedSince(since: Date): Promise<any>;
14
15
  export declare function deleteBoard(id: any): Promise<any>;
15
16
  export declare function importBoards({ groupId, files, overwrite }: {
16
17
  groupId: string;
@@ -11,8 +11,10 @@ export async function fetchBoardList(listParam = {}) {
11
11
  name
12
12
  description
13
13
  thumbnail
14
+ thumbnailUpdatedAt
14
15
  state
15
16
  version
17
+ sortOrder
16
18
  createdAt
17
19
  updatedAt
18
20
  }
@@ -36,6 +38,7 @@ export async function fetchBoard(id) {
36
38
  name
37
39
  }
38
40
  thumbnail
41
+ thumbnailUpdatedAt
39
42
  model
40
43
  createdAt
41
44
  creator {
@@ -120,7 +123,7 @@ export async function cloneBoard({ id, name, description, targetSubdomain, targe
120
123
  return response.data;
121
124
  }
122
125
  export async function releaseBoard(board) {
123
- var { id } = board;
126
+ const { id } = board;
124
127
  const response = await client.mutate({
125
128
  mutation: gql `
126
129
  mutation ReleaseBoard($id: String!) {
@@ -173,7 +176,7 @@ export async function updateBoard(board) {
173
176
  type : String
174
177
  }
175
178
  */
176
- var { id, name, description, model, groupId, type } = board;
179
+ let { id, name, description, model, groupId, type } = board;
177
180
  model = JSON.stringify(model);
178
181
  const response = await client.mutate({
179
182
  mutation: gql `
@@ -202,6 +205,34 @@ export async function updateBoard(board) {
202
205
  });
203
206
  return response.data;
204
207
  }
208
+ export async function fetchBoardsUpdatedSince(since) {
209
+ const response = await client.query({
210
+ query: gql `
211
+ query BoardsUpdatedSince($since: DateTimeISO!) {
212
+ boardsUpdatedSince(since: $since) {
213
+ id
214
+ name
215
+ description
216
+ thumbnail
217
+ thumbnailUpdatedAt
218
+ state
219
+ version
220
+ type
221
+ sortOrder
222
+ group {
223
+ id
224
+ }
225
+ createdAt
226
+ updatedAt
227
+ deletedAt
228
+ }
229
+ }
230
+ `,
231
+ variables: { since: since.toISOString() },
232
+ fetchPolicy: 'network-only'
233
+ });
234
+ return response.data.boardsUpdatedSince;
235
+ }
205
236
  export async function deleteBoard(id) {
206
237
  const response = await client.mutate({
207
238
  mutation: gql `
@@ -1 +1 @@
1
- {"version":3,"file":"board.js","sourceRoot":"","sources":["../../client/graphql/board.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,SAAS,GAAG,EAAE;IACjD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;iBAEG,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC;;;;;;;;;;;;;;KAc3C;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAAE;IACjC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;KA0BT;QACD,SAAS,EAAE,EAAE,EAAE,EAAE;KAClB,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAK;IACrC;;;;;;;;MAQE;IAEF,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAEzC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;KAcZ;QACD,SAAS,EAAE;YACT,KAAK;SACN;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IA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AC,CAAA;IAE7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;KAkBZ;QACD,SAAS,EAAE;YACT,EAAE;YACF,KAAK,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE;SACnD;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAE;IAClC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;KAIZ;QACD,SAAS,EAAE;YACT,EAAE;SACH;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EACjC,OAAO,EACP,KAAK,EACL,SAAS,EAKV;IACC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;KAQZ;QACD,SAAS,EAAE;YACT,OAAO;YACP,KAAK;YACL,SAAS;SACV;QACD,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;KAC7B,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\nimport { gqlBuilder } from '@things-factory/utils'\n\nexport async function fetchBoardList(listParam = {}) {\n const response = await client.query({\n query: gql`\n {\n boards(${gqlBuilder.buildArgs(listParam)}) {\n items {\n id\n name\n description\n thumbnail\n state\n version\n createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function fetchBoard(id) {\n const response = await client.query({\n query: gql`\n query FetchBoardById($id: String!) {\n board(id: $id) {\n id\n name\n description\n group {\n id\n name\n }\n thumbnail\n model\n createdAt\n creator {\n id\n name\n }\n state\n version\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n return response.data\n}\n\nexport async function createBoard(board) {\n /*\n input NewBoard {\n name : String!\n description : String\n model : String!\n type : String!\n groupId : String!\n }\n */\n\n board.model = JSON.stringify(board.model)\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateBoard($board: NewBoard!) {\n createBoard(board: $board) {\n id\n name\n description\n type\n model\n state\n version\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n board\n }\n })\n\n return response.data\n}\n\nexport async function cloneBoard({\n id,\n name,\n description,\n targetSubdomain,\n targetGroupId\n}: {\n id: string\n name: string\n description: string\n targetSubdomain: string\n targetGroupId: string\n}) {\n const response = await client.mutate({\n mutation: gql`\n mutation CloneBoard($id: String!, $patch: BoardPatch!, $targetSubdomain: String!, $targetGroupId: String) {\n cloneBoard(id: $id, patch: $patch, targetSubdomain: $targetSubdomain, targetGroupId: $targetGroupId) {\n id\n name\n description\n type\n model\n group {\n id\n name\n }\n state\n version\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description },\n targetSubdomain,\n targetGroupId\n }\n })\n\n return response.data\n}\n\nexport async function releaseBoard(board) {\n var { id } = board\n\n const response = await client.mutate({\n mutation: gql`\n mutation ReleaseBoard($id: String!) {\n releaseBoard(id: $id) {\n id\n name\n description\n type\n model\n group {\n id\n name\n }\n state\n version\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id\n }\n })\n\n return response.data\n}\n\nexport async function revertBoardVersion(id, version) {\n const response = await client.mutate({\n mutation: gql`\n mutation RevertBoardVersion($id: String!, $version: Float!) {\n revertBoardVersion(id: $id, version: $version) {\n name\n }\n }\n `,\n variables: {\n id,\n version\n }\n })\n\n return response.data.revertBoardVersion\n}\n\nexport async function updateBoard(board) {\n /*\n input BoardPatch {\n name : String\n description : String\n model : String\n groupId : String\n type : String\n }\n */\n var { id, name, description, model, groupId, type } = board\n model = JSON.stringify(model)\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBoard($id: String!, $patch: BoardPatch!) {\n updateBoard(id: $id, patch: $patch) {\n id\n name\n description\n model\n group {\n id\n name\n }\n type\n state\n version\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description, model, groupId, type }\n }\n })\n\n return response.data\n}\n\nexport async function deleteBoard(id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deleteBoard(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n\n return response.data\n}\n\nexport async function importBoards({\n groupId,\n files,\n overwrite\n}: {\n groupId: string\n files: File[]\n overwrite: boolean\n}) {\n const response = await client.mutate({\n mutation: gql`\n mutation importBoards($groupId: String!, $files: [Upload!]!, $overwrite: Boolean!) {\n importBoards(groupId: $groupId, files: $files, overwrite: $overwrite) {\n id\n name\n description\n }\n }\n `,\n variables: {\n groupId,\n files,\n overwrite\n },\n context: { hasUpload: true }\n })\n\n return response.data\n}\n"]}
1
+ {"version":3,"file":"board.js","sourceRoot":"","sources":["../../client/graphql/board.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,SAAS,GAAG,EAAE;IACjD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;iBAEG,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;KAgB3C;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAAE;IACjC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC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AQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;KAIZ;QACD,SAAS,EAAE;YACT,EAAE;SACH;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EACjC,OAAO,EACP,KAAK,EACL,SAAS,EAKV;IACC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;KAQZ;QACD,SAAS,EAAE;YACT,OAAO;YACP,KAAK;YACL,SAAS;SACV;QACD,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;KAC7B,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\nimport { gqlBuilder } from '@things-factory/utils'\n\nexport async function fetchBoardList(listParam = {}) {\n const response = await client.query({\n query: gql`\n {\n boards(${gqlBuilder.buildArgs(listParam)}) {\n items {\n id\n name\n description\n thumbnail\n thumbnailUpdatedAt\n state\n version\n sortOrder\n createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function fetchBoard(id) {\n const response = await client.query({\n query: gql`\n query FetchBoardById($id: String!) {\n board(id: $id) {\n id\n name\n description\n group {\n id\n name\n }\n thumbnail\n thumbnailUpdatedAt\n model\n createdAt\n creator {\n id\n name\n }\n state\n version\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n return response.data\n}\n\nexport async function createBoard(board) {\n /*\n input NewBoard {\n name : String!\n description : String\n model : String!\n type : String!\n groupId : String!\n }\n */\n\n board.model = JSON.stringify(board.model)\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateBoard($board: NewBoard!) {\n createBoard(board: $board) {\n id\n name\n description\n type\n model\n state\n version\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n board\n }\n })\n\n return response.data\n}\n\nexport async function cloneBoard({\n id,\n name,\n description,\n targetSubdomain,\n targetGroupId\n}: {\n id: string\n name: string\n description: string\n targetSubdomain: string\n targetGroupId: string\n}) {\n const response = await client.mutate({\n mutation: gql`\n mutation CloneBoard($id: String!, $patch: BoardPatch!, $targetSubdomain: String!, $targetGroupId: String) {\n cloneBoard(id: $id, patch: $patch, targetSubdomain: $targetSubdomain, targetGroupId: $targetGroupId) {\n id\n name\n description\n type\n model\n group {\n id\n name\n }\n state\n version\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description },\n targetSubdomain,\n targetGroupId\n }\n })\n\n return response.data\n}\n\nexport async function releaseBoard(board) {\n const { id } = board\n\n const response = await client.mutate({\n mutation: gql`\n mutation ReleaseBoard($id: String!) {\n releaseBoard(id: $id) {\n id\n name\n description\n type\n model\n group {\n id\n name\n }\n state\n version\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id\n }\n })\n\n return response.data\n}\n\nexport async function revertBoardVersion(id, version) {\n const response = await client.mutate({\n mutation: gql`\n mutation RevertBoardVersion($id: String!, $version: Float!) {\n revertBoardVersion(id: $id, version: $version) {\n name\n }\n }\n `,\n variables: {\n id,\n version\n }\n })\n\n return response.data.revertBoardVersion\n}\n\nexport async function updateBoard(board) {\n /*\n input BoardPatch {\n name : String\n description : String\n model : String\n groupId : String\n type : String\n }\n */\n let { id, name, description, model, groupId, type } = board\n model = JSON.stringify(model)\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBoard($id: String!, $patch: BoardPatch!) {\n updateBoard(id: $id, patch: $patch) {\n id\n name\n description\n model\n group {\n id\n name\n }\n type\n state\n version\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description, model, groupId, type }\n }\n })\n\n return response.data\n}\n\nexport async function fetchBoardsUpdatedSince(since: Date) {\n const response = await client.query({\n query: gql`\n query BoardsUpdatedSince($since: DateTimeISO!) {\n boardsUpdatedSince(since: $since) {\n id\n name\n description\n thumbnail\n thumbnailUpdatedAt\n state\n version\n type\n sortOrder\n group {\n id\n }\n createdAt\n updatedAt\n deletedAt\n }\n }\n `,\n variables: { since: since.toISOString() },\n fetchPolicy: 'network-only'\n })\n\n return response.data.boardsUpdatedSince\n}\n\nexport async function deleteBoard(id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deleteBoard(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n\n return response.data\n}\n\nexport async function importBoards({\n groupId,\n files,\n overwrite\n}: {\n groupId: string\n files: File[]\n overwrite: boolean\n}) {\n const response = await client.mutate({\n mutation: gql`\n mutation importBoards($groupId: String!, $files: [Upload!]!, $overwrite: Boolean!) {\n importBoards(groupId: $groupId, files: $files, overwrite: $overwrite) {\n id\n name\n description\n }\n }\n `,\n variables: {\n groupId,\n files,\n overwrite\n },\n context: { hasUpload: true }\n })\n\n return response.data\n}\n"]}
@@ -26,7 +26,7 @@ export async function fetchGroup(id) {
26
26
  return response.data;
27
27
  }
28
28
  export async function updateGroup(group) {
29
- var { id, name, description } = group;
29
+ const { id, name, description } = group;
30
30
  const response = await client.mutate({
31
31
  mutation: gql `
32
32
  mutation UpdateGroup($id: String!, $patch: GroupPatch!) {
@@ -1 +1 @@
1
- {"version":3,"file":"group.js","sourceRoot":"","sources":["../../client/graphql/group.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAAE;IACjC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;KAkBT;QACD,SAAS,EAAE,EAAE,EAAE,EAAE;KAClB,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CA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;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE,EAAE,OAAO;YACX,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\n\nexport async function fetchGroup(id) {\n const response = await client.query({\n query: gql`\n query FetchGroupById($id: String!) {\n group(id: $id) {\n id\n name\n description\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n return response.data\n}\n\nexport async function updateGroup(group) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateGroup($id: String!, $patch: GroupPatch!) {\n updateGroup(id: $id, patch: $patch) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function deleteGroup(id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deleteGroup(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n\n return response.data\n}\n\nexport async function fetchGroupList() {\n const response = await client.query({\n query: gql`\n {\n groups {\n items {\n id\n name\n description\n createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function createGroup(group) {\n const response = await client.mutate({\n mutation: gql`\n mutation CreateGroup($group: NewGroup!) {\n createGroup(group: $group) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: { group }\n })\n\n return response.data\n}\n\nexport async function joinGroup(boardId, groupId) {\n const response = await client.mutate({\n mutation: gql`\n mutation JoinGroup($id: String!, $boardIds: [String!]!) {\n joinGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}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CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAK;IACrC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;KAUZ;QACD,SAAS,EAAE,EAAE,KAAK,EAAE;KACrB,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAO,EAAE,OAAO;IAC9C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE,EAAE,OAAO;YACX,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\n\nexport async function fetchGroup(id) {\n const response = await client.query({\n query: gql`\n query FetchGroupById($id: String!) {\n group(id: $id) {\n id\n name\n description\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: { id }\n })\n\n return response.data\n}\n\nexport async function updateGroup(group) {\n const { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateGroup($id: String!, $patch: GroupPatch!) {\n updateGroup(id: $id, patch: $patch) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function deleteGroup(id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deleteGroup(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n\n return response.data\n}\n\nexport async function fetchGroupList() {\n const response = await client.query({\n query: gql`\n {\n groups {\n items {\n id\n name\n description\n createdAt\n updatedAt\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function createGroup(group) {\n const response = await client.mutate({\n mutation: gql`\n mutation CreateGroup($group: NewGroup!) {\n createGroup(group: $group) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: { group }\n })\n\n return response.data\n}\n\nexport async function joinGroup(boardId, groupId) {\n const response = await client.mutate({\n mutation: gql`\n mutation JoinGroup($id: String!, $boardIds: [String!]!) {\n joinGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n"]}
@@ -62,7 +62,7 @@ export async function fetchPlayGroup(groupId) {
62
62
  return response.data;
63
63
  }
64
64
  export async function createPlayGroup(group) {
65
- var { name, description } = group;
65
+ const { name, description } = group;
66
66
  const response = await client.mutate({
67
67
  mutation: gql `
68
68
  mutation CreatePlayGroup($playGroup: NewPlayGroup!) {
@@ -82,7 +82,7 @@ export async function createPlayGroup(group) {
82
82
  return response.data;
83
83
  }
84
84
  export async function updatePlayGroup(group) {
85
- var { id, name, description } = group;
85
+ const { id, name, description } = group;
86
86
  const response = await client.mutate({
87
87
  mutation: gql `
88
88
  mutation UpdatePlayGroup($id: String!, $patch: PlayGroupPatch!) {
@@ -116,7 +116,7 @@ export async function deletePlayGroup(id) {
116
116
  return response.data;
117
117
  }
118
118
  export async function joinPlayGroup(boardId, group) {
119
- var { id, name, description } = group;
119
+ const { id, name, description } = group;
120
120
  const response = await client.mutate({
121
121
  mutation: gql `
122
122
  mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {
@@ -1 +1 @@
1
- {"version":3,"file":"play-group.js","sourceRoot":"","sources":["../../client/graphql/play-group.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,CAA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AU,eAAe,CAAC,EAAE;IACtC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;KAIZ;QACD,SAAS,EAAE;YACT,EAAE;SACH;KACF,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAO,EAAE,KAAK;IAChD,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAErC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE;YACF,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAO,EAAE,OAAO;IACnD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE,EAAE,OAAO;YACX,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\n\nexport async function fetchPlayGroupList() {\n const response = await client.query({\n query: gql`\n {\n playGroups {\n items {\n id\n name\n description\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function fetchPlayGroup(groupId) {\n const response = await client.query({\n query: gql`\n query FetchPlayGroup($id: String!) {\n playGroup(id: $id) {\n id\n name\n description\n boards {\n id\n name\n description\n model\n thumbnail\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: {\n id: groupId\n }\n })\n\n return response.data\n}\n\nexport async function createPlayGroup(group) {\n var { name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreatePlayGroup($playGroup: NewPlayGroup!) {\n createPlayGroup(playGroup: $playGroup) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n playGroup: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function updatePlayGroup(group) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdatePlayGroup($id: String!, $patch: PlayGroupPatch!) {\n updatePlayGroup(id: $id, patch: $patch) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function deletePlayGroup(id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deletePlayGroup(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n return response.data\n}\n\nexport async function joinPlayGroup(boardId, group) {\n var { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {\n joinPlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n\nexport async function leavePlayGroup(boardId, groupId) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $boardIds: [String]!) {\n leavePlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n"]}
1
+ {"version":3,"file":"play-group.js","sourceRoot":"","sources":["../../client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EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;SAC7B;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EAAE;IACtC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;KAIZ;QACD,SAAS,EAAE;YACT,EAAE;SACH;KACF,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAO,EAAE,KAAK;IAChD,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAEvC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE;YACF,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAO,EAAE,OAAO;IACnD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;QACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBZ;QACD,SAAS,EAAE;YACT,EAAE,EAAE,OAAO;YACX,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC","sourcesContent":["import gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\n\nexport async function fetchPlayGroupList() {\n const response = await client.query({\n query: gql`\n {\n playGroups {\n items {\n id\n name\n description\n }\n total\n }\n }\n `\n })\n\n return response.data\n}\n\nexport async function fetchPlayGroup(groupId) {\n const response = await client.query({\n query: gql`\n query FetchPlayGroup($id: String!) {\n playGroup(id: $id) {\n id\n name\n description\n boards {\n id\n name\n description\n model\n thumbnail\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n createdAt\n creator {\n id\n name\n }\n updatedAt\n updater {\n id\n name\n }\n }\n }\n `,\n variables: {\n id: groupId\n }\n })\n\n return response.data\n}\n\nexport async function createPlayGroup(group) {\n const { name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreatePlayGroup($playGroup: NewPlayGroup!) {\n createPlayGroup(playGroup: $playGroup) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n playGroup: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function updatePlayGroup(group) {\n const { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdatePlayGroup($id: String!, $patch: PlayGroupPatch!) {\n updatePlayGroup(id: $id, patch: $patch) {\n id\n name\n description\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n patch: { name, description }\n }\n })\n\n return response.data\n}\n\nexport async function deletePlayGroup(id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n deletePlayGroup(id: $id)\n }\n `,\n variables: {\n id\n }\n })\n return response.data\n}\n\nexport async function joinPlayGroup(boardId, group) {\n const { id, name, description } = group\n\n const response = await client.mutate({\n mutation: gql`\n mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {\n joinPlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n\nexport async function leavePlayGroup(boardId, groupId) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $boardIds: [String]!) {\n leavePlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n description\n boards {\n id\n name\n description\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: [boardId]\n }\n })\n\n return response.data\n}\n"]}
@@ -19,12 +19,28 @@ export declare class AttachmentListPage extends AttachmentListPage_base {
19
19
  importable: {
20
20
  handler: (data: any, file: any) => Promise<void>;
21
21
  };
22
+ actions: {
23
+ icon: string;
24
+ emphasis: {
25
+ raised: boolean;
26
+ outlined: boolean;
27
+ dense: boolean;
28
+ danger: boolean;
29
+ };
30
+ title: string;
31
+ action: () => Promise<void>;
32
+ }[];
22
33
  };
23
34
  render(): import("lit-html").TemplateResult<1>;
24
35
  get grist(): import("@operato/data-grist").DataGrist;
25
36
  languageUpdated(i18next: any): void;
26
37
  pageInitialized(): Promise<void>;
27
38
  exportHandler(): Promise<any>;
39
+ /**
40
+ * 썸네일이 없는 기존 첨부파일들에 대해 서버에서 일괄 썸네일 생성.
41
+ * 한 배치당 20 개씩, remaining 이 0 이 될 때까지 반복 호출.
42
+ */
43
+ backfillThumbnails(): Promise<void>;
28
44
  importHandler(data: any, file: any): Promise<void>;
29
45
  }
30
46
  export {};
@@ -5,8 +5,10 @@ import { customElement, query } from 'lit/decorators.js';
5
5
  import gql from 'graphql-tag';
6
6
  import { i18next, localize } from '@operato/i18n';
7
7
  import { PageView } from '@operato/shell';
8
+ import { CommonButtonStyles } from '@operato/styles';
8
9
  import { OxAttachmentList } from '@operato/attachment/ox-attachment-list.js';
9
10
  import { client } from '@operato/graphql';
11
+ import { notify } from '@operato/layout';
10
12
  async function fetchDataFromURL(fileURL) {
11
13
  try {
12
14
  const response = await fetch(fileURL);
@@ -57,7 +59,14 @@ let AttachmentListPage = class AttachmentListPage extends localize(i18next)(Page
57
59
  },
58
60
  importable: {
59
61
  handler: this.importHandler.bind(this)
60
- }
62
+ },
63
+ actions: [
64
+ {
65
+ title: i18next.t('button.backfill thumbnails'),
66
+ action: this.backfillThumbnails.bind(this),
67
+ ...CommonButtonStyles.save
68
+ }
69
+ ]
61
70
  };
62
71
  }
63
72
  render() {
@@ -91,11 +100,63 @@ let AttachmentListPage = class AttachmentListPage extends localize(i18next)(Page
91
100
  });
92
101
  }
93
102
  catch (err) {
94
- console.log(name, err);
103
+ console.warn('Failed to process attachment:', name, err);
95
104
  }
96
105
  }
97
106
  return data;
98
107
  }
108
+ /**
109
+ * 썸네일이 없는 기존 첨부파일들에 대해 서버에서 일괄 썸네일 생성.
110
+ * 한 배치당 20 개씩, remaining 이 0 이 될 때까지 반복 호출.
111
+ */
112
+ async backfillThumbnails() {
113
+ const BATCH = 20;
114
+ let total = { attempted: 0, succeeded: 0, failed: 0 };
115
+ let remaining = Number.POSITIVE_INFINITY;
116
+ notify({ message: i18next.t('text.backfilling thumbnails') });
117
+ while (remaining > 0) {
118
+ try {
119
+ const { data } = await client.mutate({
120
+ mutation: gql `
121
+ mutation BackfillAttachmentThumbnails($limit: Int) {
122
+ backfillAttachmentThumbnails(limit: $limit) {
123
+ attempted
124
+ succeeded
125
+ failed
126
+ remaining
127
+ }
128
+ }
129
+ `,
130
+ variables: { limit: BATCH }
131
+ });
132
+ const r = data?.backfillAttachmentThumbnails;
133
+ if (!r)
134
+ break;
135
+ total.attempted += r.attempted;
136
+ total.succeeded += r.succeeded;
137
+ total.failed += r.failed;
138
+ remaining = r.remaining;
139
+ if (r.attempted === 0)
140
+ break; // 더 이상 처리할 게 없음
141
+ // 한 배치에서 아무것도 성공하지 못했다면 무한 루프 방지를 위해 중단.
142
+ // 동일 후보들이 계속 실패하는 상황이므로 서버 측 원인 해결이 선행되어야 함.
143
+ if (r.succeeded === 0)
144
+ break;
145
+ }
146
+ catch (err) {
147
+ console.error('backfill error:', err);
148
+ notify({ level: 'error', message: String(err) });
149
+ return;
150
+ }
151
+ }
152
+ notify({
153
+ message: i18next.t('text.thumbnail backfill done', {
154
+ succeeded: total.succeeded,
155
+ failed: total.failed
156
+ })
157
+ });
158
+ this.grist.fetch();
159
+ }
99
160
  async importHandler(data, file) {
100
161
  await client.mutate({
101
162
  m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B,CAAC;GACzB,kBAAkB,CAgG9B","sourcesContent":["import '@operato/attachment/ox-attachment-list.js'\n\nimport { css, html } from 'lit'\nimport { customElement, query } from 'lit/decorators.js'\nimport gql from 'graphql-tag'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView } from '@operato/shell'\nimport { OxAttachmentList } from '@operato/attachment/ox-attachment-list.js'\nimport { client } from '@operato/graphql'\n\nasync function fetchDataFromURL(fileURL: string) {\n try {\n const response = await fetch(fileURL)\n\n if (!response.ok) {\n throw new Error('Network response was not ok')\n }\n\n const blob = await response.blob() // 파일 데이터를 Blob으로 변환\n\n if (blob.size === 0) {\n throw new Error('Content is empty') // Content가 비어 있으면 예외\n }\n\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n\n reader.onload = (event: any) => {\n const dataURL = event.target.result\n resolve(dataURL)\n }\n\n reader.onerror = (event: any) => {\n reject(event.error)\n }\n\n reader.readAsDataURL(blob) // Blob을 Data URL로 읽기\n })\n } catch (error) {\n throw error\n }\n}\n\n@customElement('attachment-list-page')\nexport class AttachmentListPage extends localize(i18next)(PageView) {\n static styles = [\n css`\n :host {\n display: flex;\n }\n `\n ]\n\n @query('ox-attachment-list') attachmentList!: OxAttachmentList\n\n get context() {\n return {\n title: i18next.t('title.attachment list'),\n search: {\n handler: search => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n board_topmenu: true,\n exportable: {\n name: i18next.t('title.attachment list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() {\n return html` <ox-attachment-list .creatable=${true} without-search></ox-attachment-list> `\n }\n\n get grist() {\n return this.attachmentList.grist\n }\n\n languageUpdated(i18next) {\n this.attachmentList.requestUpdate()\n }\n\n async pageInitialized() {\n await this.updateComplete\n\n this.attachmentList.refreshAttachments()\n }\n\n async exportHandler() {\n const records = this.grist.data.records\n const data = {} as any\n\n for (const record of records) {\n const { id, name, mimetype, encoding, category, fullpath } = record\n\n try {\n const dataURL = await fetchDataFromURL(fullpath)\n\n id &&\n (data[id!] = {\n id,\n name,\n mimetype,\n encoding,\n category,\n contents: dataURL\n })\n } catch (err) {\n console.log(name, err)\n }\n }\n\n return data\n }\n\n async importHandler(data, file) {\n await client.mutate({\n mutation: gql`\n mutation importAttachments($file: Upload!) {\n importAttachments(file: $file) {\n id\n name\n description\n path\n }\n }\n `,\n variables: {\n file\n },\n context: { hasUpload: true }\n })\n\n this.grist.fetch()\n }\n}\n"]}
1
+ {"version":3,"file":"attachment-list-page.js","sourceRoot":"","sources":["../../client/pages/attachment-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,2CAA2C,CAAA;AAElD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,KAAK,UAAU,gBAAgB,CAAC,OAAe;IAC7C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,CAAA;QAErC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;QAChD,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA,CAAC,oBAAoB;QAEvD,IAAI,IAAI,CAAC,IAAI,K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AK;YAC9B,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAA;gBACrC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;gBAChD,OAAM;YACR,CAAC;QACH,CAAC;QAED,MAAM,CAAC;YACL,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,8BAA8B,EAAE;gBACjD,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,MAAM,EAAE,KAAK,CAAC,MAAM;aACrB,CAAC;SACH,CAAC,CAAA;QACF,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI;QAC5B,MAAM,MAAM,CAAC,MAAM,CAAC;YAClB,QAAQ,EAAE,GAAG,CAAA;;;;;;;;;OASZ;YACD,SAAS,EAAE;gBACT,IAAI;aACL;YACD,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;SAC7B,CAAC,CAAA;QAEF,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;;AAlJ4B;IAA5B,KAAK,CAAC,oBAAoB,CAAC;8BAAkB,gBAAgB;0DAAA;AATnD,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA4J9B","sourcesContent":["import '@operato/attachment/ox-attachment-list.js'\n\nimport { css, html } from 'lit'\nimport { customElement, query } from 'lit/decorators.js'\nimport gql from 'graphql-tag'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView } from '@operato/shell'\nimport { CommonButtonStyles } from '@operato/styles'\nimport { OxAttachmentList } from '@operato/attachment/ox-attachment-list.js'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\n\nasync function fetchDataFromURL(fileURL: string) {\n try {\n const response = await fetch(fileURL)\n\n if (!response.ok) {\n throw new Error('Network response was not ok')\n }\n\n const blob = await response.blob() // 파일 데이터를 Blob으로 변환\n\n if (blob.size === 0) {\n throw new Error('Content is empty') // Content가 비어 있으면 예외\n }\n\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n\n reader.onload = (event: any) => {\n const dataURL = event.target.result\n resolve(dataURL)\n }\n\n reader.onerror = (event: any) => {\n reject(event.error)\n }\n\n reader.readAsDataURL(blob) // Blob을 Data URL로 읽기\n })\n } catch (error) {\n throw error\n }\n}\n\n@customElement('attachment-list-page')\nexport class AttachmentListPage extends localize(i18next)(PageView) {\n static styles = [\n css`\n :host {\n display: flex;\n }\n `\n ]\n\n @query('ox-attachment-list') attachmentList!: OxAttachmentList\n\n get context() {\n return {\n title: i18next.t('title.attachment list'),\n search: {\n handler: search => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n board_topmenu: true,\n exportable: {\n name: i18next.t('title.attachment list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n },\n actions: [\n {\n title: i18next.t('button.backfill thumbnails'),\n action: this.backfillThumbnails.bind(this),\n ...CommonButtonStyles.save\n }\n ]\n }\n }\n\n render() {\n return html` <ox-attachment-list .creatable=${true} without-search></ox-attachment-list> `\n }\n\n get grist() {\n return this.attachmentList.grist\n }\n\n languageUpdated(i18next) {\n this.attachmentList.requestUpdate()\n }\n\n async pageInitialized() {\n await this.updateComplete\n\n this.attachmentList.refreshAttachments()\n }\n\n async exportHandler() {\n const records = this.grist.data.records\n const data = {} as any\n\n for (const record of records) {\n const { id, name, mimetype, encoding, category, fullpath } = record\n\n try {\n const dataURL = await fetchDataFromURL(fullpath)\n\n id &&\n (data[id!] = {\n id,\n name,\n mimetype,\n encoding,\n category,\n contents: dataURL\n })\n } catch (err) {\n console.warn('Failed to process attachment:', name, err)\n }\n }\n\n return data\n }\n\n /**\n * 썸네일이 없는 기존 첨부파일들에 대해 서버에서 일괄 썸네일 생성.\n * 한 배치당 20 개씩, remaining 이 0 이 될 때까지 반복 호출.\n */\n async backfillThumbnails() {\n const BATCH = 20\n let total = { attempted: 0, succeeded: 0, failed: 0 }\n let remaining = Number.POSITIVE_INFINITY\n\n notify({ message: i18next.t('text.backfilling thumbnails') })\n\n while (remaining > 0) {\n try {\n const { data } = await client.mutate({\n mutation: gql`\n mutation BackfillAttachmentThumbnails($limit: Int) {\n backfillAttachmentThumbnails(limit: $limit) {\n attempted\n succeeded\n failed\n remaining\n }\n }\n `,\n variables: { limit: BATCH }\n })\n const r = data?.backfillAttachmentThumbnails\n if (!r) break\n total.attempted += r.attempted\n total.succeeded += r.succeeded\n total.failed += r.failed\n remaining = r.remaining\n\n if (r.attempted === 0) break // 더 이상 처리할 게 없음\n // 한 배치에서 아무것도 성공하지 못했다면 무한 루프 방지를 위해 중단.\n // 동일 후보들이 계속 실패하는 상황이므로 서버 측 원인 해결이 선행되어야 함.\n if (r.succeeded === 0) break\n } catch (err) {\n console.error('backfill error:', err)\n notify({ level: 'error', message: String(err) })\n return\n }\n }\n\n notify({\n message: i18next.t('text.thumbnail backfill done', {\n succeeded: total.succeeded,\n failed: total.failed\n })\n })\n this.grist.fetch()\n }\n\n async importHandler(data, file) {\n await client.mutate({\n mutation: gql`\n mutation importAttachments($file: Upload!) {\n importAttachments(file: $file) {\n id\n name\n description\n path\n }\n }\n `,\n variables: {\n file\n },\n context: { hasUpload: true }\n })\n\n this.grist.fetch()\n }\n}\n"]}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Host 측 BoardActionOp dispatcher — AI 가 지시한 ephemeral scene action 을
3
+ * things-scene API 로 실행.
4
+ *
5
+ * 별개 채널 — board-edit-patch 와 달리 model 변경 X, undo 영향 X, dirty flag 무관.
6
+ * pure function 형태 (스크롤되는 customElement 와 분리) — Lit 외부에서 단위 테스트 가능.
7
+ */
8
+ import type { BoardActionOp } from '@things-factory/board-ai';
9
+ /**
10
+ * AI 의 BoardEditOp / BoardActionOp 가 지정한 대상 (id 또는 refid) 으로
11
+ * things-scene component 검색.
12
+ *
13
+ * id (사용자/AI 가 명시적으로 설정한 string identifier) 와
14
+ * refid (things-scene 이 모든 컴포넌트에 자동 발급하는 numeric identifier) 는
15
+ * 서로 별개 개념. 이 함수는 호스트 측에서 둘 중 어느 쪽으로든 lookup 가능하게 통합.
16
+ * refid 가 universal 이므로 우선.
17
+ */
18
+ export declare function findSceneComponent(scene: any, target: {
19
+ id?: string;
20
+ refid?: number;
21
+ }): any;
22
+ /**
23
+ * 단일 BoardActionOp 를 things-scene 에 적용.
24
+ *
25
+ * 호스트는 actions 배열을 순회하며 매 op 마다 호출. 실패 (잘못된 action /
26
+ * 누락된 컴포넌트 / API 예외) 시 `false` 반환 — 호스트가 warn 처리.
27
+ *
28
+ * setSceneMode 의 경우 호스트 측 reactive `mode` property 동기는 별도 (return
29
+ * 후 호스트가 scene.mode 재읽기). things-scene 의 mode: edit=1, view=0.
30
+ */
31
+ export declare function dispatchBoardAction(scene: any, action: BoardActionOp): boolean;