@cosmicdrift/kumiko-framework 0.367.0 → 0.369.0
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/AGENTS.md +1 -7
- package/README.md +1 -1
- package/agents/examples/access-control.md +2 -2
- package/agents/examples/anonymous-access-multitenant.md +2 -2
- package/agents/examples/anonymous-access.md +3 -3
- package/agents/examples/apex-landing.md +1 -1
- package/agents/examples/apex-surface-auth.md +6 -7
- package/agents/examples/api-worker-split.md +7 -8
- package/agents/examples/auth-claims.md +2 -1
- package/agents/examples/auth-foundation-providers.md +3 -3
- package/agents/examples/auth-mfa.md +3 -4
- package/agents/examples/basic-entity.md +3 -4
- package/agents/examples/chat-channels.md +4 -4
- package/agents/examples/compliance-profiles-demo.md +2 -3
- package/agents/examples/cross-feature-events.md +4 -4
- package/agents/examples/crypto-shredding-hr.md +14 -9
- package/agents/examples/currencies-global.md +3 -4
- package/agents/examples/currencies-per-tenant.md +3 -4
- package/agents/examples/custom-fields-basic.md +2 -3
- package/agents/examples/custom-handlers.md +3 -5
- package/agents/examples/dashboard-stats.md +2 -3
- package/agents/examples/delivery-notifications.md +5 -6
- package/agents/examples/e2e-generator.md +1 -1
- package/agents/examples/embedded-entity-form.md +2 -3
- package/agents/examples/embedded.md +2 -3
- package/agents/examples/encrypted-tenant-config.md +5 -6
- package/agents/examples/error-contract.md +3 -4
- package/agents/examples/event-sourcing.md +19 -23
- package/agents/examples/feature-toggles.md +4 -4
- package/agents/examples/field-access.md +3 -4
- package/agents/examples/files-post-processing.md +12 -13
- package/agents/examples/golden-path.md +208 -0
- package/agents/examples/idempotency.md +2 -2
- package/agents/examples/inbound-mail-triage.md +7 -7
- package/agents/examples/lane-routing.md +3 -3
- package/agents/examples/ledger-banking.md +2 -3
- package/agents/examples/ledger-invoicing.md +2 -3
- package/agents/examples/legal-pages.md +1 -1
- package/agents/examples/lifecycle-hooks.md +3 -3
- package/agents/examples/managed-config.md +3 -4
- package/agents/examples/managed-pages.md +2 -2
- package/agents/examples/notes-history-basic.md +4 -5
- package/agents/examples/ownership.md +3 -5
- package/agents/examples/pdf-audit-export.md +2 -3
- package/agents/examples/pipeline-basics.md +2 -2
- package/agents/examples/public-share-token.md +3 -3
- package/agents/examples/rate-limiting.md +2 -1
- package/agents/examples/realtime-sse.md +2 -3
- package/agents/examples/record-detail-layout.md +1 -1
- package/agents/examples/reference-data.md +3 -3
- package/agents/examples/relations.md +2 -2
- package/agents/examples/screens-nav.md +1 -1
- package/agents/examples/search.md +2 -2
- package/agents/examples/secrets-demo.md +8 -8
- package/agents/examples/security-baseline.md +2 -2
- package/agents/examples/session-revocation.md +7 -8
- package/agents/examples/state-machine.md +181 -165
- package/agents/examples/tags-basic.md +2 -3
- package/agents/examples/tenant-isolation.md +2 -3
- package/agents/examples/tenant-settings.md +2 -2
- package/agents/examples/tier-admin.md +3 -4
- package/agents/examples/timezones.md +3 -3
- package/agents/examples/user-data-rights.md +12 -8
- package/agents/examples/user-profile.md +3 -3
- package/agents/examples/webhook-step.md +2 -3
- package/agents/examples/wizard-form.md +4 -5
- package/agents/examples/workflow-engine.md +7 -3
- package/agents/examples/writeform-section.md +1 -1
- package/agents/examples.md +1 -0
- package/agents/features.md +4 -4
- package/dist/consumer-cli.js +2 -3
- package/dist/crypto/index.d.ts +1 -1
- package/dist/crypto/index.js +1 -1
- package/dist/crypto/owner-transition-rekey.js +2 -0
- package/dist/crypto/pg-kms-adapter.js +1 -1
- package/dist/crypto/subject-resolver.d.ts +2 -0
- package/dist/crypto/subject-resolver.js +30 -15
- package/dist/db/bun-db-deprecated.d.ts +10 -0
- package/dist/{bun-db/index.js → db/bun-db-deprecated.js} +4 -3
- package/dist/db/config-seed.js +1 -1
- package/dist/db/connection.d.ts +23 -5
- package/dist/db/connection.js +10 -5
- package/dist/db/dialect.js +1 -1
- package/dist/db/entity-field-encryption.d.ts +5 -0
- package/dist/db/entity-field-encryption.js +29 -0
- package/dist/db/entity-table-meta.js +6 -5
- package/dist/db/event-store-executor-read.js +26 -5
- package/dist/db/index.d.ts +4 -4
- package/dist/db/index.js +1 -1
- package/dist/db/migrate-runner.js +1 -1
- package/dist/db/queries/backfill-pii.js +16 -9
- package/dist/db/queries/ddl.js +1 -1
- package/dist/db/queries/event-store.d.ts +2 -0
- package/dist/db/queries/event-store.js +26 -0
- package/dist/db/queries/test-stack.js +1 -1
- package/dist/db/query.d.ts +105 -1
- package/dist/db/query.js +1450 -3
- package/dist/{stack/table-helpers.d.ts → db/table-push.d.ts} +5 -15
- package/dist/{stack/table-helpers.js → db/table-push.js} +6 -46
- package/dist/db/tenant-db.d.ts +11 -0
- package/dist/db/tenant-db.js +51 -12
- package/dist/derivatives/derivatives-context.d.ts +1 -1
- package/dist/derivatives/derivatives-context.js +1 -1
- package/dist/engine/boot-validator/gdpr-storage.js +3 -3
- package/dist/engine/boot-validator/pii-retention.js +3 -3
- package/dist/engine/boot-validator/record-owned.js +3 -3
- package/dist/engine/boot-validator/screens.js +37 -1
- package/dist/engine/bridge-stub.d.ts +4 -0
- package/dist/engine/bridge-stub.js +62 -0
- package/dist/engine/build-config-feature-schema.js +197 -65
- package/dist/engine/event-helpers.d.ts +2 -1
- package/dist/engine/event-helpers.js +1 -0
- package/dist/engine/extension-selector-plugins.d.ts +3 -0
- package/dist/engine/extension-selector-plugins.js +14 -0
- package/dist/engine/feature-config-events-jobs.d.ts +2 -0
- package/dist/engine/feature-config-events-jobs.js +3 -2
- package/dist/engine/index.d.ts +1 -0
- package/dist/engine/index.js +1 -0
- package/dist/es-ops/operations-schema.js +1 -1
- package/dist/event-store/admin-api.js +1 -1
- package/dist/event-store/archive.js +1 -1
- package/dist/event-store/errors.d.ts +2 -1
- package/dist/event-store/errors.js +6 -2
- package/dist/event-store/event-store.js +17 -9
- package/dist/event-store/events-schema.js +1 -1
- package/dist/event-store/rebuild-dead-letter.js +3 -3
- package/dist/event-store/snapshot.js +1 -1
- package/dist/event-store/upcaster-dead-letter.js +3 -3
- package/dist/files/create-file-ref-from-bytes.js +1 -1
- package/dist/files/file-routes.js +1 -1
- package/dist/i18n/settings-hub-keys.js +1 -2
- package/dist/internal/stack-support.d.ts +12 -0
- package/dist/internal/stack-support.js +12 -0
- package/dist/internal/testing.d.ts +4 -0
- package/dist/internal/testing.js +5 -0
- package/dist/jobs/job-runner.js +23 -11
- package/dist/migrations/pending-rebuilds.js +1 -1
- package/dist/migrations/pii-event-backfill.js +2 -2
- package/dist/pipeline/dispatch-shared.js +43 -23
- package/dist/pipeline/dispatch-write.js +6 -2
- package/dist/pipeline/dispatcher-utils.js +6 -2
- package/dist/pipeline/event-consumer-state.js +1 -1
- package/dist/pipeline/projection-rebuild.d.ts +1 -0
- package/dist/pipeline/projection-rebuild.js +1 -1
- package/dist/pipeline/projection-state.js +1 -1
- package/dist/pipeline/system-hooks.js +1 -1
- package/dist/schema-cli.js +3 -3
- package/dist/search/purge-subject.js +20 -10
- package/dist/seeding/index.d.ts +1 -0
- package/dist/seeding/index.js +1 -0
- package/dist/stack/index.d.ts +10 -9
- package/dist/stack/index.js +11 -19
- package/dist/testing/e2e-generator.d.ts +5 -49
- package/dist/testing/e2e-generator.js +5 -382
- package/dist/testing/handler-context.d.ts +5 -4
- package/dist/testing/handler-context.js +5 -69
- package/dist/testing/index.d.ts +10 -26
- package/dist/testing/index.js +10 -34
- package/dist/testing/real-providers.d.ts +5 -3
- package/dist/testing/real-providers.js +5 -21
- package/dist/upgrade-cli.js +6 -4
- package/package.json +37 -9
- package/src/changes.json +64 -0
- package/src/scripts/codemod/README.md +43 -0
- package/src/scripts/codemod/codemod-support.ts +276 -0
- package/src/scripts/codemod/db-factory.ts +810 -0
- package/src/scripts/codemod/feature-factory.ts +429 -0
- package/src/scripts/codemod/s3-imports.ts +274 -0
- package/src/scripts/codemod/tenant-db-options.ts +454 -0
- package/src/scripts/codemod/testing-move-targets.ts +161 -0
- package/src/scripts/codemod/testing-move.ts +520 -0
- package/dist/bun-db/connection.d.ts +0 -17
- package/dist/bun-db/connection.js +0 -40
- package/dist/bun-db/index.d.ts +0 -4
- package/dist/bun-db/query.d.ts +0 -106
- package/dist/bun-db/query.js +0 -1457
- package/dist/db/api.d.ts +0 -19
- package/dist/db/api.js +0 -23
- package/dist/db/bun-provider.d.ts +0 -2
- package/dist/db/bun-provider.js +0 -28
- package/dist/db/postgres-provider.d.ts +0 -2
- package/dist/db/postgres-provider.js +0 -21
- package/dist/db/query-api.d.ts +0 -2
- package/dist/db/query-api.js +0 -6
- package/dist/stack/db.d.ts +0 -22
- package/dist/stack/db.js +0 -67
- package/dist/stack/drain-event-consumers.d.ts +0 -4
- package/dist/stack/drain-event-consumers.js +0 -51
- package/dist/stack/drain-jobs.d.ts +0 -22
- package/dist/stack/drain-jobs.js +0 -141
- package/dist/stack/event-collector.d.ts +0 -9
- package/dist/stack/event-collector.js +0 -12
- package/dist/stack/push-entity-projection-tables.d.ts +0 -24
- package/dist/stack/push-entity-projection-tables.js +0 -74
- package/dist/stack/redis.d.ts +0 -17
- package/dist/stack/redis.js +0 -52
- package/dist/stack/request-helper.d.ts +0 -35
- package/dist/stack/request-helper.js +0 -144
- package/dist/stack/test-stack.d.ts +0 -192
- package/dist/stack/test-stack.js +0 -429
- package/dist/testing/access-assertions.d.ts +0 -2
- package/dist/testing/access-assertions.js +0 -13
- package/dist/testing/assertions.d.ts +0 -10
- package/dist/testing/assertions.js +0 -22
- package/dist/testing/boot-validator-fixture.d.ts +0 -3
- package/dist/testing/boot-validator-fixture.js +0 -101
- package/dist/testing/closed-connection-error.d.ts +0 -7
- package/dist/testing/closed-connection-error.js +0 -46
- package/dist/testing/db-cleanup.d.ts +0 -9
- package/dist/testing/db-cleanup.js +0 -31
- package/dist/testing/expect-error.d.ts +0 -2
- package/dist/testing/expect-error.js +0 -22
- package/dist/testing/file-provider-contract.d.ts +0 -2
- package/dist/testing/file-provider-contract.js +0 -102
- package/dist/testing/http-cookies.d.ts +0 -7
- package/dist/testing/http-cookies.js +0 -47
- package/dist/testing/late-bound.d.ts +0 -9
- package/dist/testing/late-bound.js +0 -31
- package/dist/testing/manual-clock.d.ts +0 -14
- package/dist/testing/manual-clock.js +0 -12
- package/dist/testing/multipart-helper.d.ts +0 -22
- package/dist/testing/multipart-helper.js +0 -77
- package/dist/testing/mutable-master-key-provider.d.ts +0 -7
- package/dist/testing/mutable-master-key-provider.js +0 -35
- package/dist/testing/observability-recorder.d.ts +0 -9
- package/dist/testing/observability-recorder.js +0 -29
- package/dist/testing/seed.d.ts +0 -9
- package/dist/testing/seed.js +0 -21
- package/dist/testing/shared-entities.d.ts +0 -286
- package/dist/testing/shared-entities.js +0 -56
- package/dist/testing/utils.d.ts +0 -1
- package/dist/testing/utils.js +0 -1
- package/dist/testing/wait-for.d.ts +0 -20
- package/dist/testing/wait-for.js +0 -47
- package/dist/testing/without-ambient-temporal.d.ts +0 -5
- package/dist/testing/without-ambient-temporal.js +0 -17
- package/dist/testing/zip-fixture.d.ts +0 -1
- package/dist/testing/zip-fixture.js +0 -33
- /package/dist/{stack/test-users.d.ts → seeding/seed-users.d.ts} +0 -0
- /package/dist/{stack/test-users.js → seeding/seed-users.js} +0 -0
package/AGENTS.md
CHANGED
|
@@ -309,19 +309,13 @@ Each `agents/examples/<name>.md` starts with the sample's README, then every
|
|
|
309
309
|
source file with its path. `src/feature.ts` holds the feature;
|
|
310
310
|
`src/__tests__/*.integration.test.ts` shows how it is tested. Samples inside
|
|
311
311
|
the framework repo set up their stack with `setupTestStack` from
|
|
312
|
-
`@cosmicdrift/kumiko-
|
|
312
|
+
`@cosmicdrift/kumiko-testing/stack` and create tables in the test. In an
|
|
313
313
|
app, `setupAppTestStack` and `seedTenant` do that for you; keep the
|
|
314
314
|
assertions, take the setup from your scaffolded integration test. Table
|
|
315
315
|
setup in sample tests (`unsafeCreateEntityTable`, `createEventsTable`) and
|
|
316
316
|
any raw `DELETE FROM` cleanup are framework internals. Never copy them;
|
|
317
317
|
isolate tests with one tenant each.
|
|
318
318
|
|
|
319
|
-
Some samples import from `@app/define`. That alias points at the generated
|
|
320
|
-
`.kumiko/define.ts`, which re-exports the engine with event types narrowed to
|
|
321
|
-
the app's own `r.defineEvent` declarations. `bun dev` and `bun run build`
|
|
322
|
-
regenerate it; never edit it. Without it, import the same names from
|
|
323
|
-
`@cosmicdrift/kumiko-framework/engine`.
|
|
324
|
-
|
|
325
319
|
## Package entry points
|
|
326
320
|
|
|
327
321
|
Import only from these subpaths of `@cosmicdrift/kumiko-framework`. Deep
|
package/README.md
CHANGED
|
@@ -93,7 +93,7 @@ export const taskFeature = defineFeature("tasks", (r) => {
|
|
|
93
93
|
| `@cosmicdrift/kumiko-framework/files` | Signed-URL upload/download, tenant-scoped storage |
|
|
94
94
|
| `@cosmicdrift/kumiko-framework/i18n` | i18next setup, per-feature translation registration |
|
|
95
95
|
| `@cosmicdrift/kumiko-framework/ui` | React hooks (Zustand stores, SSE subscription, optimistic mutations) |
|
|
96
|
-
| `@cosmicdrift/kumiko-
|
|
96
|
+
| `@cosmicdrift/kumiko-testing/stack` | `setupTestStack`, `createTestDb`, request helpers |
|
|
97
97
|
| `@cosmicdrift/kumiko-framework/utils` | Safe JSON, qualified-name helpers |
|
|
98
98
|
| `@cosmicdrift/kumiko-framework/errors` | Error classes, `writeFailure`, reason contracts |
|
|
99
99
|
|
|
@@ -36,12 +36,12 @@ bun test
|
|
|
36
36
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
37
37
|
import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
|
|
38
38
|
import { createEventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
39
|
+
import { TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
39
40
|
import {
|
|
40
41
|
setupTestStack,
|
|
41
42
|
type TestStack,
|
|
42
|
-
TestUsers,
|
|
43
43
|
unsafeCreateEntityTable,
|
|
44
|
-
} from "@cosmicdrift/kumiko-
|
|
44
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
45
45
|
import { z } from "zod";
|
|
46
46
|
import {
|
|
47
47
|
accessControlFeature,
|
|
@@ -41,12 +41,12 @@ import { afterAll, beforeAll, beforeEach, describe, expect, test } from "bun:tes
|
|
|
41
41
|
import { setTenantCookie } from "@cosmicdrift/kumiko-framework/api";
|
|
42
42
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
43
43
|
import { createEventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
44
|
+
import { TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
44
45
|
import {
|
|
45
46
|
setupTestStack,
|
|
46
47
|
type TestStack,
|
|
47
|
-
TestUsers,
|
|
48
48
|
unsafeCreateEntityTable,
|
|
49
|
-
} from "@cosmicdrift/kumiko-
|
|
49
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
50
50
|
import { multiTenantShopFeature, productEntity } from "../feature";
|
|
51
51
|
import { createSubdomainResolver, extractSubdomain } from "../subdomain-resolver";
|
|
52
52
|
|
|
@@ -42,15 +42,15 @@ bun test
|
|
|
42
42
|
// callback that confirms the tenant is real (against DB or cache).
|
|
43
43
|
|
|
44
44
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
45
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
45
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
46
46
|
import { ANONYMOUS_USER_ID, type TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
47
47
|
import { createEventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
48
|
+
import { TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
48
49
|
import {
|
|
49
50
|
setupTestStack,
|
|
50
51
|
type TestStack,
|
|
51
|
-
TestUsers,
|
|
52
52
|
unsafeCreateEntityTable,
|
|
53
|
-
} from "@cosmicdrift/kumiko-
|
|
53
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
54
54
|
import {
|
|
55
55
|
anonymousAccessFeature,
|
|
56
56
|
guestOrderEntity,
|
|
@@ -143,7 +143,7 @@ import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
|
143
143
|
import { createConfigFeature } from "@cosmicdrift/kumiko-bundled-features/config";
|
|
144
144
|
import { createSeoFeature } from "@cosmicdrift/kumiko-bundled-features/seo";
|
|
145
145
|
import { defineFeature, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
146
|
-
import { setupTestStack, type TestStack } from "@cosmicdrift/kumiko-
|
|
146
|
+
import { setupTestStack, type TestStack } from "@cosmicdrift/kumiko-testing/stack";
|
|
147
147
|
import { renderLanding, SAMPLE_PLANS } from "../feature";
|
|
148
148
|
|
|
149
149
|
const LANDING_URL = "https://tasklane.example/";
|
|
@@ -137,16 +137,15 @@ import {
|
|
|
137
137
|
} from "@cosmicdrift/kumiko-bundled-features/compliance-profiles";
|
|
138
138
|
import { USER_STATUS, userEntity, userTable } from "@cosmicdrift/kumiko-bundled-features/user";
|
|
139
139
|
import type { SendDeletionVerificationEmailFn } from "@cosmicdrift/kumiko-bundled-features/user-data-rights";
|
|
140
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
140
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
141
141
|
import { createEventsTable, eventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
142
|
+
import { createTestUser, testTenantId } from "@cosmicdrift/kumiko-framework/seeding";
|
|
143
|
+
import { resetTestTables, seedRow } from "@cosmicdrift/kumiko-testing/helpers";
|
|
142
144
|
import {
|
|
143
|
-
createTestUser,
|
|
144
145
|
setupTestStack,
|
|
145
146
|
type TestStack,
|
|
146
|
-
testTenantId,
|
|
147
147
|
unsafeCreateEntityTable,
|
|
148
|
-
} from "@cosmicdrift/kumiko-
|
|
149
|
-
import { resetTestTables, seedRow } from "@cosmicdrift/kumiko-framework/testing";
|
|
148
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
150
149
|
import { composeApexAccountApp } from "../feature";
|
|
151
150
|
|
|
152
151
|
const REQUEST_BY_EMAIL = "user-data-rights:write:request-deletion-by-email";
|
|
@@ -304,7 +303,7 @@ describe("apex-surface-auth recipe", () => {
|
|
|
304
303
|
// anonymousAccess: { defaultTenantId: APEX_TENANT_ID } })
|
|
305
304
|
|
|
306
305
|
import { createAuthEmailPasswordFeature } from "@cosmicdrift/kumiko-bundled-features/auth-email-password";
|
|
307
|
-
import {
|
|
306
|
+
import { createAuthFoundationFeature } from "@cosmicdrift/kumiko-bundled-features/auth-foundation";
|
|
308
307
|
import { createComplianceProfilesFeature } from "@cosmicdrift/kumiko-bundled-features/compliance-profiles";
|
|
309
308
|
import { createConfigFeature } from "@cosmicdrift/kumiko-bundled-features/config";
|
|
310
309
|
import { createDataRetentionFeature } from "@cosmicdrift/kumiko-bundled-features/data-retention";
|
|
@@ -342,7 +341,7 @@ export function composeApexAccountApp(opts: ApexAccountAppOptions): FeatureDefin
|
|
|
342
341
|
createAuthEmailPasswordFeature(),
|
|
343
342
|
createDataRetentionFeature(),
|
|
344
343
|
createComplianceProfilesFeature(),
|
|
345
|
-
|
|
344
|
+
createAuthFoundationFeature(),
|
|
346
345
|
createPersonalAccessTokensFeature({ scopes: {} }),
|
|
347
346
|
createSessionsFeature(),
|
|
348
347
|
createUserDataRightsFeature({
|
|
@@ -97,8 +97,8 @@ before the worker picks up the job and writes the fulfillment back.
|
|
|
97
97
|
// dispatcher (dispatchSystemWrite → orders:write:fulfillment:create).
|
|
98
98
|
|
|
99
99
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
100
|
-
|
|
101
|
-
import { buildEntityTable } from "@cosmicdrift/kumiko-framework/db";
|
|
100
|
+
|
|
101
|
+
import { buildEntityTable, selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
102
102
|
import { createRegistry } from "@cosmicdrift/kumiko-framework/engine";
|
|
103
103
|
import {
|
|
104
104
|
createApiEntrypoint,
|
|
@@ -109,17 +109,17 @@ import {
|
|
|
109
109
|
createEventsTable,
|
|
110
110
|
} from "@cosmicdrift/kumiko-framework/event-store";
|
|
111
111
|
import { createEventConsumerStateTable } from "@cosmicdrift/kumiko-framework/pipeline";
|
|
112
|
+
import { TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
113
|
+
import { makeDispatchSystemWrite } from "@cosmicdrift/kumiko-server-runtime/extra-routes-deps";
|
|
114
|
+
import { waitFor } from "@cosmicdrift/kumiko-testing/helpers";
|
|
112
115
|
import {
|
|
113
116
|
createTestDb,
|
|
114
117
|
createTestRedis,
|
|
115
118
|
type TestDb,
|
|
116
119
|
type TestRedis,
|
|
117
|
-
TestUsers,
|
|
118
120
|
unsafeCreateEntityTable,
|
|
119
121
|
unsafePushTables,
|
|
120
|
-
} from "@cosmicdrift/kumiko-
|
|
121
|
-
import { waitFor } from "@cosmicdrift/kumiko-framework/testing";
|
|
122
|
-
import { makeDispatchSystemWrite } from "@cosmicdrift/kumiko-server-runtime/extra-routes-deps";
|
|
122
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
123
123
|
import {
|
|
124
124
|
createApiWorkerSplitFeature,
|
|
125
125
|
fulfillmentEntity,
|
|
@@ -278,8 +278,7 @@ describe("api-worker-split", () => {
|
|
|
278
278
|
// dispatcher — JobContext has no write/query (fw#1717), so the app
|
|
279
279
|
// wires a write-bridge at boot (see setOrderFulfillWrite below).
|
|
280
280
|
|
|
281
|
-
import { insertOne } from "@cosmicdrift/kumiko-framework/
|
|
282
|
-
import { table, text, uuid } from "@cosmicdrift/kumiko-framework/db";
|
|
281
|
+
import { insertOne, table, text, uuid } from "@cosmicdrift/kumiko-framework/db";
|
|
283
282
|
import {
|
|
284
283
|
createEntity,
|
|
285
284
|
createNumberField,
|
|
@@ -43,7 +43,8 @@ import { afterAll, beforeAll, beforeEach, describe, expect, mock, test } from "b
|
|
|
43
43
|
import type { AuthClaimsContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
44
44
|
import { defineFeature, readClaim } from "@cosmicdrift/kumiko-framework/engine";
|
|
45
45
|
import { resolveAuthClaims } from "@cosmicdrift/kumiko-framework/pipeline";
|
|
46
|
-
import {
|
|
46
|
+
import { testTenantId } from "@cosmicdrift/kumiko-framework/seeding";
|
|
47
|
+
import { setupTestStack, type TestStack } from "@cosmicdrift/kumiko-testing/stack";
|
|
47
48
|
import {
|
|
48
49
|
type BetaFlagStore,
|
|
49
50
|
fakeSession,
|
|
@@ -33,7 +33,7 @@ bun test
|
|
|
33
33
|
```ts
|
|
34
34
|
import { describe, expect, test } from "bun:test";
|
|
35
35
|
import {
|
|
36
|
-
|
|
36
|
+
createAuthFoundationFeature,
|
|
37
37
|
resolveAnonymousAccessFromRegistry,
|
|
38
38
|
resolveTenantExistence,
|
|
39
39
|
resolveTenantResolver,
|
|
@@ -52,7 +52,7 @@ describe("auth-foundation-providers recipe", () => {
|
|
|
52
52
|
existsById: async (id) => id === TENANT,
|
|
53
53
|
trust: "authoritative",
|
|
54
54
|
});
|
|
55
|
-
const registry = createRegistry([
|
|
55
|
+
const registry = createRegistry([createAuthFoundationFeature(), routing]);
|
|
56
56
|
|
|
57
57
|
const resolved = await resolveTenantResolver({ db: fakeDb, registry });
|
|
58
58
|
expect(resolved?.trust).toBe("authoritative");
|
|
@@ -87,7 +87,7 @@ describe("auth-foundation-providers recipe", () => {
|
|
|
87
87
|
// What to copy:
|
|
88
88
|
//
|
|
89
89
|
// composeFeatures([
|
|
90
|
-
//
|
|
90
|
+
// createAuthFoundationFeature(),
|
|
91
91
|
// createSubdomainTenantRoutingFeature({ lookupBySubdomain, existsById }),
|
|
92
92
|
// …appFeatures,
|
|
93
93
|
// ], { includeBundled: true })
|
|
@@ -110,15 +110,14 @@ import {
|
|
|
110
110
|
} from "@cosmicdrift/kumiko-bundled-features/user";
|
|
111
111
|
import { configureEntityFieldEncryption } from "@cosmicdrift/kumiko-framework/db";
|
|
112
112
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
113
|
+
import { TestUsers, testTenantId } from "@cosmicdrift/kumiko-framework/seeding";
|
|
114
|
+
import { createTestEnvelopeCipher } from "@cosmicdrift/kumiko-testing/helpers";
|
|
113
115
|
import {
|
|
114
116
|
setupTestStack,
|
|
115
117
|
type TestStack,
|
|
116
|
-
TestUsers,
|
|
117
|
-
testTenantId,
|
|
118
118
|
unsafeCreateEntityTable,
|
|
119
119
|
unsafePushTables,
|
|
120
|
-
} from "@cosmicdrift/kumiko-
|
|
121
|
-
import { createTestEnvelopeCipher } from "@cosmicdrift/kumiko-framework/testing";
|
|
120
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
122
121
|
import {
|
|
123
122
|
AuthMfaHandlers,
|
|
124
123
|
base32Decode,
|
|
@@ -82,14 +82,13 @@ soft-delete + restore, and per-verb access boundaries (Editor vs Admin).
|
|
|
82
82
|
import { afterAll, beforeAll, beforeEach, describe, expect, test } from "bun:test";
|
|
83
83
|
import type { SaveContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
84
84
|
import { createEventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
85
|
+
import { createTestUser, TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
86
|
+
import { expectErrorIncludes } from "@cosmicdrift/kumiko-testing/helpers";
|
|
85
87
|
import {
|
|
86
|
-
createTestUser,
|
|
87
88
|
setupTestStack,
|
|
88
89
|
type TestStack,
|
|
89
|
-
TestUsers,
|
|
90
90
|
unsafeCreateEntityTable,
|
|
91
|
-
} from "@cosmicdrift/kumiko-
|
|
92
|
-
import { expectErrorIncludes } from "@cosmicdrift/kumiko-framework/testing";
|
|
91
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
93
92
|
import { taskEntity, taskFeature } from "../feature";
|
|
94
93
|
|
|
95
94
|
let stack: TestStack;
|
|
@@ -61,17 +61,17 @@ import {
|
|
|
61
61
|
tenantEntity,
|
|
62
62
|
tenantMembershipsTable,
|
|
63
63
|
} from "@cosmicdrift/kumiko-bundled-features/tenant";
|
|
64
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
64
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
65
65
|
import { createJobRunner, type JobRunner } from "@cosmicdrift/kumiko-framework/jobs";
|
|
66
66
|
import { createEnvMasterKeyProvider } from "@cosmicdrift/kumiko-framework/secrets";
|
|
67
|
+
import { createTestUser } from "@cosmicdrift/kumiko-framework/seeding";
|
|
68
|
+
import { waitFor } from "@cosmicdrift/kumiko-testing/helpers";
|
|
67
69
|
import {
|
|
68
|
-
createTestUser,
|
|
69
70
|
setupTestStack,
|
|
70
71
|
type TestStack,
|
|
71
72
|
unsafeCreateEntityTable,
|
|
72
73
|
unsafePushTables,
|
|
73
|
-
} from "@cosmicdrift/kumiko-
|
|
74
|
-
import { waitFor } from "@cosmicdrift/kumiko-framework/testing";
|
|
74
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
75
75
|
import { OPS_ANNOUNCEMENT_TYPE, opsFeature } from "../feature";
|
|
76
76
|
|
|
77
77
|
const admin = createTestUser({ roles: ["Admin", "TenantAdmin"] });
|
|
@@ -105,13 +105,12 @@ try interactively, mount `complianceProfilesDemoFeatures` in your own
|
|
|
105
105
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
106
106
|
import { tenantComplianceProfileEntity } from "@cosmicdrift/kumiko-bundled-features/compliance-profiles";
|
|
107
107
|
import { createEventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
108
|
+
import { createTestUser, testTenantId } from "@cosmicdrift/kumiko-framework/seeding";
|
|
108
109
|
import {
|
|
109
|
-
createTestUser,
|
|
110
110
|
setupTestStack,
|
|
111
111
|
type TestStack,
|
|
112
|
-
testTenantId,
|
|
113
112
|
unsafeCreateEntityTable,
|
|
114
|
-
} from "@cosmicdrift/kumiko-
|
|
113
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
115
114
|
import { complianceProfilesDemoFeatures } from "../feature";
|
|
116
115
|
|
|
117
116
|
const SET_PROFILE = "compliance-profiles:write:set-profile";
|
|
@@ -88,15 +88,15 @@ bun kumiko test integration samples/cross-feature-events
|
|
|
88
88
|
// callbacks. runOnce() drains deterministically.
|
|
89
89
|
|
|
90
90
|
import { afterAll, beforeAll, beforeEach, describe, expect, test } from "bun:test";
|
|
91
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
91
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
92
92
|
import { eventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
93
|
+
import { createTestUser } from "@cosmicdrift/kumiko-framework/seeding";
|
|
93
94
|
import {
|
|
94
|
-
createTestUser,
|
|
95
95
|
resetEventStore,
|
|
96
96
|
setupTestStack,
|
|
97
97
|
type TestStack,
|
|
98
98
|
unsafeCreateEntityTable,
|
|
99
|
-
} from "@cosmicdrift/kumiko-
|
|
99
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
100
100
|
import { capturedEvents, orderEntity, pubsubOrderFeature } from "../feature";
|
|
101
101
|
|
|
102
102
|
let stack: TestStack;
|
|
@@ -229,7 +229,7 @@ import {
|
|
|
229
229
|
defineFeature,
|
|
230
230
|
emitEvent,
|
|
231
231
|
typedPayload,
|
|
232
|
-
} from "@
|
|
232
|
+
} from "@cosmicdrift/kumiko-framework/engine";
|
|
233
233
|
import { z } from "zod";
|
|
234
234
|
|
|
235
235
|
// --- Entity ---
|
|
@@ -92,7 +92,7 @@ deletion grace period.
|
|
|
92
92
|
// subject's key was used, events untouched).
|
|
93
93
|
|
|
94
94
|
import { afterAll, beforeAll, beforeEach, describe, expect, test } from "bun:test";
|
|
95
|
-
|
|
95
|
+
|
|
96
96
|
import {
|
|
97
97
|
configureBlindIndexKey,
|
|
98
98
|
configurePiiSubjectKms,
|
|
@@ -101,20 +101,25 @@ import {
|
|
|
101
101
|
PII_ERASED_SENTINEL,
|
|
102
102
|
subjectIdToKey,
|
|
103
103
|
} from "@cosmicdrift/kumiko-framework/crypto";
|
|
104
|
-
import {
|
|
104
|
+
import {
|
|
105
|
+
asRawClient,
|
|
106
|
+
buildEntityTable,
|
|
107
|
+
fetchOne,
|
|
108
|
+
nullBlindIndexesForSubject,
|
|
109
|
+
} from "@cosmicdrift/kumiko-framework/db";
|
|
105
110
|
import type { SaveContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
106
111
|
import { createEventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
107
|
-
import {
|
|
108
|
-
setupTestStack,
|
|
109
|
-
type TestStack,
|
|
110
|
-
TestUsers,
|
|
111
|
-
unsafeCreateEntityTable,
|
|
112
|
-
} from "@cosmicdrift/kumiko-framework/stack";
|
|
112
|
+
import { TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
113
113
|
import {
|
|
114
114
|
resetBlindIndexKeyForTests,
|
|
115
115
|
resetPiiSubjectKmsForTests,
|
|
116
116
|
resetTestTables,
|
|
117
|
-
} from "@cosmicdrift/kumiko-
|
|
117
|
+
} from "@cosmicdrift/kumiko-testing/helpers";
|
|
118
|
+
import {
|
|
119
|
+
setupTestStack,
|
|
120
|
+
type TestStack,
|
|
121
|
+
unsafeCreateEntityTable,
|
|
122
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
118
123
|
import { employeeEntity, hrCommentEntity, hrFeature } from "../feature";
|
|
119
124
|
|
|
120
125
|
let stack: TestStack;
|
|
@@ -52,14 +52,13 @@ bun test
|
|
|
52
52
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
53
53
|
import { seedReferenceData } from "@cosmicdrift/kumiko-framework/db";
|
|
54
54
|
import type { SaveContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
55
|
+
import { createTestUser, TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
56
|
+
import { expectErrorIncludes } from "@cosmicdrift/kumiko-testing/helpers";
|
|
55
57
|
import {
|
|
56
|
-
createTestUser,
|
|
57
58
|
setupTestStack,
|
|
58
59
|
type TestStack,
|
|
59
|
-
TestUsers,
|
|
60
60
|
unsafeCreateEntityTable,
|
|
61
|
-
} from "@cosmicdrift/kumiko-
|
|
62
|
-
import { expectErrorIncludes } from "@cosmicdrift/kumiko-framework/testing";
|
|
61
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
63
62
|
import { currencyEntity, currencyTable } from "../entities/currency";
|
|
64
63
|
import { invoiceEntity } from "../entities/invoice";
|
|
65
64
|
import { tenantCurrencyEntity } from "../entities/tenant-currency";
|
|
@@ -50,14 +50,13 @@ bun test
|
|
|
50
50
|
|
|
51
51
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
52
52
|
import type { SaveContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
53
|
+
import { createTestUser, TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
54
|
+
import { expectErrorIncludes } from "@cosmicdrift/kumiko-testing/helpers";
|
|
53
55
|
import {
|
|
54
|
-
createTestUser,
|
|
55
56
|
setupTestStack,
|
|
56
57
|
type TestStack,
|
|
57
|
-
TestUsers,
|
|
58
58
|
unsafeCreateEntityTable,
|
|
59
|
-
} from "@cosmicdrift/kumiko-
|
|
60
|
-
import { expectErrorIncludes } from "@cosmicdrift/kumiko-framework/testing";
|
|
59
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
61
60
|
import { currencyEntity } from "../entities/currency";
|
|
62
61
|
import { invoiceEntity } from "../entities/invoice";
|
|
63
62
|
import { currenciesPerTenantFeature } from "../feature";
|
|
@@ -114,13 +114,12 @@ import {
|
|
|
114
114
|
fieldDefinitionEntity,
|
|
115
115
|
} from "@cosmicdrift/kumiko-bundled-features/custom-fields";
|
|
116
116
|
import { createEventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
117
|
+
import { createTestUser, testTenantId } from "@cosmicdrift/kumiko-framework/seeding";
|
|
117
118
|
import {
|
|
118
|
-
createTestUser,
|
|
119
119
|
setupTestStack,
|
|
120
120
|
type TestStack,
|
|
121
|
-
testTenantId,
|
|
122
121
|
unsafeCreateEntityTable,
|
|
123
|
-
} from "@cosmicdrift/kumiko-
|
|
122
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
124
123
|
import { propertyEntity, propertyFeature } from "../feature";
|
|
125
124
|
|
|
126
125
|
// Each test runs in its own tenant, so rows from other tests never show up.
|
|
@@ -65,15 +65,13 @@ bun kumiko test integration samples/custom-handlers
|
|
|
65
65
|
import { afterAll, beforeAll, beforeEach, describe, expect, test } from "bun:test";
|
|
66
66
|
import type { SaveContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
67
67
|
import { createEventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
68
|
+
import { createTestUser, TestUsers, testTenantId } from "@cosmicdrift/kumiko-framework/seeding";
|
|
69
|
+
import { expectErrorIncludes } from "@cosmicdrift/kumiko-testing/helpers";
|
|
68
70
|
import {
|
|
69
|
-
createTestUser,
|
|
70
71
|
setupTestStack,
|
|
71
72
|
type TestStack,
|
|
72
|
-
TestUsers,
|
|
73
|
-
testTenantId,
|
|
74
73
|
unsafeCreateEntityTable,
|
|
75
|
-
} from "@cosmicdrift/kumiko-
|
|
76
|
-
import { expectErrorIncludes } from "@cosmicdrift/kumiko-framework/testing";
|
|
74
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
77
75
|
import { counterEntity, counterFeature } from "../feature";
|
|
78
76
|
|
|
79
77
|
let stack: TestStack;
|
|
@@ -57,13 +57,12 @@ bun kumiko test integration samples/dashboard-stats
|
|
|
57
57
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
58
58
|
import type { SaveContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
59
59
|
import { createEventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
60
|
+
import { createTestUser, testTenantId } from "@cosmicdrift/kumiko-framework/seeding";
|
|
60
61
|
import {
|
|
61
|
-
createTestUser,
|
|
62
62
|
setupTestStack,
|
|
63
63
|
type TestStack,
|
|
64
|
-
testTenantId,
|
|
65
64
|
unsafeCreateEntityTable,
|
|
66
|
-
} from "@cosmicdrift/kumiko-
|
|
65
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
67
66
|
import { TICKET_STATS_QUERY, ticketEntity, ticketFeature } from "../feature";
|
|
68
67
|
|
|
69
68
|
let stack: TestStack;
|
|
@@ -105,19 +105,18 @@ import {
|
|
|
105
105
|
TenantQueries,
|
|
106
106
|
tenantMembershipsTable,
|
|
107
107
|
} from "@cosmicdrift/kumiko-bundled-features/tenant";
|
|
108
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
109
108
|
import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
109
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
110
110
|
import type { SessionUser } from "@cosmicdrift/kumiko-framework/engine";
|
|
111
111
|
import { createEventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
112
|
+
import { createTestUser, TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
113
|
+
import { createRendererMailHtmlFeature } from "@cosmicdrift/kumiko-renderer-mail-html";
|
|
114
|
+
import { expectErrorIncludes } from "@cosmicdrift/kumiko-testing/helpers";
|
|
112
115
|
import {
|
|
113
|
-
createTestUser,
|
|
114
116
|
setupTestStack,
|
|
115
117
|
type TestStack,
|
|
116
|
-
TestUsers,
|
|
117
118
|
unsafePushTables,
|
|
118
|
-
} from "@cosmicdrift/kumiko-
|
|
119
|
-
import { expectErrorIncludes } from "@cosmicdrift/kumiko-framework/testing";
|
|
120
|
-
import { createRendererMailHtmlFeature } from "@cosmicdrift/kumiko-renderer-mail-html";
|
|
119
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
121
120
|
import { supportFeature, TICKET_ASSIGNED, ticketTable } from "../feature";
|
|
122
121
|
|
|
123
122
|
// --- Test Infrastructure ---
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
createRegistry,
|
|
44
44
|
validateBoot as validateBootRaw,
|
|
45
45
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
46
|
-
import { generateE2ESpec, withBootValidatorFixture } from "@cosmicdrift/kumiko-
|
|
46
|
+
import { generateE2ESpec, withBootValidatorFixture } from "@cosmicdrift/kumiko-testing/helpers";
|
|
47
47
|
import { createShopFeature } from "../feature";
|
|
48
48
|
|
|
49
49
|
function validateBoot(features: Parameters<typeof validateBootRaw>[0]): void {
|
|
@@ -85,13 +85,12 @@ rejection, and per-role access.
|
|
|
85
85
|
|
|
86
86
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
87
87
|
import type { SaveContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
88
|
+
import { createTestUser, TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
88
89
|
import {
|
|
89
|
-
createTestUser,
|
|
90
90
|
setupTestStack,
|
|
91
91
|
type TestStack,
|
|
92
|
-
TestUsers,
|
|
93
92
|
unsafeCreateEntityTable,
|
|
94
|
-
} from "@cosmicdrift/kumiko-
|
|
93
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
95
94
|
import { prospectEntity, prospectsFeature, suggestionEntity } from "../feature";
|
|
96
95
|
|
|
97
96
|
let stack: TestStack;
|
|
@@ -52,13 +52,12 @@ screen.
|
|
|
52
52
|
|
|
53
53
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
54
54
|
import type { EntityId, SaveContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
55
|
+
import { createTestUser, TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
55
56
|
import {
|
|
56
|
-
createTestUser,
|
|
57
57
|
setupTestStack,
|
|
58
58
|
type TestStack,
|
|
59
|
-
TestUsers,
|
|
60
59
|
unsafeCreateEntityTable,
|
|
61
|
-
} from "@cosmicdrift/kumiko-
|
|
60
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
62
61
|
import { contactEntity } from "../entities/contact";
|
|
63
62
|
import { invoiceEntity } from "../entities/invoice";
|
|
64
63
|
import { productEntity } from "../entities/product";
|
|
@@ -71,7 +71,7 @@ custom boots pass their own cipher:
|
|
|
71
71
|
|
|
72
72
|
```ts illustration
|
|
73
73
|
import { createConfigResolver } from "@cosmicdrift/kumiko-bundled-features/config";
|
|
74
|
-
import { createTestEnvelopeCipher } from "@cosmicdrift/kumiko-
|
|
74
|
+
import { createTestEnvelopeCipher } from "@cosmicdrift/kumiko-testing/helpers";
|
|
75
75
|
|
|
76
76
|
const cipher = createTestEnvelopeCipher();
|
|
77
77
|
const configResolver = createConfigResolver({ cipher });
|
|
@@ -155,15 +155,14 @@ import {
|
|
|
155
155
|
createConfigFeature,
|
|
156
156
|
createConfigResolver,
|
|
157
157
|
} from "@cosmicdrift/kumiko-bundled-features/config";
|
|
158
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
158
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
159
|
+
import { TestUsers, testTenantId } from "@cosmicdrift/kumiko-framework/seeding";
|
|
160
|
+
import { createTestEnvelopeCipher } from "@cosmicdrift/kumiko-testing/helpers";
|
|
159
161
|
import {
|
|
160
162
|
setupTestStack,
|
|
161
163
|
type TestStack,
|
|
162
|
-
TestUsers,
|
|
163
|
-
testTenantId,
|
|
164
164
|
unsafePushTables,
|
|
165
|
-
} from "@cosmicdrift/kumiko-
|
|
166
|
-
import { createTestEnvelopeCipher } from "@cosmicdrift/kumiko-framework/testing";
|
|
165
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
167
166
|
import { billingFeature, stripeApiKeyHandle } from "../feature";
|
|
168
167
|
|
|
169
168
|
// Each test gets its own pair of tenants, so config rows from other tests never show up.
|
|
@@ -118,14 +118,13 @@ The chain lands in the log (for forensics), but **not** in the response to the c
|
|
|
118
118
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
119
119
|
import { buildEntityTable } from "@cosmicdrift/kumiko-framework/db";
|
|
120
120
|
import { createEventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
121
|
+
import { createTestUser, TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
122
|
+
import { updateRows } from "@cosmicdrift/kumiko-testing/helpers";
|
|
121
123
|
import {
|
|
122
|
-
createTestUser,
|
|
123
124
|
setupTestStack,
|
|
124
125
|
type TestStack,
|
|
125
|
-
TestUsers,
|
|
126
126
|
unsafeCreateEntityTable,
|
|
127
|
-
} from "@cosmicdrift/kumiko-
|
|
128
|
-
import { updateRows } from "@cosmicdrift/kumiko-framework/testing";
|
|
127
|
+
} from "@cosmicdrift/kumiko-testing/stack";
|
|
129
128
|
import { OrdersLiteReasons, orderEntity, ordersLiteFeature } from "../feature";
|
|
130
129
|
|
|
131
130
|
let stack: TestStack;
|