@byline/cli 3.9.0 → 3.10.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.
@@ -31,6 +31,6 @@ export interface DepSpec {
31
31
  /** When set, only install if the matching `answers` flag is true. */
32
32
  optional?: DepOptionalFlag;
33
33
  }
34
- export declare const BYLINE_VERSION = "^2.5.0";
34
+ export declare const BYLINE_VERSION = "^3.0.0";
35
35
  export declare const DEP_SPECS: readonly DepSpec[];
36
36
  //# sourceMappingURL=deps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../../src/manifest/deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,YAAY,CAAA;AAE1C,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,QAAQ,CAAA;IACf,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAA;IACZ,qEAAqE;IACrE,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC3B;AAQD,eAAO,MAAM,cAAc,WAAW,CAAA;AAEtC,eAAO,MAAM,SAAS,EAAE,SAAS,OAAO,EA2J9B,CAAA"}
1
+ {"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../../src/manifest/deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,YAAY,CAAA;AAE1C,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,QAAQ,CAAA;IACf,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAA;IACZ,qEAAqE;IACrE,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC3B;AASD,eAAO,MAAM,cAAc,WAAW,CAAA;AAEtC,eAAO,MAAM,SAAS,EAAE,SAAS,OAAO,EAiK9B,CAAA"}
@@ -14,13 +14,14 @@
14
14
  * `src/routes/_byline/`, `src/ui/byline/`). Transitive deps reach the
15
15
  * user via the `@byline/*` package boundary and don't need declaring.
16
16
  */
