@takagaki/cortex-decisions-viewer 0.12.286 → 0.12.293
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config-flow.js +61 -2
- package/dist/engine/config-view.js +31 -7
- package/dist/engine/connection-words.js +230 -0
- package/dist/engine/source-state-view.js +309 -25
- package/dist/engine/source-state.js +8 -0
- package/dist/google-confirm-page.js +92 -5
- package/dist/intake-scope.js +3 -0
- package/dist/member-page.js +2 -2
- package/dist/render.js +409 -95
- package/dist/source-rows.js +303 -157
- package/package.json +1 -1
|
@@ -114,7 +114,9 @@ __export(source_state_view_exports, {
|
|
|
114
114
|
SOURCES_UNAVAILABLE_REASONS: () => SOURCES_UNAVAILABLE_REASONS,
|
|
115
115
|
SOURCES_VIEW_VERSION: () => SOURCES_VIEW_VERSION,
|
|
116
116
|
buildSourcesView: () => buildSourcesView,
|
|
117
|
+
cleanSourceName: () => cleanSourceName,
|
|
117
118
|
fixerOf: () => fixerOf,
|
|
119
|
+
rowReasonKnown: () => rowReasonKnown,
|
|
118
120
|
sourcesUnavailable: () => sourcesUnavailable,
|
|
119
121
|
toolOfRowKind: () => toolOfRowKind,
|
|
120
122
|
userKeyOf: () => userKeyOf,
|
|
@@ -242,7 +244,9 @@ var R = Object.freeze({
|
|
|
242
244
|
keyMissing: "key_missing",
|
|
243
245
|
keyRejected: "key_rejected",
|
|
244
246
|
permissionMissing: "permission_missing",
|
|
247
|
+
unclearAccess: "unclear_access",
|
|
245
248
|
notMember: "not_member",
|
|
249
|
+
notConnected: "not_connected",
|
|
246
250
|
notFound: "not_found",
|
|
247
251
|
approvalPending: "approval_pending",
|
|
248
252
|
notAllowed: "not_allowed",
|
|
@@ -267,7 +271,7 @@ var answers = (a) => Object.freeze({
|
|
|
267
271
|
var INGEST_STATUS_WORDS = Object.freeze({ unauthorized: "401", forbidden: "403", not_found: "404", rate_limited: "429" });
|
|
268
272
|
function ingestWordsOf(status) {
|
|
269
273
|
const out = {};
|
|
270
|
-
for (const [
|
|
274
|
+
for (const [word2, st] of Object.entries(INGEST_STATUS_WORDS)) if (Object.hasOwn(status, st)) out[word2] = status[st];
|
|
271
275
|
return out;
|
|
272
276
|
}
|
|
273
277
|
var REASON_CODES = Object.freeze(Object.values(R));
|
|
@@ -283,7 +287,13 @@ var BROKER_DENIALS = Object.freeze({
|
|
|
283
287
|
repo_org_mismatch: R.notFound,
|
|
284
288
|
not_selected_by_app: R.notMember,
|
|
285
289
|
// App に、その場を読む権限(permission)が許されていない(`github-app-token.mjs` の断りの語)
|
|
286
|
-
perm_not_granted: R.permissionMissing
|
|
290
|
+
perm_not_granted: R.permissionMissing,
|
|
291
|
+
// tools の受け口の窓口の呼び手(`github-broker-ops.mjs`)が返す断りの語(cortex-engine #3142)。
|
|
292
|
+
// その GitHub の組織が、この Cortex の組織に登録されていない(§23・他の組織と同じ応答)/案件の会社の App がつながっていない → 利用者の側で App を入れる。
|
|
293
|
+
// ほかの窓口の拒否(`denied`)は、このプロジェクトに鍵を出さない= Cortex の設定。どれも今までは値の表に無く `unreadable`(Cortex 側で対応中)に落ちていた
|
|
294
|
+
org_not_in_tenant: R.notConnected,
|
|
295
|
+
app_not_connected: R.notConnected,
|
|
296
|
+
denied: R.notAllowed
|
|
287
297
|
});
|
|
288
298
|
var stateOf = (s) => Object.freeze({
|
|
289
299
|
toolName: s.toolName,
|
|
@@ -309,8 +319,8 @@ var TOOL_CATALOG = Object.freeze({
|
|
|
309
319
|
placeName: "\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8",
|
|
310
320
|
countUnit: "\u4EF6",
|
|
311
321
|
keyName: "API \u30AD\u30FC",
|
|
312
|
-
// 403 は IP
|
|
313
|
-
answers: { status: { 401: R.keyRejected, 403: R.
|
|
322
|
+
// 403 は IP 制限か権限(窓口からは区別できない=訳を見分けられない・cortex-engine #3142)・404 は API キーの発行者がプロジェクトのメンバーでないときも返る
|
|
323
|
+
answers: { status: { 401: R.keyRejected, 403: R.unclearAccess, 404: R.notFound, 429: R.busy, "5xx": R.busy, 0: R.busy } }
|
|
314
324
|
})
|
|
315
325
|
}),
|
|
316
326
|
github: Object.freeze({
|
|
@@ -399,8 +409,8 @@ var TOOL_CATALOG = Object.freeze({
|
|
|
399
409
|
toolName: "Figma",
|
|
400
410
|
placeName: "\u30D5\u30A1\u30A4\u30EB",
|
|
401
411
|
keyName: "API \u30AD\u30FC",
|
|
402
|
-
// Figma は失効したトークンも 403 で返す(`figma-gate.mjs
|
|
403
|
-
answers: { status: { 401: R.keyRejected, 403: R.
|
|
412
|
+
// Figma は失効したトークンも 403 で返す(`figma-gate.mjs`)。権限不足と区別できないので、訳を見分けられない語にし、画面は試せる順を出す(cortex-engine #3142)
|
|
413
|
+
answers: { status: { 401: R.keyRejected, 403: R.unclearAccess, 404: R.notFound, 429: R.busy, "5xx": R.busy, 0: R.busy } }
|
|
404
414
|
})
|
|
405
415
|
}),
|
|
406
416
|
"google-drive": Object.freeze({
|
|
@@ -504,6 +514,7 @@ var GITHUB_REPO_RE = /^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/;
|
|
|
504
514
|
var GITHUB_READS = Object.freeze(["issues", "discussions"]);
|
|
505
515
|
var FIGMA_KEY_RE = /^[A-Za-z0-9_-]{8,}$/;
|
|
506
516
|
var DRIVE_FOLDER_ID_RE = /^[A-Za-z0-9_-]+$/;
|
|
517
|
+
var PORTAL_USER_ID_RE = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
507
518
|
var GUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
508
519
|
var TEAMS_CHANNEL_RE = /^19:\S+$/;
|
|
509
520
|
var TEAMS_FOLDER_RE = /^\S+$/;
|
|
@@ -567,7 +578,7 @@ function checkItems(conn, listKey, { at, errors, idKey, re, what, allowed, seen,
|
|
|
567
578
|
}
|
|
568
579
|
checkKeys(item, [idKey, ...allowed, ...NOTE_KEYS], iat, errors);
|
|
569
580
|
checkNotes(item, iat, errors);
|
|
570
|
-
for (const k of allowed) if (k !== "read") checkOptionalStr(item, k, iat, errors);
|
|
581
|
+
for (const k of allowed) if (k !== "read" && k !== "principal") checkOptionalStr(item, k, iat, errors);
|
|
571
582
|
const id = item[idKey];
|
|
572
583
|
if (typeof id !== "string" || !re.test(id)) {
|
|
573
584
|
errors.push(`${iat}.${idKey} \u304C${what}\u306E\u5F62\u3067\u306F\u3042\u308A\u307E\u305B\u3093: ${JSON.stringify(id)}`);
|
|
@@ -703,9 +714,23 @@ function checkDrive(conn, at, errors, ctx) {
|
|
|
703
714
|
idKey: "id",
|
|
704
715
|
re: DRIVE_FOLDER_ID_RE,
|
|
705
716
|
what: "Drive \u306E\u30D5\u30A9\u30EB\u30C0 ID",
|
|
706
|
-
allowed: ["name"],
|
|
717
|
+
allowed: ["name", "principal"],
|
|
707
718
|
seen: ctx.driveFolders
|
|
708
719
|
});
|
|
720
|
+
for (const [i, f] of (Array.isArray(conn.folders) ? conn.folders : []).entries()) {
|
|
721
|
+
if (!isObj(f) || !("principal" in f)) continue;
|
|
722
|
+
const pat = `${at}.folders[${i}].principal`;
|
|
723
|
+
const p = f.principal;
|
|
724
|
+
if (!isObj(p)) {
|
|
725
|
+
errors.push(`${pat} \u306F { "kind": "person", "userId": \u2026 } \u3067\u3059\uFF08\u66F8\u304B\u306A\u3051\u308C\u3070\u6A5F\u68B0\u306E\u8A31\u53EF\u3067\u8AAD\u307F\u307E\u3059\uFF09: ${JSON.stringify(p)}`);
|
|
726
|
+
continue;
|
|
727
|
+
}
|
|
728
|
+
checkKeys(p, ["kind", "userId"], pat, errors);
|
|
729
|
+
if (p.kind !== "person") errors.push(`${pat}.kind \u306F person \u3060\u3051\u3067\u3059: ${JSON.stringify(p.kind)}`);
|
|
730
|
+
if (typeof p.userId !== "string" || !PORTAL_USER_ID_RE.test(p.userId)) {
|
|
731
|
+
errors.push(`${pat}.userId \u304C\u30DD\u30FC\u30BF\u30EB\u306E\u4EBA\u306E ID\uFF08\u5927\u6587\u5B57\u306E 26 \u5B57\uFF09\u306E\u5F62\u3067\u306F\u3042\u308A\u307E\u305B\u3093: ${JSON.stringify(p.userId)}`);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
709
734
|
}
|
|
710
735
|
function checkMeet(conn, at, errors, ctx) {
|
|
711
736
|
if ("calendarOwner" in conn && !CALENDAR_OWNERS.includes(conn.calendarOwner)) {
|
|
@@ -846,6 +871,7 @@ var INTENT_TABLE = Object.freeze({
|
|
|
846
871
|
resume: { req: [], opt: [], expectsRow: false }
|
|
847
872
|
}
|
|
848
873
|
});
|
|
874
|
+
var SOURCE_NOT_CHECKED = Object.freeze(["closed", "owner", "deadline", "fixed-ip", "wait", "limited", "not-reached", "unknown", "config", "error"]);
|
|
849
875
|
|
|
850
876
|
// ../infra/lambda/shared/config-v2-view.mjs
|
|
851
877
|
var SOURCES_CONFIG_PATH = memoryPathIn(LEGACY_DIR, import_memory_root.MEMORY_CONFIG_FILES.sources);
|
|
@@ -929,6 +955,11 @@ var ADAPTERS = [
|
|
|
929
955
|
// 確かめの口の関数の名前(規則 `check<Pascal(id)>Source`・関数は取り込みと同じ読み方をする。実体は便 S44-4a が受け口に置く)。口の無い種類は null と理由
|
|
930
956
|
fn: "checkSlackSource",
|
|
931
957
|
none: null,
|
|
958
|
+
// 手で[接続を確認]を押せるか(行の `canCheck`・画面の写しが見る)。口が無い(fn が null)道具は false。口があっても記録係の報告を読むだけの道具(会議)は false
|
|
959
|
+
manual: true,
|
|
960
|
+
// 開いた時・[記憶の更新を開始]の時に自動で確かめるか(`sweepSources`)。false の時は理由(足した時の 1 回は auto に依らず確かめる)
|
|
961
|
+
auto: false,
|
|
962
|
+
autoNone: "\u4F1A\u8A71\u3092\u8AAD\u3080\u67A0\u3092\u591C\u306E\u53D6\u308A\u8FBC\u307F\u3068\u5206\u3051\u5408\u3046\uFF08\u958B\u3044\u305F\u6642\u306B\u306F\u6253\u305F\u305A\u3001\u8DB3\u3057\u305F\u6642\u306E 1 \u56DE\u3068\u591C\u306E\u53D6\u308A\u8FBC\u307F\u306E\u7D50\u679C\u3092\u4F7F\u3046\uFF09",
|
|
932
963
|
// 足す操作: 通知先にできるか・外のログインで持ち主を確かめるか(ボタンの言葉)・つなぎ元の札・人が鍵を入れるか・外せるか
|
|
933
964
|
add: { notify: true, ownerLogin: null, origin: { label: "\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9", field: "workspace" }, key: false, removable: true },
|
|
934
965
|
// 呼ぶ経路: その場で呼ぶ(inline)。つなぎ先の設定の欄が値のとき固定 IP の台に頼む(`fixedIp`)
|
|
@@ -1006,6 +1037,11 @@ var ADAPTERS = [
|
|
|
1006
1037
|
// 確かめの口の関数の名前(規則 `check<Pascal(id)>Source`・関数は取り込みと同じ読み方をする。実体は便 S44-4a が受け口に置く)。口の無い種類は null と理由
|
|
1007
1038
|
fn: "checkGithubSource",
|
|
1008
1039
|
none: null,
|
|
1040
|
+
// 手で[接続を確認]を押せるか(行の `canCheck`・画面の写しが見る)。口が無い(fn が null)道具は false。口があっても記録係の報告を読むだけの道具(会議)は false
|
|
1041
|
+
manual: true,
|
|
1042
|
+
// 開いた時・[記憶の更新を開始]の時に自動で確かめるか(`sweepSources`)。false の時は理由(足した時の 1 回は auto に依らず確かめる)
|
|
1043
|
+
auto: true,
|
|
1044
|
+
autoNone: null,
|
|
1009
1045
|
// 足す操作: 通知先にできるか・外のログインで持ち主を確かめるか(ボタンの言葉)・つなぎ元の札・人が鍵を入れるか・外せるか
|
|
1010
1046
|
add: { notify: false, ownerLogin: null, origin: null, key: false, removable: true },
|
|
1011
1047
|
// 呼ぶ経路: その場で呼ぶ(inline)。つなぎ先の設定の欄が値のとき固定 IP の台に頼む(`fixedIp`)
|
|
@@ -1083,6 +1119,11 @@ var ADAPTERS = [
|
|
|
1083
1119
|
// 確かめの口の関数の名前(規則 `check<Pascal(id)>Source`・関数は取り込みと同じ読み方をする。実体は便 S44-4a が受け口に置く)。口の無い種類は null と理由
|
|
1084
1120
|
fn: "checkFigmaSource",
|
|
1085
1121
|
none: null,
|
|
1122
|
+
// 手で[接続を確認]を押せるか(行の `canCheck`・画面の写しが見る)。口が無い(fn が null)道具は false。口があっても記録係の報告を読むだけの道具(会議)は false
|
|
1123
|
+
manual: true,
|
|
1124
|
+
// 開いた時・[記憶の更新を開始]の時に自動で確かめるか(`sweepSources`)。false の時は理由(足した時の 1 回は auto に依らず確かめる)
|
|
1125
|
+
auto: false,
|
|
1126
|
+
autoNone: "\u95B2\u89A7\u5E2D\u306E\u6708\u306E\u56DE\u6570\u3092\u4F7F\u3046\uFF08\u958B\u3044\u305F\u6642\u306B\u306F\u6253\u305F\u305A\u3001\u8DB3\u3057\u305F\u6642\u306E 1 \u56DE\u3068\u591C\u306E\u53D6\u308A\u8FBC\u307F\u306E\u7D50\u679C\u3092\u4F7F\u3046\uFF09",
|
|
1086
1127
|
// 足す操作: 通知先にできるか・外のログインで持ち主を確かめるか(ボタンの言葉)・つなぎ元の札・人が鍵を入れるか・外せるか
|
|
1087
1128
|
add: { notify: false, ownerLogin: null, origin: null, key: true, removable: true },
|
|
1088
1129
|
// 呼ぶ経路: その場で呼ぶ(inline)。つなぎ先の設定の欄が値のとき固定 IP の台に頼む(`fixedIp`)
|
|
@@ -1160,6 +1201,11 @@ var ADAPTERS = [
|
|
|
1160
1201
|
// 確かめの口の関数の名前(規則 `check<Pascal(id)>Source`・関数は取り込みと同じ読み方をする。実体は便 S44-4a が受け口に置く)。口の無い種類は null と理由
|
|
1161
1202
|
fn: "checkDriveSource",
|
|
1162
1203
|
none: null,
|
|
1204
|
+
// 手で[接続を確認]を押せるか(行の `canCheck`・画面の写しが見る)。口が無い(fn が null)道具は false。口があっても記録係の報告を読むだけの道具(会議)は false
|
|
1205
|
+
manual: true,
|
|
1206
|
+
// 開いた時・[記憶の更新を開始]の時に自動で確かめるか(`sweepSources`)。false の時は理由(足した時の 1 回は auto に依らず確かめる)
|
|
1207
|
+
auto: true,
|
|
1208
|
+
autoNone: null,
|
|
1163
1209
|
// 足す操作: 通知先にできるか・外のログインで持ち主を確かめるか(ボタンの言葉)・つなぎ元の札・人が鍵を入れるか・外せるか
|
|
1164
1210
|
add: { notify: false, ownerLogin: "Google \u3067\u78BA\u8A8D\u3059\u308B", origin: null, key: false, removable: true },
|
|
1165
1211
|
// 呼ぶ経路: その場で呼ぶ(inline)。つなぎ先の設定の欄が値のとき固定 IP の台に頼む(`fixedIp`)
|
|
@@ -1234,6 +1280,11 @@ var ADAPTERS = [
|
|
|
1234
1280
|
// 確かめの口の関数の名前(規則 `check<Pascal(id)>Source`・関数は取り込みと同じ読み方をする。実体は便 S44-4a が受け口に置く)。口の無い種類は null と理由
|
|
1235
1281
|
fn: "checkBacklogSource",
|
|
1236
1282
|
none: null,
|
|
1283
|
+
// 手で[接続を確認]を押せるか(行の `canCheck`・画面の写しが見る)。口が無い(fn が null)道具は false。口があっても記録係の報告を読むだけの道具(会議)は false
|
|
1284
|
+
manual: true,
|
|
1285
|
+
// 開いた時・[記憶の更新を開始]の時に自動で確かめるか(`sweepSources`)。false の時は理由(足した時の 1 回は auto に依らず確かめる)
|
|
1286
|
+
auto: true,
|
|
1287
|
+
autoNone: null,
|
|
1237
1288
|
// 足す操作: 通知先にできるか・外のログインで持ち主を確かめるか(ボタンの言葉)・つなぎ元の札・人が鍵を入れるか・外せるか
|
|
1238
1289
|
add: { notify: false, ownerLogin: null, origin: { label: "\u30B9\u30DA\u30FC\u30B9", field: "domain" }, key: true, removable: true },
|
|
1239
1290
|
// 呼ぶ経路: その場で呼ぶ(inline)。つなぎ先の設定の欄が値のとき固定 IP の台に頼む(`fixedIp`)
|
|
@@ -1363,6 +1414,11 @@ var ADAPTERS = [
|
|
|
1363
1414
|
// 確かめの口の関数の名前(規則 `check<Pascal(id)>Source`・関数は取り込みと同じ読み方をする。実体は便 S44-4a が受け口に置く)。口の無い種類は null と理由
|
|
1364
1415
|
fn: "checkGoogleChatSource",
|
|
1365
1416
|
none: null,
|
|
1417
|
+
// 手で[接続を確認]を押せるか(行の `canCheck`・画面の写しが見る)。口が無い(fn が null)道具は false。口があっても記録係の報告を読むだけの道具(会議)は false
|
|
1418
|
+
manual: true,
|
|
1419
|
+
// 開いた時・[記憶の更新を開始]の時に自動で確かめるか(`sweepSources`)。false の時は理由(足した時の 1 回は auto に依らず確かめる)
|
|
1420
|
+
auto: true,
|
|
1421
|
+
autoNone: null,
|
|
1366
1422
|
// 足す操作: 通知先にできるか・外のログインで持ち主を確かめるか(ボタンの言葉)・つなぎ元の札・人が鍵を入れるか・外せるか
|
|
1367
1423
|
add: { notify: true, ownerLogin: "Google \u3067\u78BA\u8A8D\u3059\u308B", origin: null, key: false, removable: true },
|
|
1368
1424
|
// 呼ぶ経路: その場で呼ぶ(inline)。つなぎ先の設定の欄が値のとき固定 IP の台に頼む(`fixedIp`)
|
|
@@ -1447,8 +1503,14 @@ var ADAPTERS = [
|
|
|
1447
1503
|
// 種類の名前でなくこの表を引く(`shared/source-check-table.mjs`)。書き忘れ・語彙の外は `test/source-check-table.test.mjs` が赤にする
|
|
1448
1504
|
sourceCheck: {
|
|
1449
1505
|
// 確かめの口の関数の名前(規則 `check<Pascal(id)>Source`・関数は取り込みと同じ読み方をする。実体は便 S44-4a が受け口に置く)。口の無い種類は null と理由
|
|
1450
|
-
|
|
1451
|
-
|
|
1506
|
+
// 会議の口は外を呼ばない。記録係がカレンダーを作って記録係を入れ終えた報告(今の行の `calendar`)を、最後に確かめた事実として読む(cortex-engine #3173)
|
|
1507
|
+
fn: "checkMeetSource",
|
|
1508
|
+
none: null,
|
|
1509
|
+
// 手で[接続を確認]を押せるか(行の `canCheck`・画面の写しが見る)。口が無い(fn が null)道具は false。口があっても記録係の報告を読むだけの道具(会議)は false
|
|
1510
|
+
manual: false,
|
|
1511
|
+
// 開いた時・[記憶の更新を開始]の時に自動で確かめるか(`sweepSources`)。false の時は理由(足した時の 1 回は auto に依らず確かめる)
|
|
1512
|
+
auto: true,
|
|
1513
|
+
autoNone: null,
|
|
1452
1514
|
// 足す操作: 通知先にできるか・外のログインで持ち主を確かめるか(ボタンの言葉)・つなぎ元の札・人が鍵を入れるか・外せるか
|
|
1453
1515
|
add: { notify: false, ownerLogin: null, origin: null, key: false, removable: false },
|
|
1454
1516
|
// 呼ぶ経路: その場で呼ぶ(inline)。つなぎ先の設定の欄が値のとき固定 IP の台に頼む(`fixedIp`)
|
|
@@ -1478,7 +1540,7 @@ var ADAPTERS = [
|
|
|
1478
1540
|
},
|
|
1479
1541
|
remove: { op: null, reason: "\u5916\u3059\u5BFE\u8C61\u304C\u7121\u3044\uFF08\u6848\u4EF6\u306B 1 \u672C\u306E\u30AB\u30EC\u30F3\u30C0\u30FC\uFF09" },
|
|
1480
1542
|
token: { present: false, reason: "Cortex \u5074\u306B\u9375\u3092\u6301\u305F\u306A\u3044\uFF08\u30AB\u30EC\u30F3\u30C0\u30FC\u3068 Drive \u306E\u5171\u6709\u304C\u4FE1\u983C\u306E\u5B9F\u4F53\uFF09" },
|
|
1481
|
-
probe: { present: false, reason: "\u53E9\u304F\u5148\u304C\u7121\u3044\uFF08\u9375\u3082\u5230\u9054\u6027\u3082 Cortex \u5074\u306B\u7121\u3044\uFF09\u3002\u4EE3\u308F\u308A\u306B\u6848\u4EF6\u30AB\u30EC\u30F3\u30C0\u30FC\u306E\u4F5C\u6210\u72B6\u6CC1\uFF08calendar \u884C\uFF09\u3092\u51FA\u3059" },
|
|
1543
|
+
probe: { present: false, reason: "\u53E9\u304F\u5148\u304C\u7121\u3044\uFF08\u9375\u3082\u5230\u9054\u6027\u3082 Cortex \u5074\u306B\u7121\u3044\uFF09\u3002\u4EE3\u308F\u308A\u306B\u6848\u4EF6\u30AB\u30EC\u30F3\u30C0\u30FC\u306E\u4F5C\u6210\u72B6\u6CC1\uFF08calendar \u884C\uFF09\u3092\u51FA\u3059\u3002\u78BA\u304B\u3081\u306F\u4F1A\u8B70\u306E\u8A18\u9332\u4FC2\u304C\u898B\u308B\uFF08\u8A18\u9332\u4FC2\u306E\u5831\u544A\u3092\u78BA\u304B\u3081\u306E\u53E3 checkMeetSource \u304C\u8AAD\u3080\uFF09\u306E\u3067\u3001\u753B\u9762\u306B\uFF3B\u63A5\u7D9A\u3092\u78BA\u8A8D\uFF3D\u3092\u51FA\u3055\u306A\u3044" },
|
|
1482
1544
|
syncNow: {
|
|
1483
1545
|
present: false,
|
|
1484
1546
|
reason: "\u5185\u5074\u3060\u304C\u8D77\u3053\u3059\u53E3\u304C\u7121\u3044\u2014\u2014\u4E2D\u592E Apps Script \u306E\u53D7\u3051\u53E3\u306F Lambda \u304B\u3089\u5C4A\u304B\u306A\u3044\uFF08#238\uFF09\u300215 \u5206\u3054\u3068\u306E\u5B9A\u671F\u8D70\u67FB\u304C\u6B63\u5F0F\u3067\u3001\u753B\u9762\u306E\u300C\u3044\u307E\u540C\u671F\u3059\u308B\u300D\u306F\u51FA\u3055\u306A\u3044"
|
|
@@ -1529,6 +1591,11 @@ var ADAPTERS = [
|
|
|
1529
1591
|
// 確かめの口の関数の名前(規則 `check<Pascal(id)>Source`・関数は取り込みと同じ読み方をする。実体は便 S44-4a が受け口に置く)。口の無い種類は null と理由
|
|
1530
1592
|
fn: null,
|
|
1531
1593
|
none: "Phase 0: \u53D6\u308A\u8FBC\u307F\u304C\u7121\u3044\u306E\u3067\u884C\u3092\u51FA\u3055\u306A\u3044",
|
|
1594
|
+
// 手で[接続を確認]を押せるか(行の `canCheck`・画面の写しが見る)。口が無い(fn が null)道具は false。口があっても記録係の報告を読むだけの道具(会議)は false
|
|
1595
|
+
manual: false,
|
|
1596
|
+
// 開いた時・[記憶の更新を開始]の時に自動で確かめるか(`sweepSources`)。false の時は理由(足した時の 1 回は auto に依らず確かめる)
|
|
1597
|
+
auto: false,
|
|
1598
|
+
autoNone: "\u78BA\u304B\u3081\u306E\u53E3\u304C\u7121\u3044",
|
|
1532
1599
|
// 足す操作: 通知先にできるか・外のログインで持ち主を確かめるか(ボタンの言葉)・つなぎ元の札・人が鍵を入れるか・外せるか
|
|
1533
1600
|
add: { notify: false, ownerLogin: null, origin: null, key: false, removable: false },
|
|
1534
1601
|
// 呼ぶ経路: その場で呼ぶ(inline)。つなぎ先の設定の欄が値のとき固定 IP の台に頼む(`fixedIp`)
|
|
@@ -1591,6 +1658,11 @@ var ADAPTERS = [
|
|
|
1591
1658
|
// 確かめの口の関数の名前(規則 `check<Pascal(id)>Source`・関数は取り込みと同じ読み方をする。実体は便 S44-4a が受け口に置く)。口の無い種類は null と理由
|
|
1592
1659
|
fn: null,
|
|
1593
1660
|
none: "Phase 0: \u53D6\u308A\u8FBC\u307F\u304C\u7121\u3044\u306E\u3067\u884C\u3092\u51FA\u3055\u306A\u3044",
|
|
1661
|
+
// 手で[接続を確認]を押せるか(行の `canCheck`・画面の写しが見る)。口が無い(fn が null)道具は false。口があっても記録係の報告を読むだけの道具(会議)は false
|
|
1662
|
+
manual: false,
|
|
1663
|
+
// 開いた時・[記憶の更新を開始]の時に自動で確かめるか(`sweepSources`)。false の時は理由(足した時の 1 回は auto に依らず確かめる)
|
|
1664
|
+
auto: false,
|
|
1665
|
+
autoNone: "\u78BA\u304B\u3081\u306E\u53E3\u304C\u7121\u3044",
|
|
1594
1666
|
// 足す操作: 通知先にできるか・外のログインで持ち主を確かめるか(ボタンの言葉)・つなぎ元の札・人が鍵を入れるか・外せるか
|
|
1595
1667
|
add: { notify: false, ownerLogin: null, origin: null, key: false, removable: false },
|
|
1596
1668
|
// 呼ぶ経路: その場で呼ぶ(inline)。つなぎ先の設定の欄が値のとき固定 IP の台に頼む(`fixedIp`)
|
|
@@ -1649,6 +1721,11 @@ var ADAPTERS = [
|
|
|
1649
1721
|
// 確かめの口の関数の名前(規則 `check<Pascal(id)>Source`・関数は取り込みと同じ読み方をする。実体は便 S44-4a が受け口に置く)。口の無い種類は null と理由
|
|
1650
1722
|
fn: null,
|
|
1651
1723
|
none: "Phase 0: \u53D6\u308A\u8FBC\u307F\u304C\u7121\u3044\u306E\u3067\u884C\u3092\u51FA\u3055\u306A\u3044",
|
|
1724
|
+
// 手で[接続を確認]を押せるか(行の `canCheck`・画面の写しが見る)。口が無い(fn が null)道具は false。口があっても記録係の報告を読むだけの道具(会議)は false
|
|
1725
|
+
manual: false,
|
|
1726
|
+
// 開いた時・[記憶の更新を開始]の時に自動で確かめるか(`sweepSources`)。false の時は理由(足した時の 1 回は auto に依らず確かめる)
|
|
1727
|
+
auto: false,
|
|
1728
|
+
autoNone: "\u78BA\u304B\u3081\u306E\u53E3\u304C\u7121\u3044",
|
|
1652
1729
|
// 足す操作: 通知先にできるか・外のログインで持ち主を確かめるか(ボタンの言葉)・つなぎ元の札・人が鍵を入れるか・外せるか
|
|
1653
1730
|
add: { notify: false, ownerLogin: null, origin: null, key: false, removable: false },
|
|
1654
1731
|
// 呼ぶ経路: その場で呼ぶ(inline)。つなぎ先の設定の欄が値のとき固定 IP の台に頼む(`fixedIp`)
|
|
@@ -1695,6 +1772,7 @@ var ADAPTERS = [
|
|
|
1695
1772
|
|
|
1696
1773
|
// ../infra/lambda/shared/source-check-table.mjs
|
|
1697
1774
|
var SOURCE_CHECK_ROUTES = Object.freeze(["inline"]);
|
|
1775
|
+
var SOURCE_CHECK_FIELDS = Object.freeze(["fn", "none", "manual", "auto", "autoNone", "add", "route"]);
|
|
1698
1776
|
var SOURCE_CHECK_ADD_FIELDS = Object.freeze(["notify", "ownerLogin", "origin", "key", "removable"]);
|
|
1699
1777
|
var isObj3 = (v) => v != null && typeof v === "object" && !Array.isArray(v);
|
|
1700
1778
|
function sourceCheckOf(id, adapters = ADAPTERS) {
|
|
@@ -1794,8 +1872,14 @@ var SOURCE_REASONS = Object.freeze([
|
|
|
1794
1872
|
// 鍵を相手のツールが受け付けない
|
|
1795
1873
|
"permission_missing",
|
|
1796
1874
|
// 鍵は通るが、その場を読む権限・スコープが足りない
|
|
1875
|
+
// 相手が読ませてくれないが、鍵の期限切れ・その場の権限・接続元の制限のどれかを答えから見分けられない(Figma・Backlog の 403・cortex-engine #3142)。
|
|
1876
|
+
// `permission_missing` の文(権限が足りない)に決め打ちすると、鍵の入れ直しで直る物に逆の直し方を案内する(#3142 の歩いた表の Figma)。画面は試せる順を出す
|
|
1877
|
+
"unclear_access",
|
|
1797
1878
|
"not_member",
|
|
1798
1879
|
// Cortex がその場に入っていない・共有されていない
|
|
1880
|
+
// その場の持ち主の側(Slack のワークスペース・GitHub の組織)が、まだ Cortex につながっていない(cortex-engine #3142)。
|
|
1881
|
+
// 直すのは利用者の側(接続する・App を入れる)。`unreadable`(訳が言えない → Cortex 側で対応中)に落とさない
|
|
1882
|
+
"not_connected",
|
|
1799
1883
|
"not_found",
|
|
1800
1884
|
// その場が見つからない
|
|
1801
1885
|
"approval_pending",
|
|
@@ -1820,7 +1904,9 @@ var SOURCE_REASON_FIXER = Object.freeze({
|
|
|
1820
1904
|
key_missing: "user",
|
|
1821
1905
|
key_rejected: "user",
|
|
1822
1906
|
permission_missing: "user",
|
|
1907
|
+
unclear_access: "user",
|
|
1823
1908
|
not_member: "user",
|
|
1909
|
+
not_connected: "user",
|
|
1824
1910
|
not_found: "user",
|
|
1825
1911
|
approval_pending: "user",
|
|
1826
1912
|
not_allowed: "cortex",
|
|
@@ -1944,6 +2030,185 @@ function capOfTool(tool) {
|
|
|
1944
2030
|
}
|
|
1945
2031
|
var MEETINGS_TOOL = (CAPABILITY_ADAPTERS.find((c) => c.cap === "\u4F1A\u8B70") || {}).adapter;
|
|
1946
2032
|
|
|
2033
|
+
// ../infra/lambda/shared/connection-words.mjs
|
|
2034
|
+
var WORD_ACTS = Object.freeze(["check", "key", "owner", "connect", "remove"]);
|
|
2035
|
+
var WORD_PLACES = Object.freeze(["row", "add"]);
|
|
2036
|
+
var WORD_FIXERS = Object.freeze(["user", "cortex", "wait"]);
|
|
2037
|
+
var step = (act, text, needs = []) => Object.freeze({ act, text, needs: Object.freeze(needs) });
|
|
2038
|
+
var word = (w) => Object.freeze({ ...w, where: Object.freeze(w.where), steps: Object.freeze(w.steps) });
|
|
2039
|
+
var CONNECTION_WORDS = Object.freeze({
|
|
2040
|
+
key_missing: word({
|
|
2041
|
+
where: ["row"],
|
|
2042
|
+
fixer: "user",
|
|
2043
|
+
transient: false,
|
|
2044
|
+
why: "{key}\u304C\u307E\u3060\u5165\u3063\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
2045
|
+
steps: [step("key", "\u300C{key}\u3092\u5909\u66F4\u3059\u308B\u300D\u3067\u5165\u308C\u3066\u304F\u3060\u3055\u3044\u3002")],
|
|
2046
|
+
who: null
|
|
2047
|
+
}),
|
|
2048
|
+
key_rejected: word({
|
|
2049
|
+
where: ["row"],
|
|
2050
|
+
fixer: "user",
|
|
2051
|
+
transient: false,
|
|
2052
|
+
why: "\u5165\u308C\u3066\u3042\u308B{key}\u304C\u3001{tool}\u3067\u4F7F\u3048\u306A\u304F\u306A\u3063\u3066\u3044\u307E\u3059\uFF08\u671F\u9650\u5207\u308C\u30FB\u53D6\u308A\u6D88\u3057\uFF09\u3002",
|
|
2053
|
+
steps: [
|
|
2054
|
+
step("key", "\u65B0\u3057\u3044{key}\u3092\u767A\u884C\u3057\u3066\u3001\u300C{key}\u3092\u5909\u66F4\u3059\u308B\u300D\u3067\u5165\u308C\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["key"]),
|
|
2055
|
+
step("connect", "\u300C{connect}\u300D\u3067\u3064\u306A\u304E\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["connect"])
|
|
2056
|
+
],
|
|
2057
|
+
who: null
|
|
2058
|
+
}),
|
|
2059
|
+
unclear_access: word({
|
|
2060
|
+
where: ["row", "add"],
|
|
2061
|
+
fixer: "user",
|
|
2062
|
+
transient: false,
|
|
2063
|
+
why: "{tool}\u304C\u8AAD\u307E\u305B\u3066\u304F\u308C\u307E\u305B\u3093\u3002{tool}\u306E\u7B54\u3048\u304B\u3089\u306F\u3001\u8A33\u3092\u898B\u5206\u3051\u3089\u308C\u307E\u305B\u3093\u3002",
|
|
2064
|
+
steps: [
|
|
2065
|
+
step("connect", "{partner}\u304C Cortex \u306B\u3064\u306A\u304C\u3063\u3066\u3044\u306A\u3051\u308C\u3070\u3001\u300C{connect}\u300D\u3067\u3064\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002", ["connect"]),
|
|
2066
|
+
step("key", "{key}\u3092\u5165\u308C\u3066\u304B\u3089\u65E5\u304C\u7D4C\u3063\u3066\u3044\u308C\u3070\u3001\u300C{key}\u3092\u5909\u66F4\u3059\u308B\u300D\u3067\u5165\u308C\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["key"]),
|
|
2067
|
+
step(null, "{place}\u306B Cortex \u3092{join}\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["join"]),
|
|
2068
|
+
step("check", "\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["row"])
|
|
2069
|
+
],
|
|
2070
|
+
who: null
|
|
2071
|
+
}),
|
|
2072
|
+
permission_missing: word({
|
|
2073
|
+
where: ["row"],
|
|
2074
|
+
fixer: "user",
|
|
2075
|
+
transient: false,
|
|
2076
|
+
why: "{tool}\u304C\u3001\u3053\u306E{place}\u3092\u8AAD\u3080\u6A29\u9650\u304C\u8DB3\u308A\u306A\u3044\u3068\u7B54\u3048\u307E\u3057\u305F\u3002",
|
|
2077
|
+
steps: [step("check", "\u6A29\u9650\u3092\u8DB3\u3057\u305F\u5F8C\u306B\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
|
|
2078
|
+
who: "\u6A29\u9650\u3092\u8DB3\u305B\u308B\u306E\u306F\u3001{tool}\u306E{partner}\u306E\u7BA1\u7406\u8005\u3067\u3059\u3002"
|
|
2079
|
+
}),
|
|
2080
|
+
not_member: word({
|
|
2081
|
+
where: ["row"],
|
|
2082
|
+
fixer: "user",
|
|
2083
|
+
transient: false,
|
|
2084
|
+
why: "Cortex \u304C\u3053\u306E{place}\u306B\u5165\u3063\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
2085
|
+
steps: [step("check", "{place}\u306B Cortex \u3092{join}\u3057\u3066\u304B\u3089\u3001\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
|
|
2086
|
+
who: null
|
|
2087
|
+
}),
|
|
2088
|
+
not_connected: word({
|
|
2089
|
+
where: ["row", "add"],
|
|
2090
|
+
fixer: "user",
|
|
2091
|
+
transient: false,
|
|
2092
|
+
why: "{tool}\u306E{partner}\u304C\u3001\u307E\u3060 Cortex \u306B\u3064\u306A\u304C\u3063\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
2093
|
+
steps: [step("connect", "\u300C{connect}\u300D\u3067\u3064\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002", ["connect"])],
|
|
2094
|
+
who: "\u3064\u306A\u3052\u308B\u306E\u306F\u3001\u305D\u306E{partner}\u306E\u7BA1\u7406\u8005\u3067\u3059\u3002"
|
|
2095
|
+
}),
|
|
2096
|
+
not_found: word({
|
|
2097
|
+
where: ["row"],
|
|
2098
|
+
fixer: "user",
|
|
2099
|
+
transient: false,
|
|
2100
|
+
why: "\u3053\u306E{place}\u304C{tool}\u3067\u898B\u3064\u304B\u308A\u307E\u305B\u3093\uFF08\u6D88\u3055\u308C\u305F\u30FB\u79FB\u3055\u308C\u305F\u30FBURL \u304C\u9055\u3046\uFF09\u3002",
|
|
2101
|
+
steps: [
|
|
2102
|
+
step("check", "{tool}\u3067\u3053\u306E{place}\u304C\u3042\u308B\u304B\u3092\u78BA\u304B\u3081\u3066\u3001\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["row"]),
|
|
2103
|
+
step("remove", "\u7121\u3051\u308C\u3070\u300C\u3053\u306E\u63A5\u7D9A\u5148\u3092\u5916\u3059\u300D\u3067\u5916\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["row"])
|
|
2104
|
+
],
|
|
2105
|
+
who: null
|
|
2106
|
+
}),
|
|
2107
|
+
approval_pending: word({
|
|
2108
|
+
where: ["row"],
|
|
2109
|
+
fixer: "user",
|
|
2110
|
+
transient: false,
|
|
2111
|
+
why: "{tool}\u306E\u7BA1\u7406\u8005\u306E\u627F\u8A8D\u3092\u5F85\u3063\u3066\u3044\u307E\u3059\u3002",
|
|
2112
|
+
steps: [step("check", "\u627F\u8A8D\u306E\u5F8C\u306B\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
|
|
2113
|
+
who: "\u627F\u8A8D\u3067\u304D\u308B\u306E\u306F\u3001{partner}\u306E\u7BA1\u7406\u8005\u3067\u3059\u3002"
|
|
2114
|
+
}),
|
|
2115
|
+
not_allowed: word({
|
|
2116
|
+
where: ["row"],
|
|
2117
|
+
fixer: "cortex",
|
|
2118
|
+
transient: false,
|
|
2119
|
+
why: "\u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u306F\u3001\u3053\u306E{place}\u3092\u8AAD\u3080\u8A31\u53EF\u304C\u3042\u308A\u307E\u305B\u3093\u3002",
|
|
2120
|
+
steps: [],
|
|
2121
|
+
who: null
|
|
2122
|
+
}),
|
|
2123
|
+
wrong_owner: word({
|
|
2124
|
+
where: ["row"],
|
|
2125
|
+
fixer: "user",
|
|
2126
|
+
transient: false,
|
|
2127
|
+
why: "\u3053\u306E{place}\u306F\u3001\u3042\u306A\u305F\u306E\u7D44\u7E54\u306E\u7269\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002",
|
|
2128
|
+
steps: [step("remove", "\u300C\u3053\u306E\u63A5\u7D9A\u5148\u3092\u5916\u3059\u300D\u3067\u5916\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["row"])],
|
|
2129
|
+
who: null
|
|
2130
|
+
}),
|
|
2131
|
+
owner_unconfirmed: word({
|
|
2132
|
+
where: ["row"],
|
|
2133
|
+
fixer: "user",
|
|
2134
|
+
transient: false,
|
|
2135
|
+
why: "\u3053\u306E{place}\u304C\u3042\u306A\u305F\u306E\u7D44\u7E54\u306E\u7269\u304B\u3092\u3001\u307E\u3060\u78BA\u304B\u3081\u3066\u3044\u307E\u305B\u3093\u3002\u78BA\u304B\u3081\u308B\u307E\u3067\u8AAD\u307F\u307E\u305B\u3093\u3002",
|
|
2136
|
+
steps: [step("owner", "\u300C{confirm}\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
|
|
2137
|
+
who: "\u78BA\u304B\u3081\u3089\u308C\u308B\u306E\u306F\u3001\u3053\u306E{place}\u3092\u958B\u3051\u308B Google \u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u4EBA\u3067\u3059\u3002"
|
|
2138
|
+
}),
|
|
2139
|
+
busy: word({
|
|
2140
|
+
where: ["row"],
|
|
2141
|
+
fixer: "wait",
|
|
2142
|
+
transient: true,
|
|
2143
|
+
why: "{tool}\u304C\u6DF7\u3093\u3067\u3044\u3066\u3001\u78BA\u304B\u3081\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
|
|
2144
|
+
steps: [step("check", "\u3057\u3070\u3089\u304F\u3057\u3066\u81EA\u52D5\u3067\u78BA\u304B\u3081\u76F4\u3057\u307E\u3059\uFF08\u4ECA\u3059\u3050\u306A\u3089\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\uFF09\u3002")],
|
|
2145
|
+
who: null
|
|
2146
|
+
}),
|
|
2147
|
+
rate_locked: word({
|
|
2148
|
+
where: ["row"],
|
|
2149
|
+
fixer: "user",
|
|
2150
|
+
transient: false,
|
|
2151
|
+
why: "{tool}\u306E\u5229\u7528\u67A0\u3092\u4F7F\u3044\u5207\u3063\u3066\u3044\u307E\u3059\u3002{until}",
|
|
2152
|
+
steps: [
|
|
2153
|
+
step(null, "{tool}\u306E\u30D7\u30E9\u30F3\u3084\u3001{key}\u306E\u6301\u3061\u4E3B\u306E\u5E2D\u3092\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002", ["key"]),
|
|
2154
|
+
step(null, "{tool}\u306E\u30D7\u30E9\u30F3\u3092\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002", ["nokey"])
|
|
2155
|
+
],
|
|
2156
|
+
who: "\u30D7\u30E9\u30F3\u3084\u5E2D\u3092\u898B\u76F4\u305B\u308B\u306E\u306F\u3001{tool}\u306E{partner}\u306E\u7BA1\u7406\u8005\u3067\u3059\u3002"
|
|
2157
|
+
}),
|
|
2158
|
+
notes_not_received: word({
|
|
2159
|
+
where: ["row"],
|
|
2160
|
+
fixer: "wait",
|
|
2161
|
+
transient: true,
|
|
2162
|
+
why: "\u7D42\u308F\u3063\u305F\u4F1A\u8B70\u306E\u30E1\u30E2\u304C\u3001Cortex \u306B\u5C4A\u3044\u3066\u3044\u307E\u305B\u3093\u3002",
|
|
2163
|
+
steps: [step(null, "\u4F1A\u8B70\u306E\u30E1\u30E2\u3092 ON \u306B\u3057\u3001\u30E1\u30E2\u306E\u9001\u308A\u5148\u3092\u300C\u62DB\u5F85\u3057\u305F\u4EBA\u5168\u54E1\uFF08\u7D44\u7E54\u306E\u5916\u3082\u542B\u3080\uFF09\u300D\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u6B21\u306E\u4F1A\u8B70\u306E\u30E1\u30E2\u304C\u5C4A\u304F\u3068\u3001\u81EA\u52D5\u3067\u300C\u63A5\u7D9AOK\u300D\u306B\u623B\u308A\u307E\u3059\u3002")],
|
|
2164
|
+
who: "\u8A2D\u5B9A\u3067\u304D\u308B\u306E\u306F\u3001\u4F1A\u8B70\u306E\u4E3B\u50AC\u8005\u3067\u3059\u3002"
|
|
2165
|
+
}),
|
|
2166
|
+
config_busy: word({
|
|
2167
|
+
where: ["add"],
|
|
2168
|
+
fixer: "wait",
|
|
2169
|
+
transient: true,
|
|
2170
|
+
why: "\u8A2D\u5B9A\u3092\u66F8\u3044\u3066\u3044\u308B\u6700\u4E2D\uFF08\u8A18\u61B6\u306E\u66F4\u65B0\u306E\u6700\u4E2D\u306A\u3069\uFF09\u3067\u3001\u4ECA\u306F\u8DB3\u305B\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
|
|
2171
|
+
steps: [step(null, "\u3057\u3070\u3089\u304F\u3057\u3066\u300C\u8FFD\u52A0\u300D\u3092\u3082\u3046\u4E00\u5EA6\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
|
|
2172
|
+
who: null
|
|
2173
|
+
}),
|
|
2174
|
+
input_invalid: word({
|
|
2175
|
+
where: ["add"],
|
|
2176
|
+
fixer: "user",
|
|
2177
|
+
transient: false,
|
|
2178
|
+
why: "\u8CBC\u3089\u308C\u305F\u7269\u3092\u3001{tool}\u306E{place}\u3068\u3057\u3066\u8AAD\u307F\u53D6\u308C\u307E\u305B\u3093\u3002",
|
|
2179
|
+
steps: [step(null, "\u6B63\u3057\u3044\u5F62\u3067\u8CBC\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
|
|
2180
|
+
who: null
|
|
2181
|
+
}),
|
|
2182
|
+
paused: word({
|
|
2183
|
+
where: ["add"],
|
|
2184
|
+
fixer: "user",
|
|
2185
|
+
transient: false,
|
|
2186
|
+
why: "\u3053\u306E\u7A2E\u985E\u306E\u53D6\u308A\u8FBC\u307F\u306F\u6B62\u3081\u3066\u3042\u308A\u307E\u3059\u3002",
|
|
2187
|
+
steps: [step(null, "\u518D\u958B\u3057\u3066\u304B\u3089\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002")],
|
|
2188
|
+
who: null
|
|
2189
|
+
}),
|
|
2190
|
+
unreadable: word({
|
|
2191
|
+
where: ["row", "add"],
|
|
2192
|
+
fixer: "cortex",
|
|
2193
|
+
transient: false,
|
|
2194
|
+
why: "{tool}\u306E\u7B54\u3048\u3092\u3001Cortex \u304C\u8AAD\u307F\u53D6\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",
|
|
2195
|
+
steps: [
|
|
2196
|
+
step("check", "\u300C\u63A5\u7D9A\u3092\u78BA\u8A8D\u300D\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["row"]),
|
|
2197
|
+
step("key", "{key}\u3092\u5165\u308C\u3066\u304B\u3089\u65E5\u304C\u7D4C\u3063\u3066\u3044\u308C\u3070\u3001\u300C{key}\u3092\u5909\u66F4\u3059\u308B\u300D\u3067\u5165\u308C\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002", ["key"])
|
|
2198
|
+
],
|
|
2199
|
+
who: null
|
|
2200
|
+
})
|
|
2201
|
+
});
|
|
2202
|
+
var WORD_TOOL_NOUNS = Object.freeze({
|
|
2203
|
+
backlog: Object.freeze({ partner: "\u30B9\u30DA\u30FC\u30B9", confirm: null, connect: null }),
|
|
2204
|
+
github: Object.freeze({ partner: "\u7D44\u7E54", confirm: null, connect: "App \u3092\u5165\u308C\u308B" }),
|
|
2205
|
+
slack: Object.freeze({ partner: "\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9", confirm: null, connect: "\u63A5\u7D9A\u3059\u308B" }),
|
|
2206
|
+
"google-chat": Object.freeze({ partner: "Google Workspace", confirm: "Google \u3067\u78BA\u8A8D\u3059\u308B", connect: null }),
|
|
2207
|
+
figma: Object.freeze({ partner: "\u30C1\u30FC\u30E0", confirm: null, connect: null }),
|
|
2208
|
+
"google-drive": Object.freeze({ partner: "Google Workspace", confirm: "Google \u3067\u78BA\u8A8D\u3059\u308B", connect: null }),
|
|
2209
|
+
"google-meet": Object.freeze({ partner: "Google Workspace", confirm: null, connect: null })
|
|
2210
|
+
});
|
|
2211
|
+
|
|
1947
2212
|
// ../infra/lambda/shared/source-state-view.mjs
|
|
1948
2213
|
var SOURCES_VIEW_VERSION = 1;
|
|
1949
2214
|
var SOURCES_UNAVAILABLE_REASONS = Object.freeze(["no-store", "read-failed", "bad-config"]);
|
|
@@ -1958,6 +2223,9 @@ function cleanText(v, max) {
|
|
|
1958
2223
|
const t = sanitizeDetail(v).replace(ARN_RE, "***").replace(new RegExp(CONTROL_RE.source, "g"), " ").trim().slice(0, max);
|
|
1959
2224
|
return t || void 0;
|
|
1960
2225
|
}
|
|
2226
|
+
function cleanSourceName(v) {
|
|
2227
|
+
return cleanText(v, NAME_MAX);
|
|
2228
|
+
}
|
|
1961
2229
|
var atOf = (v) => typeof v === "string" && v && !Number.isNaN(timeOf(v)) ? v : void 0;
|
|
1962
2230
|
function sourcesUnavailable(reason) {
|
|
1963
2231
|
return { version: SOURCES_VIEW_VERSION, available: false, reason };
|
|
@@ -1978,15 +2246,25 @@ function toolOfRowKind(kind) {
|
|
|
1978
2246
|
function fixerOf(reason, { tool, checkedAt, ingestedAt } = {}, table = source_state_exports) {
|
|
1979
2247
|
const fn = table && table.sourceFixerOf;
|
|
1980
2248
|
if (typeof fn !== "function") return void 0;
|
|
2249
|
+
const known = Array.isArray(table.SOURCE_REASONS) ? table.SOURCE_REASONS.includes(reason) : true;
|
|
2250
|
+
if (!known && rowWordOf(reason)) return CONNECTION_WORDS[reason].fixer;
|
|
1981
2251
|
return fn(reason, { userKey: userKeyOf(tool), checkedAt: checkedAt ?? null, ingestedAt: ingestedAt ?? null });
|
|
1982
2252
|
}
|
|
1983
|
-
function
|
|
1984
|
-
|
|
2253
|
+
function rowWordOf(w) {
|
|
2254
|
+
return typeof w === "string" && Object.hasOwn(CONNECTION_WORDS, w) && CONNECTION_WORDS[w].where.includes("row");
|
|
2255
|
+
}
|
|
2256
|
+
function rowReasonKnown(reason, table = source_state_exports) {
|
|
2257
|
+
const engine = table && Array.isArray(table.SOURCE_REASONS) ? table.SOURCE_REASONS : [];
|
|
2258
|
+
return engine.includes(reason) || rowWordOf(reason);
|
|
2259
|
+
}
|
|
2260
|
+
var UNKNOWN_WORD_RE = /^[a-z0-9_]{1,40}$/;
|
|
2261
|
+
function stateOf2(item, tool = null, table = source_state_exports) {
|
|
2262
|
+
const s = stateCoreOf(item, table);
|
|
1985
2263
|
if (!tool || s.status !== "failed") return s;
|
|
1986
|
-
const f = fixerOf(s.reason, { tool, checkedAt: s.checkedAt, ingestedAt: s.ingestedAt });
|
|
2264
|
+
const f = fixerOf(s.reason, { tool, checkedAt: s.checkedAt, ingestedAt: s.ingestedAt }, table);
|
|
1987
2265
|
return f ? { ...s, fixer: f } : s;
|
|
1988
2266
|
}
|
|
1989
|
-
function stateCoreOf(item) {
|
|
2267
|
+
function stateCoreOf(item, table = source_state_exports) {
|
|
1990
2268
|
const out = {};
|
|
1991
2269
|
if (!item) return { status: "unchecked", ...out };
|
|
1992
2270
|
const ing = atOf(item.ingestedAt);
|
|
@@ -1998,11 +2276,14 @@ function stateCoreOf(item) {
|
|
|
1998
2276
|
}
|
|
1999
2277
|
const base = { status: item.status, checkedAt: item.statusAt, ...out };
|
|
2000
2278
|
if (item.status === "ok") return base;
|
|
2001
|
-
const
|
|
2002
|
-
const
|
|
2279
|
+
const known = rowReasonKnown(item.reason, table);
|
|
2280
|
+
const reason = known ? item.reason : "unreadable";
|
|
2281
|
+
const tag = !known && typeof item.reason === "string" && UNKNOWN_WORD_RE.test(item.reason) ? `word=${item.reason}` : "";
|
|
2282
|
+
const raw = cleanText(item.detail, DETAIL_MAX2);
|
|
2283
|
+
const detail = tag ? `${tag}${raw ? `,${raw}` : ""}`.slice(0, DETAIL_MAX2) : raw;
|
|
2003
2284
|
return { ...base, reason, ...detail ? { detail } : {} };
|
|
2004
2285
|
}
|
|
2005
|
-
function buildSourcesView({ project, sources, calendar = null, items, notifyRows = [], secretsNow = null }) {
|
|
2286
|
+
function buildSourcesView({ project, sources, calendar = null, items, notifyRows = [], secretsNow = null, table = source_state_exports }) {
|
|
2006
2287
|
let pk;
|
|
2007
2288
|
try {
|
|
2008
2289
|
pk = sourceStatePk(project);
|
|
@@ -2052,13 +2333,14 @@ function buildSourcesView({ project, sources, calendar = null, items, notifyRows
|
|
|
2052
2333
|
...it.workspace ? { workspace: it.workspace } : {},
|
|
2053
2334
|
name: it.name,
|
|
2054
2335
|
// 相手のツールが返した今の名前(状態の 1 件の `name`)。設定の名前(`name`)とは混ぜない
|
|
2055
|
-
...
|
|
2056
|
-
...stateOf2(item, conn.tool),
|
|
2336
|
+
...cleanSourceName(item && item.name) ? { currentName: cleanSourceName(item.name) } : {},
|
|
2337
|
+
...stateOf2(item, conn.tool, table),
|
|
2057
2338
|
paused: conn.paused === true || it.enabled === false,
|
|
2058
2339
|
notify: on.has(`${it.kind} ${it.workspace ?? ""} ${it.ref}`),
|
|
2059
2340
|
// 呼ぶ経路が「固定 IP の台に頼む」か=道具の表の値と、つなぎ先の設定の欄の値で決める(種類の名前で分けない)
|
|
2060
2341
|
fixedIp: !!(sc && sc.route.fixedIp && conn[sc.route.fixedIp.field] === sc.route.fixedIp.value),
|
|
2061
|
-
|
|
2342
|
+
// 手で押せるか=道具の表の `manual`(口があっても押させない道具がある。口の有無〈fn〉だけでは決めない)
|
|
2343
|
+
canCheck: !!(sc && sc.fn && sc.manual),
|
|
2062
2344
|
canOwnerLogin: !!(sc && sc.add.ownerLogin),
|
|
2063
2345
|
removable: !!(sc && sc.add.removable)
|
|
2064
2346
|
};
|
|
@@ -2085,7 +2367,7 @@ function buildSourcesView({ project, sources, calendar = null, items, notifyRows
|
|
|
2085
2367
|
} catch {
|
|
2086
2368
|
msk = null;
|
|
2087
2369
|
}
|
|
2088
|
-
meeting = stateOf2(msk ? bySk.get(msk) : void 0);
|
|
2370
|
+
meeting = stateOf2(msk ? bySk.get(msk) : void 0, null, table);
|
|
2089
2371
|
}
|
|
2090
2372
|
const order = ADAPTERS.map((a) => a.id);
|
|
2091
2373
|
const list2 = [...groups.values()].sort((a, b) => order.indexOf(a.kind) - order.indexOf(b.kind));
|
|
@@ -2097,7 +2379,7 @@ function buildSourcesView({ project, sources, calendar = null, items, notifyRows
|
|
|
2097
2379
|
}
|
|
2098
2380
|
return { version: SOURCES_VIEW_VERSION, available: true, total: rows.length, problems, lastIngestedAt: last, groups: list2, meeting };
|
|
2099
2381
|
}
|
|
2100
|
-
function validateSourcesView(v) {
|
|
2382
|
+
function validateSourcesView(v, table = source_state_exports) {
|
|
2101
2383
|
const errs = [];
|
|
2102
2384
|
if (!isObj4(v)) return ["sources \u304C\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u306F\u3042\u308A\u307E\u305B\u3093"];
|
|
2103
2385
|
const only = (obj, allowed, where) => {
|
|
@@ -2114,7 +2396,7 @@ function validateSourcesView(v) {
|
|
|
2114
2396
|
const isAt = (t) => typeof t === "string" && !Number.isNaN(timeOf(t));
|
|
2115
2397
|
const checkState = (r, where) => {
|
|
2116
2398
|
if (!["ok", "failed", "unchecked"].includes(r.status)) errs.push(`${where}.status \u304C\u8A9E\u5F59\u306E\u5916\u3067\u3059`);
|
|
2117
|
-
if (r.status === "failed" && !
|
|
2399
|
+
if (r.status === "failed" && !rowReasonKnown(r.reason, table)) errs.push(`${where}.reason \u304C\u7406\u7531\u306E\u7B26\u53F7\u306B\u3082\u8A9E\u306E\u8868\u306B\u3082\u3042\u308A\u307E\u305B\u3093`);
|
|
2118
2400
|
if (r.status !== "failed" && ("reason" in r || "detail" in r)) errs.push(`${where}: \u554F\u984C\u3042\u308A\u3067\u306A\u3044\u884C\u306B reason\u30FBdetail \u306F\u4ED8\u304D\u307E\u305B\u3093`);
|
|
2119
2401
|
if (r.status === "unchecked" && "checkedAt" in r) errs.push(`${where}: \u307E\u3060\u78BA\u8A8D\u3057\u3066\u3044\u306A\u3044\u884C\u306B checkedAt \u306F\u4ED8\u304D\u307E\u305B\u3093`);
|
|
2120
2402
|
if (r.status === "ok" && !isAt(r.checkedAt)) errs.push(`${where}.checkedAt \u304C\u65E5\u6642\u3067\u306F\u3042\u308A\u307E\u305B\u3093`);
|
|
@@ -2128,7 +2410,7 @@ function validateSourcesView(v) {
|
|
|
2128
2410
|
if ("fixer" in r) errs.push(`${where}.fixer \u306F\u554F\u984C\u3042\u308A\u306E\u884C\u306B\u3060\u3051\u4ED8\u304D\u307E\u3059`);
|
|
2129
2411
|
return;
|
|
2130
2412
|
}
|
|
2131
|
-
const want = fixerOf(r.reason, { tool: toolOfRowKind(r.kind), checkedAt: r.checkedAt, ingestedAt: r.ingestedAt });
|
|
2413
|
+
const want = fixerOf(r.reason, { tool: toolOfRowKind(r.kind), checkedAt: r.checkedAt, ingestedAt: r.ingestedAt }, table);
|
|
2132
2414
|
if (want === void 0 ? "fixer" in r : r.fixer !== want) errs.push(`${where}.fixer \u304C engine \u306E sourceFixerOf \u306E\u5024\uFF08${want ?? "\u6B04\u306A\u3057"}\uFF09\u3068\u9055\u3044\u307E\u3059`);
|
|
2133
2415
|
};
|
|
2134
2416
|
if (!Number.isInteger(v.total) || !Number.isInteger(v.problems)) errs.push("sources.total\u30FBproblems \u306F\u6574\u6570\u3067\u3059");
|
|
@@ -2178,7 +2460,9 @@ function validateSourcesView(v) {
|
|
|
2178
2460
|
SOURCES_UNAVAILABLE_REASONS,
|
|
2179
2461
|
SOURCES_VIEW_VERSION,
|
|
2180
2462
|
buildSourcesView,
|
|
2463
|
+
cleanSourceName,
|
|
2181
2464
|
fixerOf,
|
|
2465
|
+
rowReasonKnown,
|
|
2182
2466
|
sourcesUnavailable,
|
|
2183
2467
|
toolOfRowKind,
|
|
2184
2468
|
userKeyOf,
|
|
@@ -110,8 +110,14 @@ var SOURCE_REASONS = Object.freeze([
|
|
|
110
110
|
// 鍵を相手のツールが受け付けない
|
|
111
111
|
"permission_missing",
|
|
112
112
|
// 鍵は通るが、その場を読む権限・スコープが足りない
|
|
113
|
+
// 相手が読ませてくれないが、鍵の期限切れ・その場の権限・接続元の制限のどれかを答えから見分けられない(Figma・Backlog の 403・cortex-engine #3142)。
|
|
114
|
+
// `permission_missing` の文(権限が足りない)に決め打ちすると、鍵の入れ直しで直る物に逆の直し方を案内する(#3142 の歩いた表の Figma)。画面は試せる順を出す
|
|
115
|
+
"unclear_access",
|
|
113
116
|
"not_member",
|
|
114
117
|
// Cortex がその場に入っていない・共有されていない
|
|
118
|
+
// その場の持ち主の側(Slack のワークスペース・GitHub の組織)が、まだ Cortex につながっていない(cortex-engine #3142)。
|
|
119
|
+
// 直すのは利用者の側(接続する・App を入れる)。`unreadable`(訳が言えない → Cortex 側で対応中)に落とさない
|
|
120
|
+
"not_connected",
|
|
115
121
|
"not_found",
|
|
116
122
|
// その場が見つからない
|
|
117
123
|
"approval_pending",
|
|
@@ -136,7 +142,9 @@ var SOURCE_REASON_FIXER = Object.freeze({
|
|
|
136
142
|
key_missing: "user",
|
|
137
143
|
key_rejected: "user",
|
|
138
144
|
permission_missing: "user",
|
|
145
|
+
unclear_access: "user",
|
|
139
146
|
not_member: "user",
|
|
147
|
+
not_connected: "user",
|
|
140
148
|
not_found: "user",
|
|
141
149
|
approval_pending: "user",
|
|
142
150
|
not_allowed: "cortex",
|