@syncular/core 0.1.0 → 0.1.1
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/database.js +1 -1
- package/dist/http/blob.js +2 -2
- package/dist/http/index.js +3 -3
- package/dist/http/transport-client.js +1 -1
- package/dist/index.js +17 -17
- package/dist/kysely-column-codecs.js +1 -1
- package/dist/logger.js +1 -1
- package/dist/schemas/index.js +3 -3
- package/dist/schemas/sync.js +1 -1
- package/dist/snapshot-chunks.js +1 -1
- package/dist/sync-packs.js +1 -1
- package/dist/utils/bytes.js +1 -1
- package/dist/utils/compression.js +2 -2
- package/dist/utils/crypto.js +2 -2
- package/dist/utils/index.js +9 -9
- package/package.json +2 -2
package/dist/database.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Kysely } from 'kysely';
|
|
2
|
-
import { createColumnCodecsPlugin } from './kysely-column-codecs';
|
|
2
|
+
import { createColumnCodecsPlugin } from './kysely-column-codecs.js';
|
|
3
3
|
export function createDatabase(options) {
|
|
4
4
|
const db = new Kysely({
|
|
5
5
|
dialect: options.dialect,
|
package/dist/http/blob.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SyncTransportError } from '@syncular/core';
|
|
2
|
-
import { executeWithAuthRetry, getErrorMessage } from './shared';
|
|
3
|
-
import { createTransportApiClient, createTransportAuthRetryResolver, HTTP_TRANSPORT_SOURCE, } from './transport-client';
|
|
2
|
+
import { executeWithAuthRetry, getErrorMessage } from './shared.js';
|
|
3
|
+
import { createTransportApiClient, createTransportAuthRetryResolver, HTTP_TRANSPORT_SOURCE, } from './transport-client.js';
|
|
4
4
|
export function createHttpTransportBlobs(source) {
|
|
5
5
|
const client = createTransportApiClient(source);
|
|
6
6
|
const resolveAuthRetry = createTransportAuthRetryResolver(source);
|
package/dist/http/index.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* - a separately exported typed API client for advanced/console use
|
|
7
7
|
*/
|
|
8
8
|
import { SyncTransportError } from '@syncular/core';
|
|
9
|
-
import { applySnapshotScopesHeader, bytesToReadableStream, executeWithAuthRetry, executeWithTransientNetworkRetry, getErrorMessage, resolveSnapshotChunkRequestUrl, unwrap, } from './shared';
|
|
10
|
-
import { createTransportApiClient, createTransportAuthRetryResolver, HTTP_TRANSPORT_SOURCE, } from './transport-client';
|
|
11
|
-
export { createApiClient } from './api-client';
|
|
9
|
+
import { applySnapshotScopesHeader, bytesToReadableStream, executeWithAuthRetry, executeWithTransientNetworkRetry, getErrorMessage, resolveSnapshotChunkRequestUrl, unwrap, } from './shared.js';
|
|
10
|
+
import { createTransportApiClient, createTransportAuthRetryResolver, HTTP_TRANSPORT_SOURCE, } from './transport-client.js';
|
|
11
|
+
export { createApiClient } from './api-client.js';
|
|
12
12
|
export { unwrap };
|
|
13
13
|
function detectDefaultTransportCapabilities() {
|
|
14
14
|
const isReactNative = typeof navigator !== 'undefined' && navigator?.product === 'ReactNative';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { decodeBinarySyncPack, isBinarySyncPackContentType, } from '@syncular/core';
|
|
2
|
-
import { encodeSnapshotScopes, resolveRequestUrl, SNAPSHOT_SCOPES_HEADER, } from './shared';
|
|
2
|
+
import { encodeSnapshotScopes, resolveRequestUrl, SNAPSHOT_SCOPES_HEADER, } from './shared.js';
|
|
3
3
|
export const HTTP_TRANSPORT_SOURCE = Symbol.for('@syncular/core/http/source');
|
|
4
4
|
function isApiClientLike(value) {
|
|
5
5
|
return (typeof value === 'object' &&
|
package/dist/index.js
CHANGED
|
@@ -10,37 +10,37 @@
|
|
|
10
10
|
* - Zod schemas for runtime validation and OpenAPI
|
|
11
11
|
*/
|
|
12
12
|
// Blob transport/storage types and utilities (protocol types come from ./schemas)
|
|
13
|
-
export * from './blobs';
|
|
13
|
+
export * from './blobs.js';
|
|
14
14
|
// Column-level codecs shared by typegen and runtime paths
|
|
15
|
-
export * from './column-codecs';
|
|
15
|
+
export * from './column-codecs.js';
|
|
16
16
|
// Conflict detection utilities
|
|
17
|
-
export * from './conflict';
|
|
17
|
+
export * from './conflict.js';
|
|
18
18
|
// Database utilities
|
|
19
|
-
export * from './database';
|
|
19
|
+
export * from './database.js';
|
|
20
20
|
// Database dialect descriptors
|
|
21
|
-
export * from './dialect';
|
|
21
|
+
export * from './dialect.js';
|
|
22
22
|
// Public error response envelopes
|
|
23
|
-
export * from './error-responses';
|
|
23
|
+
export * from './error-responses.js';
|
|
24
24
|
// Kysely plugin for applying column codecs in generic queries
|
|
25
|
-
export * from './kysely-column-codecs';
|
|
25
|
+
export * from './kysely-column-codecs.js';
|
|
26
26
|
// Logging utilities
|
|
27
|
-
export * from './logger';
|
|
27
|
+
export * from './logger.js';
|
|
28
28
|
// Proxy protocol types
|
|
29
|
-
export * from './proxy';
|
|
29
|
+
export * from './proxy/index.js';
|
|
30
30
|
// Schemas (Zod)
|
|
31
|
-
export * from './schemas';
|
|
31
|
+
export * from './schemas/index.js';
|
|
32
32
|
// Scope types, patterns, and utilities
|
|
33
|
-
export * from './scopes';
|
|
33
|
+
export * from './scopes/index.js';
|
|
34
34
|
// Snapshot chunk encoding helpers
|
|
35
|
-
export * from './snapshot-chunks';
|
|
35
|
+
export * from './snapshot-chunks.js';
|
|
36
36
|
// Sync response pack encoding helpers
|
|
37
|
-
export * from './sync-packs';
|
|
37
|
+
export * from './sync-packs.js';
|
|
38
38
|
// Telemetry abstraction
|
|
39
|
-
export * from './telemetry';
|
|
39
|
+
export * from './telemetry.js';
|
|
40
40
|
// Data transformation hooks
|
|
41
|
-
export * from './transforms';
|
|
41
|
+
export * from './transforms.js';
|
|
42
42
|
// Transport and conflict types (protocol types come from ./schemas)
|
|
43
|
-
export * from './types';
|
|
43
|
+
export * from './types.js';
|
|
44
44
|
// Shared runtime utilities
|
|
45
|
-
export * from './utils';
|
|
45
|
+
export * from './utils/index.js';
|
|
46
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OperationNodeTransformer, } from 'kysely';
|
|
2
|
-
import { applyCodecFromDbValue, applyCodecToDbValue, createTableColumnCodecsResolver, } from './column-codecs';
|
|
2
|
+
import { applyCodecFromDbValue, applyCodecToDbValue, createTableColumnCodecsResolver, } from './column-codecs.js';
|
|
3
3
|
function isIdentifierNode(node) {
|
|
4
4
|
return node?.kind === 'IdentifierNode';
|
|
5
5
|
}
|
package/dist/logger.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Uses the active telemetry backend configured via `configureSyncTelemetry()`.
|
|
5
5
|
*/
|
|
6
|
-
import { getSyncTelemetry } from './telemetry';
|
|
6
|
+
import { getSyncTelemetry } from './telemetry.js';
|
|
7
7
|
/**
|
|
8
8
|
* Log a sync event using the currently configured telemetry backend.
|
|
9
9
|
*/
|
package/dist/schemas/index.js
CHANGED
package/dist/schemas/sync.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - Type inference
|
|
8
8
|
*/
|
|
9
9
|
import { z } from 'zod';
|
|
10
|
-
import { SYNC_SCOPED_SNAPSHOT_ARTIFACT_KIND_SQLITE_V1, SYNC_SCOPED_SNAPSHOT_ARTIFACT_MANIFEST_VERSION, SYNC_SNAPSHOT_ARTIFACT_COMPRESSION_NONE, SYNC_SNAPSHOT_CHUNK_COMPRESSION, SYNC_SNAPSHOT_CHUNK_ENCODINGS, } from '../snapshot-chunks';
|
|
10
|
+
import { SYNC_SCOPED_SNAPSHOT_ARTIFACT_KIND_SQLITE_V1, SYNC_SCOPED_SNAPSHOT_ARTIFACT_MANIFEST_VERSION, SYNC_SNAPSHOT_ARTIFACT_COMPRESSION_NONE, SYNC_SNAPSHOT_CHUNK_COMPRESSION, SYNC_SNAPSHOT_CHUNK_ENCODINGS, } from '../snapshot-chunks.js';
|
|
11
11
|
// ============================================================================
|
|
12
12
|
// Operation Types
|
|
13
13
|
// ============================================================================
|
package/dist/snapshot-chunks.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @syncular/core - Snapshot chunk encoding helpers
|
|
3
3
|
*/
|
|
4
|
-
import { sha256Hex } from './utils/crypto';
|
|
4
|
+
import { sha256Hex } from './utils/crypto.js';
|
|
5
5
|
export const SYNC_SNAPSHOT_CHUNK_ENCODING_BINARY_TABLE_V1 = 'binary-table-v1';
|
|
6
6
|
export const SYNC_SNAPSHOT_CHUNK_ENCODINGS = [
|
|
7
7
|
SYNC_SNAPSHOT_CHUNK_ENCODING_BINARY_TABLE_V1,
|
package/dist/sync-packs.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* metadata.
|
|
21
21
|
* - v14: snapshots can advertise scoped artifact refs.
|
|
22
22
|
*/
|
|
23
|
-
import { decodeBinarySnapshotTable, } from './snapshot-chunks';
|
|
23
|
+
import { decodeBinarySnapshotTable, } from './snapshot-chunks.js';
|
|
24
24
|
export const SYNC_PACK_ENCODING_BINARY_V1 = 'binary-sync-pack-v1';
|
|
25
25
|
export const SYNC_PACK_CONTENT_TYPE = 'application/vnd.syncular.sync-pack.v1';
|
|
26
26
|
const MAGIC = new Uint8Array([0x53, 0x53, 0x50, 0x31]); // "SSP1"
|
package/dist/utils/bytes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { gunzipSync as gunzipSyncFflate } from 'fflate';
|
|
2
|
-
import { bytesToReadableStream, readAllBytesFromStream } from './bytes';
|
|
3
|
-
import { getBunRuntime, usesNodeRuntimeModules } from './internal-runtime';
|
|
2
|
+
import { bytesToReadableStream, readAllBytesFromStream } from './bytes.js';
|
|
3
|
+
import { getBunRuntime, usesNodeRuntimeModules } from './internal-runtime.js';
|
|
4
4
|
let nodeZlibModulePromise = null;
|
|
5
5
|
function importNodeModule(specifier) {
|
|
6
6
|
return new Function('specifier', 'return import(specifier);')(specifier);
|
package/dist/utils/crypto.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { concatByteChunks } from './bytes';
|
|
2
|
-
import { getBunRuntime, usesNodeRuntimeModules } from './internal-runtime';
|
|
1
|
+
import { concatByteChunks } from './bytes.js';
|
|
2
|
+
import { getBunRuntime, usesNodeRuntimeModules } from './internal-runtime.js';
|
|
3
3
|
const textEncoder = new TextEncoder();
|
|
4
4
|
function toHex(bytes) {
|
|
5
5
|
return Array.from(bytes)
|
package/dist/utils/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from './bytes';
|
|
2
|
-
export * from './compression';
|
|
3
|
-
export * from './crypto';
|
|
4
|
-
export * from './id';
|
|
5
|
-
export * from './object';
|
|
6
|
-
export * from './realtime-change-index';
|
|
7
|
-
export * from './realtime-connection-registry';
|
|
8
|
-
export * from './table-registry';
|
|
9
|
-
export * from './url';
|
|
1
|
+
export * from './bytes.js';
|
|
2
|
+
export * from './compression.js';
|
|
3
|
+
export * from './crypto.js';
|
|
4
|
+
export * from './id.js';
|
|
5
|
+
export * from './object.js';
|
|
6
|
+
export * from './realtime-change-index.js';
|
|
7
|
+
export * from './realtime-connection-registry.js';
|
|
8
|
+
export * from './table-registry.js';
|
|
9
|
+
export * from './url.js';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncular/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Core protocol types and shared utilities for the Syncular sync framework",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Benjamin Kniffler",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"openapi-fetch": "^0.17.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@syncular/config": "
|
|
77
|
+
"@syncular/config": "0.0.0",
|
|
78
78
|
"kysely": "*",
|
|
79
79
|
"zod": "*",
|
|
80
80
|
"openapi-fetch": "^0.17.0",
|