hikoutei 0.3.4 → 0.3.6
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/README.ja.md +44 -21
- package/README.ko.md +43 -23
- package/README.md +49 -33
- package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmMappedTypedSheets.d.ts +3 -3
- package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmMappedTypedSheets.d.ts.map +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmMappedTypedSheets.js +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmScalarEntityRuntime.d.ts +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmScalarEntityRuntime.js +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmScalarRuntime.js +3 -3
- package/dist/adapter/persistence/providers/mikro-orm/engine/MikroOrmScalarRuntime.js.map +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPolling.d.ts +3 -3
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPolling.d.ts.map +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPolling.js +15 -15
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPolling.js.map +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingFastPath.d.ts +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingFastPath.d.ts.map +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingFastPath.js +3 -3
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingFastPath.js.map +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingInspection.d.ts +5 -5
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingInspection.d.ts.map +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingInspection.js +5 -5
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingInspection.js.map +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingPersistence.d.ts +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingPersistence.js +5 -5
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingPersistence.js.map +1 -1
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingSql.js +3 -3
- package/dist/adapter/persistence/providers/mikro-orm/observation/MikroOrmUserInputPollingSql.js.map +1 -1
- package/dist/adapter/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.d.ts +156 -0
- package/dist/adapter/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.js +1112 -0
- package/dist/adapter/sheets/providers/google-sheets-api/GoogleSheetsApiSyncProvider.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/constants.d.ts +87 -0
- package/dist/adapter/sheets/providers/google-sheets-api/constants.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/constants.js +97 -0
- package/dist/adapter/sheets/providers/google-sheets-api/constants.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/errors.d.ts +53 -0
- package/dist/adapter/sheets/providers/google-sheets-api/errors.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/errors.js +61 -0
- package/dist/adapter/sheets/providers/google-sheets-api/errors.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/index.d.ts +16 -0
- package/dist/adapter/sheets/providers/google-sheets-api/index.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/index.js +13 -0
- package/dist/adapter/sheets/providers/google-sheets-api/index.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/batchBuilder.d.ts +83 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/batchBuilder.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/batchBuilder.js +413 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/batchBuilder.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/observation.d.ts +86 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/observation.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/observation.js +439 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/observation.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/planner.d.ts +115 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/planner.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/planner.js +522 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/planner.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/postcondition.d.ts +17 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/postcondition.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/postcondition.js +99 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/postcondition.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/preflight.d.ts +242 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/preflight.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/preflight.js +707 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/preflight.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/sheetIdAllocator.d.ts +16 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/sheetIdAllocator.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/sheetIdAllocator.js +29 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/sheetIdAllocator.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/tableRead.d.ts +26 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/tableRead.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/tableRead.js +57 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/tableRead.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/valueNormalization.d.ts +102 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/valueNormalization.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/valueNormalization.js +375 -0
- package/dist/adapter/sheets/providers/google-sheets-api/model/valueNormalization.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.d.ts +168 -0
- package/dist/adapter/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.js +247 -0
- package/dist/adapter/sheets/providers/google-sheets-api/transport/googleSheetsApiTransport.js.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/transport/rateLimiter.d.ts +47 -0
- package/dist/adapter/sheets/providers/google-sheets-api/transport/rateLimiter.d.ts.map +1 -0
- package/dist/adapter/sheets/providers/google-sheets-api/transport/rateLimiter.js +60 -0
- package/dist/adapter/sheets/providers/google-sheets-api/transport/rateLimiter.js.map +1 -0
- package/dist/api/Hikoutei.d.ts +1 -1
- package/dist/api/Hikoutei.js +1 -1
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +2 -2
- package/dist/application/orm/mapping/contracts.d.ts +2 -2
- package/dist/application/orm/mapping/contracts.d.ts.map +1 -1
- package/dist/application/orm/mapping/definition.js +5 -5
- package/dist/application/orm/mapping/definition.js.map +1 -1
- package/dist/application/orm/mapping/projection.js +7 -7
- package/dist/application/orm/mapping/projection.js.map +1 -1
- package/dist/application/orm/persistence/flush/flushCoordinator.d.ts +3 -3
- package/dist/application/orm/persistence/flush/flushCoordinator.d.ts.map +1 -1
- package/dist/application/orm/persistence/flush/flushCoordinator.js +2 -2
- package/dist/application/orm/persistence/flush/flushCoordinator.js.map +1 -1
- package/dist/application/orm/persistence/projection/projectionEffects.d.ts +1 -1
- package/dist/application/orm/persistence/projection/projectionEffects.js +6 -6
- package/dist/application/orm/persistence/projection/projectionEffects.js.map +1 -1
- package/dist/application/orm/persistence/support/contracts.d.ts +2 -2
- package/dist/application/orm/persistence/support/contracts.d.ts.map +1 -1
- package/dist/application/sync/inbound/autoSystemConflictResolution.js +7 -7
- package/dist/application/sync/inbound/autoSystemConflictResolution.js.map +1 -1
- package/dist/application/sync/inbound/polling/SimpleSheetPolling.d.ts +3 -3
- package/dist/application/sync/inbound/polling/SimpleSheetPolling.d.ts.map +1 -1
- package/dist/application/sync/inbound/polling/SimpleSheetPolling.js +1 -1
- package/dist/application/sync/inbound/polling/SimpleSheetPolling.js.map +1 -1
- package/dist/application/sync/outbound/effects/AdaptiveEffectBatchController.d.ts +17 -1
- package/dist/application/sync/outbound/effects/AdaptiveEffectBatchController.d.ts.map +1 -1
- package/dist/application/sync/outbound/effects/AdaptiveEffectBatchController.js +27 -1
- package/dist/application/sync/outbound/effects/AdaptiveEffectBatchController.js.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectSupervisor.d.ts +2 -2
- package/dist/application/sync/outbound/effects/SyncEffectSupervisor.d.ts.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectSupervisor.js +26 -6
- package/dist/application/sync/outbound/effects/SyncEffectSupervisor.js.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorker.d.ts +24 -9
- package/dist/application/sync/outbound/effects/SyncEffectWorker.d.ts.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorker.js +128 -81
- package/dist/application/sync/outbound/effects/SyncEffectWorker.js.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorkerConstants.d.ts +31 -14
- package/dist/application/sync/outbound/effects/SyncEffectWorkerConstants.d.ts.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorkerConstants.js +32 -15
- package/dist/application/sync/outbound/effects/SyncEffectWorkerConstants.js.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorkerDispatch.d.ts +13 -9
- package/dist/application/sync/outbound/effects/SyncEffectWorkerDispatch.d.ts.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorkerDispatch.js +53 -37
- package/dist/application/sync/outbound/effects/SyncEffectWorkerDispatch.js.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorkerHelpers.js +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorkerHelpers.js.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorkerRouting.d.ts +29 -19
- package/dist/application/sync/outbound/effects/SyncEffectWorkerRouting.d.ts.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorkerRouting.js +59 -41
- package/dist/application/sync/outbound/effects/SyncEffectWorkerRouting.js.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorkerTiming.d.ts +4 -4
- package/dist/application/sync/outbound/effects/SyncEffectWorkerTiming.d.ts.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorkerTiming.js +3 -3
- package/dist/application/sync/outbound/effects/SyncEffectWorkerTiming.js.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorkerTransitions.d.ts +3 -3
- package/dist/application/sync/outbound/effects/SyncEffectWorkerTransitions.d.ts.map +1 -1
- package/dist/application/sync/outbound/effects/SyncEffectWorkerTransitions.js +42 -46
- package/dist/application/sync/outbound/effects/SyncEffectWorkerTransitions.js.map +1 -1
- package/dist/application/sync/outbound/projection/ProjectionEffectFactory.d.ts +8 -8
- package/dist/application/sync/outbound/projection/ProjectionEffectFactory.d.ts.map +1 -1
- package/dist/application/sync/outbound/projection/ProjectionEffectFactory.js +15 -15
- package/dist/application/sync/outbound/projection/ProjectionEffectFactory.js.map +1 -1
- package/dist/application/sync/outbound/reconciliation/ReconciliationScanner.d.ts +3 -3
- package/dist/application/sync/outbound/reconciliation/ReconciliationScanner.d.ts.map +1 -1
- package/dist/application/sync/outbound/reconciliation/ReconciliationScanner.js +10 -10
- package/dist/application/sync/outbound/reconciliation/ReconciliationScanner.js.map +1 -1
- package/dist/application/sync/service/SyncPollingSupervisor.d.ts +1 -1
- package/dist/application/sync/service/SyncPollingSupervisor.js +1 -1
- package/dist/application/sync/service/SyncServiceBootstrap.d.ts +29 -19
- package/dist/application/sync/service/SyncServiceBootstrap.d.ts.map +1 -1
- package/dist/application/sync/service/SyncServiceBootstrap.js +103 -78
- package/dist/application/sync/service/SyncServiceBootstrap.js.map +1 -1
- package/dist/application/sync/service/errors.d.ts +1 -1
- package/dist/application/sync/service/errors.js +1 -1
- package/dist/application/sync/service/errors.js.map +1 -1
- package/dist/application/sync/sheets/conflictProjection.d.ts.map +1 -0
- package/dist/application/sync/sheets/conflictProjection.js.map +1 -0
- package/dist/application/sync/{gateway → sheets}/conflictProjectionRegistration.d.ts +1 -1
- package/dist/application/sync/sheets/conflictProjectionRegistration.d.ts.map +1 -0
- package/dist/application/sync/{gateway → sheets}/conflictProjectionRegistration.js +3 -3
- package/dist/application/sync/sheets/conflictProjectionRegistration.js.map +1 -0
- package/dist/application/sync/sheets/constants.d.ts +66 -0
- package/dist/application/sync/sheets/constants.d.ts.map +1 -0
- package/dist/application/sync/{gateway → sheets}/constants.js +15 -15
- package/dist/application/sync/sheets/constants.js.map +1 -0
- package/dist/application/sync/sheets/errors.d.ts +15 -0
- package/dist/application/sync/sheets/errors.d.ts.map +1 -0
- package/dist/application/sync/sheets/errors.js +16 -0
- package/dist/application/sync/sheets/errors.js.map +1 -0
- package/dist/application/sync/{gateway/coordinator/CoordinatedSyncGateway.d.ts → sheets/mutationCoordinator/CoordinatedSheetsProvider.d.ts} +29 -28
- package/dist/application/sync/sheets/mutationCoordinator/CoordinatedSheetsProvider.d.ts.map +1 -0
- package/dist/application/sync/{gateway/coordinator/CoordinatedSyncGateway.js → sheets/mutationCoordinator/CoordinatedSheetsProvider.js} +27 -26
- package/dist/application/sync/sheets/mutationCoordinator/CoordinatedSheetsProvider.js.map +1 -0
- package/dist/application/sync/{gateway/coordinator → sheets/mutationCoordinator}/asyncMutex.d.ts +2 -3
- package/dist/application/sync/sheets/mutationCoordinator/asyncMutex.d.ts.map +1 -0
- package/dist/application/sync/sheets/mutationCoordinator/asyncMutex.js.map +1 -0
- package/dist/application/sync/{gateway/coordinator/coordinatorTelemetry.d.ts → sheets/mutationCoordinator/laneTelemetry.d.ts} +4 -4
- package/dist/application/sync/sheets/mutationCoordinator/laneTelemetry.d.ts.map +1 -0
- package/dist/application/sync/{gateway/coordinator/coordinatorTelemetry.js → sheets/mutationCoordinator/laneTelemetry.js} +5 -5
- package/dist/application/sync/sheets/mutationCoordinator/laneTelemetry.js.map +1 -0
- package/dist/application/sync/{gateway/SyncGatewayBootstrap.d.ts → sheets/sheetsProvisioning.d.ts} +14 -14
- package/dist/application/sync/sheets/sheetsProvisioning.d.ts.map +1 -0
- package/dist/application/sync/sheets/sheetsProvisioning.js +95 -0
- package/dist/application/sync/sheets/sheetsProvisioning.js.map +1 -0
- package/dist/application/sync/{gateway/syncGateway.d.ts → sheets/syncSheets.d.ts} +61 -117
- package/dist/application/sync/sheets/syncSheets.d.ts.map +1 -0
- package/dist/application/sync/sheets/syncSheets.js +144 -0
- package/dist/application/sync/sheets/syncSheets.js.map +1 -0
- package/dist/application/sync/{gateway/transportClassification.d.ts → sheets/transportOutcome.d.ts} +23 -22
- package/dist/application/sync/sheets/transportOutcome.d.ts.map +1 -0
- package/dist/application/sync/sheets/transportOutcome.js +97 -0
- package/dist/application/sync/sheets/transportOutcome.js.map +1 -0
- package/dist/application/sync/sheets/validation.d.ts +22 -0
- package/dist/application/sync/sheets/validation.d.ts.map +1 -0
- package/dist/application/sync/sheets/validation.js +79 -0
- package/dist/application/sync/sheets/validation.js.map +1 -0
- package/dist/application/sync/telemetry/syncTiming.d.ts +7 -7
- package/dist/application/sync/telemetry/syncTiming.d.ts.map +1 -1
- package/dist/application/sync/telemetry/syncTiming.js +2 -2
- package/dist/application/sync/telemetry/syncTiming.js.map +1 -1
- package/dist/domain/evaluate/contracts.d.ts +1 -1
- package/dist/domain/evaluate/contracts.js +1 -1
- package/dist/domain/model/constants.d.ts +1 -1
- package/dist/domain/model/constants.d.ts.map +1 -1
- package/dist/domain/model/types.d.ts +1 -1
- package/dist/domain/model/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/storage/index.d.ts +1 -1
- package/dist/infrastructure/storage/index.d.ts.map +1 -1
- package/dist/infrastructure/storage/index.js +1 -1
- package/dist/infrastructure/storage/index.js.map +1 -1
- package/dist/infrastructure/storage/state/observation/observationAudit.d.ts +1 -1
- package/dist/infrastructure/storage/state/observation/observationAudit.js +1 -1
- package/dist/infrastructure/storage/state/observation/observationTypes.d.ts +3 -3
- package/dist/infrastructure/storage/state/observation/observationTypes.d.ts.map +1 -1
- package/dist/infrastructure/storage/sync/outbound/effectOutbox.d.ts +13 -1
- package/dist/infrastructure/storage/sync/outbound/effectOutbox.d.ts.map +1 -1
- package/dist/infrastructure/storage/sync/outbound/effectOutbox.js +23 -2
- package/dist/infrastructure/storage/sync/outbound/effectOutbox.js.map +1 -1
- package/dist/infrastructure/storage/sync/outbound/effectOutboxContracts.d.ts +9 -3
- package/dist/infrastructure/storage/sync/outbound/effectOutboxContracts.d.ts.map +1 -1
- package/dist/infrastructure/storage/sync/outbound/effectOutboxContracts.js +7 -1
- package/dist/infrastructure/storage/sync/outbound/effectOutboxContracts.js.map +1 -1
- package/dist/infrastructure/storage/sync/outbound/effectOutboxSql.d.ts +11 -1
- package/dist/infrastructure/storage/sync/outbound/effectOutboxSql.d.ts.map +1 -1
- package/dist/infrastructure/storage/sync/outbound/effectOutboxSql.js +44 -3
- package/dist/infrastructure/storage/sync/outbound/effectOutboxSql.js.map +1 -1
- package/dist/infrastructure/storage/sync/shared/syncRegistry.d.ts +4 -4
- package/dist/infrastructure/storage/sync/shared/syncRegistry.d.ts.map +1 -1
- package/dist/infrastructure/storage/sync/shared/syncRegistry.js +4 -4
- package/dist/infrastructure/storage/sync/shared/syncRegistry.js.map +1 -1
- package/dist/shared/encoding/types.d.ts +1 -1
- package/docs/architecture.md +52 -23
- package/docs/ci.md +31 -23
- package/docs/code-guidelines.md +10 -18
- package/docs/development.md +37 -11
- package/docs/gateway-removal-inventory.md +147 -0
- package/docs/quick-start.md +36 -26
- package/docs/sync-bulk-write-benchmark.md +561 -0
- package/docs/sync-observability.md +38 -45
- package/docs/write-and-synchronization-flow.md +56 -39
- package/package.json +5 -4
- package/apps-script/gateway/Code.gs +0 -447
- package/dist/adapter/sheets/providers/apps-script-gateway/errors.d.ts +0 -43
- package/dist/adapter/sheets/providers/apps-script-gateway/errors.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/errors.js +0 -52
- package/dist/adapter/sheets/providers/apps-script-gateway/errors.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/index.d.ts +0 -24
- package/dist/adapter/sheets/providers/apps-script-gateway/index.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/index.js +0 -13
- package/dist/adapter/sheets/providers/apps-script-gateway/index.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperation.d.ts +0 -44
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperation.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperation.js +0 -181
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperation.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperationScript.d.ts +0 -3
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperationScript.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperationScript.js +0 -810
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperationScript.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/observation/observationOperation.d.ts +0 -31
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/observation/observationOperation.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/observation/observationOperation.js +0 -560
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/observation/observationOperation.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/read/tableReadOperation.d.ts +0 -12
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/read/tableReadOperation.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/read/tableReadOperation.js +0 -166
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/read/tableReadOperation.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/shared/appsScriptStableCodecSource.d.ts +0 -8
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/shared/appsScriptStableCodecSource.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/shared/appsScriptStableCodecSource.js +0 -122
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/shared/appsScriptStableCodecSource.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/batchAppendOperation.d.ts +0 -31
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/batchAppendOperation.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/batchAppendOperation.js +0 -567
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/batchAppendOperation.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/fastAppendOperation.d.ts +0 -19
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/fastAppendOperation.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/fastAppendOperation.js +0 -37
- package/dist/adapter/sheets/providers/apps-script-gateway/operations/write/fastAppendOperation.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/codeGsProtocol.d.ts +0 -51
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/codeGsProtocol.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/codeGsProtocol.js +0 -60
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/codeGsProtocol.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/constants.d.ts +0 -44
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/constants.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/constants.js +0 -40
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/constants.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/syncProtocol.d.ts +0 -12
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/syncProtocol.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/syncProtocol.js +0 -41
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/syncProtocol.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/timing.d.ts +0 -5
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/timing.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/timing.js +0 -53
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/timing.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/types.d.ts +0 -4
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/types.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/types.js +0 -2
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/types.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/validation.d.ts +0 -11
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/validation.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/validation.js +0 -36
- package/dist/adapter/sheets/providers/apps-script-gateway/protocol/validation.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationClient.d.ts +0 -68
- package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationClient.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationClient.js +0 -273
- package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationClient.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationSyncGateway.d.ts +0 -73
- package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationSyncGateway.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationSyncGateway.js +0 -363
- package/dist/adapter/sheets/providers/apps-script-gateway/transport/operationSyncGateway.js.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/validation.d.ts +0 -3
- package/dist/adapter/sheets/providers/apps-script-gateway/validation.d.ts.map +0 -1
- package/dist/adapter/sheets/providers/apps-script-gateway/validation.js +0 -10
- package/dist/adapter/sheets/providers/apps-script-gateway/validation.js.map +0 -1
- package/dist/application/sync/gateway/SyncGatewayBootstrap.d.ts.map +0 -1
- package/dist/application/sync/gateway/SyncGatewayBootstrap.js +0 -95
- package/dist/application/sync/gateway/SyncGatewayBootstrap.js.map +0 -1
- package/dist/application/sync/gateway/conflictProjection.d.ts.map +0 -1
- package/dist/application/sync/gateway/conflictProjection.js.map +0 -1
- package/dist/application/sync/gateway/conflictProjectionRegistration.d.ts.map +0 -1
- package/dist/application/sync/gateway/conflictProjectionRegistration.js.map +0 -1
- package/dist/application/sync/gateway/constants.d.ts +0 -66
- package/dist/application/sync/gateway/constants.d.ts.map +0 -1
- package/dist/application/sync/gateway/constants.js.map +0 -1
- package/dist/application/sync/gateway/coordinator/CoordinatedSyncGateway.d.ts.map +0 -1
- package/dist/application/sync/gateway/coordinator/CoordinatedSyncGateway.js.map +0 -1
- package/dist/application/sync/gateway/coordinator/asyncMutex.d.ts.map +0 -1
- package/dist/application/sync/gateway/coordinator/asyncMutex.js.map +0 -1
- package/dist/application/sync/gateway/coordinator/coordinatorTelemetry.d.ts.map +0 -1
- package/dist/application/sync/gateway/coordinator/coordinatorTelemetry.js.map +0 -1
- package/dist/application/sync/gateway/errors.d.ts +0 -15
- package/dist/application/sync/gateway/errors.d.ts.map +0 -1
- package/dist/application/sync/gateway/errors.js +0 -16
- package/dist/application/sync/gateway/errors.js.map +0 -1
- package/dist/application/sync/gateway/syncGateway.d.ts.map +0 -1
- package/dist/application/sync/gateway/syncGateway.js +0 -191
- package/dist/application/sync/gateway/syncGateway.js.map +0 -1
- package/dist/application/sync/gateway/transportClassification.d.ts.map +0 -1
- package/dist/application/sync/gateway/transportClassification.js +0 -133
- package/dist/application/sync/gateway/transportClassification.js.map +0 -1
- package/dist/application/sync/gateway/validation.d.ts +0 -22
- package/dist/application/sync/gateway/validation.d.ts.map +0 -1
- package/dist/application/sync/gateway/validation.js +0 -79
- package/dist/application/sync/gateway/validation.js.map +0 -1
- /package/dist/application/sync/{gateway → sheets}/conflictProjection.d.ts +0 -0
- /package/dist/application/sync/{gateway → sheets}/conflictProjection.js +0 -0
- /package/dist/application/sync/{gateway/coordinator → sheets/mutationCoordinator}/asyncMutex.js +0 -0
|
@@ -1,447 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Thin Sheet I/O dispatcher for the typed-sheets sync runtime.
|
|
3
|
-
*
|
|
4
|
-
* This is the v2 data plane. It deliberately contains no business logic, no
|
|
5
|
-
* compare-and-set, no receipts, and no outbox awareness. The Node worker is
|
|
6
|
-
* the sole decision maker; this gateway only executes signed, range-constrained
|
|
7
|
-
* Sheet operations that the worker already planned.
|
|
8
|
-
*
|
|
9
|
-
* This is the only supported Apps Script gateway source. The former full
|
|
10
|
-
* gateway implementation is no longer shipped with the package.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
var GATEWAY_SHEET_ID_PROPERTY_ = "TYPED_SHEETS_GATEWAY_SHEET_ID";
|
|
14
|
-
var GATEWAY_SHARED_SECRET_PROPERTY_ = "TYPED_SHEETS_GATEWAY_SHARED_SECRET";
|
|
15
|
-
var LEGACY_GATEWAY_SHEET_ID_PROPERTY_ = "TYPED_SHEETS_MVP_SHEET_ID";
|
|
16
|
-
var LEGACY_GATEWAY_SHARED_SECRET_PROPERTY_ = "TYPED_SHEETS_MVP_SHARED_SECRET";
|
|
17
|
-
var GATEWAY_MAX_CLOCK_SKEW_MS_ = 60 * 1000;
|
|
18
|
-
var GATEWAY_MAX_REQUEST_LIFETIME_MS_ = 10 * 60 * 1000;
|
|
19
|
-
var GATEWAY_LOCK_TIMEOUT_MS_ = 20 * 1000;
|
|
20
|
-
|
|
21
|
-
var SYNC_PROTOCOL_VERSION_ = "typed-sheets-sync-v1";
|
|
22
|
-
|
|
23
|
-
// Operations accepted by the v2 data plane. Each operation carries its own
|
|
24
|
-
// serialised function body plus the args that function needs. Adding a new
|
|
25
|
-
// operation requires only that the Node worker send a recognised opKind and a
|
|
26
|
-
// self-contained function string; this list is the allowlist of opKind values.
|
|
27
|
-
var SYNC_OPERATIONS_ = {
|
|
28
|
-
applyOperations: true,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/** Web-app entry point. Every useful operation must be a signed POST. */
|
|
32
|
-
function doPost(event) {
|
|
33
|
-
try {
|
|
34
|
-
return jsonOutput_(handlePost_(event));
|
|
35
|
-
} catch (error) {
|
|
36
|
-
return jsonOutput_(failure_("internal_error", safeErrorMessage_(error)));
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Rejects unauthenticated GET calls instead of exposing spreadsheet metadata. */
|
|
41
|
-
function doGet() {
|
|
42
|
-
return jsonOutput_(failure_("method_not_allowed", "Use a signed POST request."));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Paste the deployed /exec URL here, then run setupSyncGateway() from the
|
|
46
|
-
// Apps Script editor. It is never reachable through doPost().
|
|
47
|
-
var TYPED_SHEETS_GATEWAY_URL = "";
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Configures this bound spreadsheet for the sync gateway.
|
|
51
|
-
*
|
|
52
|
-
* Run this manually from the Apps Script editor after deploying the web app.
|
|
53
|
-
* It reads the deployed `/exec` URL from TYPED_SHEETS_GATEWAY_URL above,
|
|
54
|
-
* generates a shared secret only when one is absent, and logs a copyable local
|
|
55
|
-
* `.env` block. It is never reachable through doPost(), so the secret is not
|
|
56
|
-
* exposed by the public gateway.
|
|
57
|
-
*
|
|
58
|
-
* @returns {object} Local runner config.
|
|
59
|
-
*/
|
|
60
|
-
function setupSyncGateway() {
|
|
61
|
-
var config = configureSyncGateway_(TYPED_SHEETS_GATEWAY_URL);
|
|
62
|
-
Logger.log(config.localEnv);
|
|
63
|
-
return config;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Saves the allowlisted sheet ID and shared secret under a script lock so two
|
|
68
|
-
* manual setup executions cannot accidentally rotate the generated secret.
|
|
69
|
-
*/
|
|
70
|
-
function configureSyncGateway_(gatewayUrl) {
|
|
71
|
-
var normalizedGatewayUrl = requireSyncGatewayUrl_(gatewayUrl);
|
|
72
|
-
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
|
|
73
|
-
if (spreadsheet === null) {
|
|
74
|
-
throw new Error("setupSyncGateway() must run from the bound spreadsheet's Apps Script project.");
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
var sheetId = spreadsheet.getId();
|
|
78
|
-
if (!isNonEmptyString_(sheetId)) {
|
|
79
|
-
throw new Error("Could not resolve the bound disposable spreadsheet ID.");
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
var lock = LockService.getScriptLock();
|
|
83
|
-
if (!lock.tryLock(GATEWAY_LOCK_TIMEOUT_MS_)) {
|
|
84
|
-
throw new Error("Could not acquire the sync gateway setup lock.");
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
try {
|
|
88
|
-
var properties = PropertiesService.getScriptProperties();
|
|
89
|
-
var existingSecret = properties.getProperty(GATEWAY_SHARED_SECRET_PROPERTY_) ||
|
|
90
|
-
properties.getProperty(LEGACY_GATEWAY_SHARED_SECRET_PROPERTY_);
|
|
91
|
-
var sharedSecret = isNonEmptyString_(existingSecret) ? existingSecret : createSyncGatewaySharedSecret_();
|
|
92
|
-
|
|
93
|
-
properties.setProperty(GATEWAY_SHEET_ID_PROPERTY_, sheetId);
|
|
94
|
-
properties.setProperty(GATEWAY_SHARED_SECRET_PROPERTY_, sharedSecret);
|
|
95
|
-
|
|
96
|
-
return {
|
|
97
|
-
gatewayUrl: normalizedGatewayUrl,
|
|
98
|
-
sheetId: sheetId,
|
|
99
|
-
sharedSecret: sharedSecret,
|
|
100
|
-
localEnv: formatSyncGatewayLocalEnv_(normalizedGatewayUrl, sharedSecret, sheetId),
|
|
101
|
-
};
|
|
102
|
-
} finally {
|
|
103
|
-
lock.releaseLock();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/** Validates a deployed Apps Script Web App URL before it is copied locally. */
|
|
108
|
-
function requireSyncGatewayUrl_(value) {
|
|
109
|
-
if (typeof value !== "string" || value.trim() === "") {
|
|
110
|
-
throw new Error("Paste a deployed Apps Script Web App URL ending in /exec before running setupSyncGateway().");
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
var gatewayUrl = value.trim();
|
|
114
|
-
if (!/^https:\/\/script\.google\.com\/macros\/s\/[^/?#]+\/exec$/.test(gatewayUrl)) {
|
|
115
|
-
throw new Error("Sync gateway URL must be a deployed Apps Script Web App URL ending in /exec.");
|
|
116
|
-
}
|
|
117
|
-
return gatewayUrl;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/** Generates a long URL-safe secret only for the trusted editor setup path. */
|
|
121
|
-
function createSyncGatewaySharedSecret_() {
|
|
122
|
-
return Utilities.getUuid().replace(/-/g, "") + Utilities.getUuid().replace(/-/g, "");
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/** Formats the exact local environment values consumed by the Node sync runners. */
|
|
126
|
-
function formatSyncGatewayLocalEnv_(gatewayUrl, sharedSecret, sheetId) {
|
|
127
|
-
return [
|
|
128
|
-
"# Keep this untracked. The shared secret grants gateway access.",
|
|
129
|
-
"TYPED_SHEETS_GATEWAY_URL=" + JSON.stringify(gatewayUrl),
|
|
130
|
-
"TYPED_SHEETS_GATEWAY_SHARED_SECRET=" + JSON.stringify(sharedSecret),
|
|
131
|
-
"TYPED_SHEETS_GATEWAY_SHEET_ID=" + JSON.stringify(sheetId),
|
|
132
|
-
].join("\n");
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
function handlePost_(event) {
|
|
137
|
-
if (!event || !event.postData || typeof event.postData.contents !== "string") {
|
|
138
|
-
return failure_("invalid_request", "Expected a JSON POST body.");
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
var envelope;
|
|
142
|
-
try {
|
|
143
|
-
envelope = JSON.parse(event.postData.contents);
|
|
144
|
-
} catch (error) {
|
|
145
|
-
return failure_("invalid_json", "Request body is not valid JSON.");
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (!isPlainObject_(envelope) || envelope.protocolVersion !== SYNC_PROTOCOL_VERSION_) {
|
|
149
|
-
return failure_("unsupported_protocol", "Unsupported sync protocol version.");
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
var validation = validateSyncEnvelope_(envelope);
|
|
153
|
-
if (validation.failure !== null) return validation.failure;
|
|
154
|
-
|
|
155
|
-
if (envelope.operation === "applyOperations") {
|
|
156
|
-
return applyOperations_(envelope);
|
|
157
|
-
}
|
|
158
|
-
return failure_("unsupported_operation", "Sync operation is not implemented.");
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Executes one signed batch of Sheet operations.
|
|
163
|
-
*
|
|
164
|
-
* Each operation carries:
|
|
165
|
-
* - opKind: an allowlisted label (currently unused for dispatch, reserved for
|
|
166
|
-
* future per-op validation), and
|
|
167
|
-
* - fn: the function body as a string, of the form
|
|
168
|
-
* (spreadsheet, args) => result, and
|
|
169
|
-
* - args: a JSON-serialisable payload passed as the second argument.
|
|
170
|
-
*
|
|
171
|
-
* The function is evaluated in this request's global context, so it may call
|
|
172
|
-
* SpreadsheetApp/Utilities just like any other Apps Script code. It must not
|
|
173
|
-
* rely on any external closure, because only the body text crosses the wire.
|
|
174
|
-
*
|
|
175
|
-
* A single SpreadsheetApp.flush() is issued after all operations have run, so
|
|
176
|
-
* a multi-operation request applies atomically from the Sheet's perspective.
|
|
177
|
-
*/
|
|
178
|
-
function applyOperations_(envelope) {
|
|
179
|
-
var payload = envelope.payload;
|
|
180
|
-
if (!isPlainObject_(payload) || !Array.isArray(payload.operations)) {
|
|
181
|
-
return failure_("invalid_payload", "applyOperations payload must contain an operations array.");
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
var spreadsheet;
|
|
185
|
-
try {
|
|
186
|
-
spreadsheet = SpreadsheetApp.openById(envelope.sheetId);
|
|
187
|
-
} catch (error) {
|
|
188
|
-
return failure_("sheet_open_failed", "Configured sync spreadsheet could not be opened.");
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
var results = [];
|
|
192
|
-
for (var index = 0; index < payload.operations.length; index += 1) {
|
|
193
|
-
var operation = payload.operations[index];
|
|
194
|
-
try {
|
|
195
|
-
var operationStartedAt = Date.now();
|
|
196
|
-
var operationResult = runOneOperation_(spreadsheet, operation);
|
|
197
|
-
appendGatewayTimingPhase_(operationResult, "dispatcher_eval", Date.now() - operationStartedAt);
|
|
198
|
-
results.push(operationResult);
|
|
199
|
-
} catch (error) {
|
|
200
|
-
// Stop at the first failing operation so the worker can retry the whole
|
|
201
|
-
// signed batch idempotently. Partial results are returned for diagnosis.
|
|
202
|
-
return failure_("operation_failed", "Operation " + index + " failed: " + safeErrorMessage_(error));
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
var flushStartedAt = Date.now();
|
|
207
|
-
SpreadsheetApp.flush();
|
|
208
|
-
var flushDurationMs = Date.now() - flushStartedAt;
|
|
209
|
-
results.forEach(function (result) {
|
|
210
|
-
appendGatewayTimingPhase_(result, "dispatcher_flush", flushDurationMs);
|
|
211
|
-
});
|
|
212
|
-
return success_({ results: results });
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/** Adds dispatcher timing without requiring older dynamic operations to know the contract. */
|
|
216
|
-
function appendGatewayTimingPhase_(result, phase, durationMs) {
|
|
217
|
-
if (!isPlainObject_(result)) return;
|
|
218
|
-
if (!isPlainObject_(result.timing)) {
|
|
219
|
-
result.timing = {
|
|
220
|
-
operationKinds: [],
|
|
221
|
-
operationCounts: { append: 0, update: 0, delete: 0 },
|
|
222
|
-
durationMs: 0,
|
|
223
|
-
phases: [],
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
if (!Array.isArray(result.timing.phases)) result.timing.phases = [];
|
|
227
|
-
result.timing.phases.push({ phase: phase, durationMs: durationMs });
|
|
228
|
-
result.timing.durationMs = Number(result.timing.durationMs) + durationMs;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/** Restores one operation function from its serialised body and runs it. */
|
|
232
|
-
function runOneOperation_(spreadsheet, operation) {
|
|
233
|
-
if (!isPlainObject_(operation) || typeof operation.fn !== "string" || operation.fn.length === 0) {
|
|
234
|
-
throw new Error("operation must be an object with a non-empty fn string");
|
|
235
|
-
}
|
|
236
|
-
// The function body is restored in this request scope. Eval is safe here
|
|
237
|
-
// because the enclosing envelope was HMAC-signed; an attacker who cannot
|
|
238
|
-
// sign requests cannot inject code.
|
|
239
|
-
var fn;
|
|
240
|
-
try {
|
|
241
|
-
fn = eval("(" + operation.fn + ")");
|
|
242
|
-
} catch (error) {
|
|
243
|
-
throw new Error("operation fn could not be restored: " + safeErrorMessage_(error));
|
|
244
|
-
}
|
|
245
|
-
if (typeof fn !== "function") {
|
|
246
|
-
throw new Error("operation fn did not evaluate to a function");
|
|
247
|
-
}
|
|
248
|
-
return fn(spreadsheet, operation.args);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// ---------------------------------------------------------------------------
|
|
252
|
-
// Envelope validation (preserved from v1 so the trust boundary is unchanged)
|
|
253
|
-
// ---------------------------------------------------------------------------
|
|
254
|
-
|
|
255
|
-
/** Validates the sync envelope and resolves the configured spreadsheet id. */
|
|
256
|
-
function validateSyncEnvelope_(envelope) {
|
|
257
|
-
if (!isPlainObject_(envelope)) {
|
|
258
|
-
return { failure: failure_("invalid_envelope", "Envelope must be a JSON object.") };
|
|
259
|
-
}
|
|
260
|
-
if (envelope.protocolVersion !== SYNC_PROTOCOL_VERSION_) {
|
|
261
|
-
return { failure: failure_("unsupported_protocol", "Unsupported sync protocol version.") };
|
|
262
|
-
}
|
|
263
|
-
if (!isNonEmptyString_(envelope.requestId) || !/^[A-Za-z0-9._:-]{8,128}$/.test(envelope.requestId)) {
|
|
264
|
-
return { failure: failure_("invalid_request_id", "Request ID must be 8-128 URL-safe characters.") };
|
|
265
|
-
}
|
|
266
|
-
if (!isNonEmptyString_(envelope.operation) || !SYNC_OPERATIONS_[envelope.operation]) {
|
|
267
|
-
return { failure: failure_("unsupported_operation", "Operation is not allowlisted.") };
|
|
268
|
-
}
|
|
269
|
-
if (!isNonEmptyString_(envelope.keyId) || !isNonEmptyString_(envelope.sheetId) ||
|
|
270
|
-
!isNonEmptyString_(envelope.actorId) || !isNonEmptyString_(envelope.bodyHash) ||
|
|
271
|
-
!isNonEmptyString_(envelope.signature)) {
|
|
272
|
-
return { failure: failure_("invalid_envelope", "Sync envelope is missing an authenticated field.") };
|
|
273
|
-
}
|
|
274
|
-
if (!isPositiveSafeInteger_(envelope.issuedAt) || !isPositiveSafeInteger_(envelope.expiresAt)) {
|
|
275
|
-
return { failure: failure_("invalid_time", "issuedAt and expiresAt must be positive epoch milliseconds.") };
|
|
276
|
-
}
|
|
277
|
-
var now = Date.now();
|
|
278
|
-
if (envelope.issuedAt > now + GATEWAY_MAX_CLOCK_SKEW_MS_ || envelope.expiresAt < now ||
|
|
279
|
-
envelope.expiresAt <= envelope.issuedAt ||
|
|
280
|
-
envelope.expiresAt - envelope.issuedAt > GATEWAY_MAX_REQUEST_LIFETIME_MS_) {
|
|
281
|
-
return { failure: failure_("invalid_expiry", "Sync envelope is expired or outside the allowed lifetime.") };
|
|
282
|
-
}
|
|
283
|
-
var gateway = readGatewayConfiguration_();
|
|
284
|
-
if (gateway === null) {
|
|
285
|
-
return { failure: failure_("gateway_not_configured", "Required Script Properties are not configured.") };
|
|
286
|
-
}
|
|
287
|
-
if (gateway.sheetId !== envelope.sheetId) {
|
|
288
|
-
return { failure: failure_("sheet_not_allowlisted", "Envelope sheetId is not the configured spreadsheet.") };
|
|
289
|
-
}
|
|
290
|
-
if (envelope.keyId !== "typed-sheets-shared-secret-v1") {
|
|
291
|
-
return { failure: failure_("unknown_key", "Sync keyId is not configured.") };
|
|
292
|
-
}
|
|
293
|
-
var actualBodyHash;
|
|
294
|
-
try {
|
|
295
|
-
actualBodyHash = sha256Hex_(canonicalJson_(envelope.payload));
|
|
296
|
-
} catch (error) {
|
|
297
|
-
return { failure: failure_("invalid_payload", safeErrorMessage_(error)) };
|
|
298
|
-
}
|
|
299
|
-
if (!constantTimeEquals_(actualBodyHash, envelope.bodyHash)) {
|
|
300
|
-
return { failure: failure_("body_hash_mismatch", "Payload does not match the signed body hash.") };
|
|
301
|
-
}
|
|
302
|
-
if (!constantTimeEquals_(
|
|
303
|
-
hmacSha256Base64Url_(syncSigningInput_(envelope), gateway.sharedSecret),
|
|
304
|
-
envelope.signature,
|
|
305
|
-
)) {
|
|
306
|
-
return { failure: failure_("invalid_signature", "Sync envelope signature could not be verified.") };
|
|
307
|
-
}
|
|
308
|
-
return { failure: null };
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
/** HMAC material for typed-sheets-sync-v1; actor/sheet/key are authenticated too. */
|
|
312
|
-
function syncSigningInput_(envelope) {
|
|
313
|
-
return [
|
|
314
|
-
envelope.protocolVersion,
|
|
315
|
-
envelope.requestId,
|
|
316
|
-
envelope.operation,
|
|
317
|
-
envelope.keyId,
|
|
318
|
-
String(envelope.issuedAt),
|
|
319
|
-
String(envelope.expiresAt),
|
|
320
|
-
envelope.sheetId,
|
|
321
|
-
envelope.actorId,
|
|
322
|
-
envelope.bodyHash,
|
|
323
|
-
].join("\n");
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/** Reads the configured gateway identity, accepting one prior property namespace during migration. */
|
|
327
|
-
function readGatewayConfiguration_() {
|
|
328
|
-
var properties = PropertiesService.getScriptProperties();
|
|
329
|
-
var sheetId = properties.getProperty(GATEWAY_SHEET_ID_PROPERTY_) ||
|
|
330
|
-
properties.getProperty(LEGACY_GATEWAY_SHEET_ID_PROPERTY_);
|
|
331
|
-
var sharedSecret = properties.getProperty(GATEWAY_SHARED_SECRET_PROPERTY_) ||
|
|
332
|
-
properties.getProperty(LEGACY_GATEWAY_SHARED_SECRET_PROPERTY_);
|
|
333
|
-
if (!isNonEmptyString_(sheetId) || !isNonEmptyString_(sharedSecret)) return null;
|
|
334
|
-
return { sheetId: sheetId, sharedSecret: sharedSecret };
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
// ---------------------------------------------------------------------------
|
|
338
|
-
// Shared encoding / hashing helpers (preserved from v1)
|
|
339
|
-
// ---------------------------------------------------------------------------
|
|
340
|
-
|
|
341
|
-
function canonicalJson_(value, ancestors) {
|
|
342
|
-
ancestors = ancestors || [];
|
|
343
|
-
if (value === null) return "null";
|
|
344
|
-
if (value === true) return "true";
|
|
345
|
-
if (value === false) return "false";
|
|
346
|
-
if (typeof value === "string") return JSON.stringify(value);
|
|
347
|
-
if (typeof value === "number") {
|
|
348
|
-
if (!isFinite(value)) throw new Error("Sync payload numbers must be finite");
|
|
349
|
-
return (value === 0 ? "0" : String(value)).replace(/e\+/, "e").replace(/e(-?)0+(\d+)/, "e$1$2");
|
|
350
|
-
}
|
|
351
|
-
if (Array.isArray(value)) {
|
|
352
|
-
if (!isDenseArray_(value)) throw new Error("Sync payload arrays must be dense");
|
|
353
|
-
enterCanonicalContainer_(value, ancestors);
|
|
354
|
-
try {
|
|
355
|
-
return "[" + value.map(function (item) {
|
|
356
|
-
return canonicalJson_(item, ancestors);
|
|
357
|
-
}).join(",") + "]";
|
|
358
|
-
} finally {
|
|
359
|
-
leaveCanonicalContainer_(value, ancestors);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
if (isPlainObject_(value)) {
|
|
363
|
-
enterCanonicalContainer_(value, ancestors);
|
|
364
|
-
try {
|
|
365
|
-
return "{" + Object.keys(value).sort().map(function (key) {
|
|
366
|
-
return JSON.stringify(key) + ":" + canonicalJson_(value[key], ancestors);
|
|
367
|
-
}).join(",") + "}";
|
|
368
|
-
} finally {
|
|
369
|
-
leaveCanonicalContainer_(value, ancestors);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
throw new Error("Sync payload has unsupported value type");
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
function isDenseArray_(value) {
|
|
376
|
-
for (var index = 0; index < value.length; index += 1) {
|
|
377
|
-
if (!Object.prototype.hasOwnProperty.call(value, index)) return false;
|
|
378
|
-
}
|
|
379
|
-
return true;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
function enterCanonicalContainer_(value, ancestors) {
|
|
383
|
-
if (ancestors.indexOf(value) !== -1) {
|
|
384
|
-
throw new Error("Sync payload cannot contain cycles");
|
|
385
|
-
}
|
|
386
|
-
ancestors.push(value);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
function leaveCanonicalContainer_(value, ancestors) {
|
|
390
|
-
var index = ancestors.lastIndexOf(value);
|
|
391
|
-
if (index !== -1) ancestors.splice(index, 1);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
function sha256Hex_(value) {
|
|
395
|
-
return Utilities.computeDigest(Utilities.DigestAlgorithm.SHA_256, value, Utilities.Charset.UTF_8)
|
|
396
|
-
.map(function (byte) {
|
|
397
|
-
var unsigned = byte < 0 ? byte + 256 : byte;
|
|
398
|
-
return ("0" + unsigned.toString(16)).slice(-2);
|
|
399
|
-
})
|
|
400
|
-
.join("");
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
function hmacSha256Base64Url_(value, secret) {
|
|
404
|
-
return Utilities.base64EncodeWebSafe(Utilities.computeHmacSha256Signature(value, secret)).replace(/=+$/, "");
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
function constantTimeEquals_(left, right) {
|
|
408
|
-
if (typeof left !== "string" || typeof right !== "string") return false;
|
|
409
|
-
var maxLength = Math.max(left.length, right.length);
|
|
410
|
-
var difference = left.length ^ right.length;
|
|
411
|
-
for (var index = 0; index < maxLength; index += 1) {
|
|
412
|
-
difference |= (left.charCodeAt(index) || 0) ^ (right.charCodeAt(index) || 0);
|
|
413
|
-
}
|
|
414
|
-
return difference === 0;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
function isPlainObject_(value) {
|
|
418
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
419
|
-
var prototype = Object.getPrototypeOf(value);
|
|
420
|
-
return prototype === Object.prototype || prototype === null;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
function isNonEmptyString_(value) {
|
|
424
|
-
return typeof value === "string" && value.length > 0;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
function isPositiveSafeInteger_(value) {
|
|
428
|
-
return typeof value === "number" && isFinite(value) && Math.floor(value) === value &&
|
|
429
|
-
value > 0 && value <= Number.MAX_SAFE_INTEGER;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
function success_(result) {
|
|
433
|
-
return { ok: true, result: result };
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
function failure_(code, message) {
|
|
437
|
-
return { ok: false, error: { code: code, message: message } };
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
function jsonOutput_(value) {
|
|
441
|
-
return ContentService.createTextOutput(JSON.stringify(value)).setMimeType(ContentService.MimeType.JSON);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
function safeErrorMessage_(error) {
|
|
445
|
-
var message = error && error.message ? String(error.message) : "Unexpected gateway failure.";
|
|
446
|
-
return message.replace(/[\r\n]+/g, " ").slice(0, 500);
|
|
447
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { CoreErrorException } from "../../../../domain/errors/index.js";
|
|
2
|
-
import type { Presence } from "../../../../shared/state/index.js";
|
|
3
|
-
/** Stable error categories emitted by the signed gateway protocol. */
|
|
4
|
-
export declare const SYNC_GATEWAY_PROTOCOL_ERROR_CODES: {
|
|
5
|
-
readonly INVALID_OPERATION: "invalid_sync_gateway_operation";
|
|
6
|
-
readonly INVALID_SECRET: "invalid_sync_gateway_secret";
|
|
7
|
-
readonly INVALID_ISSUED_AT: "invalid_sync_gateway_issued_at";
|
|
8
|
-
readonly INVALID_EXPIRY: "invalid_sync_gateway_expiry";
|
|
9
|
-
readonly INVALID_SHEET_ID: "invalid_sync_gateway_sheet_id";
|
|
10
|
-
readonly INVALID_ACTOR_ID: "invalid_sync_gateway_actor_id";
|
|
11
|
-
readonly INVALID_KEY_ID: "invalid_sync_gateway_key_id";
|
|
12
|
-
readonly INVALID_REQUEST_ID: "invalid_sync_gateway_request_id";
|
|
13
|
-
readonly INVALID_CLIENT_OPTIONS: "invalid_sync_gateway_client_options";
|
|
14
|
-
readonly INVALID_OPERATION_SOURCE: "invalid_sync_gateway_operation_source";
|
|
15
|
-
readonly INVALID_JSON_VALUE: "invalid_sync_gateway_json_value";
|
|
16
|
-
readonly NON_FINITE_NUMBER: "non_finite_sync_gateway_number";
|
|
17
|
-
};
|
|
18
|
-
export type SyncGatewayProtocolErrorCode = (typeof SYNC_GATEWAY_PROTOCOL_ERROR_CODES)[keyof typeof SYNC_GATEWAY_PROTOCOL_ERROR_CODES];
|
|
19
|
-
/** Structured error for invalid protocol inputs and payload values. */
|
|
20
|
-
export declare class SyncGatewayProtocolError extends CoreErrorException<"adapter.sync_gateway", SyncGatewayProtocolErrorCode> {
|
|
21
|
-
constructor(code: SyncGatewayProtocolErrorCode, message: string);
|
|
22
|
-
}
|
|
23
|
-
/** Stable errors emitted by the Node-side Apps Script transport client. */
|
|
24
|
-
export declare const SYNC_GATEWAY_CLIENT_ERROR_CODES: {
|
|
25
|
-
readonly HTTP_ERROR: "sync_gateway_http_error";
|
|
26
|
-
readonly INVALID_RESPONSE: "invalid_sync_gateway_response";
|
|
27
|
-
readonly NETWORK_ERROR: "sync_gateway_network_error";
|
|
28
|
-
readonly INVALID_REDIRECT: "sync_gateway_invalid_redirect";
|
|
29
|
-
readonly REMOTE_ERROR: "sync_gateway_remote_error";
|
|
30
|
-
readonly TIMEOUT: "sync_gateway_timeout";
|
|
31
|
-
};
|
|
32
|
-
export type SyncGatewayClientErrorCode = (typeof SYNC_GATEWAY_CLIENT_ERROR_CODES)[keyof typeof SYNC_GATEWAY_CLIENT_ERROR_CODES];
|
|
33
|
-
/** Structured transport error with explicit HTTP-status and remote-code presence. */
|
|
34
|
-
export declare class AppsScriptSyncGatewayError extends CoreErrorException<"adapter.sync_gateway", SyncGatewayClientErrorCode> {
|
|
35
|
-
readonly status: Presence<number>;
|
|
36
|
-
readonly remoteCode: Presence<string>;
|
|
37
|
-
constructor(code: SyncGatewayClientErrorCode, message: string, status: Presence<number>, remoteCode?: Presence<string>);
|
|
38
|
-
}
|
|
39
|
-
/** Throws the shared contract error used when an operation request is invalid. */
|
|
40
|
-
export declare function invalidOperationRequest(operationLabel: string, message: string): never;
|
|
41
|
-
/** Throws the shared contract error used when an operation response is invalid. */
|
|
42
|
-
export declare function invalidOperationResponse(operationLabel: string, message: string): never;
|
|
43
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../src/adapter/s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ErrorException } from "../../../../domain/errors/index.js";
|
|
2
|
-
import { PRESENCE_KINDS } from "../../../../shared/state/index.js";
|
|
3
|
-
import { SYNC_GATEWAY_ERROR_CODES, SyncGatewayContractError, } from "../../../../application/sync/gateway/errors.js";
|
|
4
|
-
/** Stable error categories emitted by the signed gateway protocol. */
|
|
5
|
-
export const SYNC_GATEWAY_PROTOCOL_ERROR_CODES = {
|
|
6
|
-
INVALID_OPERATION: "invalid_sync_gateway_operation",
|
|
7
|
-
INVALID_SECRET: "invalid_sync_gateway_secret",
|
|
8
|
-
INVALID_ISSUED_AT: "invalid_sync_gateway_issued_at",
|
|
9
|
-
INVALID_EXPIRY: "invalid_sync_gateway_expiry",
|
|
10
|
-
INVALID_SHEET_ID: "invalid_sync_gateway_sheet_id",
|
|
11
|
-
INVALID_ACTOR_ID: "invalid_sync_gateway_actor_id",
|
|
12
|
-
INVALID_KEY_ID: "invalid_sync_gateway_key_id",
|
|
13
|
-
INVALID_REQUEST_ID: "invalid_sync_gateway_request_id",
|
|
14
|
-
INVALID_CLIENT_OPTIONS: "invalid_sync_gateway_client_options",
|
|
15
|
-
INVALID_OPERATION_SOURCE: "invalid_sync_gateway_operation_source",
|
|
16
|
-
INVALID_JSON_VALUE: "invalid_sync_gateway_json_value",
|
|
17
|
-
NON_FINITE_NUMBER: "non_finite_sync_gateway_number",
|
|
18
|
-
};
|
|
19
|
-
/** Structured error for invalid protocol inputs and payload values. */
|
|
20
|
-
export class SyncGatewayProtocolError extends CoreErrorException {
|
|
21
|
-
constructor(code, message) {
|
|
22
|
-
super("adapter.sync_gateway", code, message);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
/** Stable errors emitted by the Node-side Apps Script transport client. */
|
|
26
|
-
export const SYNC_GATEWAY_CLIENT_ERROR_CODES = {
|
|
27
|
-
HTTP_ERROR: "sync_gateway_http_error",
|
|
28
|
-
INVALID_RESPONSE: "invalid_sync_gateway_response",
|
|
29
|
-
NETWORK_ERROR: "sync_gateway_network_error",
|
|
30
|
-
INVALID_REDIRECT: "sync_gateway_invalid_redirect",
|
|
31
|
-
REMOTE_ERROR: "sync_gateway_remote_error",
|
|
32
|
-
TIMEOUT: "sync_gateway_timeout",
|
|
33
|
-
};
|
|
34
|
-
/** Structured transport error with explicit HTTP-status and remote-code presence. */
|
|
35
|
-
export class AppsScriptSyncGatewayError extends CoreErrorException {
|
|
36
|
-
status;
|
|
37
|
-
remoteCode;
|
|
38
|
-
constructor(code, message, status, remoteCode = { kind: PRESENCE_KINDS.ABSENT }) {
|
|
39
|
-
super("adapter.sync_gateway", code, message);
|
|
40
|
-
this.status = status;
|
|
41
|
-
this.remoteCode = remoteCode;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/** Throws the shared contract error used when an operation request is invalid. */
|
|
45
|
-
export function invalidOperationRequest(operationLabel, message) {
|
|
46
|
-
throw new SyncGatewayContractError(SYNC_GATEWAY_ERROR_CODES.INVALID_EFFECT_PAYLOAD, `${operationLabel} request is invalid: ${message}`);
|
|
47
|
-
}
|
|
48
|
-
/** Throws the shared contract error used when an operation response is invalid. */
|
|
49
|
-
export function invalidOperationResponse(operationLabel, message) {
|
|
50
|
-
throw new SyncGatewayContractError(SYNC_GATEWAY_ERROR_CODES.INVALID_GATEWAY_RESPONSE, `${operationLabel} response is invalid: ${message}`);
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../src/adapter/sheets/providers/apps-script-gateway/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,gDAAgD,CAAC;AAExD,sEAAsE;AACtE,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,iBAA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,GAAG,cAAc,wBAAwB,OAAO,EAAE,CACnD,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,wBAAwB,CACtC,cAAsB,EACtB,OAAe;IAEf,MAAM,IAAI,wBAAwB,CAChC,wBAAwB,CAAC,wBAAwB,EACjD,GAAG,cAAc,yBAAyB,OAAO,EAAE,CACpD,CAAC;AACJ,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** Signed adapter tools for the registry-bound Apps Script sync gateway. */
|
|
2
|
-
export { APPS_SCRIPT_OPERATION_NAMES, } from "./protocol/constants.js";
|
|
3
|
-
export type { AppsScriptOperationName } from "./protocol/constants.js";
|
|
4
|
-
export { canonicalSyncJson, syncSha256Hex, } from "./protocol/syncProtocol.js";
|
|
5
|
-
export type { SyncJsonValue, } from "./protocol/syncProtocol.js";
|
|
6
|
-
export { AppsScriptSyncGatewayError, SYNC_GATEWAY_CLIENT_ERROR_CODES, } from "./errors.js";
|
|
7
|
-
export type { SyncGatewayClientErrorCode } from "./errors.js";
|
|
8
|
-
export { APPS_SCRIPT_OPERATION_PROTOCOL_VERSION, appsScriptOperationSigningInput, signAppsScriptOperationEnvelope, createAppsScriptOperationEnvelope, } from "./protocol/codeGsProtocol.js";
|
|
9
|
-
export type { AppsScriptOperationWire, AppsScriptOperationPayload, AppsScriptOperationSigningFields, AppsScriptOperationEnvelope, CreateAppsScriptOperationEnvelopeOptions, } from "./protocol/codeGsProtocol.js";
|
|
10
|
-
export { AppsScriptOperationClient } from "./transport/operationClient.js";
|
|
11
|
-
export { createFastAppendRowsOperation } from "./operations/write/fastAppendOperation.js";
|
|
12
|
-
export { createBatchAppendRowsOperation } from "./operations/write/batchAppendOperation.js";
|
|
13
|
-
export { createReadTableRowsOperation } from "./operations/read/tableReadOperation.js";
|
|
14
|
-
export { createApplyEffectsOperation, createReadEffectPostconditionOperation, createReadEffectPostconditionsOperation, } from "./operations/effect/effectOperation.js";
|
|
15
|
-
export { createEnsureRowAnchorsOperation, createObserveSnapshotOperation, createReadSnapshotOperation, } from "./operations/observation/observationOperation.js";
|
|
16
|
-
export { AppsScriptOperationSyncGateway } from "./transport/operationSyncGateway.js";
|
|
17
|
-
export type { AppsScriptOperationDefinition, AnyAppsScriptOperationDefinition, AppsScriptOperationGateway, AppsScriptOperationResult, AppsScriptOperationResults, AppsScriptOperationClientOptions, AppsScriptOperationRequestEvent, } from "./transport/operationClient.js";
|
|
18
|
-
export type { AppsScriptFastAppendOperationArgs, AppsScriptFastAppendOperationRequest, AppsScriptFastAppendOperation, } from "./operations/write/fastAppendOperation.js";
|
|
19
|
-
export type { AppsScriptBatchAppendOperationArgs, AppsScriptBatchAppendOperation, } from "./operations/write/batchAppendOperation.js";
|
|
20
|
-
export type { AppsScriptApplyEffectsOperationArgs, AppsScriptApplyEffectsOperationRequest, AppsScriptReadEffectPostconditionOperationArgs, AppsScriptReadEffectPostconditionsOperationArgs, } from "./operations/effect/effectOperation.js";
|
|
21
|
-
export type { AppsScriptEnsureRowAnchorsOperationArgs, AppsScriptObserveSnapshotOperationArgs, AppsScriptReadSnapshotOperationArgs, } from "./operations/observation/observationOperation.js";
|
|
22
|
-
export type { AppsScriptReadTableRowsRequest, } from "./operations/read/tableReadOperation.js";
|
|
23
|
-
export type { AppsScriptOperationProjectionStatus, AppsScriptOperationSyncGatewayOptions, } from "./transport/operationSyncGateway.js";
|
|
24
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/adapter/sheets/providers/apps-script-gateway/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,EACL,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EACL,iBAAiB,EACjB,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,aAAa,GACd,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AM,kDAAkD,CAAC;AAC1D,YAAY,EACV,8BAA8B,GAC/B,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACV,mCAAmC,EACnC,qCAAqC,GACtC,MAAM,qCAAqC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/** Signed adapter tools for the registry-bound Apps Script sync gateway. */
|
|
2
|
-
export { APPS_SCRIPT_OPERATION_NAMES, } from "./protocol/constants.js";
|
|
3
|
-
export { canonicalSyncJson, syncSha256Hex, } from "./protocol/syncProtocol.js";
|
|
4
|
-
export { AppsScriptSyncGatewayError, SYNC_GATEWAY_CLIENT_ERROR_CODES, } from "./errors.js";
|
|
5
|
-
export { APPS_SCRIPT_OPERATION_PROTOCOL_VERSION, appsScriptOperationSigningInput, signAppsScriptOperationEnvelope, createAppsScriptOperationEnvelope, } from "./protocol/codeGsProtocol.js";
|
|
6
|
-
export { AppsScriptOperationClient } from "./transport/operationClient.js";
|
|
7
|
-
export { createFastAppendRowsOperation } from "./operations/write/fastAppendOperation.js";
|
|
8
|
-
export { createBatchAppendRowsOperation } from "./operations/write/batchAppendOperation.js";
|
|
9
|
-
export { createReadTableRowsOperation } from "./operations/read/tableReadOperation.js";
|
|
10
|
-
export { createApplyEffectsOperation, createReadEffectPostconditionOperation, createReadEffectPostconditionsOperation, } from "./operations/effect/effectOperation.js";
|
|
11
|
-
export { createEnsureRowAnchorsOperation, createObserveSnapshotOperation, createReadSnapshotOperation, } from "./operations/observation/observationOperation.js";
|
|
12
|
-
export { AppsScriptOperationSyncGateway } from "./transport/operationSyncGateway.js";
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/adapter/sheets/providers/apps-script-gateway/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,EACL,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,iBAAiB,EACjB,aAAa,GACd,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,sCAAsC,EACtC,+BAA+B,EAC/B,+BAA+B,EAC/B,iCAAiC,GAClC,MAAM,8BAA8B,CAAC;AAQtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AACvF,OAAO,EACL,2BAA2B,EAC3B,sCAAsC,EACtC,uCAAuC,GACxC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC"}
|
package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperation.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/** Thin-Gateway operations for regular projection effects and recovery reads. */
|
|
2
|
-
import type { ApplySyncEffectsRequest, ApplySyncEffectsResult, SyncEffectPostcondition, SyncGatewayAuthority, SyncGatewayEffect, SyncGatewayEffectPostconditionResult } from "../../../../../../application/sync/gateway/syncGateway.js";
|
|
3
|
-
import type { AppsScriptOperationDefinition } from "../../transport/operationClient.js";
|
|
4
|
-
declare const EFFECT_OPERATION_MODES: {
|
|
5
|
-
readonly APPLY: "applyEffects";
|
|
6
|
-
readonly READ_ONE: "readEffectPostcondition";
|
|
7
|
-
readonly READ_BATCH: "readEffectPostconditions";
|
|
8
|
-
};
|
|
9
|
-
interface EffectOperationRouteOptions {
|
|
10
|
-
readonly identityField?: string;
|
|
11
|
-
readonly checkboxHeaders?: readonly string[];
|
|
12
|
-
}
|
|
13
|
-
export type AppsScriptApplyEffectsOperationRequest = ApplySyncEffectsRequest & EffectOperationRouteOptions;
|
|
14
|
-
export type AppsScriptApplyEffectsOperationArgs = {
|
|
15
|
-
readonly mode: typeof EFFECT_OPERATION_MODES.APPLY;
|
|
16
|
-
} & AppsScriptApplyEffectsOperationRequest;
|
|
17
|
-
export type AppsScriptReadEffectPostconditionOperationArgs = {
|
|
18
|
-
readonly mode: typeof EFFECT_OPERATION_MODES.READ_ONE;
|
|
19
|
-
readonly physicalSheetId: string;
|
|
20
|
-
readonly sheetName: string;
|
|
21
|
-
readonly registeredRange: string;
|
|
22
|
-
readonly projection: ApplySyncEffectsRequest["projection"];
|
|
23
|
-
readonly schemaVersion: number;
|
|
24
|
-
readonly authority?: SyncGatewayAuthority;
|
|
25
|
-
readonly effect: SyncGatewayEffect;
|
|
26
|
-
} & EffectOperationRouteOptions;
|
|
27
|
-
export type AppsScriptReadEffectPostconditionsOperationArgs = {
|
|
28
|
-
readonly mode: typeof EFFECT_OPERATION_MODES.READ_BATCH;
|
|
29
|
-
readonly physicalSheetId: string;
|
|
30
|
-
readonly sheetName: string;
|
|
31
|
-
readonly registeredRange: string;
|
|
32
|
-
readonly projection: ApplySyncEffectsRequest["projection"];
|
|
33
|
-
readonly schemaVersion: number;
|
|
34
|
-
readonly authority?: SyncGatewayAuthority;
|
|
35
|
-
readonly effects: readonly SyncGatewayEffect[];
|
|
36
|
-
} & EffectOperationRouteOptions;
|
|
37
|
-
/** Builds the regular update/delete operation executed by the thin Gateway. */
|
|
38
|
-
export declare function createApplyEffectsOperation(request: AppsScriptApplyEffectsOperationRequest): AppsScriptOperationDefinition<AppsScriptApplyEffectsOperationArgs, ApplySyncEffectsResult>;
|
|
39
|
-
/** Builds the single-effect response-loss probe. */
|
|
40
|
-
export declare function createReadEffectPostconditionOperation(request: Omit<AppsScriptReadEffectPostconditionOperationArgs, "mode">): AppsScriptOperationDefinition<AppsScriptReadEffectPostconditionOperationArgs, SyncEffectPostcondition>;
|
|
41
|
-
/** Builds the batched response-loss probe used by the worker. */
|
|
42
|
-
export declare function createReadEffectPostconditionsOperation(request: Omit<AppsScriptReadEffectPostconditionsOperationArgs, "mode">): AppsScriptOperationDefinition<AppsScriptReadEffectPostconditionsOperationArgs, readonly SyncGatewayEffectPostconditionResult[]>;
|
|
43
|
-
export {};
|
|
44
|
-
//# sourceMappingURL=effectOperation.d.ts.map
|
package/dist/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperation.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"effectOperation.d.ts","sourceRoot":"","sources":["../../../../../../../src/adapter/sheets/providers/apps-script-gateway/operations/effect/effectOperation.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAEjF,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,oCAAoC,EAErC,MAAM,2DAA2D,CAAC;AAgBnE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AASxF,QAAA,MAAM,sBAAsB;;;;CAIlB,CAAC;AAEX,UAAU,2BAA2B;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C;AAED,MAAM,MAAM,sCAAsC,GAAG,uBAAuB,GAC1E,2BAA2B,CAAC;AAE9B,MAAM,MAAM,mCAAmC,GAAG;IAChD,QAAQ,CAAC,IAAI,EAAE,OAAO,sBAAsB,CAAC,KAAK,CAAC;CACpD,GAAG,sCAAsC,CAAC;AAE3C,MAAM,MAAM,8CAA8C,GAAG;IAC3D,QAAQ,CAAC,IAAI,EAAE,OAAO,sBAAsB,CAAC,QAAQ,CAAC;IACtD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC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