@capybara-hq/testing 0.1.0-rc.42 → 0.1.0-rc.43

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/dist/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export { type FakeSlackAck, type FakeSlackCall, type FakeSlackFailure, type Fake
23
23
  export { type FakeTelegramBot, type FakeTelegramCall, type FakeTelegramFailure, type FakeTelegramMessage, type FakeTelegramOptions, type FakeTelegramServer, findTelegramButton, startFakeTelegram, type TgChat, type TgUser, telegramCallback, telegramGroupMessage, telegramPrivateMessage, telegramWebhookHeaders, } from "./fake-telegram.js";
24
24
  export { FAKE_EXTENSIONS, type FakeExtensionName, fakeExtensionDir, fakeExtensionEntry, type PackedFixture, packFixture, } from "./fixtures.js";
25
25
  export { cardRecorded, cookieRequest, createAgent, createConversation, createLocalAccount, createOrg, enableModelProviders, eventsOf, joinOrg, type KernelApp, type KernelRequest, type KernelRequestOptions, type KernelResponse, login, pidOwningLocalPort, postMessage, sleep, startTestKernel, TEST_PASSWORD, type TestKernel, testKernelConfig, truncateTables, waitFor, waitForEvent, waitForTerminal, } from "./kernel-helpers.js";
26
+ export { type LoginSourceSeed, seedLoginSources } from "./login-sources.js";
26
27
  export { FAKE_PNG_BASE64, isPngBase64, pdfBase64, pdfSampleWord, redPngBase64, solidPngBase64, } from "./media-samples.js";
27
28
  export { type ConformanceTarget, checkDeclaredParameters, describeModelProviderConformance, MEDIA_SAMPLES, thinkingReplayParams, } from "./model-conformance.js";
28
29
  export { describePushProviderConformance, type PushConformanceTarget, type PushOutcome, type PushVendorRequest, } from "./push-conformance.js";
package/dist/index.js CHANGED
@@ -23,6 +23,7 @@ export { findSlackButton, signSlackWebhook, slackBlockAction, slackDmEvent, slac
23
23
  export { findTelegramButton, startFakeTelegram, telegramCallback, telegramGroupMessage, telegramPrivateMessage, telegramWebhookHeaders, } from "./fake-telegram.js";
24
24
  export { FAKE_EXTENSIONS, fakeExtensionDir, fakeExtensionEntry, packFixture, } from "./fixtures.js";
25
25
  export { cardRecorded, cookieRequest, createAgent, createConversation, createLocalAccount, createOrg, enableModelProviders, eventsOf, joinOrg, login, pidOwningLocalPort, postMessage, sleep, startTestKernel, TEST_PASSWORD, testKernelConfig, truncateTables, waitFor, waitForEvent, waitForTerminal, } from "./kernel-helpers.js";
26
+ export { seedLoginSources } from "./login-sources.js";
26
27
  export { FAKE_PNG_BASE64, isPngBase64, pdfBase64, pdfSampleWord, redPngBase64, solidPngBase64, } from "./media-samples.js";
27
28
  export { checkDeclaredParameters, describeModelProviderConformance, MEDIA_SAMPLES, thinkingReplayParams, } from "./model-conformance.js";
28
29
  export { describePushProviderConformance, } from "./push-conformance.js";
@@ -0,0 +1,12 @@
1
+ import { type KernelSchemaDb, type LoginSourceSettings } from "@capybara-hq/kernel";
2
+ /** One entry for {@link seedLoginSources}: only `plugin` is required. */
3
+ export type LoginSourceSeed = Pick<LoginSourceSettings, "plugin"> & Partial<LoginSourceSettings>;
4
+ /**
5
+ * Replaces the deployment's login sources (the `loginSources` deployment setting) with `entries`,
6
+ * in this order (the login page order). Defaults: `enabled: true`, `signUp: "link"` (an unlinked
7
+ * external account goes to the link page; pass `signUp: "create"` where a test signs up through a
8
+ * login source), no trusted tenants. It writes the row directly through `db` (any replica reads it
9
+ * at its next sign-in), without the admin checks: the extension need not be loaded or configured.
10
+ * The row references `accounts`, so `TRUNCATE capybara.accounts CASCADE` empties it: seed after.
11
+ */
12
+ export declare function seedLoginSources(db: KernelSchemaDb, entries: readonly LoginSourceSeed[]): Promise<void>;
@@ -0,0 +1,17 @@
1
+ import { writeLoginSources, } from "@capybara-hq/kernel";
2
+ /**
3
+ * Replaces the deployment's login sources (the `loginSources` deployment setting) with `entries`,
4
+ * in this order (the login page order). Defaults: `enabled: true`, `signUp: "link"` (an unlinked
5
+ * external account goes to the link page; pass `signUp: "create"` where a test signs up through a
6
+ * login source), no trusted tenants. It writes the row directly through `db` (any replica reads it
7
+ * at its next sign-in), without the admin checks: the extension need not be loaded or configured.
8
+ * The row references `accounts`, so `TRUNCATE capybara.accounts CASCADE` empties it: seed after.
9
+ */
10
+ export async function seedLoginSources(db, entries) {
11
+ await writeLoginSources(db, entries.map((e) => ({
12
+ plugin: e.plugin,
13
+ enabled: e.enabled ?? true,
14
+ signUp: e.signUp ?? "link",
15
+ trustedTenants: e.trustedTenants ?? [],
16
+ })), null);
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capybara-hq/testing",
3
- "version": "0.1.0-rc.42",
3
+ "version": "0.1.0-rc.43",
4
4
  "description": "Test helpers for Capybara: test containers, dual-replica harness and fake third-party servers",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -47,17 +47,17 @@
47
47
  "tsx": "^4.23.15",
48
48
  "ws": "^8.22.0",
49
49
  "zod": "^4.6.7",
50
- "@capybara-hq/kernel": "^0.1.0-rc.92"
50
+ "@capybara-hq/kernel": "^0.1.0-rc.94"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/pg": "^8.23.1",
54
54
  "@types/ws": "^8.18.2",
55
- "@capybara-hq/plugin-client": "^0.1.0-rc.9",
56
- "@capybara-hq/plugin-sdk": "^0.1.0-rc.75"
55
+ "@capybara-hq/plugin-sdk": "^0.1.0-rc.77",
56
+ "@capybara-hq/plugin-client": "^0.1.0-rc.9"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "vitest": "^5.0.5",
60
- "@capybara-hq/plugin-sdk": "^0.1.0-rc.75",
60
+ "@capybara-hq/plugin-sdk": "^0.1.0-rc.77",
61
61
  "@capybara-hq/plugin-tools": "^0.1.0-rc.25"
62
62
  },
63
63
  "peerDependenciesMeta": {