17
- // Floor for installed `@byline/*` versions. Must match the minor that
18
- // introduced any new API the templates we drop into the host project
19
- // reference. e.g. `byline/server.config.ts` imports
20
- // `lexicalEditorEmbedServer` from `@byline/richtext-lexical/server`,
21
- // which landed in 2.5.0 so we floor at ^2.5.0 to keep pnpm from
22
- // resolving an older lockfile pin under `^2.0.0`.
23
- export const BYLINE_VERSION = '^2.5.0';
17
+ // Floor for installed `@byline/*` versions. The `@byline/*` packages release
18
+ // in lockstep, and the templates we drop into the host project reference
19
+ // 3.x-only APIs throughout (e.g. `i18n.translations` / `adminTranslations`,
20
+ // `source_locale`, the audit log, and `lexicalEditorToMarkdownServer`). A `^2`
21
+ // floor would let pnpm resolve the latest 2.x against these 3.x templates, so
22
+ // we floor at the current major. Bump the minor when a template starts using an
23
+ // API that landed in a later 3.x release.
24
+ export const BYLINE_VERSION = '^3.0.0';
24
25
  export const DEP_SPECS = [
25
26
  // ---- @byline/* — released in lockstep at BYLINE_VERSION -----------------
26
27
  {
@@ -65,6 +66,12 @@ export const DEP_SPECS = [
65
66
  group: 'byline',
66
67
  note: 'TanStack Start integrations + route stubs',
67
68
  },
69
+ {
70
+ name: '@byline/i18n',
71
+ version: BYLINE_VERSION,
72
+ group: 'byline',
73
+ note: 'admin-interface translations; imported by byline/i18n.ts (adminTranslations)',
74
+ },
68
75
  {
69
76
  name: '@byline/richtext-lexical',
70
77
  version: BYLINE_VERSION,
@@ -1 +1 @@
1
- {"version":3,"file":"deps.js","sourceRoot":"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AAQ,EAAE,YAAY;QACtB,IAAI,EAAE,mGAAmG;KAC1G;CACO,CAAA"}
@@ -7,32 +7,24 @@
7
7
  */
8
8
 
9
9
  /**
10
- * Shared i18n locale configuration — no upstream dependencies, safe to import
11
- * from both config entry-points and collection schema files without circular
12
- * references.
10
+ * Shared i18n configuration — assembles the `defineServerConfig` /
11
+ * `defineClientConfig` payload from the host's locale sets and the admin
12
+ * translation bundle.
13
+ *
14
+ * The locale arrays themselves live in `./locales.ts`, a dependency-free leaf
15
+ * module, so the public frontend can import them without pulling in the admin
16
+ * translation graph this file depends on. Re-exported here for back-compat
17
+ * with existing `~/i18n` importers.
13
18
  *
14
19
  * `interface` locales govern the CMS admin UI language.
15
20
  * `content` locales govern the languages a document can be published in.
16
21
  */
17
22
 
18
- export interface LocaleDefinition {
19
- code: string
20
- label: string
21
- }
23
+ import { adminTranslations } from '@byline/i18n/admin'
22
24
 
23
- /** Locales available in the CMS admin interface. */
24
- export const interfaceLocales: LocaleDefinition[] = [
25
- { code: 'en', label: 'English' },
26
- { code: 'es', label: 'Español' },
27
- ]
25
+ import { contentLocales, interfaceLocales, type LocaleDefinition } from './locales.js'
28
26
 
29
- /** Locales a document can be published in. */
30
- export const contentLocales = [
31
- { code: 'en', label: 'English' },
32
- { code: 'fr', label: 'Français' },
33
- { code: 'es', label: 'Español' },
34
- { code: 'de', label: 'Deutsch' },
35
- ] as const
27
+ export { contentLocales, interfaceLocales, type LocaleDefinition }
36
28
 
37
29
  /** Derived config object — passed directly to defineServerConfig / defineClientConfig. */
38
30
  export const i18n = {
@@ -40,7 +32,7 @@ export const i18n = {
40
32
  defaultLocale: 'en',
41
33
  locales: interfaceLocales.map((l) => l.code),
42
34
  // Optional display names for the admin language switcher. Lets you
43
- // author `Español` rather than the lowercase `español` that
35
+ // author `Français` rather than the lowercase `français` that
44
36
  // Intl.DisplayNames returns; omit to fall back to Intl per code.
45
37
  localeDefinitions: interfaceLocales.map((l) => ({ code: l.code, nativeName: l.label })),
46
38
  },
@@ -53,4 +45,14 @@ export const i18n = {
53
45
  // hreflang / "read this in…" affordances without a parallel map.
54
46
  localeDefinitions: contentLocales.map((l) => ({ code: l.code, nativeName: l.label })),
55
47
  },
48
+ // Admin UI translations. `adminTranslations({...})` ships the `byline-admin`
49
+ // namespace bundled into `@byline/i18n/admin`. A non-empty `interface.locales`
50
+ // REQUIRES this — `initBylineCore()` throws at boot otherwise. To extend the
51
+ // registry with your own namespace (custom fields, plugins), merge bundles:
52
+ // import { mergeTranslations } from '@byline/i18n'
53
+ // translations: mergeTranslations(
54
+ // adminTranslations({ locales: interfaceLocales.map((l) => l.code) }),
55
+ // myPluginTranslations({ locales: interfaceLocales.map((l) => l.code) })
56
+ // ),
57
+ translations: adminTranslations({ locales: interfaceLocales.map((l) => l.code) }),
56
58
  }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * This Source Code is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
+ *
6
+ * Copyright (c) Infonomic Company Limited
7
+ */
8
+
9
+ /**
10
+ * Leaf locale definitions — the host's two locale sets, as plain data with
11
+ * **zero** runtime dependencies (no `@byline/*` imports, no translation
12
+ * registry). `byline/i18n.ts` consumes these to assemble the
13
+ * `defineServerConfig` / `defineClientConfig` payload.
14
+ *
15
+ * Kept separate from `byline/i18n.ts` so a public frontend (or a collection
16
+ * schema file loaded outside Vite — e.g. when running seeds via tsx) can
17
+ * import the locale arrays without dragging in the admin translation graph
18
+ * (`@byline/i18n/admin`) that `i18n.ts` depends on. Importing `byline/i18n.ts`
19
+ * would; importing this won't — which keeps the lazy admin/public bundle split
20
+ * (`src/routes/_byline/route.lazy.tsx`) intact.
21
+ *
22
+ * `interface` locales govern the CMS admin UI language; `content` locales
23
+ * govern the languages a document can be published in.
24
+ */
25
+
26
+ export interface LocaleDefinition {
27
+ code: string
28
+ label: string
29
+ }
30
+
31
+ /** Locales available in the CMS admin interface. */
32
+ // Every code listed here must have a matching bundle in `@byline/i18n/admin`
33
+ // (or a third-party plugin merged in via `mergeTranslations(...)`).
34
+ // `adminTranslations({ locales })` in `byline/i18n.ts` throws at boot if a
35
+ // requested code is not bundled — `@byline/i18n/admin` ships English and French.
36
+ export const interfaceLocales: LocaleDefinition[] = [
37
+ { code: 'en', label: 'English' },
38
+ { code: 'fr', label: 'Français' },
39
+ ]
40
+
41
+ /** Locales a document can be published in. */
42
+ export const contentLocales = [
43
+ { code: 'en', label: 'English' },
44
+ { code: 'fr', label: 'Français' },
45
+ { code: 'es', label: 'Español' },
46
+ { code: 'de', label: 'Deutsch' },
47
+ ] as const
@@ -27,6 +27,7 @@ import { getAdminBylineClient } from '@byline/host-tanstack-start/integrations/b
27
27
  import {
28
28
  lexicalEditorEmbedServer,
29
29
  lexicalEditorPopulateServer,
30
+ lexicalEditorToMarkdownServer,
30
31
  } from '@byline/richtext-lexical/server'
31
32
  import { localStorageProvider } from '@byline/storage-local'
32
33
 
@@ -134,6 +135,10 @@ async function buildBylineCore(): Promise<BylineCore<AdminStore>> {
134
135
  richText: {
135
136
  embed: lexicalEditorEmbedServer({ getClient: getAdminBylineClient }),
136
137
  populate: lexicalEditorPopulateServer({ getClient: getAdminBylineClient }),
138
+ // One-way Lexical → markdown serializer for the agent-readable export
139
+ // surface (`.md` content routes, `llms.txt`). Pure JSON walk — no
140
+ // client needed. Remove if you don't expose the markdown surface.
141
+ toMarkdown: lexicalEditorToMarkdownServer(),
137
142
  },
138
143
  },
139
144
  })
@@ -7,32 +7,24 @@
7
7
  */
8
8
 
9
9
  /**
10
- * Shared i18n locale configuration — no upstream dependencies, safe to import
11
- * from both config entry-points and collection schema files without circular
12
- * references.
10
+ * Shared i18n configuration — assembles the `defineServerConfig` /
11
+ * `defineClientConfig` payload from the host's locale sets and the admin
12
+ * translation bundle.
13
+ *
14
+ * The locale arrays themselves live in `./locales.ts`, a dependency-free leaf
15
+ * module, so the public frontend can import them without pulling in the admin
16
+ * translation graph this file depends on. Re-exported here for back-compat
17
+ * with existing `~/i18n` importers.
13
18
  *
14
19
  * `interface` locales govern the CMS admin UI language.
15
20
  * `content` locales govern the languages a document can be published in.
16
21
  */
17
22
 
18
- export interface LocaleDefinition {
19
- code: string
20
- label: string
21
- }
23
+ import { adminTranslations } from '@byline/i18n/admin'
22
24
 
23
- /** Locales available in the CMS admin interface. */
24
- export const interfaceLocales: LocaleDefinition[] = [
25
- { code: 'en', label: 'English' },
26
- { code: 'es', label: 'Español' },
27
- ]
25
+ import { contentLocales, interfaceLocales, type LocaleDefinition } from './locales.js'
28
26
 
29
- /** Locales a document can be published in. */
30
- export const contentLocales = [
31
- { code: 'en', label: 'English' },
32
- { code: 'fr', label: 'Français' },
33
- { code: 'es', label: 'Español' },
34
- { code: 'de', label: 'Deutsch' },
35
- ] as const
27
+ export { contentLocales, interfaceLocales, type LocaleDefinition }
36
28
 
37
29
  /** Derived config object — passed directly to defineServerConfig / defineClientConfig. */
38
30
  export const i18n = {
@@ -40,7 +32,7 @@ export const i18n = {
40
32
  defaultLocale: 'en',
41
33
  locales: interfaceLocales.map((l) => l.code),
42
34
  // Optional display names for the admin language switcher. Lets you
43
- // author `Español` rather than the lowercase `español` that
35
+ // author `Français` rather than the lowercase `français` that
44
36
  // Intl.DisplayNames returns; omit to fall back to Intl per code.
45
37
  localeDefinitions: interfaceLocales.map((l) => ({ code: l.code, nativeName: l.label })),
46
38
  },
@@ -53,4 +45,14 @@ export const i18n = {
53
45
  // hreflang / "read this in…" affordances without a parallel map.
54
46
  localeDefinitions: contentLocales.map((l) => ({ code: l.code, nativeName: l.label })),
55
47
  },
48
+ // Admin UI translations. `adminTranslations({...})` ships the `byline-admin`
49
+ // namespace bundled into `@byline/i18n/admin`. A non-empty `interface.locales`
50
+ // REQUIRES this — `initBylineCore()` throws at boot otherwise. To extend the
51
+ // registry with your own namespace (custom fields, plugins), merge bundles:
52
+ // import { mergeTranslations } from '@byline/i18n'
53
+ // translations: mergeTranslations(
54
+ // adminTranslations({ locales: interfaceLocales.map((l) => l.code) }),
55
+ // myPluginTranslations({ locales: interfaceLocales.map((l) => l.code) })
56
+ // ),
57
+ translations: adminTranslations({ locales: interfaceLocales.map((l) => l.code) }),
56
58
  }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * This Source Code is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
+ *
6
+ * Copyright (c) Infonomic Company Limited
7
+ */
8
+
9
+ /**
10
+ * Leaf locale definitions — the host's two locale sets, as plain data with
11
+ * **zero** runtime dependencies (no `@byline/*` imports, no translation
12
+ * registry). `byline/i18n.ts` consumes these to assemble the
13
+ * `defineServerConfig` / `defineClientConfig` payload.
14
+ *
15
+ * Kept separate from `byline/i18n.ts` so a public frontend (or a collection
16
+ * schema file loaded outside Vite — e.g. when running seeds via tsx) can
17
+ * import the locale arrays without dragging in the admin translation graph
18
+ * (`@byline/i18n/admin`) that `i18n.ts` depends on. Importing `byline/i18n.ts`
19
+ * would; importing this won't — which keeps the lazy admin/public bundle split
20
+ * (`src/routes/_byline/route.lazy.tsx`) intact.
21
+ *
22
+ * `interface` locales govern the CMS admin UI language; `content` locales
23
+ * govern the languages a document can be published in.
24
+ */
25
+
26
+ export interface LocaleDefinition {
27
+ code: string
28
+ label: string
29
+ }
30
+
31
+ /** Locales available in the CMS admin interface. */
32
+ // Every code listed here must have a matching bundle in `@byline/i18n/admin`
33
+ // (or a third-party plugin merged in via `mergeTranslations(...)`).
34
+ // `adminTranslations({ locales })` in `byline/i18n.ts` throws at boot if a
35
+ // requested code is not bundled — `@byline/i18n/admin` ships English and French.
36
+ export const interfaceLocales: LocaleDefinition[] = [
37
+ { code: 'en', label: 'English' },
38
+ { code: 'fr', label: 'Français' },
39
+ ]
40
+
41
+ /** Locales a document can be published in. */
42
+ export const contentLocales = [
43
+ { code: 'en', label: 'English' },
44
+ { code: 'fr', label: 'Français' },
45
+ { code: 'es', label: 'Español' },
46
+ { code: 'de', label: 'Deutsch' },
47
+ ] as const
@@ -23,6 +23,7 @@ import { getAdminBylineClient } from '@byline/host-tanstack-start/integrations/b
23
23
  import {
24
24
  lexicalEditorEmbedServer,
25
25
  lexicalEditorPopulateServer,
26
+ lexicalEditorToMarkdownServer,
26
27
  } from '@byline/richtext-lexical/server'
27
28
  import { localStorageProvider } from '@byline/storage-local'
28
29
 
@@ -206,6 +207,10 @@ async function buildBylineCore(): Promise<BylineCore<AdminStore>> {
206
207
  richText: {
207
208
  embed: lexicalEditorEmbedServer({ getClient: getAdminBylineClient }),
208
209
  populate: lexicalEditorPopulateServer({ getClient: getAdminBylineClient }),
210
+ // One-way Lexical → markdown serializer for the agent-readable export
211
+ // surface (`.md` content routes, `llms.txt`). Pure JSON walk — no
212
+ // client needed. Remove if you don't expose the markdown surface.
213
+ toMarkdown: lexicalEditorToMarkdownServer(),
209
214
  },
210
215
  },
211
216
  })
