hikoutei 0.10.1-dev → 0.10.4-dev
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/composition/localRuntime.js +2 -2
- package/dist/composition/localRuntime.js.map +1 -1
- package/dist/contracts/domain/model/constants.d.ts +15 -0
- package/dist/contracts/domain/model/constants.d.ts.map +1 -1
- package/dist/contracts/domain/model/constants.js +13 -0
- package/dist/contracts/domain/model/constants.js.map +1 -1
- package/dist/contracts/shared/observability/internalLog.d.ts.map +1 -0
- package/dist/contracts/shared/observability/internalLog.js.map +1 -0
- package/dist/contracts/shared/observability/logEvents.d.ts.map +1 -0
- package/dist/contracts/shared/observability/logEvents.js.map +1 -0
- package/dist/contracts/sheets/mutationCoordinator/CoordinatedSheetsProvider.js +1 -1
- package/dist/contracts/sheets/mutationCoordinator/CoordinatedSheetsProvider.js.map +1 -1
- package/dist/contracts/sheets/mutationCoordinator/laneTelemetry.d.ts +1 -1
- package/dist/contracts/sheets/mutationCoordinator/laneTelemetry.d.ts.map +1 -1
- package/dist/contracts/sheets/mutationCoordinator/laneTelemetry.js +1 -1
- package/dist/contracts/sheets/mutationCoordinator/laneTelemetry.js.map +1 -1
- package/dist/contracts/sheets/timing.d.ts +4 -37
- package/dist/contracts/sheets/timing.d.ts.map +1 -1
- package/dist/contracts/sheets/timing.js +4 -18
- package/dist/contracts/sheets/timing.js.map +1 -1
- package/dist/internal/syncStatus.d.ts.map +1 -1
- package/dist/internal/syncStatus.js +1 -2
- package/dist/internal/syncStatus.js.map +1 -1
- package/dist/orm/persistence/projection/projectionEffects.d.ts.map +1 -1
- package/dist/orm/persistence/projection/projectionEffects.js +2 -2
- package/dist/orm/persistence/projection/projectionEffects.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.d.ts +2 -0
- package/dist/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.js +21 -4
- package/dist/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/constants.d.ts +13 -2
- package/dist/sheets/providers/google-sheets-api/constants.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/constants.js +17 -2
- package/dist/sheets/providers/google-sheets-api/constants.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/errors.js +2 -2
- package/dist/sheets/providers/google-sheets-api/errors.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/index.d.ts +1 -1
- package/dist/sheets/providers/google-sheets-api/index.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/index.js +1 -1
- package/dist/sheets/providers/google-sheets-api/index.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/batchBuilder.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/batchBuilder.js +7 -7
- package/dist/sheets/providers/google-sheets-api/model/batchBuilder.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/observation.d.ts +3 -3
- package/dist/sheets/providers/google-sheets-api/model/observation.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/observation.js +11 -8
- package/dist/sheets/providers/google-sheets-api/model/observation.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/plannerReceipt.d.ts +6 -5
- package/dist/sheets/providers/google-sheets-api/model/plannerReceipt.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/plannerReceipt.js +97 -43
- package/dist/sheets/providers/google-sheets-api/model/plannerReceipt.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/postcondition.d.ts +8 -5
- package/dist/sheets/providers/google-sheets-api/model/postcondition.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/postcondition.js +50 -60
- package/dist/sheets/providers/google-sheets-api/model/postcondition.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightContext.d.ts +5 -6
- package/dist/sheets/providers/google-sheets-api/model/preflightContext.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightContext.js +22 -15
- package/dist/sheets/providers/google-sheets-api/model/preflightContext.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightVerify.d.ts +2 -2
- package/dist/sheets/providers/google-sheets-api/model/preflightVerify.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/model/preflightVerify.js +10 -7
- package/dist/sheets/providers/google-sheets-api/model/preflightVerify.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/applyEffects.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/applyEffects.js +2 -3
- package/dist/sheets/providers/google-sheets-api/operations/applyEffects.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/fastAppend.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/fastAppend.js +2 -3
- package/dist/sheets/providers/google-sheets-api/operations/fastAppend.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/preflightOp.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/preflightOp.js +2 -2
- package/dist/sheets/providers/google-sheets-api/operations/preflightOp.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/provisioning.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/provisioning.js +2 -2
- package/dist/sheets/providers/google-sheets-api/operations/provisioning.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/readRows.js +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/readRows.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/rowChecks.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/rowChecks.js +9 -7
- package/dist/sheets/providers/google-sheets-api/operations/rowChecks.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/shared.d.ts +119 -58
- package/dist/sheets/providers/google-sheets-api/operations/shared.d.ts.map +1 -1
- package/dist/sheets/providers/google-sheets-api/operations/shared.js +168 -153
- package/dist/sheets/providers/google-sheets-api/operations/shared.js.map +1 -1
- package/dist/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.d.ts +1 -1
- package/dist/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.js +4 -4
- package/dist/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.js.map +1 -1
- package/dist/storage/sqlite/migrateSchema.d.ts.map +1 -1
- package/dist/storage/sqlite/migrateSchema.js +36 -3
- package/dist/storage/sqlite/migrateSchema.js.map +1 -1
- package/dist/storage/sqlite/schema.d.ts +3 -1
- package/dist/storage/sqlite/schema.d.ts.map +1 -1
- package/dist/storage/sqlite/schema.js +6 -2
- package/dist/storage/sqlite/schema.js.map +1 -1
- package/dist/storage/sqlite/schemaTypes.d.ts +1 -1
- package/dist/storage/sqlite/schemaTypes.d.ts.map +1 -1
- package/dist/sync/outbound/projection/ProjectionEffectFactory.d.ts +19 -0
- package/dist/sync/outbound/projection/ProjectionEffectFactory.d.ts.map +1 -1
- package/dist/sync/outbound/projection/ProjectionEffectFactory.js +35 -0
- package/dist/sync/outbound/projection/ProjectionEffectFactory.js.map +1 -1
- package/dist/sync-engine/api/hikouteiCore.js +2 -2
- package/dist/sync-engine/api/hikouteiCore.js.map +1 -1
- package/dist/sync-engine/api/internalEntityManager.js +2 -2
- package/dist/sync-engine/api/internalEntityManager.js.map +1 -1
- package/dist/sync-engine/sync/outbound/SheetsEffectDispatcher.d.ts +13 -2
- package/dist/sync-engine/sync/outbound/SheetsEffectDispatcher.d.ts.map +1 -1
- package/dist/sync-engine/sync/outbound/SheetsEffectDispatcher.js +37 -5
- package/dist/sync-engine/sync/outbound/SheetsEffectDispatcher.js.map +1 -1
- package/dist/sync-engine/sync/outbound/dispatcherSupport.d.ts +4 -7
- package/dist/sync-engine/sync/outbound/dispatcherSupport.d.ts.map +1 -1
- package/dist/sync-engine/sync/outbound/dispatcherSupport.js +4 -14
- package/dist/sync-engine/sync/outbound/dispatcherSupport.js.map +1 -1
- package/dist/sync-engine/sync/service/SyncServiceBootstrap.js +2 -2
- package/dist/sync-engine/sync/service/SyncServiceBootstrap.js.map +1 -1
- package/dist/sync-engine/sync/service/adopt/adoptionSeeding.js +1 -1
- package/dist/sync-engine/sync/service/adopt/adoptionSeeding.js.map +1 -1
- package/dist/sync-engine/sync/service/effectSupervisor.js +2 -2
- package/dist/sync-engine/sync/service/effectSupervisor.js.map +1 -1
- package/dist/sync-engine/sync/service/pollingSupervisor.js +2 -2
- package/dist/sync-engine/sync/service/pollingSupervisor.js.map +1 -1
- package/dist/sync-engine/sync/service/requestTelemetry.js +2 -2
- package/dist/sync-engine/sync/service/requestTelemetry.js.map +1 -1
- package/dist/sync-engine/sync/service/shutdown.js +1 -1
- package/dist/sync-engine/sync/service/shutdown.js.map +1 -1
- package/dist/sync-engine/sync/service/syncAutoStart.js +2 -2
- package/dist/sync-engine/sync/service/syncAutoStart.js.map +1 -1
- package/dist/sync-engine/sync/sheetsContract/conflictProjectionRegistration.js +1 -1
- package/dist/sync-engine/sync/sheetsContract/conflictProjectionRegistration.js.map +1 -1
- package/package.json +5 -4
- package/dist/contracts/sheets/transportOutcome.d.ts +0 -90
- package/dist/contracts/sheets/transportOutcome.d.ts.map +0 -1
- package/dist/contracts/sheets/transportOutcome.js +0 -191
- package/dist/contracts/sheets/transportOutcome.js.map +0 -1
- package/dist/sheets/providers/google-sheets-api/model/readPlan.d.ts +0 -168
- package/dist/sheets/providers/google-sheets-api/model/readPlan.d.ts.map +0 -1
- package/dist/sheets/providers/google-sheets-api/model/readPlan.js +0 -184
- package/dist/sheets/providers/google-sheets-api/model/readPlan.js.map +0 -1
- package/dist/sheets/providers/google-sheets-api/model/receiptCursor.d.ts +0 -102
- package/dist/sheets/providers/google-sheets-api/model/receiptCursor.d.ts.map +0 -1
- package/dist/sheets/providers/google-sheets-api/model/receiptCursor.js +0 -132
- package/dist/sheets/providers/google-sheets-api/model/receiptCursor.js.map +0 -1
- package/dist/sheets/providers/google-sheets-api/model/rowCheckFormula.d.ts +0 -35
- package/dist/sheets/providers/google-sheets-api/model/rowCheckFormula.d.ts.map +0 -1
- package/dist/sheets/providers/google-sheets-api/model/rowCheckFormula.js +0 -57
- package/dist/sheets/providers/google-sheets-api/model/rowCheckFormula.js.map +0 -1
- package/dist/sheets/providers/google-sheets-api/model/sheetIdAllocator.d.ts +0 -16
- package/dist/sheets/providers/google-sheets-api/model/sheetIdAllocator.d.ts.map +0 -1
- package/dist/sheets/providers/google-sheets-api/model/sheetIdAllocator.js +0 -29
- package/dist/sheets/providers/google-sheets-api/model/sheetIdAllocator.js.map +0 -1
- package/dist/sheets/providers/google-sheets-api/operations/readEngine.d.ts +0 -50
- package/dist/sheets/providers/google-sheets-api/operations/readEngine.d.ts.map +0 -1
- package/dist/sheets/providers/google-sheets-api/operations/readEngine.js +0 -124
- package/dist/sheets/providers/google-sheets-api/operations/readEngine.js.map +0 -1
- package/dist/sheets/providers/google-sheets-api/operations/writeEngine.d.ts +0 -90
- package/dist/sheets/providers/google-sheets-api/operations/writeEngine.d.ts.map +0 -1
- package/dist/sheets/providers/google-sheets-api/operations/writeEngine.js +0 -112
- package/dist/sheets/providers/google-sheets-api/operations/writeEngine.js.map +0 -1
- package/dist/sheets/providers/google-sheets-api/transport/quotaGovernor.d.ts +0 -229
- package/dist/sheets/providers/google-sheets-api/transport/quotaGovernor.d.ts.map +0 -1
- package/dist/sheets/providers/google-sheets-api/transport/quotaGovernor.js +0 -299
- package/dist/sheets/providers/google-sheets-api/transport/quotaGovernor.js.map +0 -1
- package/dist/sheets/providers/google-sheets-api/transport/rateLimiter.d.ts +0 -185
- package/dist/sheets/providers/google-sheets-api/transport/rateLimiter.d.ts.map +0 -1
- package/dist/sheets/providers/google-sheets-api/transport/rateLimiter.js +0 -248
- package/dist/sheets/providers/google-sheets-api/transport/rateLimiter.js.map +0 -1
- package/dist/sheets/providers/google-sheets-api/transport/rawErrorSchemas.d.ts +0 -7
- package/dist/sheets/providers/google-sheets-api/transport/rawErrorSchemas.d.ts.map +0 -1
- package/dist/sheets/providers/google-sheets-api/transport/rawErrorSchemas.js +0 -26
- package/dist/sheets/providers/google-sheets-api/transport/rawErrorSchemas.js.map +0 -1
- package/dist/sync-engine/shared/observability/internalLog.d.ts.map +0 -1
- package/dist/sync-engine/shared/observability/internalLog.js.map +0 -1
- package/dist/sync-engine/shared/observability/logEvents.d.ts.map +0 -1
- package/dist/sync-engine/shared/observability/logEvents.js.map +0 -1
- /package/dist/{sync-engine → contracts}/shared/observability/internalLog.d.ts +0 -0
- /package/dist/{sync-engine → contracts}/shared/observability/internalLog.js +0 -0
- /package/dist/{sync-engine → contracts}/shared/observability/logEvents.d.ts +0 -0
- /package/dist/{sync-engine → contracts}/shared/observability/logEvents.js +0 -0
|
@@ -1,76 +1,130 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Sheets boundary adapter over the neutral CAS-evidence receipt encoders.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* The planning outcome shapes (`plannerContracts.ts`) and the Sheets result
|
|
5
|
+
* contract (`SyncEffectResult`) stay provider-owned; the receipt and
|
|
6
|
+
* result-encoding semantics live in the kernel (`@hikoutei/ikisaki`
|
|
7
|
+
* `evidence/plannerReceipt.ts`). This module maps between the two at the
|
|
8
|
+
* boundary with no semantic content of its own.
|
|
8
9
|
*/
|
|
9
10
|
import { SYNC_EFFECT_RESULT_STATUSES, SYNC_POSTCONDITION_STATUSES } from "../../../../contracts/sheets/constants.js";
|
|
10
11
|
import { presentValue, absentValue } from "../../../../contracts/state/index.js";
|
|
12
|
+
import { encodeOutcomeResultEvidence, encodeSchemaErrorResultEvidence, makeReceiptEvidence, withDeferredPostconditionEvidence, } from "@hikoutei/ikisaki";
|
|
11
13
|
/** Builds a receipt record exactly like `makeReceipt_`. */
|
|
12
14
|
export function makeReceipt(effect, visibleHash, visibleRevision) {
|
|
13
|
-
return
|
|
14
|
-
effectId: effect.effectId,
|
|
15
|
-
payloadHash: effect.payloadHash,
|
|
16
|
-
status: "applied",
|
|
17
|
-
visibleHash,
|
|
18
|
-
visibleRevision,
|
|
19
|
-
};
|
|
15
|
+
return makeReceiptEvidence(effect.effectId, effect.payloadHash, visibleHash, visibleRevision);
|
|
20
16
|
}
|
|
21
17
|
/** Encodes a planned outcome as a provider result (Apps Script `result_`). */
|
|
22
18
|
export function encodeOutcomeResult(outcome) {
|
|
19
|
+
return toSyncEffectResult(encodeOutcomeResultEvidence(toOutcomeEvidence(outcome)));
|
|
20
|
+
}
|
|
21
|
+
/** Builds a schema_error result without any receipt-backed evidence. */
|
|
22
|
+
export function encodeSchemaErrorResult(effect, reason) {
|
|
23
|
+
return toSyncEffectResult(encodeSchemaErrorResultEvidence(effect.effectId, effect.payloadHash, reason));
|
|
24
|
+
}
|
|
25
|
+
/** Applies the deferred-mode postcondition relabeling for applied results. */
|
|
26
|
+
export function withDeferredPostcondition(result) {
|
|
27
|
+
// Non-applied results (and already-relabeled ones) pass through
|
|
28
|
+
// untouched, exactly like the historical helper — only a verified
|
|
29
|
+
// applied result is relabeled, so unlisted statuses can never be
|
|
30
|
+
// corrupted by the neutral round-trip.
|
|
31
|
+
if ((result.status !== SYNC_EFFECT_RESULT_STATUSES.APPLIED &&
|
|
32
|
+
result.status !== SYNC_EFFECT_RESULT_STATUSES.ALREADY_APPLIED) ||
|
|
33
|
+
result.postcondition !== SYNC_POSTCONDITION_STATUSES.VERIFIED) {
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
return toSyncEffectResult(withDeferredPostconditionEvidence(fromSyncEffectResult(result)));
|
|
37
|
+
}
|
|
38
|
+
/** Projects a planner outcome onto the neutral evidence shape. */
|
|
39
|
+
function toOutcomeEvidence(outcome) {
|
|
23
40
|
switch (outcome.kind) {
|
|
24
41
|
case "applied":
|
|
42
|
+
return {
|
|
43
|
+
kind: "applied",
|
|
44
|
+
effectId: outcome.effect.effectId,
|
|
45
|
+
payloadHash: outcome.effect.payloadHash,
|
|
46
|
+
receipt: outcome.receipt,
|
|
47
|
+
created: outcome.created,
|
|
48
|
+
deletion: outcome.deletion,
|
|
49
|
+
};
|
|
25
50
|
case "already_applied":
|
|
26
51
|
return {
|
|
52
|
+
kind: "already_applied",
|
|
27
53
|
effectId: outcome.effect.effectId,
|
|
28
54
|
payloadHash: outcome.effect.payloadHash,
|
|
29
|
-
|
|
30
|
-
? SYNC_EFFECT_RESULT_STATUSES.APPLIED
|
|
31
|
-
: SYNC_EFFECT_RESULT_STATUSES.ALREADY_APPLIED,
|
|
32
|
-
visibleRevision: presentValue(outcome.receipt.visibleRevision),
|
|
33
|
-
visibleHash: presentValue(outcome.receipt.visibleHash),
|
|
34
|
-
snapshotHash: absentValue(),
|
|
35
|
-
reason: absentValue(),
|
|
36
|
-
postcondition: SYNC_POSTCONDITION_STATUSES.VERIFIED,
|
|
55
|
+
receipt: outcome.receipt,
|
|
37
56
|
};
|
|
38
57
|
case "guard_mismatch":
|
|
39
58
|
case "repair_reobserve":
|
|
40
59
|
case "schema_error":
|
|
41
60
|
case "retryable_error":
|
|
42
61
|
return {
|
|
62
|
+
kind: outcome.kind,
|
|
43
63
|
effectId: outcome.effect.effectId,
|
|
44
64
|
payloadHash: outcome.effect.payloadHash,
|
|
45
|
-
|
|
46
|
-
visibleRevision: absentValue(),
|
|
47
|
-
visibleHash: absentValue(),
|
|
48
|
-
snapshotHash: absentValue(),
|
|
49
|
-
reason: presentValue(outcome.reason),
|
|
50
|
-
postcondition: SYNC_POSTCONDITION_STATUSES.UNAVAILABLE,
|
|
65
|
+
reason: outcome.reason,
|
|
51
66
|
};
|
|
52
67
|
}
|
|
53
68
|
}
|
|
54
|
-
/**
|
|
55
|
-
|
|
69
|
+
/** Maps a neutral coded result onto the Sheets result contract. */
|
|
70
|
+
function toSyncEffectResult(result) {
|
|
56
71
|
return {
|
|
57
|
-
effectId:
|
|
58
|
-
payloadHash:
|
|
59
|
-
status:
|
|
60
|
-
|
|
61
|
-
|
|
72
|
+
effectId: result.effectId,
|
|
73
|
+
payloadHash: result.payloadHash,
|
|
74
|
+
status: result.status === "applied"
|
|
75
|
+
? SYNC_EFFECT_RESULT_STATUSES.APPLIED
|
|
76
|
+
: result.status === "already_applied"
|
|
77
|
+
? SYNC_EFFECT_RESULT_STATUSES.ALREADY_APPLIED
|
|
78
|
+
: result.status === "guard_mismatch"
|
|
79
|
+
? SYNC_EFFECT_RESULT_STATUSES.GUARD_MISMATCH
|
|
80
|
+
: result.status === "repair_reobserve"
|
|
81
|
+
? SYNC_EFFECT_RESULT_STATUSES.REPAIR_REOBSERVE
|
|
82
|
+
: result.status === "schema_error"
|
|
83
|
+
? SYNC_EFFECT_RESULT_STATUSES.SCHEMA_ERROR
|
|
84
|
+
: SYNC_EFFECT_RESULT_STATUSES.RETRYABLE_ERROR,
|
|
85
|
+
visibleRevision: result.visibleRevision === undefined
|
|
86
|
+
? absentValue()
|
|
87
|
+
: presentValue(result.visibleRevision),
|
|
88
|
+
visibleHash: result.visibleHash === undefined
|
|
89
|
+
? absentValue()
|
|
90
|
+
: presentValue(result.visibleHash),
|
|
62
91
|
snapshotHash: absentValue(),
|
|
63
|
-
reason: presentValue(reason),
|
|
64
|
-
postcondition:
|
|
92
|
+
reason: result.reason === undefined ? absentValue() : presentValue(result.reason),
|
|
93
|
+
postcondition: result.postcondition === "verified"
|
|
94
|
+
? SYNC_POSTCONDITION_STATUSES.VERIFIED
|
|
95
|
+
: result.postcondition === "acknowledged"
|
|
96
|
+
? SYNC_POSTCONDITION_STATUSES.ACKNOWLEDGED
|
|
97
|
+
: SYNC_POSTCONDITION_STATUSES.UNAVAILABLE,
|
|
65
98
|
};
|
|
66
99
|
}
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
result.
|
|
71
|
-
result.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
100
|
+
/** Projects a Sheets result back onto the neutral coded shape. */
|
|
101
|
+
function fromSyncEffectResult(result) {
|
|
102
|
+
return {
|
|
103
|
+
effectId: result.effectId,
|
|
104
|
+
payloadHash: result.payloadHash,
|
|
105
|
+
status: result.status === SYNC_EFFECT_RESULT_STATUSES.APPLIED
|
|
106
|
+
? "applied"
|
|
107
|
+
: result.status === SYNC_EFFECT_RESULT_STATUSES.ALREADY_APPLIED
|
|
108
|
+
? "already_applied"
|
|
109
|
+
: result.status === SYNC_EFFECT_RESULT_STATUSES.GUARD_MISMATCH
|
|
110
|
+
? "guard_mismatch"
|
|
111
|
+
: result.status === SYNC_EFFECT_RESULT_STATUSES.REPAIR_REOBSERVE
|
|
112
|
+
? "repair_reobserve"
|
|
113
|
+
: result.status === SYNC_EFFECT_RESULT_STATUSES.SCHEMA_ERROR
|
|
114
|
+
? "schema_error"
|
|
115
|
+
: "retryable_error",
|
|
116
|
+
visibleRevision: result.visibleRevision.kind === "present"
|
|
117
|
+
? result.visibleRevision.value
|
|
118
|
+
: undefined,
|
|
119
|
+
visibleHash: result.visibleHash.kind === "present"
|
|
120
|
+
? result.visibleHash.value
|
|
121
|
+
: undefined,
|
|
122
|
+
reason: result.reason.kind === "present" ? result.reason.value : undefined,
|
|
123
|
+
postcondition: result.postcondition === SYNC_POSTCONDITION_STATUSES.VERIFIED
|
|
124
|
+
? "verified"
|
|
125
|
+
: result.postcondition === SYNC_POSTCONDITION_STATUSES.ACKNOWLEDGED
|
|
126
|
+
? "acknowledged"
|
|
127
|
+
: "unavailable",
|
|
128
|
+
};
|
|
75
129
|
}
|
|
76
130
|
//# sourceMappingURL=plannerReceipt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plannerReceipt.js","sourceRoot":"","sources":["../../../../../../../../src/sheets/providers/google-sheets-api/model/plannerReceipt.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plannerReceipt.js","sourceRoot":"","sources":["../../../../../../../../src/sheets/providers/google-sheets-api/model/plannerReceipt.ts"],"names":[],"mappings":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,eAAe;gBAC7D,CAAC,CAAC,iBAAiB;gBACnB,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,2BAA2B,CAAC,cAAc;oBAC5D,CAAC,CAAC,gBAAgB;oBAClB,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,2BAA2B,CAAC,gBAAgB;wBAC9D,CAAC,CAAC,kBAAkB;wBACpB,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,2BAA2B,CAAC,YAAY;4BAC1D,CAAC,CAAC,cAAc;4BAChB,CAAC,CAAC,iBAAiB;QAC7B,eAAe,EAAE,MAAM,CAAC,eAAe,CAAC,IAAI,KAAK,SAAS;YACxD,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK;YAC9B,CAAC,CAAC,SAAS;QACb,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,KAAK,SAAS;YAChD,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK;YAC1B,CAAC,CAAC,SAAS;QACb,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QAC1E,aAAa,EAAE,MAAM,CAAC,aAAa,KAAK,2BAA2B,CAAC,QAAQ;YAC1E,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,MAAM,CAAC,aAAa,KAAK,2BAA2B,CAAC,YAAY;gBACjE,CAAC,CAAC,cAAc;gBAChB,CAAC,CAAC,aAAa;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Sheets boundary adapter over the neutral CAS-evidence postcondition
|
|
3
|
+
* classifier.
|
|
3
4
|
*
|
|
4
5
|
* Recovery probes classify one effect against a fresh target+receipt read.
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* The Sheets context model (anchor/identity row lookup, working-row hashes,
|
|
7
|
+
* deletion-ness, route validation) stays provider-owned here; the
|
|
8
|
+
* applied/unapplied/changed/unavailable decision lives in the kernel
|
|
9
|
+
* (`@hikoutei/ikisaki` `evidence/postcondition.ts`). This module builds the
|
|
10
|
+
* neutral evidence views from the context and maps the verdict onto the
|
|
11
|
+
* Sheets postcondition contract.
|
|
9
12
|
*/
|
|
10
13
|
import type { SyncEffectPostcondition, SyncProjectionEffect } from "../../../../contracts/sheets/syncSheets.js";
|
|
11
14
|
import type { PreflightContext, PreflightReceipt } from "./preflightContext.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcondition.d.ts","sourceRoot":"","sources":["../../../../../../../../src/sheets/providers/google-sheets-api/model/postcondition.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"postcondition.d.ts","sourceRoot":"","sources":["../../../../../../../../src/sheets/providers/google-sheets-api/model/postcondition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAO9G,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAUhF;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAC9C,uBAAuB,CA0BzB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,oBAAoB,GAC3B,MAAM,GAAG,SAAS,CAGpB"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Sheets boundary adapter over the neutral CAS-evidence postcondition
|
|
3
|
+
* classifier.
|
|
3
4
|
*
|
|
4
5
|
* Recovery probes classify one effect against a fresh target+receipt read.
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* The Sheets context model (anchor/identity row lookup, working-row hashes,
|
|
7
|
+
* deletion-ness, route validation) stays provider-owned here; the
|
|
8
|
+
* applied/unapplied/changed/unavailable decision lives in the kernel
|
|
9
|
+
* (`@hikoutei/ikisaki` `evidence/postcondition.ts`). This module builds the
|
|
10
|
+
* neutral evidence views from the context and maps the verdict onto the
|
|
11
|
+
* Sheets postcondition contract.
|
|
9
12
|
*/
|
|
10
13
|
import { PRESENCE_KINDS } from "../../../../contracts/state/index.js";
|
|
11
14
|
import { presentValue, absentValue } from "../../../../contracts/state/index.js";
|
|
15
|
+
import { classifyCasPostcondition, } from "@hikoutei/ikisaki";
|
|
12
16
|
import { currentHash, findWorkingRow, toWorkingRow, } from "./plannerWorkingRow.js";
|
|
13
17
|
import { isDeletionEffect } from "./plannerDeletion.js";
|
|
14
18
|
import { requireProviderEffect } from "./planner.js";
|
|
@@ -27,51 +31,21 @@ export function classifyPostcondition(context, effect, receipts) {
|
|
|
27
31
|
};
|
|
28
32
|
requireProviderEffect(effect, request, context);
|
|
29
33
|
const receipt = receipts.get(effect.effectId);
|
|
30
|
-
if (receipt !== undefined && receipt.payloadHash !== effect.payloadHash) {
|
|
31
|
-
return postcondition("changed", absentValue(), absentValue());
|
|
32
|
-
}
|
|
33
34
|
const row = findProbeRow(context, effect);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
? postcondition("unapplied", presentValue(effect.expectedVisibleRevision), presentValue(deleteHash))
|
|
49
|
-
: postcondition("changed", absentValue(), presentValue(deleteHash));
|
|
50
|
-
}
|
|
51
|
-
// A receipt alone cannot prove that a non-delete row still exists; a manual
|
|
52
|
-
// deletion must remain observable instead of closing the outbox.
|
|
53
|
-
if (row === undefined) {
|
|
54
|
-
return postcondition(receipt !== undefined || !effect.payload.createIfMissing ? "changed" : "unapplied", absentValue(), absentValue(), receipt === undefined ? undefined : "receipt_target_missing");
|
|
55
|
-
}
|
|
56
|
-
const current = currentHash(row, effect.payload.fields);
|
|
57
|
-
if (current === effect.payload.targetVisibleHash) {
|
|
58
|
-
if (receipt === undefined) {
|
|
59
|
-
// The row already carries the target content, but without a receipt
|
|
60
|
-
// there is no durable proof that this effect was applied by the
|
|
61
|
-
// provider: the two-batch inline path can crash between the target-row
|
|
62
|
-
// write and the receipt write and leave exactly this orphan. Closing
|
|
63
|
-
// the outbox on row-hash evidence alone would turn that crash into a
|
|
64
|
-
// false success, so stay fail-closed.
|
|
65
|
-
return postcondition("unavailable", absentValue(), presentValue(current), "receipt_missing");
|
|
66
|
-
}
|
|
67
|
-
return postcondition("applied", presentValue(receipt.visibleRevision), presentValue(current));
|
|
68
|
-
}
|
|
69
|
-
const repairGuard = effect.repairGuardHash;
|
|
70
|
-
if (current === effect.expectedVisibleHash ||
|
|
71
|
-
(repairGuard.kind === PRESENCE_KINDS.PRESENT && current === repairGuard.value)) {
|
|
72
|
-
return postcondition("unapplied", presentValue(effect.expectedVisibleRevision), presentValue(current));
|
|
73
|
-
}
|
|
74
|
-
return postcondition("changed", absentValue(), presentValue(current));
|
|
35
|
+
const verdict = classifyCasPostcondition(toClassifyInput(effect, receipt, row));
|
|
36
|
+
return {
|
|
37
|
+
disposition: verdict.disposition,
|
|
38
|
+
visibleRevision: verdict.visibleRevision === undefined
|
|
39
|
+
? absentValue()
|
|
40
|
+
: presentValue(verdict.visibleRevision),
|
|
41
|
+
visibleHash: verdict.visibleHash === undefined
|
|
42
|
+
? absentValue()
|
|
43
|
+
: presentValue(verdict.visibleHash),
|
|
44
|
+
// The direct provider never computes a snapshot hash; recovery does not
|
|
45
|
+
// need it and the Apps Script provider also returns null here.
|
|
46
|
+
snapshotHash: absentValue(),
|
|
47
|
+
...(verdict.reason === undefined ? {} : { reason: verdict.reason }),
|
|
48
|
+
};
|
|
75
49
|
}
|
|
76
50
|
/**
|
|
77
51
|
* Locates the row number the probe's `findProbeRow` will classify for one
|
|
@@ -85,6 +59,33 @@ export function probeTargetRowNumber(context, effect) {
|
|
|
85
59
|
const row = findProbeRow(context, effect);
|
|
86
60
|
return row === undefined ? undefined : row.rowNumber;
|
|
87
61
|
}
|
|
62
|
+
/** Projects one effect plus its read-back evidence onto the neutral input. */
|
|
63
|
+
function toClassifyInput(effect, receipt, row) {
|
|
64
|
+
return {
|
|
65
|
+
isDeletion: isDeletionEffect(effect.effectKind),
|
|
66
|
+
expectedVisibleHash: effect.expectedVisibleHash,
|
|
67
|
+
expectedVisibleRevision: effect.expectedVisibleRevision,
|
|
68
|
+
targetVisibleHash: effect.payload.targetVisibleHash,
|
|
69
|
+
createIfMissing: effect.payload.createIfMissing,
|
|
70
|
+
repairGuardHash: effect.repairGuardHash.kind === PRESENCE_KINDS.PRESENT
|
|
71
|
+
? effect.repairGuardHash.value
|
|
72
|
+
: null,
|
|
73
|
+
effectPayloadHash: effect.payloadHash,
|
|
74
|
+
receipt: receipt === undefined
|
|
75
|
+
? undefined
|
|
76
|
+
: {
|
|
77
|
+
payloadHash: receipt.payloadHash,
|
|
78
|
+
visibleRevision: receipt.visibleRevision,
|
|
79
|
+
visibleHash: receipt.visibleHash,
|
|
80
|
+
},
|
|
81
|
+
observedRow: row === undefined
|
|
82
|
+
? undefined
|
|
83
|
+
: {
|
|
84
|
+
rowNumber: row.rowNumber,
|
|
85
|
+
currentHash: currentHash(row, effect.payload.fields),
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
88
89
|
function findProbeRow(context, effect) {
|
|
89
90
|
const byAnchor = new Map();
|
|
90
91
|
const byIdentity = new Map();
|
|
@@ -101,15 +102,4 @@ function findProbeRow(context, effect) {
|
|
|
101
102
|
}
|
|
102
103
|
return findWorkingRow(byAnchor, byIdentity, effect.payload.targetAnchor, effect.targetId);
|
|
103
104
|
}
|
|
104
|
-
function postcondition(disposition, visibleRevision, visibleHash, reason) {
|
|
105
|
-
const result = {
|
|
106
|
-
disposition,
|
|
107
|
-
visibleRevision,
|
|
108
|
-
visibleHash,
|
|
109
|
-
// The direct provider never computes a snapshot hash; recovery does not
|
|
110
|
-
// need it and the Apps Script provider also returns null here.
|
|
111
|
-
snapshotHash: absentValue(),
|
|
112
|
-
};
|
|
113
|
-
return reason === undefined ? result : { ...result, reason };
|
|
114
|
-
}
|
|
115
105
|
//# sourceMappingURL=postcondition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcondition.js","sourceRoot":"","sources":["../../../../../../../../src/sheets/providers/google-sheets-api/model/postcondition.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"postcondition.js","sourceRoot":"","sources":["../../../../../../../../src/sheets/providers/google-sheets-api/model/postcondition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EACL,wBAAwB,GAEzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,WAAW,EACX,cAAc,EACd,YAAY,GACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGrD;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAyB,EACzB,MAA4B,EAC5B,QAA+C;IAE/C,MAAM,OAAO,GAAG;QACd,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS;QACnC,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,eAA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O,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1F,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,OAAO,EAAE,CAAC;YACrD,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IACD,OAAO,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -12,8 +12,7 @@ import type { NormalizedCell } from "../../../../contracts/encoding/types.js";
|
|
|
12
12
|
import type { Presence } from "../../../../contracts/state/index.js";
|
|
13
13
|
import type { SyncMissingTabOperation } from "../../../../contracts/sheets/errors.js";
|
|
14
14
|
import type { GoogleSheetsApiTransport } from "../transport/googleSheetsApiTransport.js";
|
|
15
|
-
import type
|
|
16
|
-
import { type EngineRuntime, type PlannedRange, type ReadCalibration, type ReadEvidence } from "./readPlan.js";
|
|
15
|
+
import { type BandEvidence, type BandRange, type EngineRuntime, type ReadCalibration, type ReceiptReadCursor } from "@hikoutei/ikisaki";
|
|
17
16
|
/** One validated merged-cell region (a GridRange) from a sheet payload. */
|
|
18
17
|
export interface ParsedMergedCell {
|
|
19
18
|
readonly sheetId?: number;
|
|
@@ -187,7 +186,7 @@ credentialIndex?: number): Promise<readonly ParsedSheet[]>;
|
|
|
187
186
|
*/
|
|
188
187
|
export interface PreflightReadShape {
|
|
189
188
|
readonly scoped: boolean;
|
|
190
|
-
readonly cursor?: ReceiptReadCursor
|
|
189
|
+
readonly cursor?: ReceiptReadCursor<PreflightReceipt>;
|
|
191
190
|
}
|
|
192
191
|
/** The historical whole-table read shape (every fallback/recovery path). */
|
|
193
192
|
export declare const LEGACY_PREFLIGHT_READ_SHAPE: PreflightReadShape;
|
|
@@ -207,7 +206,7 @@ export declare const LEGACY_PREFLIGHT_READ_SHAPE: PreflightReadShape;
|
|
|
207
206
|
* a title (a transport that never reports `gridProperties`) the historical
|
|
208
207
|
* single open band is planned unchanged (correct, un-banded).
|
|
209
208
|
*/
|
|
210
|
-
export declare function buildPreflightRanges(routes: readonly PreflightRouteOptions[], receiptSheet: ParsedSheet | undefined, shape?: PreflightReadShape, receiptBandStart?: number | undefined, rowBounds?: ReadonlyMap<string, number>, calibration?: ReadCalibration | undefined, evidence?:
|
|
209
|
+
export declare function buildPreflightRanges(routes: readonly PreflightRouteOptions[], receiptSheet: ParsedSheet | undefined, shape?: PreflightReadShape, receiptBandStart?: number | undefined, rowBounds?: ReadonlyMap<string, number>, calibration?: ReadCalibration | undefined, evidence?: BandEvidence): readonly BandRange[];
|
|
211
210
|
/**
|
|
212
211
|
* True when one route's TARGET read is column-scoped (header row + key-column
|
|
213
212
|
* bands) rather than full-width: only key-column routes can hide non-key row
|
|
@@ -221,7 +220,7 @@ export declare function routeUsesColumnScope(route: PreflightRouteOptions, scope
|
|
|
221
220
|
* on the lane the runtime was built for), so a chunked plan is sequential
|
|
222
221
|
* but lands as ONE reassembled logical document for the context builders.
|
|
223
222
|
*/
|
|
224
|
-
export declare function readPreflightData(engine: EngineRuntime, route: PreflightRouteOptions, sheets: readonly ParsedSheet[],
|
|
223
|
+
export declare function readPreflightData(engine: EngineRuntime<ParsedSheet, number, ParsedGridData>, route: PreflightRouteOptions, sheets: readonly ParsedSheet[],
|
|
225
224
|
/** Field mask override; defaults to the values-only base mask. The
|
|
226
225
|
* oversized-verification fallback passes the full-evidence preflight mask
|
|
227
226
|
* to reproduce the historical whole-table read exactly. */
|
|
@@ -235,7 +234,7 @@ shape?: PreflightReadShape): Promise<PreflightContext>;
|
|
|
235
234
|
* invalid provider state (e.g. a missing tab) detected while building a
|
|
236
235
|
* route context.
|
|
237
236
|
*/
|
|
238
|
-
export declare function readPreflightDataForRoutes(engine: EngineRuntime, routes: readonly PreflightRouteOptions[], sheets: readonly ParsedSheet[], operation?: SyncMissingTabOperation,
|
|
237
|
+
export declare function readPreflightDataForRoutes(engine: EngineRuntime<ParsedSheet, number, ParsedGridData>, routes: readonly PreflightRouteOptions[], sheets: readonly ParsedSheet[], operation?: SyncMissingTabOperation,
|
|
239
238
|
/** Field mask override; defaults to the values-only base mask (see
|
|
240
239
|
* `readPreflightData`). */
|
|
241
240
|
fields?: string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preflightContext.d.ts","sourceRoot":"","sources":["../../../../../../../../src/sheets/providers/google-sheets-api/model/preflightContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAkBnE,OAAO,KAAK,EACV,uBAAuB,EACxB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EACV,wBAAwB,EAEzB,MAAM,0CAA0C,CAAC;AAMlD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"preflightContext.d.ts","sourceRoot":"","sources":["../../../../../../../../src/sheets/providers/google-sheets-api/model/preflightContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAkBnE,OAAO,KAAK,EACV,uBAAuB,EACxB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EACV,wBAAwB,EAEzB,MAAM,0CAA0C,CAAC;AAMlD,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,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,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7C,CAoDA"}
|
|
@@ -14,7 +14,8 @@ import { GOOGLE_SHEETS_API_ENUMERATION_FIELDS, GOOGLE_SHEETS_API_PREFLIGHT_BASE_
|
|
|
14
14
|
import { GoogleSheetsApiTransportError, invalidProviderState, } from "../errors.js";
|
|
15
15
|
import { PRESENCE_KINDS } from "../../../../contracts/state/constants.js";
|
|
16
16
|
import { columnLetters, parseRegisteredRange, quoteA1SheetName, } from "./valueNormalization.js";
|
|
17
|
-
import { authoritativeRowBound, packReadRequests, planRowBands, } from "
|
|
17
|
+
import { authoritativeRowBound, packReadRequests, planRowBands, } from "@hikoutei/ikisaki";
|
|
18
|
+
import { SHEET_MAX_ROW } from "../constants.js";
|
|
18
19
|
import { apiNumberValue, apiStringValue, parseSheetPropertiesDocument, } from "./preflightParsing.js";
|
|
19
20
|
import { anchorColumnFor, checkColumnFor, findSheetByTitle, gridRowCells, indexRows, pickRegisteredGrid, readRows, requireSheetByTitle, requireSheetGrids, requireSingleGrid, resolveGridCell, synthesizeScopedTargetGrid, } from "./preflightRows.js";
|
|
20
21
|
import { readRegisteredHeaders, validateCheckboxHeaders, } from "./preflightHeaders.js";
|
|
@@ -71,9 +72,9 @@ export function buildPreflightRanges(routes, receiptSheet, shape = LEGACY_PREFLI
|
|
|
71
72
|
const ranges = [];
|
|
72
73
|
const push = (items) => {
|
|
73
74
|
for (const item of items) {
|
|
74
|
-
if (seen.has(item.
|
|
75
|
+
if (seen.has(item.address))
|
|
75
76
|
continue;
|
|
76
|
-
seen.add(item.
|
|
77
|
+
seen.add(item.address);
|
|
77
78
|
ranges.push(item);
|
|
78
79
|
}
|
|
79
80
|
};
|
|
@@ -83,9 +84,10 @@ export function buildPreflightRanges(routes, receiptSheet, shape = LEGACY_PREFLI
|
|
|
83
84
|
if (receiptSheet !== undefined) {
|
|
84
85
|
const receiptQuote = `${quoteA1SheetName(GOOGLE_SHEETS_API_RECEIPT_SHEET_NAME)}!`;
|
|
85
86
|
push(planRowBands({
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
addressPrefix: receiptQuote,
|
|
88
|
+
firstColumn: "A",
|
|
89
|
+
lastColumn: columnLetters(GOOGLE_SHEETS_API_RECEIPT_HEADERS.length),
|
|
90
|
+
openEndRow: SHEET_MAX_ROW,
|
|
89
91
|
columnCount: GOOGLE_SHEETS_API_RECEIPT_HEADERS.length,
|
|
90
92
|
fromRow: receiptBandStart === undefined || receiptBandStart < 2 ? 1 : receiptBandStart,
|
|
91
93
|
rowBound: rowBounds.get(GOOGLE_SHEETS_API_RECEIPT_SHEET_NAME),
|
|
@@ -123,9 +125,10 @@ function scopedOrFullTargetRanges(route, scoped, rowBounds, calibration, evidenc
|
|
|
123
125
|
const calib = calibration ?? NO_CALIBRATION;
|
|
124
126
|
const bound = rowBounds.get(route.sheetName);
|
|
125
127
|
const fullSpan = () => planRowBands({
|
|
126
|
-
quote,
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
addressPrefix: quote,
|
|
129
|
+
firstColumn: "A",
|
|
130
|
+
lastColumn: columnLetters(lastColumn),
|
|
131
|
+
openEndRow: SHEET_MAX_ROW,
|
|
129
132
|
columnCount: lastColumn,
|
|
130
133
|
fromRow: 1,
|
|
131
134
|
rowBound: bound,
|
|
@@ -140,14 +143,14 @@ function scopedOrFullTargetRanges(route, scoped, rowBounds, calibration, evidenc
|
|
|
140
143
|
const checkProbeItem = checkProbe === undefined
|
|
141
144
|
? []
|
|
142
145
|
: [{
|
|
143
|
-
|
|
146
|
+
address: `${quote}${columnLetters(checkProbe)}1:${columnLetters(checkProbe)}1`,
|
|
144
147
|
cells: 1,
|
|
145
148
|
}];
|
|
146
149
|
if (!scoped)
|
|
147
150
|
return [...fullSpan(), ...checkProbeItem];
|
|
148
151
|
const lastLetter = columnLetters(lastColumn);
|
|
149
152
|
const headerBand = [{
|
|
150
|
-
|
|
153
|
+
address: `${quote}A1:${lastLetter}1`,
|
|
151
154
|
cells: lastColumn,
|
|
152
155
|
}];
|
|
153
156
|
const columns = [];
|
|
@@ -167,9 +170,10 @@ function scopedOrFullTargetRanges(route, scoped, rowBounds, calibration, evidenc
|
|
|
167
170
|
for (const column of new Set(columns)) {
|
|
168
171
|
const letter = columnLetters(column);
|
|
169
172
|
ranges.push(...planRowBands({
|
|
170
|
-
quote,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
+
addressPrefix: quote,
|
|
174
|
+
firstColumn: letter,
|
|
175
|
+
lastColumn: letter,
|
|
176
|
+
openEndRow: SHEET_MAX_ROW,
|
|
173
177
|
columnCount: 1,
|
|
174
178
|
fromRow: 2,
|
|
175
179
|
rowBound: bound,
|
|
@@ -236,7 +240,10 @@ async function readPreflightContextsWithCursor(engine, routes, sheets, receiptSh
|
|
|
236
240
|
if (receiptSheet !== undefined)
|
|
237
241
|
titles.push(receiptSheet.title);
|
|
238
242
|
for (const title of titles) {
|
|
239
|
-
const bound = authoritativeRowBound(sheets
|
|
243
|
+
const bound = authoritativeRowBound(sheets.map((sheet) => ({
|
|
244
|
+
title: sheet.title,
|
|
245
|
+
rowCount: sheet.gridProperties?.rowCount,
|
|
246
|
+
})), engine.rowBounds, title);
|
|
240
247
|
if (bound !== undefined)
|
|
241
248
|
rowBounds.set(title, bound);
|
|
242
249
|
}
|