@vrplatform/kysely 1.3.45-stage.7 → 1.3.45-stage.710
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/build/.data.tar +2 -2
- package/build/main/control-plane/index.d.ts +28 -6
- package/build/main/control-plane/index.js.map +1 -1
- package/build/main/index.d.ts +11 -0
- package/build/main/index.js +131 -26
- package/build/main/index.js.map +1 -1
- package/build/main/local/index.js +98 -8
- package/build/main/local/index.js.map +1 -1
- package/build/main/postgres-error.d.ts +3 -3
- package/build/main/postgres-error.js +4 -3
- package/build/main/postgres-error.js.map +1 -1
- package/build/main/query/tenant/status.d.ts +1 -1
- package/build/main/query/tenant/status.js +4 -2
- package/build/main/query/tenant/status.js.map +1 -1
- package/build/main/regional.d.ts +1 -0
- package/build/main/regional.js +1 -0
- package/build/main/regional.js.map +1 -1
- package/build/main/test/index.d.ts +25 -2
- package/build/main/test/index.js +36 -5
- package/build/main/test/index.js.map +1 -1
- package/build/main/v1.generated.d.ts +151 -19
- package/build/main/v1.generated.js.map +1 -1
- package/build/migrations-v2/0000000000031-ui-permission-role-simplification.ts +70 -0
- package/build/migrations-v2/0000000000032-tenant-delete-ownership-cascades.ts +44 -0
- package/build/migrations-v2/0000000000033-plaid-connect-session-telemetry.ts +31 -0
- package/build/migrations-v2/0000000000033-reservation-issue-seed-bucket-index.ts +19 -0
- package/build/migrations-v2/0000000000034-retire-recent-classification-indexes.ts +29 -0
- package/build/migrations-v2/0000000000035-core-change-autovacuum.ts +24 -0
- package/build/migrations-v2/0000000000036-journal-entry-inactive-reason-constraint.ts +33 -0
- package/build/migrations-v2/0000000000037-journal-entry-inactive-reasons.ts +19 -0
- package/build/migrations-v2/0000000000038-journal-entry-group-inactive-reason.ts +14 -0
- package/build/migrations-v2/0000000000039-reservation-guest-breakdown.ts +19 -0
- package/build/migrations-v2/0000000000040-csv-import-source-identity-index.ts +23 -0
- package/build/migrations-v2/0000000000041-payment-returns.ts +38 -0
- package/build/migrations-v2/0000000000042-operation-resource-types.ts +609 -0
- package/build/migrations-v2/0000000000043-reservation-journal-freshness.ts +149 -0
- package/build/migrations-v2/0000000000044-reservation-journal-freshness-backfill.ts +254 -0
- package/build/migrations-v2/0000000000045-reservation-journal-freshness-revision-repair.ts +83 -0
- package/build/migrations-v2/0000000000046-materialized-reservation-journal-operations.ts +709 -0
- package/build/migrations-v2/0000000000047-public-audit-completion.ts +77 -0
- package/build/migrations-v2/0000000000048-reservation-journal-full-refresh-repair.ts +136 -0
- package/build/migrations-v2/0000000000049-queued-journal-operation-failures.ts +60 -0
- package/build/migrations-v2/0000000000050-connection-oauth-state.ts +43 -0
- package/build/migrations-v2/0000000000051-owner-statement-email-delivery.ts +134 -0
- package/build/migrations-v2/0000000000052-fee-journal-lock-skip-operations.ts +59 -0
- package/build/migrations-v2/0000000000053-fee-journal-lock-skip-null-attempt.ts +44 -0
- package/build/migrations-v2/0000000000054-journal-refresh-issue-codes.ts +16 -0
- package/build/migrations-v2/0000000000055-tenant-billing-subscription.ts +8 -0
- package/build/migrations-v2/0000000000056-journal-operation-failure-precedence.ts +306 -0
- package/build/migrations-v2/0000000000057-journal-invalidation-failure-code.ts +28 -0
- package/build/module/control-plane/index.d.ts +28 -6
- package/build/module/control-plane/index.js.map +1 -1
- package/build/module/index.d.ts +11 -0
- package/build/module/index.js +131 -26
- package/build/module/index.js.map +1 -1
- package/build/module/local/index.js +98 -8
- package/build/module/local/index.js.map +1 -1
- package/build/module/postgres-error.d.ts +3 -3
- package/build/module/postgres-error.js +4 -3
- package/build/module/postgres-error.js.map +1 -1
- package/build/module/query/tenant/status.d.ts +1 -1
- package/build/module/query/tenant/status.js +4 -2
- package/build/module/query/tenant/status.js.map +1 -1
- package/build/module/regional.d.ts +1 -0
- package/build/module/regional.js +1 -0
- package/build/module/regional.js.map +1 -1
- package/build/module/test/index.d.ts +25 -2
- package/build/module/test/index.js +35 -5
- package/build/module/test/index.js.map +1 -1
- package/build/module/v1.generated.d.ts +151 -19
- package/build/module/v1.generated.js.map +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
// PRO-18065: persist the diagnostic identifiers support needs to escalate
|
|
5
|
+
// Plaid Link failures (institution identity and structured exit errors).
|
|
6
|
+
// Columns are nullable and additive, so the migration is rewrite-free.
|
|
7
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
8
|
+
await sql`
|
|
9
|
+
alter table public.plaid_connect_session
|
|
10
|
+
add column institution_id text,
|
|
11
|
+
add column institution_name text,
|
|
12
|
+
add column exit_error_code text,
|
|
13
|
+
add column exit_error_type text,
|
|
14
|
+
add column exit_request_id text,
|
|
15
|
+
add column exit_view text,
|
|
16
|
+
add column exited_at timestamptz
|
|
17
|
+
`.execute(db);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
21
|
+
await sql`
|
|
22
|
+
alter table public.plaid_connect_session
|
|
23
|
+
drop column if exists institution_id,
|
|
24
|
+
drop column if exists institution_name,
|
|
25
|
+
drop column if exists exit_error_code,
|
|
26
|
+
drop column if exists exit_error_type,
|
|
27
|
+
drop column if exists exit_request_id,
|
|
28
|
+
drop column if exists exit_view,
|
|
29
|
+
drop column if exists exited_at
|
|
30
|
+
`.execute(db);
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
5
|
+
await sql`
|
|
6
|
+
create index if not exists reservation_issue_seed_bucket_idx
|
|
7
|
+
on public.reservation (
|
|
8
|
+
(get_byte(uuid_send(id), 15) % 60),
|
|
9
|
+
id
|
|
10
|
+
)
|
|
11
|
+
include (tenant_id)
|
|
12
|
+
`.execute(db);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
16
|
+
await sql`
|
|
17
|
+
drop index if exists public.reservation_issue_seed_bucket_idx
|
|
18
|
+
`.execute(db);
|
|
19
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
5
|
+
await sql`
|
|
6
|
+
drop index if exists public.payment_line_recent_classification_idx
|
|
7
|
+
`.execute(db);
|
|
8
|
+
await sql`
|
|
9
|
+
drop index if exists
|
|
10
|
+
accounting.transaction_line_recent_classification_idx
|
|
11
|
+
`.execute(db);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
15
|
+
await sql`
|
|
16
|
+
create index if not exists payment_line_recent_classification_idx
|
|
17
|
+
on public.payment_line (updated_at, type2)
|
|
18
|
+
include (payment_id, reservation_id)
|
|
19
|
+
where type2 is not null and type2 != 'deviation'
|
|
20
|
+
`.execute(db);
|
|
21
|
+
await sql`
|
|
22
|
+
create index if not exists transaction_line_recent_classification_idx
|
|
23
|
+
on accounting.transaction_line (
|
|
24
|
+
updated_at,
|
|
25
|
+
match_line_type_classification
|
|
26
|
+
)
|
|
27
|
+
where match_line_type_classification is not null
|
|
28
|
+
`.execute(db);
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
5
|
+
await sql`set local lock_timeout = '5s'`.execute(db);
|
|
6
|
+
await sql`set local statement_timeout = '60s'`.execute(db);
|
|
7
|
+
await sql`
|
|
8
|
+
alter table core.change set (
|
|
9
|
+
autovacuum_vacuum_scale_factor = 0.001,
|
|
10
|
+
autovacuum_analyze_scale_factor = 0.001
|
|
11
|
+
)
|
|
12
|
+
`.execute(db);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
16
|
+
await sql`set local lock_timeout = '5s'`.execute(db);
|
|
17
|
+
await sql`set local statement_timeout = '60s'`.execute(db);
|
|
18
|
+
await sql`
|
|
19
|
+
alter table core.change reset (
|
|
20
|
+
autovacuum_vacuum_scale_factor,
|
|
21
|
+
autovacuum_analyze_scale_factor
|
|
22
|
+
)
|
|
23
|
+
`.execute(db);
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
5
|
+
await sql`set local lock_timeout = '5s'`.execute(db);
|
|
6
|
+
await sql`set local statement_timeout = '60s'`.execute(db);
|
|
7
|
+
await sql`
|
|
8
|
+
alter table accounting.journal_entry
|
|
9
|
+
add constraint journal_entry_inactive_reason_status_check
|
|
10
|
+
check (
|
|
11
|
+
(
|
|
12
|
+
status = 'inactive'
|
|
13
|
+
and inactive_reason is not null
|
|
14
|
+
)
|
|
15
|
+
or
|
|
16
|
+
(
|
|
17
|
+
status <> 'inactive'
|
|
18
|
+
and inactive_reason is null
|
|
19
|
+
)
|
|
20
|
+
) not valid
|
|
21
|
+
`.execute(db);
|
|
22
|
+
await sql`
|
|
23
|
+
alter table accounting.journal_entry
|
|
24
|
+
validate constraint journal_entry_inactive_reason_status_check
|
|
25
|
+
`.execute(db);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
29
|
+
await sql`
|
|
30
|
+
alter table accounting.journal_entry
|
|
31
|
+
drop constraint if exists journal_entry_inactive_reason_status_check
|
|
32
|
+
`.execute(db);
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
5
|
+
await sql`
|
|
6
|
+
alter type accounting.journal_entry_inactive_reason
|
|
7
|
+
add value if not exists 'historicalLedger'
|
|
8
|
+
before 'unknownInactiveReason'
|
|
9
|
+
`.execute(db);
|
|
10
|
+
await sql`
|
|
11
|
+
alter type accounting.journal_entry_inactive_reason
|
|
12
|
+
add value if not exists 'listingOwnershipPeriodNotFound'
|
|
13
|
+
before 'unknownInactiveReason'
|
|
14
|
+
`.execute(db);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function down(_db: Kysely<unknown>): Promise<void> {
|
|
18
|
+
// PostgreSQL enum values cannot be removed safely without rebuilding the type.
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
5
|
+
await sql`
|
|
6
|
+
alter type accounting.journal_entry_inactive_reason
|
|
7
|
+
add value if not exists 'unbalancedGroupInactiveLeg'
|
|
8
|
+
before 'unknownInactiveReason'
|
|
9
|
+
`.execute(db);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export async function down(_db: Kysely<unknown>): Promise<void> {
|
|
13
|
+
// PostgreSQL enum values cannot be removed safely without rebuilding the type.
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
5
|
+
await sql`set local lock_timeout = '180s'`.execute(db);
|
|
6
|
+
await sql`
|
|
7
|
+
alter table public.reservation
|
|
8
|
+
add column adults integer,
|
|
9
|
+
add column children integer
|
|
10
|
+
`.execute(db);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
14
|
+
await sql`
|
|
15
|
+
alter table public.reservation
|
|
16
|
+
drop column children,
|
|
17
|
+
drop column adults
|
|
18
|
+
`.execute(db);
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
5
|
+
await sql`
|
|
6
|
+
create index sync_csv_import_source_identity_idx
|
|
7
|
+
on core.sync (
|
|
8
|
+
tenant_id,
|
|
9
|
+
(params ->> 'resource'),
|
|
10
|
+
((params -> 'targetIdentity') ->> 'type'),
|
|
11
|
+
((params -> 'targetIdentity') ->> 'id'),
|
|
12
|
+
(params ->> 'sourceHash'),
|
|
13
|
+
created_at desc
|
|
14
|
+
)
|
|
15
|
+
where params @> '{"category":"csvImportV2"}'::jsonb
|
|
16
|
+
`.execute(db);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
20
|
+
await sql`
|
|
21
|
+
drop index core.sync_csv_import_source_identity_idx
|
|
22
|
+
`.execute(db);
|
|
23
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import { sql } from 'kysely';
|
|
3
|
+
|
|
4
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
5
|
+
await sql`set local lock_timeout = '5s'`.execute(db);
|
|
6
|
+
await sql`set local statement_timeout = '60s'`.execute(db);
|
|
7
|
+
await sql`
|
|
8
|
+
alter table accounting.transaction
|
|
9
|
+
add column returned_from_transaction_id uuid null
|
|
10
|
+
references accounting.transaction (id) on delete restrict,
|
|
11
|
+
add column return_effective_at timestamptz null,
|
|
12
|
+
add constraint transaction_payment_return_shape_check check (
|
|
13
|
+
(returned_from_transaction_id is null) = (return_effective_at is null)
|
|
14
|
+
and returned_from_transaction_id is distinct from id
|
|
15
|
+
and (
|
|
16
|
+
returned_from_transaction_id is null
|
|
17
|
+
or (type = 'payout' and cent_total > 0)
|
|
18
|
+
)
|
|
19
|
+
)
|
|
20
|
+
`.execute(db);
|
|
21
|
+
await sql`
|
|
22
|
+
create index transaction_returned_from_idx
|
|
23
|
+
on accounting.transaction (tenant_id, returned_from_transaction_id)
|
|
24
|
+
where returned_from_transaction_id is not null
|
|
25
|
+
`.execute(db);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
29
|
+
await sql`
|
|
30
|
+
drop index accounting.transaction_returned_from_idx
|
|
31
|
+
`.execute(db);
|
|
32
|
+
await sql`
|
|
33
|
+
alter table accounting.transaction
|
|
34
|
+
drop constraint transaction_payment_return_shape_check,
|
|
35
|
+
drop column return_effective_at,
|
|
36
|
+
drop column returned_from_transaction_id
|
|
37
|
+
`.execute(db);
|
|
38
|
+
}
|