@@ -65,6 +65,19 @@ CREATE TABLE "byline_admin_users" (
65
65
  CONSTRAINT "byline_admin_users_email_unique" UNIQUE("email")
66
66
  );
67
67
  --> statement-breakpoint
68
+ CREATE TABLE "byline_audit_log" (
69
+ "id" uuid PRIMARY KEY NOT NULL,
70
+ "document_id" uuid,
71
+ "collection_id" uuid,
72
+ "actor_id" uuid,
73
+ "actor_realm" varchar(16) NOT NULL,
74
+ "action" varchar(64) NOT NULL,
75
+ "field" varchar(128),
76
+ "before" jsonb,
77
+ "after" jsonb,
78
+ "occurred_at" timestamp (6) with time zone DEFAULT now() NOT NULL
79
+ );
80
+ --> statement-breakpoint
68
81
  CREATE TABLE "byline_store_boolean" (
69
82
  "id" uuid PRIMARY KEY NOT NULL,
70
83
  "document_version_id" uuid NOT NULL,
@@ -316,6 +329,9 @@ CREATE INDEX "idx_byline_admin_refresh_tokens_token_hash" ON "byline_admin_refre
316
329
  CREATE INDEX "idx_byline_admin_role_admin_user_user" ON "byline_admin_role_admin_user" USING btree ("admin_user_id");--> statement-breakpoint
317
330
  CREATE INDEX "idx_byline_admin_roles_machine_name" ON "byline_admin_roles" USING btree ("machine_name");--> statement-breakpoint
318
331
  CREATE INDEX "idx_byline_admin_users_email" ON "byline_admin_users" USING btree ("email");--> statement-breakpoint
332
+ CREATE INDEX "idx_audit_log_document_id" ON "byline_audit_log" USING btree ("document_id","id");--> statement-breakpoint
333
+ CREATE INDEX "idx_audit_log_actor_id" ON "byline_audit_log" USING btree ("actor_id","id");--> statement-breakpoint
334
+ CREATE INDEX "idx_audit_log_action" ON "byline_audit_log" USING btree ("action","id");--> statement-breakpoint
319
335
  CREATE INDEX "idx_boolean_value" ON "byline_store_boolean" USING btree ("value");--> statement-breakpoint
320
336
  CREATE INDEX "idx_boolean_path_value" ON "byline_store_boolean" USING btree ("field_path","value");--> statement-breakpoint
321
337
  CREATE INDEX "idx_boolean_collection_value" ON "byline_store_boolean" USING btree ("collection_id","field_path","value");--> statement-breakpoint
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "52560051-1da6-41f4-8a2c-b9a7b5421d26",
2
+ "id": "00066c6d-bed5-4d32-8431-d950cb3ce641",
3
3
  "prevId": "00000000-0000-0000-0000-000000000000",
4
4
  "version": "7",
5
5
  "dialect": "postgresql",
@@ -562,6 +562,144 @@
562
562
  "checkConstraints": {},
563
563
  "isRLSEnabled": false
564
564
  },
