@xxmachina/common 0.0.0-PLACEHOLDER

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 (160) hide show
  1. package/_shared/auth/index.d.ts +8 -0
  2. package/_shared/auth/passports/anonymous/index.d.ts +8 -0
  3. package/_shared/auth/passports/firebase/index.d.ts +19 -0
  4. package/_shared/auth/passports/internal/index.d.ts +17 -0
  5. package/_shared/auth/passports/msal/index.d.ts +26 -0
  6. package/_shared/meta/index.d.ts +8 -0
  7. package/_shared/meta/redis/index.d.ts +39 -0
  8. package/auth/index.d.ts +16 -0
  9. package/azure-auth/index.d.ts +41 -0
  10. package/domain/builder/index.d.ts +81 -0
  11. package/domain/builder/screen-item/index.d.ts +7 -0
  12. package/domain/index.d.ts +2 -0
  13. package/domain/models/index.d.ts +517 -0
  14. package/fesm2022/xxmachina-common-_shared-auth-passports-anonymous.mjs +20 -0
  15. package/fesm2022/xxmachina-common-_shared-auth-passports-anonymous.mjs.map +1 -0
  16. package/fesm2022/xxmachina-common-_shared-auth-passports-firebase.mjs +41 -0
  17. package/fesm2022/xxmachina-common-_shared-auth-passports-firebase.mjs.map +1 -0
  18. package/fesm2022/xxmachina-common-_shared-auth-passports-internal.mjs +34 -0
  19. package/fesm2022/xxmachina-common-_shared-auth-passports-internal.mjs.map +1 -0
  20. package/fesm2022/xxmachina-common-_shared-auth-passports-msal.mjs +49 -0
  21. package/fesm2022/xxmachina-common-_shared-auth-passports-msal.mjs.map +1 -0
  22. package/fesm2022/xxmachina-common-_shared-auth.mjs +25 -0
  23. package/fesm2022/xxmachina-common-_shared-auth.mjs.map +1 -0
  24. package/fesm2022/xxmachina-common-_shared-meta-redis.mjs +99 -0
  25. package/fesm2022/xxmachina-common-_shared-meta-redis.mjs.map +1 -0
  26. package/fesm2022/xxmachina-common-_shared-meta.mjs +26 -0
  27. package/fesm2022/xxmachina-common-_shared-meta.mjs.map +1 -0
  28. package/fesm2022/xxmachina-common-auth.mjs +17 -0
  29. package/fesm2022/xxmachina-common-auth.mjs.map +1 -0
  30. package/fesm2022/xxmachina-common-azure-auth.mjs +160 -0
  31. package/fesm2022/xxmachina-common-azure-auth.mjs.map +1 -0
  32. package/fesm2022/xxmachina-common-domain-builder-screen-item.mjs +201 -0
  33. package/fesm2022/xxmachina-common-domain-builder-screen-item.mjs.map +1 -0
  34. package/fesm2022/xxmachina-common-domain-builder.mjs +494 -0
  35. package/fesm2022/xxmachina-common-domain-builder.mjs.map +1 -0
  36. package/fesm2022/xxmachina-common-domain-models.mjs +841 -0
  37. package/fesm2022/xxmachina-common-domain-models.mjs.map +1 -0
  38. package/fesm2022/xxmachina-common-domain.mjs +7 -0
  39. package/fesm2022/xxmachina-common-domain.mjs.map +1 -0
  40. package/fesm2022/xxmachina-common-firebase-auth.mjs +36 -0
  41. package/fesm2022/xxmachina-common-firebase-auth.mjs.map +1 -0
  42. package/fesm2022/xxmachina-common-infra-converters-google.mjs +39 -0
  43. package/fesm2022/xxmachina-common-infra-converters-google.mjs.map +1 -0
  44. package/fesm2022/xxmachina-common-infra-external-data-connect.mjs +13 -0
  45. package/fesm2022/xxmachina-common-infra-external-data-connect.mjs.map +1 -0
  46. package/fesm2022/xxmachina-common-infra-external-quick-js.mjs +61 -0
  47. package/fesm2022/xxmachina-common-infra-external-quick-js.mjs.map +1 -0
  48. package/fesm2022/xxmachina-common-infra-external-resend.mjs +10 -0
  49. package/fesm2022/xxmachina-common-infra-external-resend.mjs.map +1 -0
  50. package/fesm2022/xxmachina-common-infra-external.mjs +35 -0
  51. package/fesm2022/xxmachina-common-infra-external.mjs.map +1 -0
  52. package/fesm2022/xxmachina-common-infra-query-firestore.mjs +33 -0
  53. package/fesm2022/xxmachina-common-infra-query-firestore.mjs.map +1 -0
  54. package/fesm2022/xxmachina-common-infra-query-hasura.mjs +20 -0
  55. package/fesm2022/xxmachina-common-infra-query-hasura.mjs.map +1 -0
  56. package/fesm2022/xxmachina-common-infra-repository-dataconnect.mjs +18 -0
  57. package/fesm2022/xxmachina-common-infra-repository-dataconnect.mjs.map +1 -0
  58. package/fesm2022/xxmachina-common-infra-repository-firestore.mjs +73 -0
  59. package/fesm2022/xxmachina-common-infra-repository-firestore.mjs.map +1 -0
  60. package/fesm2022/xxmachina-common-infra-repository-hasura.mjs +41 -0
  61. package/fesm2022/xxmachina-common-infra-repository-hasura.mjs.map +1 -0
  62. package/fesm2022/xxmachina-common-infra-repository-notion.mjs +105 -0
  63. package/fesm2022/xxmachina-common-infra-repository-notion.mjs.map +1 -0
  64. package/fesm2022/xxmachina-common-infra.mjs +368 -0
  65. package/fesm2022/xxmachina-common-infra.mjs.map +1 -0
  66. package/fesm2022/xxmachina-common-invoice-domain-builders.mjs +79 -0
  67. package/fesm2022/xxmachina-common-invoice-domain-builders.mjs.map +1 -0
  68. package/fesm2022/xxmachina-common-invoice-domain-models.mjs +432 -0
  69. package/fesm2022/xxmachina-common-invoice-domain-models.mjs.map +1 -0
  70. package/fesm2022/xxmachina-common-invoice-domain-resolvers.mjs +41 -0
  71. package/fesm2022/xxmachina-common-invoice-domain-resolvers.mjs.map +1 -0
  72. package/fesm2022/xxmachina-common-invoice-domain.mjs +8 -0
  73. package/fesm2022/xxmachina-common-invoice-domain.mjs.map +1 -0
  74. package/fesm2022/xxmachina-common-invoice-usecase-contract.mjs +27 -0
  75. package/fesm2022/xxmachina-common-invoice-usecase-contract.mjs.map +1 -0
  76. package/fesm2022/xxmachina-common-invoice-usecase-invoice.mjs +191 -0
  77. package/fesm2022/xxmachina-common-invoice-usecase-invoice.mjs.map +1 -0
  78. package/fesm2022/xxmachina-common-invoice-usecase-order.mjs +36 -0
  79. package/fesm2022/xxmachina-common-invoice-usecase-order.mjs.map +1 -0
  80. package/fesm2022/xxmachina-common-invoice-usecase-partner.mjs +36 -0
  81. package/fesm2022/xxmachina-common-invoice-usecase-partner.mjs.map +1 -0
  82. package/fesm2022/xxmachina-common-services-graphql.mjs +323 -0
  83. package/fesm2022/xxmachina-common-services-graphql.mjs.map +1 -0
  84. package/fesm2022/xxmachina-common-services-query-config.mjs +44 -0
  85. package/fesm2022/xxmachina-common-services-query-config.mjs.map +1 -0
  86. package/fesm2022/xxmachina-common-services-query.mjs +65 -0
  87. package/fesm2022/xxmachina-common-services-query.mjs.map +1 -0
  88. package/fesm2022/xxmachina-common-services-speech.mjs +178 -0
  89. package/fesm2022/xxmachina-common-services-speech.mjs.map +1 -0
  90. package/fesm2022/xxmachina-common-services-transformer.mjs +27 -0
  91. package/fesm2022/xxmachina-common-services-transformer.mjs.map +1 -0
  92. package/fesm2022/xxmachina-common-stores-firestore.mjs +33 -0
  93. package/fesm2022/xxmachina-common-stores-firestore.mjs.map +1 -0
  94. package/fesm2022/xxmachina-common-stores-hasura.mjs +32 -0
  95. package/fesm2022/xxmachina-common-stores-hasura.mjs.map +1 -0
  96. package/fesm2022/xxmachina-common-stores-inmemory.mjs +102 -0
  97. package/fesm2022/xxmachina-common-stores-inmemory.mjs.map +1 -0
  98. package/fesm2022/xxmachina-common-stores.mjs +16 -0
  99. package/fesm2022/xxmachina-common-stores.mjs.map +1 -0
  100. package/fesm2022/xxmachina-common-usecase-assistant.mjs +67 -0
  101. package/fesm2022/xxmachina-common-usecase-assistant.mjs.map +1 -0
  102. package/fesm2022/xxmachina-common-usecase-database.mjs +95 -0
  103. package/fesm2022/xxmachina-common-usecase-database.mjs.map +1 -0
  104. package/fesm2022/xxmachina-common-usecase-graphql.mjs +51 -0
  105. package/fesm2022/xxmachina-common-usecase-graphql.mjs.map +1 -0
  106. package/fesm2022/xxmachina-common-usecase-link.mjs +26 -0
  107. package/fesm2022/xxmachina-common-usecase-link.mjs.map +1 -0
  108. package/fesm2022/xxmachina-common-usecase-project.mjs +35 -0
  109. package/fesm2022/xxmachina-common-usecase-project.mjs.map +1 -0
  110. package/fesm2022/xxmachina-common-usecase-spec.mjs +45 -0
  111. package/fesm2022/xxmachina-common-usecase-spec.mjs.map +1 -0
  112. package/fesm2022/xxmachina-common-usecase.mjs +198 -0
  113. package/fesm2022/xxmachina-common-usecase.mjs.map +1 -0
  114. package/fesm2022/xxmachina-common-utils-crypto.mjs +30 -0
  115. package/fesm2022/xxmachina-common-utils-crypto.mjs.map +1 -0
  116. package/fesm2022/xxmachina-common-utils.mjs +53 -0
  117. package/fesm2022/xxmachina-common-utils.mjs.map +1 -0
  118. package/fesm2022/xxmachina-common.mjs +6 -0
  119. package/fesm2022/xxmachina-common.mjs.map +1 -0
  120. package/firebase-auth/index.d.ts +6 -0
  121. package/index.d.ts +1 -0
  122. package/infra/converters/google/index.d.ts +15 -0
  123. package/infra/external/data-connect/index.d.ts +7 -0
  124. package/infra/external/index.d.ts +24 -0
  125. package/infra/external/quick-js/index.d.ts +24 -0
  126. package/infra/external/resend/index.d.ts +16 -0
  127. package/infra/index.d.ts +206 -0
  128. package/infra/query/firestore/index.d.ts +20 -0
  129. package/infra/query/hasura/index.d.ts +9 -0
  130. package/infra/repository/dataconnect/index.d.ts +28 -0
  131. package/infra/repository/firestore/index.d.ts +42 -0
  132. package/infra/repository/hasura/index.d.ts +24 -0
  133. package/infra/repository/notion/index.d.ts +89 -0
  134. package/invoice/domain/builders/index.d.ts +31 -0
  135. package/invoice/domain/index.d.ts +3 -0
  136. package/invoice/domain/models/index.d.ts +78 -0
  137. package/invoice/domain/resolvers/index.d.ts +15 -0
  138. package/invoice/usecase/contract/index.d.ts +14 -0
  139. package/invoice/usecase/invoice/index.d.ts +34 -0
  140. package/invoice/usecase/order/index.d.ts +16 -0
  141. package/invoice/usecase/partner/index.d.ts +16 -0
  142. package/package.json +276 -0
  143. package/services/graphql/index.d.ts +97 -0
  144. package/services/query/config/index.d.ts +18 -0
  145. package/services/query/index.d.ts +29 -0
  146. package/services/speech/index.d.ts +37 -0
  147. package/services/transformer/index.d.ts +14 -0
  148. package/stores/firestore/index.d.ts +17 -0
  149. package/stores/hasura/index.d.ts +17 -0
  150. package/stores/index.d.ts +32 -0
  151. package/stores/inmemory/index.d.ts +33 -0
  152. package/usecase/assistant/index.d.ts +18 -0
  153. package/usecase/database/index.d.ts +39 -0
  154. package/usecase/graphql/index.d.ts +17 -0
  155. package/usecase/index.d.ts +73 -0
  156. package/usecase/link/index.d.ts +13 -0
  157. package/usecase/project/index.d.ts +16 -0
  158. package/usecase/spec/index.d.ts +17 -0
  159. package/utils/crypto/index.d.ts +9 -0
  160. package/utils/index.d.ts +5 -0
