@coffre/cli 0.1.11 → 0.1.12

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.
@@ -8,6 +8,13 @@
8
8
  "when": 1790930587507,
9
9
  "tag": "0000_baseline",
10
10
  "breakpoints": true
11
+ },
12
+ {
13
+ "idx": 1,
14
+ "version": "7",
15
+ "when": 1791062292678,
16
+ "tag": "0001_remove_syncs",
17
+ "breakpoints": true
11
18
  }
12
19
  ]
13
20
  }
@@ -1,5 +1,5 @@
1
1
  import { d as esm_default } from "./esm-Bts-esAl.js";
2
- import { $ as Subquery, C as PgJsonb, D as PgDateString, E as PgDate, F as haveSameKeys, G as sql, H as SQL, I as isConfig, J as Table, K as Columns, L as mapResultRow, N as getTableColumns, P as getTableLikeName, Q as tracer, R as mapUpdateSet, S as PgNumeric, U as View, V as Param, W as fillPlaceholders, X as getTableUniqueName, Y as getTableName, Z as ViewBaseConfig, _ as PgTimestamp, a as getOperators, b as PgTime, c as normalizeRelation, ct as entityKind, d as eq, et as WithSubquery, h as PgUUID, i as extractTablesRelationalConfig, j as applyMixins, lt as is, n as One, nt as PgColumn, o as getOrderByOperators, p as PgTable, q as Schema, r as createTableRelationsHelpers, s as mapRelationalRow, st as Column, t as Many, u as and, v as PgTimestampString, w as PgJson, z as orderSelectedFields } from "./relations-CJCGPRst.js";
2
+ import { $ as WithSubquery, A as applyMixins, B as Param, C as PgJson, E as PgDateString, F as isConfig, G as Columns, H as View, I as mapResultRow, J as getTableName, K as Schema, L as mapUpdateSet, M as getTableColumns, N as getTableLikeName, P as haveSameKeys, Q as Subquery, R as orderSelectedFields, S as PgJsonb, T as PgDate, U as fillPlaceholders, V as SQL, W as sql, X as ViewBaseConfig, Y as getTableUniqueName, Z as tracer, _ as PgTimestampString, a as getOperators, c as normalizeRelation, ct as is, d as eq, f as PgTable, g as PgTimestamp, i as extractTablesRelationalConfig, m as PgUUID, n as One, o as getOrderByOperators, ot as Column, q as Table, r as createTableRelationsHelpers, s as mapRelationalRow, st as entityKind, t as Many, tt as PgColumn, u as and, x as PgNumeric, y as PgTime } from "./relations-BuTStNq-.js";
3
3
  //#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@5.20260920.1_@libsql+client@0.18.0_@types+pg@8.20.0_pg@8.16.3/node_modules/drizzle-orm/logger.js
