@runeditrun/rer 0.2.100 → 0.2.102
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 +30 -102
- package/cli/README.md +16 -89
- package/cli/app-address.mjs +2 -0
- package/cli/business/api.mjs +2 -1
- package/cli/business/choices.mjs +1 -1
- package/cli/business/command.mjs +36 -30
- package/cli/business/connect.mjs +1 -1
- package/cli/business/lease.mjs +0 -9
- package/cli/business/local-commands.mjs +1 -27
- package/cli/business/outbound.mjs +2 -14
- package/cli/business/questions.mjs +85 -48
- package/cli/business/service.mjs +1 -24
- package/cli/business/setup-command.mjs +33 -26
- package/cli/business/state.mjs +1 -1
- package/cli/business/supervisor.mjs +26 -91
- package/cli/companion/command.mjs +2 -0
- package/cli/demo-native.mjs +1 -1
- package/cli/parse.mjs +2 -1
- package/global/CHANGELOG.md +32 -0
- package/global/README.md +30 -102
- package/global/main.mjs +2 -0
- package/modules/container/adapters/d1-limits.mjs +2 -10
- package/modules/d1-transport/limits.d.mts +10 -0
- package/modules/d1-transport/limits.mjs +10 -0
- package/modules/demo-host/native/prepare.mjs +2 -1
- package/modules/deploy-kit/d1-import.mjs +11 -1
- package/modules/deploy-kit/migrations.mjs +14 -1
- package/modules/import-kit/schema/importers.schema.json +104 -2
- package/modules/import-kit/src/d1/README.md +14 -0
- package/modules/import-kit/src/d1/apply-reads.ts +74 -0
- package/modules/import-kit/src/d1/apply.ts +32 -9
- package/modules/import-kit/src/d1/history.ts +2 -2
- package/modules/import-kit/src/d1/redaction-step.ts +17 -7
- package/modules/import-kit/src/d1/types.ts +11 -0
- package/modules/import-kit/src/door/ADOPTING.md +0 -37
- package/modules/import-kit/src/door/README.md +0 -66
- package/modules/import-kit/src/door/admission.ts +3 -13
- package/modules/import-kit/src/door/authority.ts +0 -1
- package/modules/import-kit/src/door/failures.ts +1 -1
- package/modules/import-kit/src/door/grants.ts +5 -19
- package/modules/import-kit/src/door/handler.ts +1 -12
- package/modules/import-kit/src/door/index.ts +0 -6
- package/modules/import-kit/src/door/planning.ts +19 -44
- package/modules/import-kit/src/door/protocol.ts +2 -4
- package/modules/import-kit/src/door/schema.ts +0 -2
- package/modules/import-kit/src/door/store.ts +2 -2
- package/modules/import-kit/src/door/types.ts +1 -24
- package/modules/import-kit/src/provenance/credentials.ts +14 -5
- package/modules/import-kit/src/status/evidence.ts +3 -1
- package/modules/import-kit/src/status/index.ts +17 -2
- package/modules/import-kit/src/status/schema.ts +8 -0
- package/modules/import-kit/src/status/types.ts +25 -4
- package/package.json +1 -1
- package/cli/business/archive-task.mjs +0 -32
- package/cli/business/bounded-waves.d.mts +0 -23
- package/cli/business/bounded-waves.mjs +0 -57
- package/cli/business/catchup-task.mjs +0 -49
- package/cli/business/export-inputs.mjs +0 -79
- package/cli/business/export-task.mjs +0 -24
- package/cli/business/legacy-package.mjs +0 -117
- package/cli/business/package-transfer.mjs +0 -127
- package/cli/business/setup-demo.mjs +0 -95
- package/cli/business/vendor-door.mjs +0 -303
- package/cli/business/vendors/README.md +0 -215
- package/cli/business/vendors/calendly.mjs +0 -80
- package/cli/business/vendors/common.mjs +0 -280
- package/cli/business/vendors/credential-names.mjs +0 -124
- package/cli/business/vendors/index.mjs +0 -96
- package/cli/business/vendors/pagerduty.mjs +0 -61
- package/cli/business/vendors/sentry.mjs +0 -85
- package/cli/business/vendors/sorry.mjs +0 -106
- package/cli/business/vendors/uptimerobot.mjs +0 -21
- package/cli/business/vendors/zendesk-attachments.mjs +0 -57
- package/cli/business/vendors/zendesk-encode.mjs +0 -133
- package/cli/business/vendors/zendesk-guide.mjs +0 -34
- package/cli/business/vendors/zendesk-package.mjs +0 -28
- package/cli/business/vendors/zendesk-pages.mjs +0 -61
- package/cli/business/vendors/zendesk-people.mjs +0 -7
- package/cli/business/vendors/zendesk-store.mjs +0 -154
- package/cli/business/vendors/zendesk-tickets.mjs +0 -21
- package/cli/business/vendors/zendesk-token.mjs +0 -31
- package/cli/business/vendors/zendesk-transport.mjs +0 -48
- package/cli/business/vendors/zendesk.mjs +0 -61
- package/modules/import-kit/src/door/package.ts +0 -121
- package/modules/import-kit/src/door/waves/README.md +0 -158
- package/modules/import-kit/src/door/waves/digests.ts +0 -38
- package/modules/import-kit/src/door/waves/inventory.ts +0 -84
- package/modules/import-kit/src/door/waves/journal.ts +0 -19
- package/modules/import-kit/src/door/waves/lifecycle.ts +0 -242
- package/modules/import-kit/src/door/waves/preparation.ts +0 -190
- package/modules/import-kit/src/door/waves/schema.ts +0 -73
- package/modules/import-kit/src/door/waves/store.ts +0 -112
- package/modules/import-kit/src/door/waves/types.ts +0 -76
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export type DoorAction = 'uploads' | 'plan' | 'apply' | 'status' | 'reconcile' | 'undo' | 'cancel' | 'archive' | 'restore-check' | 'prepare' | 'seal-parent' | 'review-parent' | 'apply-child' | 'wave-status' | 'finalize-parent' | 'reverse-parent';
|
|
1
|
+
export type DoorAction = 'uploads' | 'plan' | 'apply' | 'status' | 'reconcile' | 'undo' | 'cancel' | 'archive' | 'restore-check';
|
|
3
2
|
/** Grant-only actions: the owner-session mount answers them 404. */
|
|
4
|
-
export const GRANT_ONLY_ACTIONS: readonly DoorAction[] = ['cancel', 'archive', 'restore-check'
|
|
3
|
+
export const GRANT_ONLY_ACTIONS: readonly DoorAction[] = ['cancel', 'archive', 'restore-check'];
|
|
5
4
|
|
|
6
5
|
export interface DoorGrant {
|
|
7
6
|
v: 1;
|
|
@@ -21,7 +20,6 @@ export interface DoorGrant {
|
|
|
21
20
|
approvalRecordId?: string;
|
|
22
21
|
approvedAt?: string;
|
|
23
22
|
catchup?: 'bounded';
|
|
24
|
-
bounded?: WaveBinding;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
export class DoorError extends Error {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { importDoorBoundedWavesMigration } from './waves/schema.ts';
|
|
2
1
|
function planTables(suffix = ''): string[] {
|
|
3
2
|
return [
|
|
4
3
|
`CREATE TABLE IF NOT EXISTS ik_door_plans${suffix} (
|
|
@@ -99,5 +98,4 @@ export const importDoorSchema = [
|
|
|
99
98
|
...failureSchema,
|
|
100
99
|
...importDoorScopesMigration,
|
|
101
100
|
...importDoorArchiveMigration,
|
|
102
|
-
...importDoorBoundedWavesMigration,
|
|
103
101
|
];
|
|
@@ -8,8 +8,8 @@ import { importDoorSchemaCheck } from './schema.ts';
|
|
|
8
8
|
export const sql = (sql: string, ...params: unknown[]): D1Sql => ({ sql, params });
|
|
9
9
|
export const statement = (db: D1Database, query: D1Sql) => db.prepare(query.sql).bind(...query.params ?? []);
|
|
10
10
|
export const assertion = (query: D1Sql) => sql(`INSERT INTO ik_d1_assertions(ok) SELECT CASE WHEN (${query.sql}) THEN 1 ELSE 0 END`, ...query.params ?? []);
|
|
11
|
-
export async function transact(db: D1Database, authority: D1Sql, queries: D1Sql[]
|
|
12
|
-
await db.batch([assertion(authority), ...queries, assertion(authority), sql('DELETE FROM ik_d1_assertions')
|
|
11
|
+
export async function transact(db: D1Database, authority: D1Sql, queries: D1Sql[]): Promise<void> {
|
|
12
|
+
await db.batch([assertion(authority), ...queries, assertion(authority), sql('DELETE FROM ik_d1_assertions')].map(q => statement(db, q)));
|
|
13
13
|
}
|
|
14
14
|
export async function authorized(request: DoorRequest): Promise<void> {
|
|
15
15
|
const row = await statement(request.options.database, sql(`SELECT CASE WHEN (${request.authority.sql}) THEN 1 ELSE 0 END AS ok`, ...request.authority.params ?? [])).first();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { D1Database, D1Sql, D1TargetAdapter } from '../d1/types.ts';
|
|
2
2
|
import type { D1ReversalPolicy } from '../d1/undo-types.ts';
|
|
3
3
|
import type { ImportMapping, ImportPlan, Json, ParsedRecord, ReaderLimits } from '../types.ts';
|
|
4
|
-
import type { ImportDoorBoundedSource } from './waves/types.ts';
|
|
5
4
|
import type { DoorGrant } from './protocol.ts';
|
|
6
5
|
import type { ImportDoorIntake } from './intake/types.ts';
|
|
7
6
|
export type { ImportDoorIntake, IntakeFormat } from './intake/types.ts';
|
|
@@ -13,30 +12,8 @@ export interface ImportDoorRawUpload {
|
|
|
13
12
|
readonly sha256: string;
|
|
14
13
|
readonly size: number;
|
|
15
14
|
}
|
|
16
|
-
export interface DoorPackageFile { readonly path: string; readonly bytes: number; readonly sha256: string; readonly offset: number }
|
|
17
|
-
export interface DoorPackageManifest {
|
|
18
|
-
format: 'rer-door-package/1'; source: {format: string; [key: string]: Json}; mode: string;
|
|
19
|
-
stream: {bytes: number; sha256: string}; segments: {bytes: number; sha256: string}[];
|
|
20
|
-
index: {path: 'index.ndjson'; bytes: number; sha256: string};
|
|
21
|
-
records: {total: number | null; byKind: Record<string, number>}; totals: Json;
|
|
22
|
-
}
|
|
23
|
-
export interface ImportDoorPackageUpload {
|
|
24
|
-
readonly manifest: Readonly<DoorPackageManifest>;
|
|
25
|
-
readonly files: readonly Readonly<DoorPackageFile>[];
|
|
26
|
-
/** A verified file, bounded by the declaration and the caller's optional tighter limit. */
|
|
27
|
-
read(path: string, maxBytes?: number): Promise<Uint8Array>;
|
|
28
|
-
}
|
|
29
|
-
export interface ImportDoorPackageSource {
|
|
30
|
-
formats: readonly string[];
|
|
31
|
-
maxBytes: number;
|
|
32
|
-
maxSegments: number;
|
|
33
|
-
/** Return the whole logical snapshot, never one plan per segment or record wave. */
|
|
34
|
-
read(upload: ImportDoorPackageUpload, limits: Readonly<Required<ReaderLimits>>): ParsedRecord[] | Promise<ParsedRecord[]>;
|
|
35
|
-
}
|
|
36
15
|
/** One decoded source; existing adapters may keep the mount's format. */
|
|
37
16
|
export interface ImportDoorSource {
|
|
38
|
-
package?: ImportDoorPackageSource;
|
|
39
|
-
bounded?: ImportDoorBoundedSource;
|
|
40
17
|
mapping: ImportMapping;
|
|
41
18
|
parse(value: Json, index: number): ParsedRecord | ParsedRecord[];
|
|
42
19
|
ownerPrincipalId?: string;
|
|
@@ -95,7 +72,7 @@ export type ImportDoorOptions = ImportDoorMountOptions & (
|
|
|
95
72
|
parse?: undefined; mapping?: undefined; readRaw?: undefined;
|
|
96
73
|
});
|
|
97
74
|
export type DoorAccess = Pick<DoorGrant, 'action' | 'installationId' | 'email' | 'namespace'
|
|
98
|
-
| '
|
|
75
|
+
| 'maxBytes' | 'maxChunks' | 'maxRecords' | 'fingerprint' | 'approvalRecordId' | 'approvedAt' | 'catchup'>;
|
|
99
76
|
export interface ImportOperatorOptions extends ImportDoorRuntimeOptions {
|
|
100
77
|
installationId: string;
|
|
101
78
|
appOrigin: string;
|
|
@@ -142,6 +142,10 @@ function memberKey(key: string): ReturnType<typeof credentialKey> {
|
|
|
142
142
|
const name = credentialMember(decodedCredentialText(key));
|
|
143
143
|
return name === undefined ? undefined : { name, holds: value => !emptyCredential(value) };
|
|
144
144
|
}
|
|
145
|
+
/** The parsed URL, or undefined for text that looks like one but does not parse. */
|
|
146
|
+
function parseUrl(text: string): URL | undefined {
|
|
147
|
+
try { return new URL(text, 'https://credential-check.invalid'); } catch { return undefined; }
|
|
148
|
+
}
|
|
145
149
|
const looksLikeUrl = (value: string) => /^(?:https?:\/\/|\/|\?)/i.test(decodedCredentialText(value));
|
|
146
150
|
|
|
147
151
|
export function assertNoCredentials(value: unknown, policy?: PaginationCursorPolicy): void {
|
|
@@ -167,14 +171,19 @@ export function assertNoCredentials(value: unknown, policy?: PaginationCursorPol
|
|
|
167
171
|
} else if (typeof item === 'string') {
|
|
168
172
|
// Relative pagination links receive the same check as absolute links.
|
|
169
173
|
if (!looksLikeUrl(item)) return;
|
|
170
|
-
|
|
174
|
+
// Free text that merely starts like a URL (`http:// see below`) does not parse: it is prose,
|
|
175
|
+
// with no user name to find. Its raw text still goes through the query-key scans below.
|
|
176
|
+
const url = parseUrl(item);
|
|
171
177
|
const structure = decodedCredentialText(credentialUrlStructure(item, policy).split('#')[0]);
|
|
172
|
-
const decodedUrl =
|
|
173
|
-
if (url
|
|
174
|
-
|
|
178
|
+
const decodedUrl = parseUrl(structure);
|
|
179
|
+
if (url?.username || url?.password || decodedUrl?.username || decodedUrl?.password) throw new CredentialError('CREDENTIAL_IN_DURABLE_URL', { kind: 'url-userinfo' });
|
|
180
|
+
const rawQueryStart = item.indexOf('?'), rawFragmentStart = item.indexOf('#');
|
|
181
|
+
const search = url ? url.search.slice(1)
|
|
182
|
+
: rawQueryStart < 0 || (rawFragmentStart >= 0 && rawFragmentStart < rawQueryStart) ? '' : item.slice(rawQueryStart + 1, rawFragmentStart < 0 ? item.length : rawFragmentStart);
|
|
183
|
+
for (const pair of search.split('&')) {
|
|
175
184
|
if (credentialQueryKey(pair.split('=')[0], policy)) throw new CredentialError('CREDENTIAL_IN_DURABLE_URL', { kind: 'url-query' });
|
|
176
185
|
}
|
|
177
|
-
for (const child of url.searchParams.values()) visit(child);
|
|
186
|
+
if (url) for (const child of url.searchParams.values()) visit(child);
|
|
178
187
|
// Encoded delimiters outside opaque values must not hide credential keys.
|
|
179
188
|
// Any key introduced by decoding has no exact-wire cursor exemption.
|
|
180
189
|
// A decoded fragment delimiter must not truncate these query checks either.
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
ImporterRecord,
|
|
9
9
|
ImporterValidationIssue,
|
|
10
10
|
ImporterValidationResult,
|
|
11
|
+
MoveInImporterRecord,
|
|
11
12
|
VerifiedImporter,
|
|
12
13
|
} from './types.ts';
|
|
13
14
|
|
|
@@ -23,7 +24,7 @@ const strayPercent = /%(?![0-9A-Fa-f]{2})/;
|
|
|
23
24
|
const nonAscii = /[^\x00-\x7f]/;
|
|
24
25
|
|
|
25
26
|
export async function validateImporterEvidence(
|
|
26
|
-
records: ImporterRecord
|
|
27
|
+
records: Array<ImporterRecord | MoveInImporterRecord>,
|
|
27
28
|
evidence: ImporterEvidencePort | undefined,
|
|
28
29
|
issues: ImporterValidationIssue[],
|
|
29
30
|
): Promise<ImporterValidationResult['evidence']> {
|
|
@@ -37,6 +38,7 @@ export async function validateImporterEvidence(
|
|
|
37
38
|
for (let index = 0; index < records.length; index += 1) {
|
|
38
39
|
const record = records[index]!;
|
|
39
40
|
const path = `$.importers[${index}]`;
|
|
41
|
+
if (!('evidence' in record)) continue;
|
|
40
42
|
const reference = record.evidence as ImporterEvidenceReference;
|
|
41
43
|
const receipt = await resolveAndCheckArtifact(reference, evidence, `${path}.evidence`, issues, counters);
|
|
42
44
|
if (!receipt) continue;
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
ImporterValidationIssue,
|
|
7
7
|
ImporterValidationResult,
|
|
8
8
|
ImportersDocument,
|
|
9
|
+
MoveInImporterRecord,
|
|
9
10
|
} from './types.ts';
|
|
10
11
|
|
|
11
12
|
export type * from './types.ts';
|
|
@@ -22,7 +23,18 @@ export async function validateImporters(
|
|
|
22
23
|
const counters: ImporterValidationResult['evidence'] = { required: 0, resolved: 0, verifiedReceipts: 0 };
|
|
23
24
|
if (issues.length > 0) return result(issues, counters);
|
|
24
25
|
|
|
25
|
-
const
|
|
26
|
+
const { schemaVersion, importers } = document as ImportersDocument;
|
|
27
|
+
const records = importers as Array<ImporterRecord | MoveInImporterRecord>;
|
|
28
|
+
// Version 1 rows carry no Move in fields and version 2 rows all three; the schema allows either row shape in either file.
|
|
29
|
+
for (let index = 0; index < records.length; index += 1) {
|
|
30
|
+
if (Object.hasOwn(records[index]!, 'moveIn') !== (schemaVersion === 2)) {
|
|
31
|
+
issues.push({ code: 'SCHEMA_VERSION_ROW', path: `$.importers[${index}]`, message: schemaVersion === 2 ? 'Every version 2 row declares moveIn, accepts and export.' : 'Move in fields need schemaVersion 2.' });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (schemaVersion === 1 && Object.hasOwn(document as object, 'format')) {
|
|
35
|
+
issues.push({ code: 'SCHEMA_VERSION_ROW', path: '$.format', message: 'The import format path needs schemaVersion 2.' });
|
|
36
|
+
}
|
|
37
|
+
if (issues.length > 0) return result(issues, counters);
|
|
26
38
|
const seen = new Map<string, number>();
|
|
27
39
|
for (let index = 0; index < records.length; index += 1) {
|
|
28
40
|
const record = records[index]!;
|
|
@@ -43,7 +55,10 @@ export async function validateImporters(
|
|
|
43
55
|
}
|
|
44
56
|
if (issues.length > 0) return result(issues, counters);
|
|
45
57
|
|
|
46
|
-
|
|
58
|
+
// A row with no status declares only its Move in page; it has no evidence to resolve.
|
|
59
|
+
const evidenced = records.some((record) => 'evidence' in record);
|
|
60
|
+
if (!evidenced) return result(issues, counters);
|
|
61
|
+
const evidenceCounters = await validateImporterEvidence(records, evidence, issues);
|
|
47
62
|
return result(issues, evidenceCounters);
|
|
48
63
|
}
|
|
49
64
|
|
|
@@ -13,6 +13,8 @@ interface JsonSchema {
|
|
|
13
13
|
pattern?: string;
|
|
14
14
|
minimum?: number;
|
|
15
15
|
minItems?: number;
|
|
16
|
+
maxItems?: number;
|
|
17
|
+
uniqueItems?: boolean;
|
|
16
18
|
minProperties?: number;
|
|
17
19
|
required?: string[];
|
|
18
20
|
properties?: Record<string, JsonSchema>;
|
|
@@ -91,6 +93,12 @@ function schemaIssues(value: unknown, schema: JsonSchema, root: JsonSchema, path
|
|
|
91
93
|
if (schema.minItems !== undefined && value.length < schema.minItems) {
|
|
92
94
|
issues.push({ code: 'SCHEMA_MIN_ITEMS', path, message: `Array must contain at least ${schema.minItems} item(s).` });
|
|
93
95
|
}
|
|
96
|
+
if (schema.maxItems !== undefined && value.length > schema.maxItems) {
|
|
97
|
+
issues.push({ code: 'SCHEMA_MAX_ITEMS', path, message: `Array must contain no more than ${schema.maxItems} item(s).` });
|
|
98
|
+
}
|
|
99
|
+
if (schema.uniqueItems && new Set(value.map(canonicalJson)).size !== value.length) {
|
|
100
|
+
issues.push({ code: 'SCHEMA_UNIQUE_ITEMS', path, message: 'Array items must be unique.' });
|
|
101
|
+
}
|
|
94
102
|
if (schema.items) {
|
|
95
103
|
for (let index = 0; index < value.length; index += 1) {
|
|
96
104
|
issues.push(...schemaIssues(value[index], schema.items, root, `${path}[${index}]`));
|
|
@@ -47,14 +47,35 @@ export interface NoImporter {
|
|
|
47
47
|
evidence: NoneEvidence;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/** A version 1 row: the evidence-bound status of an importer. */
|
|
50
51
|
export type ImporterRecord = VerifiedImporter | DocumentedImporter | NoImporter;
|
|
51
52
|
|
|
52
|
-
export
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
export type MoveInAccepts = 'file' | 'key' | 'address';
|
|
54
|
+
|
|
55
|
+
/** What a seed's Move in page takes and how to get it out of the old tool (version 2). */
|
|
56
|
+
export interface MoveInDeclaration {
|
|
57
|
+
/** The seed's Move in path; starts with `/`. */
|
|
58
|
+
moveIn: string;
|
|
59
|
+
/** A non-empty subset of file, key and address. */
|
|
60
|
+
accepts: MoveInAccepts[];
|
|
61
|
+
/** One short paragraph of plain text, at most 1,000 characters. */
|
|
62
|
+
export: string;
|
|
56
63
|
}
|
|
57
64
|
|
|
65
|
+
/** A version 2 row; `status` and `evidence` appear together or not at all. */
|
|
66
|
+
export type MoveInImporterRecord =
|
|
67
|
+
| ({ incumbent: string; product: string } & MoveInDeclaration)
|
|
68
|
+
| (VerifiedImporter & MoveInDeclaration)
|
|
69
|
+
| (DocumentedImporter & MoveInDeclaration)
|
|
70
|
+
| (NoImporter & MoveInDeclaration);
|
|
71
|
+
|
|
72
|
+
export type ImportersDocument = {
|
|
73
|
+
$schema: './schema/importers.schema.json';
|
|
74
|
+
} & (
|
|
75
|
+
| { schemaVersion: 1; importers: ImporterRecord[]; format?: undefined }
|
|
76
|
+
| { schemaVersion: 2; importers: MoveInImporterRecord[]; format?: string }
|
|
77
|
+
);
|
|
78
|
+
|
|
58
79
|
/** A resolver must return the bytes it actually resolved and the final URL. */
|
|
59
80
|
export interface ResolvedEvidenceArtifact {
|
|
60
81
|
url: string;
|
package/package.json
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { withUploadedBundle, door, DOOR_ID, count, plural } from './vendor-door.mjs';
|
|
2
|
-
|
|
3
|
-
// Key order is not part of the door's counts; compare them as values.
|
|
4
|
-
const stable = value => JSON.stringify(value, (_, item) => item && typeof item === 'object' && !Array.isArray(item) ? Object.fromEntries(Object.entries(item).sort(([a], [b]) => a.localeCompare(b))) : item);
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Perform a claimed switchoff.archive: the vendor's final export uploaded into
|
|
8
|
-
* the app's import door, kept there by the door's `archive` action as the tool's
|
|
9
|
-
* archive in the app's own storage (`business-archive/<tool>/<takenAt>`, the tool
|
|
10
|
-
* being the vendor's namespace), then read back by the door's `restore-check`,
|
|
11
|
-
* which parses it and writes nothing native. Run checks that the archive and its
|
|
12
|
-
* test-restore are exactly this bundle, then completes with the archive_id and
|
|
13
|
-
* the bundle's SHA-256; Business runs its own restore-check before the task is
|
|
14
|
-
* done. Returns the line to say.
|
|
15
|
-
*/
|
|
16
|
-
export function runArchive({ lease, task, grant, directory, say, ownerPage }) {
|
|
17
|
-
const takenAt = new Date().toISOString();
|
|
18
|
-
return withUploadedBundle({ lease, task, grant, directory, say,
|
|
19
|
-
doing: (name, origin, keyed) => `Archiving the final ${name} export through the shipped read-only adapter. ${keyed ? 'The key stays on this computer; the archive' : 'The archive'} goes only to the app's import door at ${origin} and stays in the app's own storage.` },
|
|
20
|
-
async ({ vendor, name, origin, uploadId, bundle, fresh }) => {
|
|
21
|
-
const kept = await door(await fresh('archive'), { uploadId, tool: vendor, takenAt }, lease.signal);
|
|
22
|
-
const [input, unique, rejected] = ['input', 'unique', 'rejected'].map(field => count(kept.counts?.[field]));
|
|
23
|
-
if (typeof kept.archiveId !== 'string' || !DOOR_ID.test(kept.archiveId) || kept.key !== `business-archive/${vendor}/${takenAt}` || kept.tool !== vendor
|
|
24
|
-
|| kept.takenAt !== takenAt || kept.bundleSha256 !== bundle.sha256 || kept.bytes !== bundle.size || [input, unique, rejected].includes(null)) throw Error("The app's import door returned an invalid archive answer.");
|
|
25
|
-
// The door reads its own copy back and parses it as a restore would, with no native writes.
|
|
26
|
-
const restored = await door(await fresh('restore-check'), { archiveId: kept.archiveId }, lease.signal);
|
|
27
|
-
if (restored.archiveId !== kept.archiveId || restored.key !== kept.key || restored.bundleSha256 !== bundle.sha256 || restored.bytes !== bundle.size
|
|
28
|
-
|| stable(restored.counts) !== stable(kept.counts) || !Array.isArray(restored.rejected)) throw Error(`The app's test-restore of the ${name} archive does not match the exported file. The archive was not reported.`);
|
|
29
|
-
return { outputs: { archive_id: kept.archiveId, bundle_sha256: bundle.sha256 },
|
|
30
|
-
said: `Archive kept in ${origin} as ${kept.key}: ${plural(bundle.size, 'byte')}, ${plural(unique, 'source record')}, test-restored with no writes (${rejected} rejected). Business test-restores it again itself; cancelling ${name} stays the owner's step in the browser: ${ownerPage}` };
|
|
31
|
-
});
|
|
32
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { WaveTotals, WaveBinding } from '../../modules/import-kit/src/door/waves/types.ts';
|
|
2
|
-
export interface BoundedApproval { id: string; at: string }
|
|
3
|
-
export interface BoundedArrangement {
|
|
4
|
-
protocol: 'rer-bounded-waves/1'; migration: string; revision: string; policy: string;
|
|
5
|
-
catchup?: boolean; parentId?: string;
|
|
6
|
-
parentApproval?: BoundedApproval & { fingerprint: string };
|
|
7
|
-
children?: { ordinal: number; fingerprint: string; approval?: BoundedApproval }[];
|
|
8
|
-
}
|
|
9
|
-
export interface BoundedAggregate {
|
|
10
|
-
protocol: 'rer-bounded-waves/1'; parentId: string; fingerprint: string;
|
|
11
|
-
aggregateSuccess: true; nativeSuccess: boolean; completeHead: string; counts: WaveTotals;
|
|
12
|
-
goneButRetained: { kind: string; sourceId: string }[]; children: number;
|
|
13
|
-
}
|
|
14
|
-
export interface BoundedPending {
|
|
15
|
-
parentId: string; state: 'awaiting_parent_approval' | 'awaiting_child_approval' | 'partial';
|
|
16
|
-
aggregateSuccess: false; fingerprint?: string; ordinal?: number; children?: unknown[];
|
|
17
|
-
}
|
|
18
|
-
export function sendBoundedWaves(options: {
|
|
19
|
-
arrangement: BoundedArrangement; uploadId: string; signal: AbortSignal;
|
|
20
|
-
fresh(action: string, extra: { bounded: WaveBinding }): Promise<unknown>;
|
|
21
|
-
request(grant: unknown, body: Record<string, unknown>, signal: AbortSignal): Promise<any>;
|
|
22
|
-
checkpoint?(progress: Record<string, string | number | boolean | undefined>): Promise<void>;
|
|
23
|
-
}): Promise<BoundedAggregate | BoundedPending>;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
const PROTOCOL = 'rer-bounded-waves/1';
|
|
2
|
-
const digest = value => typeof value === 'string' && /^[a-f0-9]{64}$/.test(value);
|
|
3
|
-
const id = value => typeof value === 'string' && /^[A-Za-z0-9_-]{1,128}$/.test(value);
|
|
4
|
-
/** Business supplies a typed arrangement and fresh grants. The sender cannot
|
|
5
|
-
* choose a destination or manufacture any parent/child approval. */
|
|
6
|
-
export async function sendBoundedWaves({ arrangement, uploadId, fresh, request, signal, checkpoint = async () => {} }) {
|
|
7
|
-
if (arrangement?.protocol !== PROTOCOL || !['migration','revision','policy'].every(k => id(arrangement[k]))) throw Error('BOUNDED_TASK_REQUIRED: Business must supply the typed bounded-wave arrangement.');
|
|
8
|
-
const binding = { protocol: PROTOCOL, migration: arrangement.migration, revision: arrangement.revision, policy: arrangement.policy };
|
|
9
|
-
const post = async (action, body, extra = {}) => {
|
|
10
|
-
signal.throwIfAborted();
|
|
11
|
-
const grant = await fresh(action, { bounded: { ...binding, ...extra } });
|
|
12
|
-
return request(grant, body, signal);
|
|
13
|
-
};
|
|
14
|
-
let parentId = arrangement.parentId;
|
|
15
|
-
if (parentId !== undefined && !id(parentId)) throw Error('Invalid bounded parent identifier.');
|
|
16
|
-
// Replaying page zero resolves the durable preparation cursor, including a
|
|
17
|
-
// response lost before Business saved the latest page checkpoint.
|
|
18
|
-
{
|
|
19
|
-
let ordinal = 0;
|
|
20
|
-
for (;;) {
|
|
21
|
-
const prepared = await post('prepare', { ...(parentId ? { parentId } : { uploadId, ...(arrangement.catchup ? { catchup: true } : {}) }), ordinal });
|
|
22
|
-
if (!id(prepared.parentId) || !Number.isSafeInteger(prepared.next) || prepared.next <= ordinal) throw Error('Invalid bounded preparation response.');
|
|
23
|
-
parentId = prepared.parentId; ordinal = prepared.next;
|
|
24
|
-
await checkpoint({ parent_id: parentId, prepared_children: ordinal, aggregate_success: false });
|
|
25
|
-
const status = await post('wave-status', { parentId });
|
|
26
|
-
if (!Number.isSafeInteger(status.census?.children) || status.census.children < ordinal) throw Error('Invalid complete census response.');
|
|
27
|
-
if (ordinal === status.census.children) break;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (!id(parentId)) throw Error('Invalid bounded parent identifier.');
|
|
31
|
-
const sealed = await post('seal-parent', { parentId });
|
|
32
|
-
if (!digest(sealed.fingerprint) || sealed.parentId !== parentId || !Array.isArray(sealed.children)) throw Error('Invalid sealed parent response.');
|
|
33
|
-
const approval = arrangement.parentApproval;
|
|
34
|
-
if (!approval) return { parentId, fingerprint: sealed.fingerprint, state: 'awaiting_parent_approval', aggregateSuccess: false, children: sealed.children };
|
|
35
|
-
if (approval.fingerprint !== sealed.fingerprint || !Array.isArray(arrangement.children) || arrangement.children.length !== sealed.children.length
|
|
36
|
-
|| arrangement.children.some((c, i) => c.ordinal !== i || c.fingerprint !== sealed.children[i].fingerprint)) throw Error('Business approvals differ from the immutable server children.');
|
|
37
|
-
const parentBinding = { parentFingerprint: approval.fingerprint, parentApprovalRecordId: approval.id, parentApprovedAt: approval.at };
|
|
38
|
-
await post('review-parent', { parentId }, parentBinding);
|
|
39
|
-
for (const child of arrangement.children) {
|
|
40
|
-
// Approvals are request/grant inputs to Business, never proof from this task.
|
|
41
|
-
if (!child.approval) return { parentId, state: 'awaiting_child_approval', ordinal: child.ordinal, aggregateSuccess: false };
|
|
42
|
-
for (;;) {
|
|
43
|
-
const status = await post('wave-status', { parentId });
|
|
44
|
-
if (status.state === 'withdrawn') throw Error('Bounded parent was withdrawn.');
|
|
45
|
-
const current = status.children?.[child.ordinal];
|
|
46
|
-
if (!current || current.fingerprint !== child.fingerprint) throw Error('Server child inventory changed.');
|
|
47
|
-
if (current.childSuccess) break;
|
|
48
|
-
const applied = await post('apply-child', { parentId, ordinal: child.ordinal, reviewedFingerprint: child.fingerprint }, { ...parentBinding, childFingerprint: child.fingerprint });
|
|
49
|
-
await checkpoint({ parent_id: parentId, child: child.ordinal, job_id: applied.job?.id, child_success: applied.childSuccess === true, aggregate_success: false });
|
|
50
|
-
if (!applied.job || ['failed','undone','rolled_back'].includes(applied.job.state)) return { parentId, state: 'partial', ordinal: child.ordinal, aggregateSuccess: false };
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const aggregate = await post('finalize-parent', { parentId }, parentBinding);
|
|
54
|
-
if (aggregate.parentId !== parentId || aggregate.fingerprint !== sealed.fingerprint || aggregate.aggregateSuccess !== true || aggregate.completeHead !== parentId) throw Error('Destination did not return a complete aggregate receipt.');
|
|
55
|
-
await checkpoint({ parent_id: parentId, aggregate_success: true });
|
|
56
|
-
return aggregate;
|
|
57
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { sendBoundedWaves } from './bounded-waves.mjs';
|
|
2
|
-
import { ExportWaiting } from './vendor-door.mjs';
|
|
3
|
-
import { withUploadedBundle, door, checkedPreview, plural } from './vendor-door.mjs';
|
|
4
|
-
|
|
5
|
-
// Why the door refused a catch-up under the owner's standing approval
|
|
6
|
-
// (import-kit door, "Catch-up and recovery": `catchup_requires_proposal:<reason>`).
|
|
7
|
-
const beyond = {
|
|
8
|
-
empty_baseline: 'the app holds no earlier import to compare with',
|
|
9
|
-
source_records_gone: 'records were removed in the old tool',
|
|
10
|
-
native_or_mapping_conflict: 'records changed in the app since they were imported',
|
|
11
|
-
rejected_or_unmapped_records: 'some records cannot be brought over as they are',
|
|
12
|
-
change_must_be_under_five_percent: '5% or more of the records changed',
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Perform a claimed catchup.vendor: the vendor's current export uploaded into the
|
|
17
|
-
* app's import door, then a catch-up plan of it (a zero-write preview of what
|
|
18
|
-
* changed since the import). Business mints the plan grant under the owner's
|
|
19
|
-
* standing catch-up approval when one covers this tool; the door then refuses a
|
|
20
|
-
* change at or above its bound, and run asks for a plan grant for the owner's
|
|
21
|
-
* review instead. Completion reports the door's upload_id and plan_id and the
|
|
22
|
-
* bundle's SHA-256; Business applies the plan under the standing approval or
|
|
23
|
-
* after the owner approves it. Returns the line to say.
|
|
24
|
-
*/
|
|
25
|
-
export function runCatchup({ lease, task, grant, directory, say, ownerPage }) {
|
|
26
|
-
return withUploadedBundle({ lease, task, grant, directory, say,
|
|
27
|
-
doing: (name, origin, keyed) => `Bringing over recent ${name} changes through the shipped read-only adapter. ${keyed ? 'The key stays on this computer; records' : 'Records'} go only to the app's import door at ${origin}.` },
|
|
28
|
-
async ({ origin, uploadId, bundle, fresh, preview: uploadedPreview }) => {
|
|
29
|
-
if (task.bounded_waves) {
|
|
30
|
-
const result=await sendBoundedWaves({arrangement:{...task.bounded_waves,catchup:true},uploadId,fresh,request:door,signal:lease.signal,checkpoint:cp=>lease.checkpointSaved(cp)});
|
|
31
|
-
if (!result.aggregateSuccess) throw new ExportWaiting(`Bounded catch-up ${result.parentId} is ${result.state}; no complete migration receipt.`, 'configuration_required');
|
|
32
|
-
return {outputs:{parent_id:result.parentId,parent_fingerprint:result.fingerprint,aggregate_success:true},said:`Destination ${origin} reconciled the complete bounded catch-up ${result.parentId}.`};
|
|
33
|
-
}
|
|
34
|
-
let planGrant = await fresh('plan'), refused = null, preview;
|
|
35
|
-
try { preview = uploadedPreview ?? await door(planGrant, { uploadId, catchup: true }, lease.signal); }
|
|
36
|
-
catch (error) {
|
|
37
|
-
const reason = planGrant.catchup === 'bounded' && /^catchup_requires_proposal:([a-z0-9_]+)$/.exec(error.doorCode ?? '')?.[1];
|
|
38
|
-
if (!reason) throw error;
|
|
39
|
-
refused = Object.hasOwn(beyond, reason) ? beyond[reason] : 'it is more than that approval covers';
|
|
40
|
-
planGrant = await fresh('plan', { review: true });
|
|
41
|
-
preview = await door(planGrant, { uploadId, catchup: true }, lease.signal);
|
|
42
|
-
}
|
|
43
|
-
const { records, created, updated, unchanged, gone, rejected } = checkedPreview(preview, bundle);
|
|
44
|
-
const planned = `Catch-up planned in ${origin}: ${plural(records, 'source record')}; ${created} new, ${updated} changed, ${unchanged} unchanged, ${gone} gone, ${rejected} rejected.`;
|
|
45
|
-
return { outputs: { upload_id: uploadId, plan_id: preview.planId, bundle_sha256: bundle.sha256 },
|
|
46
|
-
said: planGrant.catchup === 'bounded' ? `${planned} It is within the owner's standing catch-up approval, so Business applies it and checks the result.`
|
|
47
|
-
: `${planned} ${refused ? `It needs the owner's own approval (${refused}): nothing` : 'Nothing'} changes in the app until the owner approves this catch-up in the browser: ${ownerPage}` };
|
|
48
|
-
});
|
|
49
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// The non-secret inputs a leased vendor task carries for its shipped adapter
|
|
2
|
-
// (the executor task view's `export_inputs`, platform executors/tasks.ts): one
|
|
3
|
-
// closed shape per vendor, never a key. Business fills them from the Business's
|
|
4
|
-
// inventory evidence and the owner's answers; a window the plan does not state
|
|
5
|
-
// is the vendor's full history (`since` null or absent).
|
|
6
|
-
//
|
|
7
|
-
// sentry {organization: {id, slug, region: 'us'|'de'}, window: {since}}
|
|
8
|
-
// pagerduty {window: {since}, schedules: 'all'} (the plan moves every rota and
|
|
9
|
-
// keeps PagerDuty as the pager)
|
|
10
|
-
// sorry {page: {host}}
|
|
11
|
-
// uptimerobot needs none.
|
|
12
|
-
|
|
13
|
-
const DAY = 86_400_000;
|
|
14
|
-
const invalid = () => { throw Error('Business returned invalid export inputs for this task.'); };
|
|
15
|
-
const plain = value => value && typeof value === 'object' && !Array.isArray(value) ? value : invalid();
|
|
16
|
-
function closed(value, required, optional = []) {
|
|
17
|
-
plain(value);
|
|
18
|
-
if (Object.keys(value).some(key => !required.includes(key) && !optional.includes(key)) || required.some(key => !Object.hasOwn(value, key))) invalid();
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
const sourceId = value => typeof value === 'string' && /^[A-Za-z0-9_-]{1,128}$/.test(value) ? value : invalid();
|
|
22
|
-
/** The window's start as an ISO instant, or null for the vendor's full history. */
|
|
23
|
-
function since(window) {
|
|
24
|
-
closed(window, [], ['since']);
|
|
25
|
-
const value = window.since ?? null;
|
|
26
|
-
if (value === null) return null;
|
|
27
|
-
if (typeof value !== 'string' || value.length > 40 || !/^\d{4}-\d\d-\d\dT/.test(value) || !Number.isFinite(Date.parse(value))) invalid();
|
|
28
|
-
return new Date(value).toISOString();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const shapes = {
|
|
32
|
-
zendesk(value) {
|
|
33
|
-
closed(value, ['account'], ['mode','highWater']);
|
|
34
|
-
const account = closed(value.account, ['subdomain']);
|
|
35
|
-
if (typeof account.subdomain !== 'string' || !/^(?!-)[a-z0-9-]{1,63}(?<!-)$/u.test(account.subdomain)
|
|
36
|
-
|| !['snapshot','sweep','census','retire'].includes(value.mode ?? 'snapshot')
|
|
37
|
-
|| value.highWater !== undefined && (!Number.isSafeInteger(value.highWater) || value.highWater < 0)
|
|
38
|
-
|| value.mode === 'sweep' && value.highWater === undefined) invalid();
|
|
39
|
-
return { account: { subdomain: account.subdomain }, mode: value.mode ?? 'snapshot', ...(value.highWater !== undefined ? { highWater: value.highWater } : {}) };
|
|
40
|
-
},
|
|
41
|
-
uptimerobot: () => ({}),
|
|
42
|
-
'happytohelp-legacy': () => ({}),
|
|
43
|
-
sentry(value, now) {
|
|
44
|
-
closed(value, ['organization', 'window']);
|
|
45
|
-
const organization = closed(value.organization, ['id', 'slug', 'region']);
|
|
46
|
-
if (!['us', 'de'].includes(organization.region)) invalid();
|
|
47
|
-
const id = Number.isSafeInteger(organization.id) && organization.id >= 0 ? String(organization.id) : sourceId(organization.id);
|
|
48
|
-
// Full history: from the start of time, which Sentry answers with all it retains.
|
|
49
|
-
return { organization: { id, slug: sourceId(organization.slug), region: organization.region }, start: since(value.window) ?? new Date(0).toISOString(), end: new Date(now).toISOString() };
|
|
50
|
-
},
|
|
51
|
-
pagerduty(value, now) {
|
|
52
|
-
closed(value, ['window', 'schedules']);
|
|
53
|
-
if (value.schedules !== 'all') invalid();
|
|
54
|
-
// Rotas move into Oncall beside PagerDuty, so the window runs in whole UTC days
|
|
55
|
-
// to two weeks ahead (the coming overrides; the default of Oncall's own
|
|
56
|
-
// exporter). Oncall compares a schedule's final timeline over at most 31 days
|
|
57
|
-
// and refuses a longer one, so the window starts at the plan's `since` or 31
|
|
58
|
-
// days before its end, whichever is later.
|
|
59
|
-
const until = Math.floor(now / DAY) * DAY + 14 * DAY, start = since(value.window), floor = until - 31 * DAY;
|
|
60
|
-
return { start: new Date(start === null ? floor : Math.max(Math.floor(Date.parse(start) / DAY) * DAY, floor)).toISOString(), end: new Date(until).toISOString() };
|
|
61
|
-
},
|
|
62
|
-
sorry(value) {
|
|
63
|
-
closed(value, ['page']);
|
|
64
|
-
const page = closed(value.page, ['host']);
|
|
65
|
-
if (typeof page.host !== 'string' || page.host.length > 253 || !/^[a-z0-9.-]+$/.test(page.host)) invalid();
|
|
66
|
-
return { page: { host: page.host } };
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
/** What each vendor's inputs are, in the owner's terms, while a task lacks them. */
|
|
70
|
-
export const inputNeeds = { zendesk: 'its Zendesk account subdomain', sentry: 'its Sentry organization and export window', pagerduty: 'its export window', sorry: "its status page's address" };
|
|
71
|
-
|
|
72
|
-
/** The shipped adapter's inputs for `vendor` from the leased task's
|
|
73
|
-
* `export_inputs`, or null when the task carries none yet. */
|
|
74
|
-
export function exportInputs(vendor, task, now = Date.now()) {
|
|
75
|
-
if (!Object.hasOwn(shapes, vendor)) return null;
|
|
76
|
-
if (vendor === 'uptimerobot' || vendor === 'happytohelp-legacy') return {};
|
|
77
|
-
if (task.export_inputs === undefined || task.export_inputs === null) return null;
|
|
78
|
-
return shapes[vendor](task.export_inputs, now);
|
|
79
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { sendBoundedWaves } from './bounded-waves.mjs';
|
|
2
|
-
import { ExportWaiting } from './vendor-door.mjs';
|
|
3
|
-
import { withUploadedBundle, door, checkedPreview, plural } from './vendor-door.mjs';
|
|
4
|
-
|
|
5
|
-
/** Perform a claimed export.vendor: the shipped adapter's bundle uploaded into
|
|
6
|
-
* the app's import door, then the door's plan (a zero-write preview), then
|
|
7
|
-
* completion with the door's upload_id and plan_id and the bundle's SHA-256.
|
|
8
|
-
* Returns the line to say. */
|
|
9
|
-
export function runExport({ lease, task, grant, directory, say, ownerPage }) {
|
|
10
|
-
return withUploadedBundle({ lease, task, grant, directory, say,
|
|
11
|
-
doing: (name, origin, keyed) => `Exporting ${name} through the shipped read-only adapter. ${keyed ? 'The key stays on this computer; records' : 'Records'} go only to the app's import door at ${origin}.` },
|
|
12
|
-
async ({ origin, uploadId, bundle, fresh, preview: uploadedPreview }) => {
|
|
13
|
-
if (task.bounded_waves) {
|
|
14
|
-
const result=await sendBoundedWaves({arrangement:task.bounded_waves,uploadId,fresh,request:door,signal:lease.signal,checkpoint:cp=>lease.checkpointSaved(cp)});
|
|
15
|
-
if (!result.aggregateSuccess) throw new ExportWaiting(`Bounded import ${result.parentId} is ${result.state}; no complete migration receipt.`, 'configuration_required');
|
|
16
|
-
return {outputs:{parent_id:result.parentId,parent_fingerprint:result.fingerprint,aggregate_success:true},said:`Destination ${origin} reconciled the complete bounded import ${result.parentId}.`};
|
|
17
|
-
}
|
|
18
|
-
const preview = uploadedPreview ?? await door(await fresh('plan'), { uploadId, ...(bundle.mode === 'sweep' ? { catchup: true } : {}) }, lease.signal), { records, created, updated, unchanged, rejected } = checkedPreview(preview, bundle);
|
|
19
|
-
// Identifiers only: Business reads that plan from the door with its own grants
|
|
20
|
-
// and completes the task only if it is the plan of exactly this bundle.
|
|
21
|
-
return { outputs: { upload_id: uploadId, plan_id: preview.planId, bundle_sha256: bundle.sha256 },
|
|
22
|
-
said: `Import preview ready in ${origin}: ${plural(records, 'source record')}; ${created} to create, ${updated} to update, ${unchanged} unchanged, ${rejected} rejected. Nothing was imported: the owner reviews and approves this move in the browser: ${ownerPage}` };
|
|
23
|
-
});
|
|
24
|
-
}
|