@@ -0,0 +1,494 @@
1
+ import { createAction } from '@ng-atomic/core';
2
+ import { flatten } from 'flat';
3
+ import { omitBy } from 'lodash-es';
4
+ import { createNavigateAction } from '@ng-atomic/components/frames/app';
5
+ import { message } from '@nx-ddd/common';
6
+ import { QueryHelper } from '@xxmachina/common/domain/models';
7
+
8
+ class CommandBuilder {
9
+ buildFromOpenApi(openApi) {
10
+ return Object.keys(openApi.getPaths()).flatMap((path) => {
11
+ return openApi.getMethods(path).map((method, index) => ({
12
+ id: openApi.getOperationId(path, method) ?? `cmd-${index}`,
13
+ name: openApi.getSummary(path, method) ?? '',
14
+ description: openApi.getDescription(path, method) ?? '',
15
+ type: 'webApiRequest',
16
+ webApiRequest: {
17
+ path: path,
18
+ method: method.toLocaleUpperCase(),
19
+ contentType: openApi.getContentType(path, method),
20
+ responseContentType: openApi.getResponseContentType(path, method),
21
+ bodySchema: openApi.getRequestBodySchema(path, method),
22
+ serverUrl: openApi.getServerUrl(),
23
+ apiJsonUrl: openApi.apiJsonUrl,
24
+ security: openApi.getSecurity(path, method) ?? [],
25
+ }
26
+ }));
27
+ });
28
+ }
29
+ }
30
+
31
+ var ActionId;
32
+ (function (ActionId) {
33
+ ActionId["NAVIGATE_TO_COMMAND_PAGE"] = "[@xxmachina/common] Navigate To Command Page";
34
+ ActionId["EXECUTE_COMMAND"] = "[@xxmachina/common] Execute Command";
35
+ })(ActionId || (ActionId = {}));
36
+ class CommandActionsBuilder {
37
+ commands = [];
38
+ options = {};
39
+ item = null;
40
+ filterIds = null;
41
+ autoIds = [];
42
+ setCommands(commands) {
43
+ const newFactory = new CommandActionsBuilder();
44
+ newFactory.commands = [...commands];
45
+ newFactory.options = { ...this.options };
46
+ newFactory.item = this.item;
47
+ newFactory.filterIds = this.filterIds;
48
+ newFactory.autoIds = this.autoIds;
49
+ return newFactory;
50
+ }
51
+ setOptions(options) {
52
+ const newFactory = new CommandActionsBuilder();
53
+ newFactory.commands = [...this.commands];
54
+ newFactory.options = { ...this.options, ...options };
55
+ newFactory.item = this.item;
56
+ newFactory.filterIds = this.filterIds;
57
+ newFactory.autoIds = this.autoIds;
58
+ return newFactory;
59
+ }
60
+ setItem(item) {
61
+ const newFactory = new CommandActionsBuilder();
62
+ newFactory.commands = [...this.commands];
63
+ newFactory.options = { ...this.options };
64
+ newFactory.item = item;
65
+ newFactory.filterIds = this.filterIds;
66
+ newFactory.autoIds = this.autoIds;
67
+ return newFactory;
68
+ }
69
+ setFilterIds(filterIds = []) {
70
+ const newFactory = new CommandActionsBuilder();
71
+ newFactory.commands = [...this.commands];
72
+ newFactory.options = { ...this.options };
73
+ newFactory.item = this.item;
74
+ newFactory.filterIds = filterIds.map((id) => typeof id === 'string' ? id : id.id);
75
+ newFactory.autoIds = filterIds.filter((id) => typeof id !== 'string' && id.auto).map((id) => id.id);
76
+ return newFactory;
77
+ }
78
+ setAutoIds(autoIds) {
79
+ const newFactory = new CommandActionsBuilder();
80
+ newFactory.commands = [...this.commands];
81
+ newFactory.options = { ...this.options };
82
+ newFactory.item = this.item;
83
+ newFactory.filterIds = [...this.filterIds];
84
+ newFactory.autoIds = autoIds;
85
+ return newFactory;
86
+ }
87
+ applyFilter(commands) {
88
+ if (!this.filterIds)
89
+ return commands;
90
+ return this.filterIds.map((id) => commands.find((command) => command.id === id))
91
+ .filter((command) => !!command);
92
+ }
93
+ buildAction(id) {
94
+ const command = this.commands.find((command) => command.id === id);
95
+ if (!command)
96
+ throw new Error(`Command not found: ${id}`);
97
+ const actionId = this.autoIds.includes(command.id)
98
+ ? ActionId.EXECUTE_COMMAND
99
+ : ActionId.NAVIGATE_TO_COMMAND_PAGE;
100
+ const creator = createAction(actionId, command.webApiRequest.bodySchema, {
101
+ name: command.name,
102
+ icon: this.options.icon || 'default',
103
+ ...this.options,
104
+ });
105
+ return creator.create({
106
+ command,
107
+ body: this.item,
108
+ options: {
109
+ queryId: this.options.queryId,
110
+ confirm: this.options.confirm,
111
+ }
112
+ });
113
+ }
114
+ buildActions(item, navigationExtras = {}, overwrite = {}) {
115
+ const filteredCommands = this.applyFilter(this.commands);
116
+ return filteredCommands.map((command) => {
117
+ if (this.autoIds.includes(command.id)) {
118
+ return createAction(ActionId.EXECUTE_COMMAND, command.webApiRequest.bodySchema, {
119
+ name: command.name,
120
+ icon: this.options.icon || 'default',
121
+ }).create({
122
+ command,
123
+ body: this.item,
124
+ options: {
125
+ queryId: this.options.queryId,
126
+ confirm: this.options.confirm,
127
+ }
128
+ }, overwrite);
129
+ }
130
+ else {
131
+ const data = omitBy(flatten({ data: this.item, queryId: this.options.queryId }), value => typeof value === 'undefined');
132
+ return createNavigateAction(['commands', { skip: true }, command.id, data], navigationExtras, {
133
+ name: command.name,
134
+ icon: this.options.icon,
135
+ ...overwrite,
136
+ });
137
+ }
138
+ });
139
+ }
140
+ buildItemActions() {
141
+ return (item) => this.setItem(item).buildActions();
142
+ }
143
+ }
144
+ function createCommandNavigateAction(command, navigationExtras = {}, item = {}, options = {}, overwrite = {}) {
145
+ if (!command)
146
+ return null;
147
+ return new CommandActionsBuilder()
148
+ .setItem(item)
149
+ .setCommands([command])
150
+ .setOptions(options)
151
+ .setFilterIds([command.id])
152
+ .buildActions(item, navigationExtras, overwrite)[0];
153
+ }
154
+ function createCommandExecutionAction(command, item = {}, options = {}, overwrite = {}) {
155
+ if (!command)
156
+ return null;
157
+ return new CommandActionsBuilder()
158
+ .setItem(item)
159
+ .setCommands([command])
160
+ .setOptions(options)
161
+ .setFilterIds([command.id])
162
+ .setAutoIds([command.id])
163
+ .buildActions(item, undefined, overwrite)[0];
164
+ }
165
+
166
+ const NOTION_PROP_TYPE_MAP = {
167
+ people: 'string',
168
+ unique_id: 'string',
169
+ rich_text: 'string',
170
+ title: 'string',
171
+ text: 'string',
172
+ number: 'number',
173
+ select: 'enum',
174
+ status: 'enum',
175
+ multi_select: 'string',
176
+ date: 'date',
177
+ person: 'string',
178
+ files: 'string',
179
+ checkbox: 'boolean',
180
+ url: 'string',
181
+ email: 'string',
182
+ phone_number: 'string',
183
+ relation: 'string',
184
+ rollup: 'string',
185
+ created_time: 'date',
186
+ created_by: 'string',
187
+ last_edited_time: 'date',
188
+ last_edited_by: 'string',
189
+ };
190
+ const NOTION_KEY_MAP = {
191
+ 'relation': 'FK',
192
+ 'unique_id': 'UK',
193
+ };
194
+ class ErBuilder {
195
+ build(databases) {
196
+ const schemas = [];
197
+ const dbIdToName = databases.reduce((acc, db) => ({
198
+ ...acc,
199
+ [db.id]: db?.title?.[0]?.plain_text
200
+ }), {});
201
+ for (const database of databases) {
202
+ const schema = this.parseDatabaseSchema(database, database?.title?.[0]?.plain_text, dbIdToName);
203
+ schemas.push(schema);
204
+ }
205
+ return this.buildMermaidER(schemas);
206
+ }
207
+ parseDatabaseSchema(database, name = '', map = {}) {
208
+ const properties = database.properties;
209
+ const fields = [];
210
+ const relations = [];
211
+ Object.keys(properties)
212
+ .filter(propName => {
213
+ if (['formula', 'rollup', 'button'].includes(properties[propName].type))
214
+ return false;
215
+ return true;
216
+ })
217
+ .sort()
218
+ .forEach(propName => {
219
+ const prop = properties[propName];
220
+ const type = prop.type;
221
+ const mappedType = NOTION_PROP_TYPE_MAP[type];
222
+ const key = NOTION_KEY_MAP[type] ?? ' ';
223
+ const field = `${mappedType} ${type} ${key} "${propName}"`;
224
+ fields.push(field);
225
+ // リレーションシップの解析
226
+ if (type === 'relation') {
227
+ const relation = prop['relation'];
228
+ if (relation && relation.database_id) {
229
+ const targetDbId = relation.database_id;
230
+ const targetDbName = map[targetDbId] || 'Unknown';
231
+ relations.push({
232
+ source: name,
233
+ target: targetDbName,
234
+ label: propName,
235
+ type: '||--||', // リレーションのタイプを適宜設定
236
+ });
237
+ }
238
+ else if (relation && Array.isArray(relation)) {
239
+ relation.forEach(rel => {
240
+ const targetDbId = rel.database_id;
241
+ const targetDbName = map[targetDbId] || 'Unknown';
242
+ relations.push({
243
+ source: name,
244
+ target: targetDbName,
245
+ label: propName,
246
+ type: '||--o{',
247
+ });
248
+ });
249
+ }
250
+ }
251
+ });
252
+ return { name, fields, relations };
253
+ }
254
+ buildMermaidER(schemas) {
255
+ let mermaid = 'erDiagram\n';
256
+ // エンティティの定義
257
+ schemas.forEach(schema => {
258
+ mermaid += ` "${schema.name}" {\n`;
259
+ mermaid += schema.fields.map(field => ` ${field}`).join('\n');
260
+ mermaid += '\n }\n';
261
+ });
262
+ // リレーションシップの定義
263
+ schemas.forEach(schema => {
264
+ schema.relations.forEach(relation => {
265
+ mermaid += ` "${relation.source}" ${relation.type} "${relation.target}" : "${relation.label}"\n`;
266
+ });
267
+ });
268
+ return mermaid;
269
+ }
270
+ }
271
+
272
+ class QueryBuilder {
273
+ static buildByGraphql(graphql, meta = {}) {
274
+ return QueryHelper.tryParse({
275
+ id: 'builded_query',
276
+ type: 'graphql',
277
+ projectId: 'default',
278
+ title: 'Builded Query',
279
+ summary: 'This query was built by QueryBuilder',
280
+ graphql: {
281
+ endpoint: graphql.endpoint,
282
+ query: message `${graphql.query}`,
283
+ headersJson: JSON.stringify(graphql.headers),
284
+ variablesJson: JSON.stringify(graphql.variables),
285
+ transformerTs: graphql?.transformerTs ?? null,
286
+ },
287
+ createdAt: null,
288
+ updatedAt: null,
289
+ ...meta,
290
+ });
291
+ }
292
+ }
293
+
294
+ function buildPageItem(property, propName, dbName) {
295
+ switch (property.type) {
296
+ case 'select': return {
297
+ id: property.id,
298
+ name: propName,
299
+ type: '入力(単一選択)',
300
+ notionPropType: 'セレクト',
301
+ formula: '',
302
+ valueType: 'string',
303
+ dbName,
304
+ };
305
+ case 'multi_select': return {
306
+ id: property.id,
307
+ name: propName,
308
+ type: '入力(複数選択)',
309
+ notionPropType: 'マルチセレクト',
310
+ formula: '',
311
+ valueType: 'string',
312
+ dbName,
313
+ };
314
+ case 'relation': return {
315
+ id: property.id,
316
+ name: propName,
317
+ type: '入力(単一選択)',
318
+ notionPropType: 'リレーション',
319
+ formula: '',
320
+ valueType: 'string',
321
+ dbName,
322
+ };
323
+ case 'rollup': return {
324
+ id: property.id,
325
+ name: propName,
326
+ type: '表示',
327
+ notionPropType: 'ロールアップ',
328
+ formula: '',
329
+ valueType: 'string',
330
+ dbName,
331
+ };
332
+ case 'unique_id': return {
333
+ id: property.id,
334
+ name: propName,
335
+ type: '表示',
336
+ notionPropType: 'ユニークID',
337
+ formula: '',
338
+ valueType: 'string',
339
+ dbName,
340
+ };
341
+ case 'created_time': return {
342
+ id: property.id,
343
+ name: propName,
344
+ type: '表示',
345
+ notionPropType: '作成日時',
346
+ formula: '',
347
+ valueType: 'date',
348
+ dbName,
349
+ };
350
+ case 'created_by': return {
351
+ id: property.id,
352
+ name: propName,
353
+ type: '表示',
354
+ notionPropType: '作成者',
355
+ formula: '',
356
+ valueType: 'string',
357
+ dbName,
358
+ };
359
+ case 'rich_text': return {
360
+ id: property.id,
361
+ name: propName,
362
+ type: '入力(テキスト)',
363
+ notionPropType: 'テキスト',
364
+ formula: '',
365
+ valueType: 'string',
366
+ dbName,
367
+ };
368
+ case 'number': return {
369
+ id: property.id,
370
+ name: propName,
371
+ type: '入力(数値)',
372
+ notionPropType: '数値',
373
+ formula: '',
374
+ valueType: 'number',
375
+ dbName,
376
+ };
377
+ case 'date': return {
378
+ id: property.id,
379
+ name: propName,
380
+ type: '入力(日時)',
381
+ notionPropType: '日時',
382
+ formula: '',
383
+ valueType: 'date',
384
+ dbName,
385
+ };
386
+ case 'checkbox': return {
387
+ id: property.id,
388
+ name: propName,
389
+ type: '入力(複数選択)',
390
+ notionPropType: 'チェックボックス',
391
+ formula: '',
392
+ valueType: 'boolean',
393
+ dbName,
394
+ };
395
+ case 'title': return {
396
+ id: property.id,
397
+ name: propName,
398
+ type: '入力(テキスト)',
399
+ notionPropType: 'タイトル',
400
+ formula: '',
401
+ valueType: 'string',
402
+ dbName,
403
+ };
404
+ case 'people': return {
405
+ id: property.id,
406
+ name: propName,
407
+ type: '入力(単一選択)',
408
+ notionPropType: 'ユーザー',
409
+ formula: '',
410
+ valueType: 'string',
411
+ dbName,
412
+ };
413
+ case 'last_edited_time': return {
414
+ id: property.id,
415
+ name: propName,
416
+ type: '表示',
417
+ notionPropType: '最終更新日時',
418
+ formula: '',
419
+ valueType: 'date',
420
+ dbName,
421
+ };
422
+ case 'last_edited_by': return {
423
+ id: property.id,
424
+ name: propName,
425
+ type: '表示',
426
+ notionPropType: '最終更新者',
427
+ formula: '',
428
+ valueType: 'string',
429
+ dbName,
430
+ };
431
+ case 'status': return {
432
+ id: property.id,
433
+ name: propName,
434
+ type: '入力(単一選択)',
435
+ notionPropType: 'ステータス',
436
+ formula: '',
437
+ valueType: 'string',
438
+ dbName,
439
+ };
440
+ case 'formula': return {
441
+ id: property.id,
442
+ name: propName,
443
+ type: '表示',
444
+ notionPropType: '数式',
445
+ formula: '',
446
+ valueType: 'any',
447
+ dbName,
448
+ };
449
+ /* @ts-ignore */
450
+ case 'button': return {
451
+ id: property?.['id'] ?? '',
452
+ name: propName,
453
+ type: 'ボタン',
454
+ notionPropType: 'ボタン',
455
+ formula: '',
456
+ valueType: 'string',
457
+ dbName,
458
+ };
459
+ default: return {
460
+ id: property.id,
461
+ name: propName,
462
+ type: '不明',
463
+ notionPropType: property.type,
464
+ formula: '',
465
+ valueType: 'string',
466
+ dbName,
467
+ };
468
+ }
469
+ }
470
+ class ScreenItemBuilder {
471
+ build(database) {
472
+ const items = [];
473
+ Object.entries(database?.properties ?? {}).sort((a, b) => {
474
+ return a[0].localeCompare(b[0]);
475
+ }).filter(([propName, prop]) => {
476
+ // if (propName.startsWith('_')) return false;
477
+ // if (/^\d/.test(propName)) return false;
478
+ // if (propName.includes('旧エクセル')) return false;
479
+ // if (['formula', 'rollup', 'button'].includes(prop.type)) return false;
480
+ return true;
481
+ }).forEach(([propName, prop]) => {
482
+ const item = buildPageItem(prop, propName, database?.title?.[0]?.plain_text ?? '');
483
+ items.push(item);
484
+ });
485
+ return items;
486
+ }
487
+ }
488
+
489
+ /**
490
+ * Generated bundle index. Do not edit.
491
+ */
492
+
493
+ export { ActionId, CommandActionsBuilder, CommandBuilder, ErBuilder, QueryBuilder, ScreenItemBuilder, createCommandExecutionAction, createCommandNavigateAction };
494
+ //# sourceMappingURL=xxmachina-common-domain-builder.mjs.map