4
4
  var ConsoleLogWriter = class {
5
5
  static [entityKind] = "ConsoleLogWriter";
@@ -1,2 +1,2 @@
1
- import { a as NodePgSession, i as NodePgPreparedQuery, n as NodePgDriver, o as NodePgTransaction, r as drizzle, t as NodePgDatabase } from "./node-postgres-_y-EeSHQ.js";
1
+ import { a as NodePgSession, i as NodePgPreparedQuery, n as NodePgDriver, o as NodePgTransaction, r as drizzle, t as NodePgDatabase } from "./node-postgres-BHgGDfvg.js";
2
2
  export { NodePgDatabase, NodePgDriver, NodePgPreparedQuery, NodePgSession, NodePgTransaction, drizzle };
@@ -1,4 +1,4 @@
1
- import { G as sql, l as relations } from "./relations-CJCGPRst.js";
1
+ import { W as sql, l as relations } from "./relations-BuTStNq-.js";
2
2
  //#region ../db/dist/commits-BuW-NL3n.js
3
3
  const pending = /* @__PURE__ */ new WeakMap();
4
4
  /** `db`, its transactions tracked for `afterCommit`. */
@@ -18,13 +18,12 @@ function trackCommits(db, outer = null) {
18
18
  return db;
19
19
  }
20
20
  //#endregion
21
- //#region ../db/dist/relations-DqgxtlKu.js
21
+ //#region ../db/dist/relations-BfR3JjT1.js
22
22
  /**
23
23
  * What both schemas share beyond their columns: the relations and the
24
24
  * one generated column.
25
25
  *
26
- * Relations are for Drizzle's relational queries (`db.query.syncs
27
- * .findMany({ with })`), which read a row and what hangs off it in one
26
+ * Relations are for Drizzle's relational queries (`db.query.secrets.findMany({ with })`), which read a row and what hangs off it in one
28
27
  * statement on every dialect. They add no constraints; the foreign keys in
29
28
  * each schema do that. Each schema calls this with its own tables, so a
30
29
  * relational query on SQLite joins SQLite tables.
@@ -44,26 +43,7 @@ function relationsOf(t) {
44
43
  fields: [t.secrets.environmentId],
45
44
  references: [t.environments.id]
46
45
  })
47
- })),
48
- syncsRelations: relations(t.syncs, ({ one, many }) => ({
49
- project: one(t.projects, {
50
- fields: [t.syncs.projectId],
51
- references: [t.projects.id]
52
- }),
53
- environment: one(t.environments, {
54
- fields: [t.syncs.environmentId],
55
- references: [t.environments.id]
56
- }),
57
- credential: one(t.secrets, {
58
- fields: [t.syncs.credentialSecretId],
59
- references: [t.secrets.id]
60
- }),
61
- keys: many(t.syncKeys)
62
- })),
63
- syncKeysRelations: relations(t.syncKeys, ({ one }) => ({ sync: one(t.syncs, {
64
- fields: [t.syncKeys.syncId],
65
- references: [t.syncs.id]
66
- }) }))
46
+ }))
67
47
  };
68
48
  }
69
49
  /**
@@ -2398,10 +2398,6 @@ const pgTable = (name, columns, extraConfig) => {
2398
2398
  };
2399
2399
  //#endregion
2400
2400
  //#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@5.20260920.1_@libsql+client@0.18.0_@types+pg@8.20.0_pg@8.16.3/node_modules/drizzle-orm/pg-core/primary-keys.js
2401
- function primaryKey(...config) {
2402
- if (config[0].columns) return new PrimaryKeyBuilder(config[0].columns, config[0].name);
2403
- return new PrimaryKeyBuilder(config);
2404
- }
2405
2401
  var PrimaryKeyBuilder = class {
2406
2402
  static [entityKind] = "PgPrimaryKeyBuilder";
2407
2403
  /** @internal */
@@ -2709,4 +2705,4 @@ function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelect
2709
2705
  return result;
2710
2706
  }
2711
2707
  //#endregion
2712
- export { Subquery as $, bigint as A, textDecoder as B, PgJsonb as C, PgDateString as D, PgDate as E, haveSameKeys as F, sql as G, SQL as H, isConfig as I, Table as J, Columns as K, mapResultRow as L, getColumnNameAndConfig as M, getTableColumns as N, customType as O, getTableLikeName as P, tracer as Q, mapUpdateSet as R, PgNumeric as S, integer as T, View as U, Param as V, fillPlaceholders as W, getTableUniqueName as X, getTableName as Y, ViewBaseConfig as Z, PgTimestamp as _, getOperators as a, TableName as at, PgTime as b, normalizeRelation as c, entityKind as ct, eq as d, WithSubquery as et, primaryKey as f, uuid as g, PgUUID as h, extractTablesRelationalConfig as i, foreignKey as it, applyMixins as j, boolean as k, relations as l, is as lt, pgTable as m, One as n, PgColumn as nt, getOrderByOperators as o, ColumnBuilder as ot, PgTable as p, Schema as q, createTableRelationsHelpers as r, unique as rt, mapRelationalRow as s, Column as st, Many as t, IndexedColumn as tt, and as u, PgTimestampString as v, PgJson as w, text as x, timestamp as y, orderSelectedFields as z };
2708
+ export { WithSubquery as $, applyMixins as A, Param as B, PgJson as C, customType as D, PgDateString as E, isConfig as F, Columns as G, View as H, mapResultRow as I, getTableName as J, Schema as K, mapUpdateSet as L, getTableColumns as M, getTableLikeName as N, boolean as O, haveSameKeys as P, Subquery as Q, orderSelectedFields as R, PgJsonb as S, PgDate as T, fillPlaceholders as U, SQL as V, sql as W, ViewBaseConfig as X, getTableUniqueName as Y, tracer as Z, PgTimestampString as _, getOperators as a, ColumnBuilder as at, text as b, normalizeRelation as c, is as ct, eq as d, IndexedColumn as et, PgTable as f, PgTimestamp as g, uuid as h, extractTablesRelationalConfig as i, TableName as it, getColumnNameAndConfig as j, bigint as k, relations as l, PgUUID as m, One as n, unique as nt, getOrderByOperators as o, Column as ot, pgTable as p, Table as q, createTableRelationsHelpers as r, foreignKey as rt, mapRelationalRow as s, entityKind as st, Many as t, PgColumn as tt, and as u, timestamp as v, integer as w, PgNumeric as x, PgTime as y, textDecoder as z };
@@ -1,6 +1,6 @@
1
1
  import { n as ROLE_NAMES, r as assignableToEnvironment } from "./access-CO1kGjWW.js";
