@clivly/sdk 0.11.0 → 0.12.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/dist/drizzle.cjs CHANGED
@@ -141,6 +141,7 @@ function fromDrizzle(db, table, opts) {
141
141
  const idColumnName = idColumn.name;
142
142
  const source = {
143
143
  entity: opts.entity,
144
+ ...opts.pushSource === void 0 ? {} : { pushSource: opts.pushSource },
144
145
  cursorField: cursorColumnName,
145
146
  idField: idColumnName,
146
147
  fetchPage: ({ since, limit }) => drizzleDb.select(projection).from(table).where(since ? drizzle_orm.sql`(${cursorColumn}, ${idColumn}) > (${since.time}, ${since.id})` : void 0).orderBy((0, drizzle_orm.asc)(cursorColumn), (0, drizzle_orm.asc)(idColumn)).limit(limit),
@@ -82,6 +82,21 @@ interface FromDrizzleOptions {
82
82
  * check and a false explanation.
83
83
  */
84
84
  objectType?: string;
85
+ /**
86
+ * The label this source's pushes carry, when it differs from `entity`.
87
+ *
88
+ * `entity` is the CURSOR KEY — two sources sharing it share a cursor, so the
89
+ * first to run advances it and the second silently pushes nothing. The push
90
+ * LABEL is matched against a mapping's `sourceTable`, which is the host
91
+ * table name. Those two requirements conflict whenever one table feeds two
92
+ * concepts: an `organization` table mapped as both a company and a
93
+ * subscription deal needs distinct cursors but the same table name on the
94
+ * wire.
95
+ *
96
+ * `fromDrizzleProjection` stamps this itself for the projection case. This
97
+ * is the same escape hatch for a plain single-table source.
98
+ */
99
+ pushSource?: string;
85
100
  }
86
101
  /**
87
102
  * Build a `SyncSource` from a Drizzle table, generating the keyset-paginated
@@ -82,6 +82,21 @@ interface FromDrizzleOptions {
82
82
  * check and a false explanation.
83
83
  */
84
84
  objectType?: string;
85
+ /**
86
+ * The label this source's pushes carry, when it differs from `entity`.
87
+ *
88
+ * `entity` is the CURSOR KEY — two sources sharing it share a cursor, so the
89
+ * first to run advances it and the second silently pushes nothing. The push
90
+ * LABEL is matched against a mapping's `sourceTable`, which is the host
91
+ * table name. Those two requirements conflict whenever one table feeds two
92
+ * concepts: an `organization` table mapped as both a company and a
93
+ * subscription deal needs distinct cursors but the same table name on the
94
+ * wire.
95
+ *
96
+ * `fromDrizzleProjection` stamps this itself for the projection case. This
97
+ * is the same escape hatch for a plain single-table source.
98
+ */
99
+ pushSource?: string;
85
100
  }
86
101
  /**
87
102
  * Build a `SyncSource` from a Drizzle table, generating the keyset-paginated
package/dist/drizzle.mjs CHANGED
@@ -140,6 +140,7 @@ function fromDrizzle(db, table, opts) {
140
140
  const idColumnName = idColumn.name;
141
141
  const source = {
142
142
  entity: opts.entity,
143
+ ...opts.pushSource === void 0 ? {} : { pushSource: opts.pushSource },
143
144
  cursorField: cursorColumnName,
144
145
  idField: idColumnName,
145
146
  fetchPage: ({ since, limit }) => drizzleDb.select(projection).from(table).where(since ? sql`(${cursorColumn}, ${idColumn}) > (${since.time}, ${since.id})` : void 0).orderBy(asc(cursorColumn), asc(idColumn)).limit(limit),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clivly/sdk",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "private": false,
5
5
  "description": "Clivly SDK — connect your app to Clivly Cloud (heartbeat, discovery, auth bridge).",
6
6
  "license": "MIT",
@@ -53,7 +53,7 @@
53
53
  "README.md"
54
54
  ],
55
55
  "dependencies": {
56
- "@clivly/core": "0.11.0"
56
+ "@clivly/core": "0.12.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@electric-sql/pglite": "^0.5.4",