565
+ "public.byline_audit_log": {
566
+ "name": "byline_audit_log",
567
+ "schema": "",
568
+ "columns": {
569
+ "id": {
570
+ "name": "id",
571
+ "type": "uuid",
572
+ "primaryKey": true,
573
+ "notNull": true
574
+ },
575
+ "document_id": {
576
+ "name": "document_id",
577
+ "type": "uuid",
578
+ "primaryKey": false,
579
+ "notNull": false
580
+ },
581
+ "collection_id": {
582
+ "name": "collection_id",
583
+ "type": "uuid",
584
+ "primaryKey": false,
585
+ "notNull": false
586
+ },
587
+ "actor_id": {
588
+ "name": "actor_id",
589
+ "type": "uuid",
590
+ "primaryKey": false,
591
+ "notNull": false
592
+ },
593
+ "actor_realm": {
594
+ "name": "actor_realm",
595
+ "type": "varchar(16)",
596
+ "primaryKey": false,
597
+ "notNull": true
598
+ },
599
+ "action": {
600
+ "name": "action",
601
+ "type": "varchar(64)",
602
+ "primaryKey": false,
603
+ "notNull": true
604
+ },
605
+ "field": {
606
+ "name": "field",
607
+ "type": "varchar(128)",
608
+ "primaryKey": false,
609
+ "notNull": false
610
+ },
611
+ "before": {
612
+ "name": "before",
613
+ "type": "jsonb",
614
+ "primaryKey": false,
615
+ "notNull": false
616
+ },
617
+ "after": {
618
+ "name": "after",
619
+ "type": "jsonb",
620
+ "primaryKey": false,
621
+ "notNull": false
622
+ },
623
+ "occurred_at": {
624
+ "name": "occurred_at",
625
+ "type": "timestamp (6) with time zone",
626
+ "primaryKey": false,
627
+ "notNull": true,
628
+ "default": "now()"
629
+ }
630
+ },
631
+ "indexes": {
632
+ "idx_audit_log_document_id": {
633
+ "name": "idx_audit_log_document_id",
634
+ "columns": [
635
+ {
636
+ "expression": "document_id",
637
+ "isExpression": false,
638
+ "asc": true,
639
+ "nulls": "last"
640
+ },
641
+ {
642
+ "expression": "id",
643
+ "isExpression": false,
644
+ "asc": true,
645
+ "nulls": "last"
646
+ }
647
+ ],
648
+ "isUnique": false,
649
+ "concurrently": false,
650
+ "method": "btree",
651
+ "with": {}
652
+ },
653
+ "idx_audit_log_actor_id": {
654
+ "name": "idx_audit_log_actor_id",
655
+ "columns": [
656
+ {
657
+ "expression": "actor_id",
658
+ "isExpression": false,
659
+ "asc": true,
660
+ "nulls": "last"
661
+ },
662
+ {
663
+ "expression": "id",
664
+ "isExpression": false,
665
+ "asc": true,
666
+ "nulls": "last"
667
+ }
668
+ ],
669
+ "isUnique": false,
670
+ "concurrently": false,
671
+ "method": "btree",
672
+ "with": {}
673
+ },
674
+ "idx_audit_log_action": {
675
+ "name": "idx_audit_log_action",
676
+ "columns": [
677
+ {
678
+ "expression": "action",
679
+ "isExpression": false,
680
+ "asc": true,
681
+ "nulls": "last"
682
+ },
683
+ {
684
+ "expression": "id",
685
+ "isExpression": false,
686
+ "asc": true,
687
+ "nulls": "last"
688
+ }
689
+ ],
690
+ "isUnique": false,
691
+ "concurrently": false,
692
+ "method": "btree",
693
+ "with": {}
694
+ }
695
+ },
696
+ "foreignKeys": {},
697
+ "compositePrimaryKeys": {},
698
+ "uniqueConstraints": {},
699
+ "policies": {},
700
+ "checkConstraints": {},
701
+ "isRLSEnabled": false
702
+ },
565
703
  "public.byline_store_boolean": {
566
704
  "name": "byline_store_boolean",
567
705
  "schema": "",
@@ -5,8 +5,8 @@
5
5
  {
6
6
  "idx": 0,
7
7
  "version": "7",
8
- "when": 1780302968051,
9
- "tag": "0000_yielding_northstar",
8
+ "when": 1781318465897,
9
+ "tag": "0000_rainy_starjammers",
10
10
  "breakpoints": true
11
11
  }
12
12
  ]
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@byline/cli",
3
3
  "private": false,
4
4
  "license": "MPL-2.0",
5
- "version": "3.9.0",
5
+ "version": "3.10.0",
6
6
  "engines": {
7
7
  "node": ">=20.9.0"
8
8
  },