@vrplatform/kysely 1.3.45-stage.119 → 1.3.45-stage.1247
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 +38 -2
- package/build/main/index.js +271 -55
- package/build/main/index.js.map +1 -1
- package/build/main/local/index.js +115 -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/listing/status.js +6 -2
- package/build/main/query/listing/status.js.map +1 -1
- package/build/main/query/tenant/status.d.ts +1 -1
- package/build/main/query/tenant/status.js +5 -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 +40 -8
- package/build/main/test/index.js.map +1 -1
- package/build/main/v1.generated.d.ts +195 -19
- package/build/main/v1.generated.js.map +1 -1
- 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/migrations-v2/0000000000058-journal-invalidation-locked-failure.ts +16 -0
- package/build/migrations-v2/0000000000059-billing-active-listing-cross-region-partner.ts +135 -0
- package/build/migrations-v2/0000000000060-accounting-integrity-change-driven.ts +99 -0
- package/build/migrations-v2/0000000000061-tenant-pending-onboarding-status.ts +37 -0
- package/build/migrations-v2/0000000000062-statement-payout-operations.ts +16 -0
- package/build/migrations-v2/0000000000063-missing-account-assignments-issue-code.ts +13 -0
- package/build/migrations-v2/0000000000064-journal-invalidation-source-lookup-index.ts +26 -0
- package/build/migrations-v2/0000000000065-hasura-connection-event-credentials.ts +42 -0
- package/build/migrations-v2/0000000000066-recurring-fee-listing-subscription-match-by.ts +51 -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 +38 -2
- package/build/module/index.js +269 -55
- package/build/module/index.js.map +1 -1
- package/build/module/local/index.js +115 -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/listing/status.js +6 -2
- package/build/module/query/listing/status.js.map +1 -1
- package/build/module/query/tenant/status.d.ts +1 -1
- package/build/module/query/tenant/status.js +5 -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 +39 -8
- package/build/module/test/index.js.map +1 -1
- package/build/module/v1.generated.d.ts +195 -19
- package/build/module/v1.generated.js.map +1 -1
- package/package.json +9 -7
|
@@ -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
|
+
}
|