@tiangong-lca/cli 0.1.1 → 0.1.2
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.md +26 -6
- package/dist/src/batch.d.ts +6 -0
- package/dist/src/batch.js +6 -0
- package/dist/src/batch.js.map +1 -0
- package/dist/src/cli.d.ts +161 -0
- package/dist/src/command-spec.d.ts +90 -0
- package/dist/src/command-spec.js +400 -0
- package/dist/src/command-spec.js.map +1 -0
- package/dist/src/lib/artifacts.d.ts +9 -0
- package/dist/src/lib/auth-identity-receipt.d.ts +160 -0
- package/dist/src/lib/batch/attempt-recovery.d.ts +12 -0
- package/dist/src/lib/batch/attempt-recovery.js +183 -0
- package/dist/src/lib/batch/attempt-recovery.js.map +1 -0
- package/dist/src/lib/batch/canonical-contracts.d.ts +21 -0
- package/dist/src/lib/batch/canonical-contracts.js +180 -0
- package/dist/src/lib/batch/canonical-contracts.js.map +1 -0
- package/dist/src/lib/batch/engine.d.ts +2 -0
- package/dist/src/lib/batch/engine.js +294 -0
- package/dist/src/lib/batch/engine.js.map +1 -0
- package/dist/src/lib/batch/errors.d.ts +51 -0
- package/dist/src/lib/batch/errors.js +81 -0
- package/dist/src/lib/batch/errors.js.map +1 -0
- package/dist/src/lib/batch/item-projection.d.ts +10 -0
- package/dist/src/lib/batch/item-projection.js +118 -0
- package/dist/src/lib/batch/item-projection.js.map +1 -0
- package/dist/src/lib/batch/run-lock.d.ts +4 -0
- package/dist/src/lib/batch/run-lock.js +155 -0
- package/dist/src/lib/batch/run-lock.js.map +1 -0
- package/dist/src/lib/batch/scheduler-runtime.d.ts +29 -0
- package/dist/src/lib/batch/scheduler-runtime.js +114 -0
- package/dist/src/lib/batch/scheduler-runtime.js.map +1 -0
- package/dist/src/lib/batch/types.d.ts +183 -0
- package/dist/src/lib/batch/types.js +2 -0
- package/dist/src/lib/batch/types.js.map +1 -0
- package/dist/src/lib/dataset-author.d.ts +39 -0
- package/dist/src/lib/dataset-bilingual.d.ts +165 -0
- package/dist/src/lib/dataset-classification.d.ts +279 -0
- package/dist/src/lib/dataset-command.d.ts +53 -0
- package/dist/src/lib/dataset-contract.d.ts +82 -0
- package/dist/src/lib/dataset-curation-queue.d.ts +219 -0
- package/dist/src/lib/dataset-evidence-search.d.ts +134 -0
- package/dist/src/lib/dataset-import-lca.d.ts +136 -0
- package/dist/src/lib/dataset-local.d.ts +23 -0
- package/dist/src/lib/dataset-maintenance-alias-request.d.ts +12 -0
- package/dist/src/lib/dataset-maintenance-alias-rewrite.d.ts +111 -0
- package/dist/src/lib/dataset-maintenance-apply.d.ts +458 -0
- package/dist/src/lib/dataset-maintenance-clear-account.d.ts +161 -0
- package/dist/src/lib/dataset-maintenance-contract.d.ts +317 -0
- package/dist/src/lib/dataset-maintenance-derivatives.d.ts +48 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-approval-claim.d.ts +50 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-capture.d.ts +110 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-command.d.ts +15 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-contract.d.ts +387 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-execution-contract.d.ts +456 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-freeze.d.ts +99 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-plan.d.ts +85 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-recovery.d.ts +268 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-run.d.ts +123 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-seal.d.ts +50 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-verify.d.ts +85 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-wire.d.ts +32 -0
- package/dist/src/lib/dataset-maintenance-pagination.d.ts +58 -0
- package/dist/src/lib/dataset-maintenance-plan.d.ts +40 -0
- package/dist/src/lib/dataset-maintenance-protected-artifacts.d.ts +16 -0
- package/dist/src/lib/dataset-maintenance-protected-before.d.ts +71 -0
- package/dist/src/lib/dataset-maintenance-protected-contract.d.ts +385 -0
- package/dist/src/lib/dataset-maintenance-protected-freeze.d.ts +148 -0
- package/dist/src/lib/dataset-maintenance-protected-preparation.d.ts +76 -0
- package/dist/src/lib/dataset-maintenance-protected-run.d.ts +252 -0
- package/dist/src/lib/dataset-maintenance-protected-seal.d.ts +93 -0
- package/dist/src/lib/dataset-maintenance-protected-toolchain.d.ts +31 -0
- package/dist/src/lib/dataset-maintenance-protected-verify.d.ts +99 -0
- package/dist/src/lib/dataset-maintenance-remote.d.ts +212 -0
- package/dist/src/lib/dataset-maintenance-support-validation.d.ts +18 -0
- package/dist/src/lib/dataset-maintenance-verify.d.ts +102 -0
- package/dist/src/lib/dataset-patch.d.ts +193 -0
- package/dist/src/lib/dataset-references-rewrite.d.ts +77 -0
- package/dist/src/lib/dataset-remote-refresh.d.ts +64 -0
- package/dist/src/lib/dataset-remote-verify.d.ts +168 -0
- package/dist/src/lib/dataset-save-draft-run.d.ts +283 -0
- package/dist/src/lib/dataset-save-draft-run.js +54 -21
- package/dist/src/lib/dataset-save-draft-run.js.map +1 -1
- package/dist/src/lib/dataset-source-upload-attachments.d.ts +109 -0
- package/dist/src/lib/dataset-validate.d.ts +62 -0
- package/dist/src/lib/dotenv.d.ts +6 -0
- package/dist/src/lib/env.d.ts +59 -0
- package/dist/src/lib/errors.d.ts +18 -0
- package/dist/src/lib/flow-build-alias-map.d.ts +80 -0
- package/dist/src/lib/flow-fetch-rows.d.ts +70 -0
- package/dist/src/lib/flow-get.d.ts +35 -0
- package/dist/src/lib/flow-governance.d.ts +22 -0
- package/dist/src/lib/flow-list.d.ts +57 -0
- package/dist/src/lib/flow-materialize-decisions.d.ts +67 -0
- package/dist/src/lib/flow-payload-validation.d.ts +32 -0
- package/dist/src/lib/flow-publish-reviewed-data.d.ts +262 -0
- package/dist/src/lib/flow-publish-version.d.ts +193 -0
- package/dist/src/lib/flow-qa.d.ts +289 -0
- package/dist/src/lib/flow-read.d.ts +70 -0
- package/dist/src/lib/flow-regen-product.d.ts +431 -0
- package/dist/src/lib/flow-remediate.d.ts +133 -0
- package/dist/src/lib/http.d.ts +25 -0
- package/dist/src/lib/identity-preflight.d.ts +235 -0
- package/dist/src/lib/io.d.ts +2 -0
- package/dist/src/lib/kb-search.d.ts +23 -0
- package/dist/src/lib/lca-release.d.ts +105 -0
- package/dist/src/lib/lifecyclemodel-auto-build.d.ts +223 -0
- package/dist/src/lib/lifecyclemodel-bundle-save.d.ts +71 -0
- package/dist/src/lib/lifecyclemodel-graph.d.ts +91 -0
- package/dist/src/lib/lifecyclemodel-orchestrate.d.ts +349 -0
- package/dist/src/lib/lifecyclemodel-publish-build.d.ts +77 -0
- package/dist/src/lib/lifecyclemodel-publish-resulting-process.d.ts +27 -0
- package/dist/src/lib/lifecyclemodel-qa.d.ts +206 -0
- package/dist/src/lib/lifecyclemodel-resulting-process.d.ts +204 -0
- package/dist/src/lib/lifecyclemodel-save-draft-run.d.ts +96 -0
- package/dist/src/lib/lifecyclemodel-validate-build.d.ts +78 -0
- package/dist/src/lib/llm.d.ts +51 -0
- package/dist/src/lib/package-version.d.ts +3 -0
- package/dist/src/lib/process-auto-build.d.ts +168 -0
- package/dist/src/lib/process-batch-build.d.ts +97 -0
- package/dist/src/lib/process-dedup-review.d.ts +253 -0
- package/dist/src/lib/process-flow-build-plan.d.ts +108 -0
- package/dist/src/lib/process-get.d.ts +26 -0
- package/dist/src/lib/process-list.d.ts +87 -0
- package/dist/src/lib/process-payload-validation.d.ts +27 -0
- package/dist/src/lib/process-publish-build.d.ts +148 -0
- package/dist/src/lib/process-qa.d.ts +243 -0
- package/dist/src/lib/process-refresh-references.d.ts +179 -0
- package/dist/src/lib/process-required-fields.d.ts +142 -0
- package/dist/src/lib/process-resume-build.d.ts +77 -0
- package/dist/src/lib/process-save-draft-run.d.ts +72 -0
- package/dist/src/lib/process-save-draft.d.ts +53 -0
- package/dist/src/lib/process-scope-statistics.d.ts +210 -0
- package/dist/src/lib/process-verify-rows.d.ts +71 -0
- package/dist/src/lib/publish.d.ts +219 -0
- package/dist/src/lib/remote.d.ts +19 -0
- package/dist/src/lib/run.d.ts +60 -0
- package/dist/src/lib/runtime-rulesets.d.ts +29 -0
- package/dist/src/lib/state-lock.d.ts +25 -0
- package/dist/src/lib/state-lock.js +23 -1
- package/dist/src/lib/state-lock.js.map +1 -1
- package/dist/src/lib/supabase-client.d.ts +47 -0
- package/dist/src/lib/supabase-data-api-contract.d.ts +304 -0
- package/dist/src/lib/supabase-data-api-replay.d.ts +74 -0
- package/dist/src/lib/supabase-json-ordered-write.d.ts +65 -0
- package/dist/src/lib/supabase-rest.d.ts +26 -0
- package/dist/src/lib/supabase-session.d.ts +115 -0
- package/dist/src/lib/tidas-languages.d.ts +3 -0
- package/dist/src/lib/tidas-sdk-package-validator.d.ts +111 -0
- package/dist/src/lib/tidas-sdk-validation.d.ts +42 -0
- package/dist/src/lib/unstructured.d.ts +32 -0
- package/dist/src/lib/user-api-key.d.ts +16 -0
- package/dist/src/lib/validation.d.ts +82 -0
- package/dist/src/main.d.ts +4 -0
- package/package.json +13 -2
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { type FlowIdentityApproval, type FlowIdentityExecutionIdentity, type FlowIdentityFreeze, type FlowIdentityScopeProof, type FlowIdentityScopeStatus } from './dataset-maintenance-flow-identity-execution-contract.js';
|
|
2
|
+
import type { FlowIdentityPlan } from './dataset-maintenance-flow-identity-contract.js';
|
|
3
|
+
import { type JsonObject } from './dataset-maintenance-contract.js';
|
|
4
|
+
import { lookupMaintenanceFlowIdentityScope, readMaintenanceFlowIdentityScope, resolveMaintenanceRemoteContext, type DatasetMaintenanceRemoteContext } from './dataset-maintenance-remote.js';
|
|
5
|
+
import type { FetchLike } from './http.js';
|
|
6
|
+
declare const USER_STATE_CLAIM: 'authenticated_actor_state_100_plus_own_state_0';
|
|
7
|
+
export type FlowIdentityRecoveryReason = 'wrapper_exited_without_permit' | 'process_response_ambiguous' | 'process_domain_rejected' | 'finalize_response_ambiguous' | 'derivatives_became_ready_after_wrapper_exit';
|
|
8
|
+
export type FlowIdentityRecoveryMode = 'resume_and_finalize' | 'finalize_only';
|
|
9
|
+
export type FlowIdentityRecoveryBaseline = {
|
|
10
|
+
status: FlowIdentityScopeStatus['status'];
|
|
11
|
+
completed_process_count: number;
|
|
12
|
+
next_ordinal: number;
|
|
13
|
+
primary_complete: boolean;
|
|
14
|
+
primary_current: boolean;
|
|
15
|
+
live_guard_current: boolean;
|
|
16
|
+
protected_closure_current: boolean;
|
|
17
|
+
derivatives_current: boolean;
|
|
18
|
+
whole_scope_proof_sha256: string;
|
|
19
|
+
};
|
|
20
|
+
export type FlowIdentityRecoveryFreeze = {
|
|
21
|
+
schema_version: 'dataset-flow-identity-recovery-freeze.v1';
|
|
22
|
+
generated_at_utc: string;
|
|
23
|
+
environment: 'production';
|
|
24
|
+
project_ref: string;
|
|
25
|
+
actor: {
|
|
26
|
+
user_id: string;
|
|
27
|
+
email: string;
|
|
28
|
+
};
|
|
29
|
+
target_visibility: 'owner_draft';
|
|
30
|
+
user_state_claim: typeof USER_STATE_CLAIM;
|
|
31
|
+
scope_id: string;
|
|
32
|
+
scope_proof_sha256: string;
|
|
33
|
+
operation_id: string;
|
|
34
|
+
plan_sha256: string;
|
|
35
|
+
original_freeze_sha256: string;
|
|
36
|
+
original_execution_request_id: string;
|
|
37
|
+
original_execution_identity_sha256: string;
|
|
38
|
+
original_execution_approval_request_sha256: string;
|
|
39
|
+
original_execution_approval_text_sha256: string;
|
|
40
|
+
original_execution_approval_identity_sha256: string;
|
|
41
|
+
recovery_reason: FlowIdentityRecoveryReason;
|
|
42
|
+
recovery_mode: FlowIdentityRecoveryMode;
|
|
43
|
+
baseline: FlowIdentityRecoveryBaseline;
|
|
44
|
+
toolchain_evidence_sha256: string;
|
|
45
|
+
approval_reusable: false;
|
|
46
|
+
maximum_wrapper_invocations: 1;
|
|
47
|
+
maximum_cli_apply_spawns: 1;
|
|
48
|
+
maximum_process_posts: number;
|
|
49
|
+
maximum_finalize_posts: 1;
|
|
50
|
+
automatic_retry: false;
|
|
51
|
+
recovery_freeze_sha256: string;
|
|
52
|
+
};
|
|
53
|
+
export type FlowIdentityRecoveryApprovalRequestCore = {
|
|
54
|
+
schema_version: 'dataset-flow-identity-recovery-approval-request.v1';
|
|
55
|
+
approved_at_utc: string;
|
|
56
|
+
environment: 'production';
|
|
57
|
+
project_ref: string;
|
|
58
|
+
actor: {
|
|
59
|
+
user_id: string;
|
|
60
|
+
email: string;
|
|
61
|
+
};
|
|
62
|
+
target_visibility: 'owner_draft';
|
|
63
|
+
user_state_claim: typeof USER_STATE_CLAIM;
|
|
64
|
+
scope_id: string;
|
|
65
|
+
scope_proof_sha256: string;
|
|
66
|
+
operation_id: string;
|
|
67
|
+
plan_sha256: string;
|
|
68
|
+
original_freeze_sha256: string;
|
|
69
|
+
original_execution_request_id: string;
|
|
70
|
+
original_execution_identity_sha256: string;
|
|
71
|
+
original_execution_approval_request_sha256: string;
|
|
72
|
+
original_execution_approval_text_sha256: string;
|
|
73
|
+
original_execution_approval_identity_sha256: string;
|
|
74
|
+
recovery_reason: FlowIdentityRecoveryReason;
|
|
75
|
+
recovery_mode: FlowIdentityRecoveryMode;
|
|
76
|
+
baseline: FlowIdentityRecoveryBaseline;
|
|
77
|
+
recovery_freeze_file_sha256: string;
|
|
78
|
+
recovery_freeze_sha256: string;
|
|
79
|
+
toolchain_evidence_sha256: string;
|
|
80
|
+
approval_reusable: false;
|
|
81
|
+
maximum_wrapper_invocations: 1;
|
|
82
|
+
maximum_cli_apply_spawns: 1;
|
|
83
|
+
maximum_process_posts: number;
|
|
84
|
+
maximum_finalize_posts: 1;
|
|
85
|
+
automatic_retry: false;
|
|
86
|
+
};
|
|
87
|
+
export type FlowIdentityRecoveryApprovalRequest = FlowIdentityRecoveryApprovalRequestCore & {
|
|
88
|
+
request_sha256: string;
|
|
89
|
+
};
|
|
90
|
+
export type FlowIdentityRecoveryApproval = {
|
|
91
|
+
schema_version: 'dataset-flow-identity-recovery-approval.v1';
|
|
92
|
+
approved_at_utc: string;
|
|
93
|
+
actor: {
|
|
94
|
+
user_id: string;
|
|
95
|
+
email: string;
|
|
96
|
+
};
|
|
97
|
+
plan_sha256: string;
|
|
98
|
+
scope_id: string;
|
|
99
|
+
scope_proof_sha256: string;
|
|
100
|
+
recovery_freeze_sha256: string;
|
|
101
|
+
toolchain_evidence_sha256: string;
|
|
102
|
+
recovery_approval_request_sha256: string;
|
|
103
|
+
recovery_approval_text_sha256: string;
|
|
104
|
+
recovery_approval_identity_sha256: string;
|
|
105
|
+
};
|
|
106
|
+
export type FreezeFlowIdentityRecoveryOptions = {
|
|
107
|
+
planPath: string;
|
|
108
|
+
freezePath: string;
|
|
109
|
+
approvalPath: string;
|
|
110
|
+
runDir: string;
|
|
111
|
+
toolchainEvidencePath: string;
|
|
112
|
+
expectedProjectRef: string;
|
|
113
|
+
confirm: string;
|
|
114
|
+
approvedAtUtc: string;
|
|
115
|
+
recoveryReason: FlowIdentityRecoveryReason;
|
|
116
|
+
cliVersion: string;
|
|
117
|
+
outDir: string;
|
|
118
|
+
env: NodeJS.ProcessEnv;
|
|
119
|
+
fetchImpl: FetchLike;
|
|
120
|
+
timeoutMs?: number;
|
|
121
|
+
now?: Date;
|
|
122
|
+
dependencies?: {
|
|
123
|
+
resolveContext: typeof resolveMaintenanceRemoteContext;
|
|
124
|
+
lookup: typeof lookupMaintenanceFlowIdentityScope;
|
|
125
|
+
read: typeof readMaintenanceFlowIdentityScope;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
export type FlowIdentityRecoveryFreezeReport = {
|
|
129
|
+
schema_version: 'dataset-flow-identity-recovery-freeze-report.v1';
|
|
130
|
+
generated_at_utc: string;
|
|
131
|
+
status: 'frozen';
|
|
132
|
+
execution_submitted: false;
|
|
133
|
+
network_calls: 2 | 3;
|
|
134
|
+
database_calls: 1 | 2;
|
|
135
|
+
scope_id: string;
|
|
136
|
+
plan_sha256: string;
|
|
137
|
+
recovery_freeze_sha256: string;
|
|
138
|
+
recovery_freeze_file_sha256: string;
|
|
139
|
+
recovery_approval_request_sha256: string;
|
|
140
|
+
recovery_approval_text_sha256: string;
|
|
141
|
+
artifacts: {
|
|
142
|
+
freeze: string;
|
|
143
|
+
scope_proof: string;
|
|
144
|
+
approval_request: string;
|
|
145
|
+
approval_text: string;
|
|
146
|
+
report: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
export type SealFlowIdentityRecoveryApprovalOptions = {
|
|
150
|
+
recoveryFreezePath: string;
|
|
151
|
+
approvalRequestPath: string;
|
|
152
|
+
humanApprovalPath: string;
|
|
153
|
+
approveFreezeFile: string;
|
|
154
|
+
approveRequest: string;
|
|
155
|
+
approveText: string;
|
|
156
|
+
confirm: string;
|
|
157
|
+
approvedAtUtc: string;
|
|
158
|
+
outDir: string;
|
|
159
|
+
now?: Date;
|
|
160
|
+
};
|
|
161
|
+
export type FlowIdentityRecoveryApprovalSealReport = {
|
|
162
|
+
schema_version: 'dataset-flow-identity-recovery-approval-seal-report.v1';
|
|
163
|
+
generated_at_utc: string;
|
|
164
|
+
status: 'sealed';
|
|
165
|
+
execution_submitted: false;
|
|
166
|
+
network_calls: 0;
|
|
167
|
+
database_calls: 0;
|
|
168
|
+
scope_id: string;
|
|
169
|
+
plan_sha256: string;
|
|
170
|
+
recovery_freeze_sha256: string;
|
|
171
|
+
recovery_approval_request_sha256: string;
|
|
172
|
+
recovery_approval_text_sha256: string;
|
|
173
|
+
recovery_approval_identity_sha256: string;
|
|
174
|
+
artifacts: {
|
|
175
|
+
human_approval: string;
|
|
176
|
+
approval: string;
|
|
177
|
+
report: string;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
export type PreparedFlowIdentityRecoveryExecution = {
|
|
181
|
+
plan: FlowIdentityPlan;
|
|
182
|
+
originalFreeze: FlowIdentityFreeze;
|
|
183
|
+
originalApproval: FlowIdentityApproval;
|
|
184
|
+
originalIdentity: FlowIdentityExecutionIdentity;
|
|
185
|
+
scope: FlowIdentityScopeProof;
|
|
186
|
+
recoveryFreeze: FlowIdentityRecoveryFreeze;
|
|
187
|
+
recoveryApproval: FlowIdentityRecoveryApproval;
|
|
188
|
+
recoveryRequest: JsonObject;
|
|
189
|
+
};
|
|
190
|
+
/** Sanitized proof returned by the recovery admission RPC after the permit is removed. */
|
|
191
|
+
export type FlowIdentityRecoveryProof = {
|
|
192
|
+
ok: true;
|
|
193
|
+
command: 'cmd_dataset_flow_identity_scope_recover_guarded';
|
|
194
|
+
schema_version: 'dataset-flow-identity-scope-recovery-result.v1';
|
|
195
|
+
scope_id: string;
|
|
196
|
+
scope_proof_sha256: string;
|
|
197
|
+
status: FlowIdentityRecoveryBaseline['status'];
|
|
198
|
+
completed_process_count: number;
|
|
199
|
+
next_ordinal: number;
|
|
200
|
+
whole_scope_proof_sha256: string;
|
|
201
|
+
recovery_wire_request_sha256: string;
|
|
202
|
+
recovery_approval_identity_sha256: string;
|
|
203
|
+
invocation_id: string;
|
|
204
|
+
audit_id: string;
|
|
205
|
+
replay: boolean;
|
|
206
|
+
};
|
|
207
|
+
export declare const FLOW_IDENTITY_RECOVERY_FREEZE_ARTIFACTS: {
|
|
208
|
+
readonly freeze: 'flow-identity-recovery-freeze.json';
|
|
209
|
+
readonly scope_proof: 'flow-identity-recovery-scope-proof.json';
|
|
210
|
+
readonly approval_request: 'flow-identity-recovery-approval-request.json';
|
|
211
|
+
readonly approval_text: 'flow-identity-recovery-approval-request.txt';
|
|
212
|
+
readonly report: 'flow-identity-recovery-freeze-report.json';
|
|
213
|
+
};
|
|
214
|
+
export declare const FLOW_IDENTITY_RECOVERY_APPROVAL_ARTIFACTS: {
|
|
215
|
+
readonly human_approval: 'flow-identity-recovery-human-approval.txt';
|
|
216
|
+
readonly approval: 'flow-identity-recovery-approval.json';
|
|
217
|
+
readonly report: 'flow-identity-recovery-approval-seal-report.json';
|
|
218
|
+
};
|
|
219
|
+
declare function canonicalTimestamp(value: string, label: string): string;
|
|
220
|
+
declare function readRecoveryScopeProof(options: {
|
|
221
|
+
runDir: string;
|
|
222
|
+
plan: FlowIdentityPlan;
|
|
223
|
+
identity: FlowIdentityExecutionIdentity;
|
|
224
|
+
}): FlowIdentityScopeProof | null;
|
|
225
|
+
declare function recoveryBaseline(status: FlowIdentityScopeStatus): FlowIdentityRecoveryBaseline;
|
|
226
|
+
export declare function computeFlowIdentityRecoveryFreezeSha256(freeze: FlowIdentityRecoveryFreeze): string;
|
|
227
|
+
declare function recoveryRequestCore(value: FlowIdentityRecoveryApprovalRequest): FlowIdentityRecoveryApprovalRequestCore;
|
|
228
|
+
export declare function computeFlowIdentityRecoveryApprovalRequestSha256(request: FlowIdentityRecoveryApprovalRequest): string;
|
|
229
|
+
export declare function computeFlowIdentityRecoveryApprovalIdentitySha256(approval: FlowIdentityRecoveryApproval): string;
|
|
230
|
+
export declare function renderFlowIdentityRecoveryApprovalText(core: FlowIdentityRecoveryApprovalRequestCore, requestSha256: string): string;
|
|
231
|
+
export declare function parseFlowIdentityRecoveryFreeze(value: unknown): FlowIdentityRecoveryFreeze;
|
|
232
|
+
export declare function parseFlowIdentityRecoveryApprovalRequest(value: unknown): FlowIdentityRecoveryApprovalRequest;
|
|
233
|
+
export declare function parseFlowIdentityRecoveryApproval(value: unknown, freeze: FlowIdentityRecoveryFreeze): FlowIdentityRecoveryApproval;
|
|
234
|
+
declare function assertContext(plan: FlowIdentityPlan, context: DatasetMaintenanceRemoteContext): void;
|
|
235
|
+
declare function assertRecoverableStatus(status: FlowIdentityScopeStatus, plan: FlowIdentityPlan): void;
|
|
236
|
+
export declare function freezeFlowIdentityRecovery(options: FreezeFlowIdentityRecoveryOptions): Promise<FlowIdentityRecoveryFreezeReport>;
|
|
237
|
+
export declare function sealFlowIdentityRecoveryApproval(options: SealFlowIdentityRecoveryApprovalOptions): FlowIdentityRecoveryApprovalSealReport;
|
|
238
|
+
declare function deterministicUuidFromSha256(digest: string): string;
|
|
239
|
+
export declare function buildFlowIdentityRecoveryRequest(options: {
|
|
240
|
+
freeze: FlowIdentityRecoveryFreeze;
|
|
241
|
+
approval: FlowIdentityRecoveryApproval;
|
|
242
|
+
}): JsonObject;
|
|
243
|
+
export declare function parseFlowIdentityRecoveryProof(options: {
|
|
244
|
+
value: unknown;
|
|
245
|
+
freeze: FlowIdentityRecoveryFreeze;
|
|
246
|
+
approval: FlowIdentityRecoveryApproval;
|
|
247
|
+
request: JsonObject;
|
|
248
|
+
expectedInvocationId?: string;
|
|
249
|
+
}): FlowIdentityRecoveryProof;
|
|
250
|
+
export declare function prepareFlowIdentityRecoveryExecution(options: {
|
|
251
|
+
plan: unknown;
|
|
252
|
+
originalFreeze: unknown;
|
|
253
|
+
originalApproval: unknown;
|
|
254
|
+
scope: unknown;
|
|
255
|
+
recoveryFreeze: unknown;
|
|
256
|
+
recoveryApproval: unknown;
|
|
257
|
+
}): PreparedFlowIdentityRecoveryExecution;
|
|
258
|
+
export declare function assertFreshRecoveryBaseline(status: FlowIdentityScopeStatus, freeze: FlowIdentityRecoveryFreeze): void;
|
|
259
|
+
export declare const __testInternals: {
|
|
260
|
+
assertContext: typeof assertContext;
|
|
261
|
+
assertRecoverableStatus: typeof assertRecoverableStatus;
|
|
262
|
+
canonicalTimestamp: typeof canonicalTimestamp;
|
|
263
|
+
deterministicUuidFromSha256: typeof deterministicUuidFromSha256;
|
|
264
|
+
readRecoveryScopeProof: typeof readRecoveryScopeProof;
|
|
265
|
+
recoveryBaseline: typeof recoveryBaseline;
|
|
266
|
+
recoveryRequestCore: typeof recoveryRequestCore;
|
|
267
|
+
};
|
|
268
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { prepareFlowIdentityExecution, type FlowIdentityScopeProof, type FlowIdentityScopeStatus } from './dataset-maintenance-flow-identity-execution-contract.js';
|
|
2
|
+
import { type PreparedFlowIdentityRecoveryExecution } from './dataset-maintenance-flow-identity-recovery.js';
|
|
3
|
+
import type { FlowIdentityPlan, FlowIdentityProcessTemplate } from './dataset-maintenance-flow-identity-contract.js';
|
|
4
|
+
import { finalizeMaintenanceFlowIdentityScope, lookupMaintenanceFlowIdentityScope, preflightMaintenanceFlowIdentityScope, recoverMaintenanceFlowIdentityScope, readMaintenanceFlowIdentityScope, resolveMaintenanceRemoteContext, rewriteMaintenanceFlowIdentityProcess, type DatasetMaintenanceRemoteContext } from './dataset-maintenance-remote.js';
|
|
5
|
+
import type { FetchLike } from './http.js';
|
|
6
|
+
import { type FlowIdentityApprovalClaim } from './dataset-maintenance-flow-identity-approval-claim.js';
|
|
7
|
+
export type FlowIdentityRunStatus = 'passed' | 'pending' | 'blocked' | 'failed' | 'indeterminate';
|
|
8
|
+
export type RunFlowIdentityOptions = {
|
|
9
|
+
planPath: string;
|
|
10
|
+
freezePath: string;
|
|
11
|
+
approvalPath: string;
|
|
12
|
+
recoveryFreezePath?: string;
|
|
13
|
+
recoveryApprovalPath?: string;
|
|
14
|
+
recoveryRunDir?: string;
|
|
15
|
+
outDir: string;
|
|
16
|
+
commit: boolean;
|
|
17
|
+
statusOnly: boolean;
|
|
18
|
+
approveExecution?: string;
|
|
19
|
+
confirm?: string;
|
|
20
|
+
waitSeconds?: number;
|
|
21
|
+
pollMs?: number;
|
|
22
|
+
timeoutMs?: number;
|
|
23
|
+
env: NodeJS.ProcessEnv;
|
|
24
|
+
fetchImpl: FetchLike;
|
|
25
|
+
now?: Date;
|
|
26
|
+
sleep?: (ms: number) => Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
export type FlowIdentityRunReport = {
|
|
29
|
+
schema_version: 'dataset-flow-identity-run-report.v2';
|
|
30
|
+
generated_at_utc: string;
|
|
31
|
+
mode: 'commit' | 'status_only';
|
|
32
|
+
status: FlowIdentityRunStatus;
|
|
33
|
+
operation_id: string;
|
|
34
|
+
plan_sha256: string;
|
|
35
|
+
request_id: string;
|
|
36
|
+
identity_sha256: string;
|
|
37
|
+
scope_id: string | null;
|
|
38
|
+
database_status: FlowIdentityScopeStatus['status'] | null;
|
|
39
|
+
process_count: number;
|
|
40
|
+
completed_process_count: number;
|
|
41
|
+
next_ordinal: number | null;
|
|
42
|
+
automatic_retry: false;
|
|
43
|
+
issues: Array<{
|
|
44
|
+
code: string;
|
|
45
|
+
message: string;
|
|
46
|
+
details?: unknown;
|
|
47
|
+
}>;
|
|
48
|
+
};
|
|
49
|
+
type ProcessTemplate = Pick<FlowIdentityProcessTemplate, 'process' | 'rewrites' | 'collision_ledger'>;
|
|
50
|
+
type PreparedRun = ReturnType<typeof prepareFlowIdentityExecution> & {
|
|
51
|
+
planPath: string;
|
|
52
|
+
outDir: string;
|
|
53
|
+
templates: ProcessTemplate[];
|
|
54
|
+
recovery: PreparedFlowIdentityRecoveryExecution | null;
|
|
55
|
+
approvalClaim: FlowIdentityApprovalClaim | null;
|
|
56
|
+
};
|
|
57
|
+
type RunDependencies = {
|
|
58
|
+
resolveContext: typeof resolveMaintenanceRemoteContext;
|
|
59
|
+
preflight: typeof preflightMaintenanceFlowIdentityScope;
|
|
60
|
+
lookup?: typeof lookupMaintenanceFlowIdentityScope;
|
|
61
|
+
recover?: typeof recoverMaintenanceFlowIdentityScope;
|
|
62
|
+
rewrite: typeof rewriteMaintenanceFlowIdentityProcess;
|
|
63
|
+
read: typeof readMaintenanceFlowIdentityScope;
|
|
64
|
+
finalize: typeof finalizeMaintenanceFlowIdentityScope;
|
|
65
|
+
sleep: (ms: number) => Promise<void>;
|
|
66
|
+
now: () => Date;
|
|
67
|
+
claimApproval?: (options: {
|
|
68
|
+
claim: FlowIdentityApprovalClaim;
|
|
69
|
+
env: NodeJS.ProcessEnv;
|
|
70
|
+
}) => string;
|
|
71
|
+
};
|
|
72
|
+
declare function errorDetails(error: unknown): {
|
|
73
|
+
name: string;
|
|
74
|
+
message: string;
|
|
75
|
+
code: string | null;
|
|
76
|
+
};
|
|
77
|
+
declare function readCanonicalJson(filePath: string, label: string): unknown;
|
|
78
|
+
declare function processStem(ordinal: number, id: string, version: string): string;
|
|
79
|
+
declare function loadProcessTemplates(planPath: string, plan: FlowIdentityPlan): ProcessTemplate[];
|
|
80
|
+
declare function prepareRun(options: RunFlowIdentityOptions): PreparedRun;
|
|
81
|
+
declare function assertContext(prepared: PreparedRun, context: DatasetMaintenanceRemoteContext): void;
|
|
82
|
+
declare function numberedArtifact(directory: string, prefix: string): string;
|
|
83
|
+
declare function validateCompletedRequests(prepared: PreparedRun, status: FlowIdentityScopeStatus): void;
|
|
84
|
+
declare function requirePendingProcess(prepared: PreparedRun, status: FlowIdentityScopeStatus, ordinal: number): {
|
|
85
|
+
ledger: FlowIdentityScopeStatus['processes'][number];
|
|
86
|
+
template: ProcessTemplate;
|
|
87
|
+
};
|
|
88
|
+
declare function report(options: {
|
|
89
|
+
prepared: PreparedRun;
|
|
90
|
+
mode: 'commit' | 'status_only';
|
|
91
|
+
status: FlowIdentityRunStatus;
|
|
92
|
+
scope: FlowIdentityScopeProof | null;
|
|
93
|
+
database: FlowIdentityScopeStatus | null;
|
|
94
|
+
issues?: FlowIdentityRunReport['issues'];
|
|
95
|
+
now: Date;
|
|
96
|
+
}): FlowIdentityRunReport;
|
|
97
|
+
declare function completedRunStatus(status: FlowIdentityScopeStatus): 'passed' | 'blocked';
|
|
98
|
+
declare function waitForFinalizeDecision(options: {
|
|
99
|
+
command: RunFlowIdentityOptions;
|
|
100
|
+
prepared: PreparedRun;
|
|
101
|
+
context: DatasetMaintenanceRemoteContext;
|
|
102
|
+
scope: FlowIdentityScopeProof;
|
|
103
|
+
initial: FlowIdentityScopeStatus;
|
|
104
|
+
dependencies: RunDependencies;
|
|
105
|
+
}): Promise<FlowIdentityScopeStatus>;
|
|
106
|
+
declare function executeRun(command: RunFlowIdentityOptions, dependencies: RunDependencies, preparedInput?: PreparedRun): Promise<FlowIdentityRunReport>;
|
|
107
|
+
export declare function runFlowIdentity(options: RunFlowIdentityOptions): Promise<FlowIdentityRunReport>;
|
|
108
|
+
export declare const __testInternals: {
|
|
109
|
+
assertContext: typeof assertContext;
|
|
110
|
+
completedRunStatus: typeof completedRunStatus;
|
|
111
|
+
errorDetails: typeof errorDetails;
|
|
112
|
+
executeRun: typeof executeRun;
|
|
113
|
+
loadProcessTemplates: typeof loadProcessTemplates;
|
|
114
|
+
numberedArtifact: typeof numberedArtifact;
|
|
115
|
+
prepareRun: typeof prepareRun;
|
|
116
|
+
processStem: typeof processStem;
|
|
117
|
+
readCanonicalJson: typeof readCanonicalJson;
|
|
118
|
+
requirePendingProcess: typeof requirePendingProcess;
|
|
119
|
+
report: typeof report;
|
|
120
|
+
validateCompletedRequests: typeof validateCompletedRequests;
|
|
121
|
+
waitForFinalizeDecision: typeof waitForFinalizeDecision;
|
|
122
|
+
};
|
|
123
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type SealFlowIdentityApprovalOptions = {
|
|
2
|
+
planPath: string;
|
|
3
|
+
freezePath: string;
|
|
4
|
+
approvalRequestPath: string;
|
|
5
|
+
humanApprovalPath: string;
|
|
6
|
+
approveFreezeFile: string;
|
|
7
|
+
approveRequest: string;
|
|
8
|
+
approveText: string;
|
|
9
|
+
confirm: string;
|
|
10
|
+
approvedAtUtc: string;
|
|
11
|
+
outDir: string;
|
|
12
|
+
now?: Date;
|
|
13
|
+
};
|
|
14
|
+
export type FlowIdentityApprovalSealReport = {
|
|
15
|
+
schema_version: 'dataset-flow-identity-execution-approval-seal-report.v2';
|
|
16
|
+
generated_at_utc: string;
|
|
17
|
+
approval_authority_at_utc: string;
|
|
18
|
+
status: 'sealed';
|
|
19
|
+
execution_submitted: false;
|
|
20
|
+
network_calls: 0;
|
|
21
|
+
database_calls: 0;
|
|
22
|
+
plan_sha256: string;
|
|
23
|
+
operation_id: string;
|
|
24
|
+
freeze_file_sha256: string;
|
|
25
|
+
freeze_sha256: string;
|
|
26
|
+
policy_approval_text_sha256: string;
|
|
27
|
+
execution_approval_request_sha256: string;
|
|
28
|
+
execution_approval_text_sha256: string;
|
|
29
|
+
execution_approval_identity_sha256: string;
|
|
30
|
+
artifacts: {
|
|
31
|
+
human_approval: string;
|
|
32
|
+
approval: string;
|
|
33
|
+
report: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const FLOW_IDENTITY_APPROVAL_ARTIFACTS: {
|
|
37
|
+
readonly human_approval: 'flow-identity-execution-human-approval.txt';
|
|
38
|
+
readonly approval: 'flow-identity-execution-approval.json';
|
|
39
|
+
readonly report: 'flow-identity-execution-approval-seal-report.json';
|
|
40
|
+
};
|
|
41
|
+
declare function requireHash(value: string, label: string): void;
|
|
42
|
+
declare function requireDistinctApprovalHashDomains(hashes: readonly string[]): void;
|
|
43
|
+
declare function requireCanonicalJson(filePath: string, label: string): import("./dataset-maintenance-protected-artifacts.js").ProtectedJsonArtifact;
|
|
44
|
+
export declare function sealFlowIdentityApproval(options: SealFlowIdentityApprovalOptions): FlowIdentityApprovalSealReport;
|
|
45
|
+
export declare const __testInternals: {
|
|
46
|
+
requireCanonicalJson: typeof requireCanonicalJson;
|
|
47
|
+
requireDistinctApprovalHashDomains: typeof requireDistinctApprovalHashDomains;
|
|
48
|
+
requireHash: typeof requireHash;
|
|
49
|
+
};
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type FlowIdentityScopeStatus } from './dataset-maintenance-flow-identity-execution-contract.js';
|
|
2
|
+
import { type FlowIdentityLiveCapture, type FlowIdentityOccurrence, type FlowIdentityPlan } from './dataset-maintenance-flow-identity-contract.js';
|
|
3
|
+
import { type DatasetMaintenanceRemoteRow, type DatasetMaintenanceRowSnapshot, type JsonObject } from './dataset-maintenance-contract.js';
|
|
4
|
+
import type { FetchLike } from './http.js';
|
|
5
|
+
export type VerifyFlowIdentityOptions = {
|
|
6
|
+
planPath: string;
|
|
7
|
+
freezePath: string;
|
|
8
|
+
approvalPath: string;
|
|
9
|
+
runDir: string;
|
|
10
|
+
outDir: string;
|
|
11
|
+
pageSize?: number;
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
env: NodeJS.ProcessEnv;
|
|
14
|
+
fetchImpl: FetchLike;
|
|
15
|
+
now?: Date;
|
|
16
|
+
};
|
|
17
|
+
export type FlowIdentityVerificationIssue = {
|
|
18
|
+
code: string;
|
|
19
|
+
message: string;
|
|
20
|
+
details?: unknown;
|
|
21
|
+
};
|
|
22
|
+
export type FlowIdentityVerificationReport = {
|
|
23
|
+
schema_version: 'dataset-flow-identity-verification-report.v1';
|
|
24
|
+
generated_at_utc: string;
|
|
25
|
+
status: 'passed' | 'pending' | 'failed';
|
|
26
|
+
plan_sha256: string;
|
|
27
|
+
operation_id: string;
|
|
28
|
+
scope_id: string;
|
|
29
|
+
database_status: FlowIdentityScopeStatus['status'];
|
|
30
|
+
terminal_proof_sha256: string | null;
|
|
31
|
+
checks: {
|
|
32
|
+
source_rows_unchanged: boolean;
|
|
33
|
+
public_target_rows_unchanged: boolean;
|
|
34
|
+
support_rows_unchanged: boolean;
|
|
35
|
+
affected_processes_exact: boolean;
|
|
36
|
+
approved_source_reference_residue: number;
|
|
37
|
+
protected_closure_exact: boolean;
|
|
38
|
+
complete_owner_draft_process_scan: boolean;
|
|
39
|
+
derivatives_causally_terminal: boolean;
|
|
40
|
+
};
|
|
41
|
+
counts: {
|
|
42
|
+
source_rows: number;
|
|
43
|
+
public_target_rows: number;
|
|
44
|
+
support_rows: number;
|
|
45
|
+
affected_processes: number;
|
|
46
|
+
owner_draft_processes_scanned: number;
|
|
47
|
+
};
|
|
48
|
+
issues: FlowIdentityVerificationIssue[];
|
|
49
|
+
};
|
|
50
|
+
type ReadbackInput = {
|
|
51
|
+
plan: FlowIdentityPlan;
|
|
52
|
+
capture: FlowIdentityLiveCapture;
|
|
53
|
+
status: FlowIdentityScopeStatus;
|
|
54
|
+
currentStableRows: DatasetMaintenanceRemoteRow[];
|
|
55
|
+
currentOwnerDraftProcesses: DatasetMaintenanceRemoteRow[];
|
|
56
|
+
processScanComplete: boolean;
|
|
57
|
+
};
|
|
58
|
+
declare function rowKey(table: string, id: string, version: string, userId: string | null): string;
|
|
59
|
+
declare function snapshotKey(row: DatasetMaintenanceRowSnapshot): string;
|
|
60
|
+
declare function currentKey(row: DatasetMaintenanceRemoteRow): string;
|
|
61
|
+
declare function snapshotWithoutJson(row: DatasetMaintenanceRemoteRow): DatasetMaintenanceRowSnapshot;
|
|
62
|
+
declare function jsonColumnsMatch(row: DatasetMaintenanceRemoteRow): boolean;
|
|
63
|
+
declare function processExchanges(payload: JsonObject | null): JsonObject[] | null;
|
|
64
|
+
declare function buildOccurrenceIndex(rows: DatasetMaintenanceRemoteRow[], issues: FlowIdentityVerificationIssue[]): Map<string, FlowIdentityOccurrence[]>;
|
|
65
|
+
declare function compareStableRows(options: {
|
|
66
|
+
expected: DatasetMaintenanceRowSnapshot[];
|
|
67
|
+
currentByKey: Map<string, DatasetMaintenanceRemoteRow>;
|
|
68
|
+
code: string;
|
|
69
|
+
issues: FlowIdentityVerificationIssue[];
|
|
70
|
+
}): boolean;
|
|
71
|
+
declare function derivativeSetIsCausallyTerminal(input: ReadbackInput): boolean;
|
|
72
|
+
export declare function verifyFlowIdentityReadback(input: ReadbackInput): FlowIdentityVerificationReport;
|
|
73
|
+
export declare function verifyFlowIdentity(options: VerifyFlowIdentityOptions): Promise<FlowIdentityVerificationReport>;
|
|
74
|
+
export declare const __testInternals: {
|
|
75
|
+
buildOccurrenceIndex: typeof buildOccurrenceIndex;
|
|
76
|
+
compareStableRows: typeof compareStableRows;
|
|
77
|
+
currentKey: typeof currentKey;
|
|
78
|
+
derivativeSetIsCausallyTerminal: typeof derivativeSetIsCausallyTerminal;
|
|
79
|
+
processExchanges: typeof processExchanges;
|
|
80
|
+
jsonColumnsMatch: typeof jsonColumnsMatch;
|
|
81
|
+
rowKey: typeof rowKey;
|
|
82
|
+
snapshotKey: typeof snapshotKey;
|
|
83
|
+
snapshotWithoutJson: typeof snapshotWithoutJson;
|
|
84
|
+
};
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type JsonObject } from './dataset-maintenance-contract.js';
|
|
2
|
+
export type StandardStMultiLang = string | {
|
|
3
|
+
'@xml:lang': string;
|
|
4
|
+
'#text': string;
|
|
5
|
+
} | Array<{
|
|
6
|
+
'@xml:lang': string;
|
|
7
|
+
'#text': string;
|
|
8
|
+
}>;
|
|
9
|
+
declare function assertTransportString(value: string, path: string): void;
|
|
10
|
+
declare function isExactStMultiLangEntry(value: unknown): value is {
|
|
11
|
+
'@xml:lang': string;
|
|
12
|
+
'#text': string;
|
|
13
|
+
};
|
|
14
|
+
export declare function isStandardFlowIdentityShortDescription(value: unknown): value is StandardStMultiLang;
|
|
15
|
+
export declare function assertFlowIdentityWireJson(value: unknown, label?: string): JsonObject;
|
|
16
|
+
export declare function assertFlowIdentityWireValue(value: unknown, label?: string): unknown;
|
|
17
|
+
declare function arrayIndex(key: string): number | null;
|
|
18
|
+
declare function compareCanonicalKeys(left: string, right: string): number;
|
|
19
|
+
declare function canonicalRestrictedJson(value: unknown): string;
|
|
20
|
+
export declare function flowIdentityRestrictedJsonText(value: unknown): string;
|
|
21
|
+
export declare function flowIdentityRestrictedSha256(value: unknown): string;
|
|
22
|
+
export declare const __testInternals: {
|
|
23
|
+
MAX_COUNT: number;
|
|
24
|
+
MAX_INDEX: number;
|
|
25
|
+
MAX_ORDINAL: number;
|
|
26
|
+
isExactStMultiLangEntry: typeof isExactStMultiLangEntry;
|
|
27
|
+
arrayIndex: typeof arrayIndex;
|
|
28
|
+
compareCanonicalKeys: typeof compareCanonicalKeys;
|
|
29
|
+
canonicalRestrictedJson: typeof canonicalRestrictedJson;
|
|
30
|
+
assertTransportString: typeof assertTransportString;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type DatasetMaintenanceTableCompleteness = {
|
|
2
|
+
status: 'complete';
|
|
3
|
+
complete: true;
|
|
4
|
+
strategy: 'postgrest_exact_count';
|
|
5
|
+
requested_page_size: number;
|
|
6
|
+
effective_page_size: number;
|
|
7
|
+
pages_fetched: number;
|
|
8
|
+
rows_fetched: number;
|
|
9
|
+
exact_total: number;
|
|
10
|
+
termination_reason: 'content_range_total_reached';
|
|
11
|
+
content_range_verified: true;
|
|
12
|
+
ordering_verified: true;
|
|
13
|
+
duplicate_count: 0;
|
|
14
|
+
};
|
|
15
|
+
export type DatasetMaintenanceSnapshotCompleteness<Table extends string = string> = {
|
|
16
|
+
status: 'complete';
|
|
17
|
+
complete: true;
|
|
18
|
+
strategy: 'postgrest_exact_count_multi_request';
|
|
19
|
+
requested_page_size: number;
|
|
20
|
+
page_count: number;
|
|
21
|
+
row_count: number;
|
|
22
|
+
entity_counts: Record<Table, number>;
|
|
23
|
+
tables: Array<{
|
|
24
|
+
table: Table;
|
|
25
|
+
} & DatasetMaintenanceTableCompleteness>;
|
|
26
|
+
};
|
|
27
|
+
export type DatasetMaintenancePage<T> = {
|
|
28
|
+
rows: T[];
|
|
29
|
+
source_url: string;
|
|
30
|
+
content_range: string | null;
|
|
31
|
+
};
|
|
32
|
+
type ParsedContentRange = {
|
|
33
|
+
start: number | null;
|
|
34
|
+
end: number | null;
|
|
35
|
+
total: number;
|
|
36
|
+
};
|
|
37
|
+
export declare function isDatasetMaintenanceSnapshotCompleteness<Table extends string>(value: unknown, expectedTables: readonly Table[]): value is DatasetMaintenanceSnapshotCompleteness<Table>;
|
|
38
|
+
export declare function isSnapshotCompletenessCompatible<Table extends string>(value: unknown, baseline: DatasetMaintenanceSnapshotCompleteness<Table> | undefined, expectedTables: readonly Table[]): boolean;
|
|
39
|
+
export declare function parseExactContentRange(value: string | null, details?: Record<string, unknown>): ParsedContentRange;
|
|
40
|
+
export declare function fetchCompletePostgrestPages<T>(options: {
|
|
41
|
+
table: string;
|
|
42
|
+
requestedPageSize: number;
|
|
43
|
+
fetchPage: (offset: number) => Promise<DatasetMaintenancePage<T>>;
|
|
44
|
+
rowIdentity: (row: T) => string | null;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
rows: T[];
|
|
47
|
+
source_urls: string[];
|
|
48
|
+
completeness: DatasetMaintenanceTableCompleteness;
|
|
49
|
+
}>;
|
|
50
|
+
export declare function buildSnapshotCompleteness<Table extends string>(options: {
|
|
51
|
+
tables: readonly Table[];
|
|
52
|
+
requestedPageSize: number;
|
|
53
|
+
results: Array<{
|
|
54
|
+
table: Table;
|
|
55
|
+
completeness: DatasetMaintenanceTableCompleteness;
|
|
56
|
+
}>;
|
|
57
|
+
}): DatasetMaintenanceSnapshotCompleteness<Table>;
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type DatasetMaintenanceAliasSchemas } from './dataset-maintenance-alias-rewrite.js';
|
|
2
|
+
import type { FetchLike } from './http.js';
|
|
3
|
+
import { type DatasetMaintenanceOperation, type DatasetMaintenancePlan, type DatasetMaintenancePlanAction, type DatasetMaintenanceProtectedRow, type DatasetMaintenanceReferenceImpact, type DatasetMaintenanceRemoteRow, type DatasetMaintenanceRowSnapshot, type DatasetMaintenanceScopeAction, type JsonObject } from './dataset-maintenance-contract.js';
|
|
4
|
+
import { maintenancePayloadIdentity, type DatasetMaintenanceSupportSchemas } from './dataset-maintenance-support-validation.js';
|
|
5
|
+
export type RunDatasetMaintenancePlanOptions = {
|
|
6
|
+
scopePath: string;
|
|
7
|
+
operation: DatasetMaintenanceOperation;
|
|
8
|
+
outDir: string;
|
|
9
|
+
pageSize?: number;
|
|
10
|
+
timeoutMs?: number;
|
|
11
|
+
env: NodeJS.ProcessEnv;
|
|
12
|
+
fetchImpl: FetchLike;
|
|
13
|
+
now?: Date;
|
|
14
|
+
supportSchemas?: DatasetMaintenanceSupportSchemas;
|
|
15
|
+
aliasSchemas?: DatasetMaintenanceAliasSchemas;
|
|
16
|
+
};
|
|
17
|
+
declare function referenceImpacts(options: {
|
|
18
|
+
rows: DatasetMaintenanceRemoteRow[];
|
|
19
|
+
deletes: DatasetMaintenanceScopeAction[];
|
|
20
|
+
phase: DatasetMaintenanceReferenceImpact['phase'];
|
|
21
|
+
}): DatasetMaintenanceReferenceImpact[];
|
|
22
|
+
declare function projectedRows(options: {
|
|
23
|
+
current: DatasetMaintenanceRemoteRow[];
|
|
24
|
+
actions: DatasetMaintenancePlanAction[];
|
|
25
|
+
desiredPayloads: Map<string, JsonObject>;
|
|
26
|
+
}): DatasetMaintenanceRemoteRow[];
|
|
27
|
+
export declare function maintenanceProjectedReferenceFingerprint(rows: DatasetMaintenanceRemoteRow[]): unknown[];
|
|
28
|
+
declare function protectedRows(options: {
|
|
29
|
+
snapshot: DatasetMaintenanceRowSnapshot[];
|
|
30
|
+
actions: DatasetMaintenancePlanAction[];
|
|
31
|
+
}): DatasetMaintenanceProtectedRow[];
|
|
32
|
+
export declare function runDatasetMaintenancePlan(options: RunDatasetMaintenancePlanOptions): Promise<DatasetMaintenancePlan>;
|
|
33
|
+
export declare const __testInternals: {
|
|
34
|
+
desiredPayloadIdentity: typeof maintenancePayloadIdentity;
|
|
35
|
+
maintenanceProjectedReferenceFingerprint: typeof maintenanceProjectedReferenceFingerprint;
|
|
36
|
+
projectedRows: typeof projectedRows;
|
|
37
|
+
protectedRows: typeof protectedRows;
|
|
38
|
+
referenceImpacts: typeof referenceImpacts;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ProtectedJsonArtifact = {
|
|
2
|
+
resolved: string;
|
|
3
|
+
value: unknown;
|
|
4
|
+
text: string;
|
|
5
|
+
file_sha256: string;
|
|
6
|
+
};
|
|
7
|
+
export type ProtectedTextArtifact = Omit<ProtectedJsonArtifact, 'value'>;
|
|
8
|
+
export declare function readProtectedTextArtifact(filePath: string): ProtectedTextArtifact;
|
|
9
|
+
export declare function readProtectedJsonArtifact(options: {
|
|
10
|
+
filePath: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}): ProtectedJsonArtifact;
|
|
13
|
+
export declare function ensurePrivateArtifactDirectory(directory: string): string;
|
|
14
|
+
export declare function materializePrivateArtifactDirectoryAtomically<T>(directory: string, materialize: (stagingDirectory: string) => T): T;
|
|
15
|
+
export declare function writePrivateImmutableText(filePath: string, text: string): string;
|
|
16
|
+
export declare function writePrivateImmutableJson(filePath: string, value: unknown): string;
|