2
- import { B as textDecoder, G as sql, J as Table, M as getColumnNameAndConfig, at as TableName, ct as entityKind, ot as ColumnBuilder, st as Column } from "./relations-CJCGPRst.js";
3
- import { i as relationsOf, r as ACTIVE_SUBJECT, t as asPostgres } from "./portable-CPh2thNN.js";
2
+ import { W as sql, at as ColumnBuilder, it as TableName, j as getColumnNameAndConfig, ot as Column, q as Table, st as entityKind, z as textDecoder } from "./relations-BuTStNq-.js";
3
+ import { i as relationsOf, r as ACTIVE_SUBJECT, t as asPostgres } from "./portable-9wWdi5e1.js";
4
4
  //#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@5.20260920.1_@libsql+client@0.18.0_@types+pg@8.20.0_pg@8.16.3/node_modules/drizzle-orm/sqlite-core/checks.js
5
5
  var CheckBuilder = class {
6
6
  constructor(name, value) {
@@ -646,40 +646,6 @@ function uniqueIndex(name) {
646
646
  return new IndexBuilderOn(name, true);
647
647
  }
648
648
  //#endregion
649
- //#region ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@5.20260920.1_@libsql+client@0.18.0_@types+pg@8.20.0_pg@8.16.3/node_modules/drizzle-orm/sqlite-core/primary-keys.js
650
- function primaryKey(...config) {
651
- if (config[0].columns) return new PrimaryKeyBuilder(config[0].columns, config[0].name);
652
- return new PrimaryKeyBuilder(config);
653
- }
654
- var PrimaryKeyBuilder = class {
655
- static [entityKind] = "SQLitePrimaryKeyBuilder";
656
- /** @internal */
657
- columns;
658
- /** @internal */
659
- name;
660
- constructor(columns, name) {
661
- this.columns = columns;
662
- this.name = name;
663
- }
664
- /** @internal */
665
- build(table) {
666
- return new PrimaryKey(table, this.columns, this.name);
667
- }
668
- };
669
- var PrimaryKey = class {
670
- constructor(table, columns, name) {
671
- this.table = table;
672
- this.columns = columns;
673
- this.name = name;
674
- }
675
- static [entityKind] = "SQLitePrimaryKey";
676
- columns;
677
- name;
678
- getName() {
679
- return this.name ?? `${this.table[SQLiteTable.Symbol.Name]}_${this.columns.map((column) => column.name).join("_")}_pk`;
680
- }
681
- };
682
- //#endregion
683
649
  //#region ../db/dist/schema-sqlite.js
684
650
  /**
685
651
  * The schema in schema.ts, for SQLite (through libsql). Same tables,
@@ -1014,65 +980,11 @@ const deviceAuthorizations = sqliteTable("device_authorizations", {
1014
980
  foreignColumns: [vaultMembers.principal]
1015
981
  }).onDelete("restrict")
1016
982
  ]);
1017
- const syncs = sqliteTable("syncs", {
1018
- id: text().primaryKey(),
1019
- projectId: text("project_id").notNull(),
1020
- environmentId: text("environment_id").notNull(),
1021
- provider: text().notNull(),
1022
- config: text().notNull(),
1023
- credentialSecretId: text("credential_secret_id").notNull(),
1024
- createdAt: createdAt(),
1025
- createdBy: text("created_by").notNull(),
1026
- pausedAt: time("paused_at"),
1027
- archivedAt: time("archived_at"),
1028
- leaseUntil: time("lease_until"),
1029
- lastRunAt: time("last_run_at"),
1030
- lastStatus: text("last_status"),
1031
- lastError: text("last_error")
1032
- }, (table) => [
1033
- check("syncs_config_check", sql`json_valid(${table.config})`),
1034
- check("syncs_last_status_check", sql`${table.lastStatus} IS NULL OR ${table.lastStatus} IN ('ok', 'partial', 'failed')`),
1035
- foreignKey({
1036
- name: "syncs_environment_in_project",
1037
- columns: [table.environmentId, table.projectId],
1038
- foreignColumns: [environments.id, environments.projectId]
1039
- }).onDelete("restrict"),
1040
- foreignKey({
1041
- name: "syncs_credential_secret_id_fkey",
1042
- columns: [table.credentialSecretId],
1043
- foreignColumns: [secrets.id]
1044
- }).onDelete("restrict"),
1045
- index("syncs_environment_idx").on(table.environmentId)
1046
- ]);
1047
- const syncKeys = sqliteTable("sync_keys", {
1048
- syncId: text("sync_id").notNull(),
1049
- key: text().notNull(),
1050
- secretVersionId: text("secret_version_id"),
1051
- pushedAt: time("pushed_at").notNull().default(now),
1052
- removedAt: time("removed_at")
1053
- }, (table) => [
1054
- primaryKey({
1055
- name: "sync_keys_pkey",
1056
- columns: [table.syncId, table.key]
1057
- }),
1058
- foreignKey({
1059
- name: "sync_keys_sync_id_fkey",
1060
- columns: [table.syncId],
1061
- foreignColumns: [syncs.id]
1062
- }).onDelete("restrict"),
1063
- foreignKey({
1064
- name: "sync_keys_secret_version_id_fkey",
1065
- columns: [table.secretVersionId],
1066
- foreignColumns: [secretVersions.id]
1067
- }).onDelete("restrict")
1068
- ]);
1069
- const { environmentsRelations, secretsRelations, syncsRelations, syncKeysRelations } = relationsOf(asPostgres({
983
+ const { environmentsRelations, secretsRelations } = relationsOf(asPostgres({
1070
984
  projects,
1071
985
  environments,
1072
986
  secrets,
1073
- secretVersions,
1074
- syncs,
1075
- syncKeys
987
+ secretVersions
1076
988
  }));
1077
989
  //#endregion
1078
- export { auditChainHead, auditLog, credentials, deviceAuthorizations, environments, environmentsRelations, identities, projects, secretVersions, secrets, secretsRelations, syncKeys, syncKeysRelations, syncs, syncsRelations, vaultGrants, vaultMembers };
990
+ export { auditChainHead, auditLog, credentials, deviceAuthorizations, environments, environmentsRelations, identities, projects, secretVersions, secrets, secretsRelations, vaultGrants, vaultMembers };
@@ -1,6 +1,6 @@
1
1
  import { d as esm_default } from "./esm-Bts-esAl.js";
2
2
  import { C as yes, E as isEmpty, S as wrap, T as init, _ as select, b as truncate, c as Cancelled, d as listed, f as openTerminal, g as row, h as release, i as keyValues, l as edit, m as readKeys, n as jsonWarning, o as needsTerminal, p as paragraph, r as keyGuide, s as showSecrets, t as generateKeys, u as hiddenLine, v as style, w as KINDS, x as width, y as textLine } from "./keys-BCKUEb-Y.js";
3
- import { r as postgresConnection, t as engineOfUrl } from "./connect-CpN0VYGE.js";
3
+ import { r as postgresConnection, t as engineOfUrl } from "./connect-tekAM4hC.js";
4
4
  import { parseArgs } from "node:util";
5
5
  import { spawn } from "node:child_process";
6
6
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
@@ -65,7 +65,7 @@ function verifyHistory(expected, applied, requireComplete) {
65
65
  async function postgresMigrator(url) {
66
66
  const [{ default: pg }, { drizzle }, { migrate }] = await Promise.all([
67
67
  import("./esm-B69mMLcR.js"),
68
- import("./node-postgres-BlNvYfq_.js"),
68
+ import("./node-postgres-BWEOOdc6.js"),
69
69
  import("./migrator-W1a-ooWi.js")
70
70
  ]);
71
71
  const pool = new pg.Pool({
@@ -95,7 +95,7 @@ async function postgresMigrator(url) {
95
95
  };
96
96
  }
97
97
  async function sqliteMigrator(url) {
98
- const [{ openDatabase }, { migrate }] = await Promise.all([import("./connect-fkn_APVy.js"), import("drizzle-orm/libsql/migrator")]);
98
+ const [{ openDatabase }, { migrate }] = await Promise.all([import("./connect-BXDkiWOL.js"), import("drizzle-orm/libsql/migrator")]);
99
99
  const { db, close } = await openDatabase(url);
100
100
  const sqlite = db;
101
101
  return {
@@ -13,11 +13,11 @@
13
13
  "conformance": "coffre-conformance node"
14
14
  },
15
15
  "dependencies": {
16
- "@coffre/server": "0.1.11",
17
- "@coffre/vault": "0.1.11"
16
+ "@coffre/server": "0.1.12",
17
+ "@coffre/vault": "0.1.12"
18
18
  },
19
19
  "devDependencies": {
20
- "@coffre/conformance": "0.1.11",
20
+ "@coffre/conformance": "0.1.12",
21
21
  "@types/node": "26.1.1",
22
22
  "typescript": "5.9.3"
23
23
  }
@@ -28,7 +28,7 @@
28
28
  "hyperdrive": [{ "binding": "HYPERDRIVE", "id": "replace-with-your-hyperdrive-id" }],
29
29
  // The vault Worker, vault/wrangler.jsonc. Deploy it first.
30
30
  "services": [{ "binding": "VAULT", "service": "coffre-vault" }],
31
- // The heartbeat, audit checkpoints and due syncs.
31
+ // The heartbeat and audit checkpoints.
32
32
  "triggers": { "crons": ["*/5 * * * *"] },
33
33
  // The pages' scripts, styles and fonts, all under /_coffre/assets/.
34
34
  "assets": { "directory": "../node_modules/@coffre/ui/dist/client" }
@@ -14,13 +14,13 @@
14
14
  "conformance": "coffre-conformance workers"
15
15
  },
16
16
  "dependencies": {
17
- "@coffre/server": "0.1.11",
18
- "@coffre/ui": "0.1.11",
19
- "@coffre/vault": "0.1.11"
17
+ "@coffre/server": "0.1.12",
18
+ "@coffre/ui": "0.1.12",
19
+ "@coffre/vault": "0.1.12"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@cloudflare/workers-types": "5.20260920.1",
23
- "@coffre/conformance": "0.1.11",
23
+ "@coffre/conformance": "0.1.12",
24
24
  "typescript": "5.9.3",
25
25
  "wrangler": "4.118.0"
26
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffre/cli",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "The coffre command line: secrets in your shell, and `coffre init` for a new deployment.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,9 +28,9 @@
28
28
  "pg": "8.16.3",
29
29
  "tsdown": "0.23.0",
30
30
  "typescript": "5.9.3",
31
- "@coffre/client": "0.1.11",
32
- "@coffre/core": "0.1.11",
33
- "@coffre/db": "0.1.11"
31
+ "@coffre/client": "0.1.12",
32
+ "@coffre/core": "0.1.12",
33
+ "@coffre/db": "0.1.12"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "tsdown && node scripts/copy-templates.ts && node scripts/copy-migrations.ts",