@fedify/postgres 2.1.0-dev.405 → 2.1.0-dev.406

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/kv.d.cts CHANGED
@@ -3,61 +3,61 @@ import { Sql } from "postgres";
3
3
 
4
4
  //#region src/kv.d.ts
5
5
  /**
6
- * Options for the PostgreSQL key–value store.
7
- */
6
+ * Options for the PostgreSQL key–value store.
7
+ */
8
8
  interface PostgresKvStoreOptions {
9
9
  /**
10
- * The table name to use for the key–value store.
11
- * `"fedify_kv_v2"` by default.
12
- * @default `"fedify_kv_v2"`
13
- */
10
+ * The table name to use for the key–value store.
11
+ * `"fedify_kv_v2"` by default.
12
+ * @default `"fedify_kv_v2"`
13
+ */
14
14
  readonly tableName?: string;
15
15
  /**
16
- * Whether the table has been initialized. `false` by default.
17
- * @default `false`
18
- */
16
+ * Whether the table has been initialized. `false` by default.
17
+ * @default `false`
18
+ */
19
19
  readonly initialized?: boolean;
20
20
  }
21
21
  /**
22
- * A key–value store that uses PostgreSQL as the underlying storage.
23
- *
24
- * @example
25
- * ```ts
26
- * import { createFederation } from "@fedify/fedify";
27
- * import { PostgresKvStore } from "@fedify/postgres";
28
- * import postgres from "postgres";
29
- *
30
- * const federation = createFederation({
31
- * // ...
32
- * kv: new PostgresKvStore(postgres("postgres://user:pass@localhost/db")),
33
- * });
34
- * ```
35
- */
22
+ * A key–value store that uses PostgreSQL as the underlying storage.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * import { createFederation } from "@fedify/fedify";
27
+ * import { PostgresKvStore } from "@fedify/postgres";
28
+ * import postgres from "postgres";
29
+ *
30
+ * const federation = createFederation({
31
+ * // ...
32
+ * kv: new PostgresKvStore(postgres("postgres://user:pass@localhost/db")),
33
+ * });
34
+ * ```
35
+ */
36
36
  declare class PostgresKvStore implements KvStore {
37
37
  #private;
38
38
  /**
39
- * Creates a new PostgreSQL key–value store.
40
- * @param sql The PostgreSQL client to use.
41
- * @param options The options for the key–value store.
42
- */
39
+ * Creates a new PostgreSQL key–value store.
40
+ * @param sql The PostgreSQL client to use.
41
+ * @param options The options for the key–value store.
42
+ */
43
43
  constructor(sql: Sql<{}>, options?: PostgresKvStoreOptions);
44
44
  get<T = unknown>(key: KvKey): Promise<T | undefined>;
45
45
  set(key: KvKey, value: unknown, options?: KvStoreSetOptions | undefined): Promise<void>;
46
46
  delete(key: KvKey): Promise<void>;
47
47
  /**
48
- * {@inheritDoc KvStore.list}
49
- * @since 1.10.0
50
- */
48
+ * {@inheritDoc KvStore.list}
49
+ * @since 1.10.0
50
+ */
51
51
  list(prefix?: KvKey): AsyncIterable<KvStoreListEntry>;
52
52
  /**
53
- * Creates the table used by the key–value store if it does not already exist.
54
- * Does nothing if the table already exists.
55
- */
53
+ * Creates the table used by the key–value store if it does not already exist.
54
+ * Does nothing if the table already exists.
55
+ */
56
56
  initialize(): Promise<void>;
57
57
  /**
58
- * Drops the table used by the key–value store. Does nothing if the table
59
- * does not exist.
60
- */
58
+ * Drops the table used by the key–value store. Does nothing if the table
59
+ * does not exist.
60
+ */
61
61
  drop(): Promise<void>;
62
62
  }
63
63
  //#endregion
package/dist/kv.d.ts CHANGED
@@ -4,61 +4,61 @@ import { KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions } from "@fedify/fed
4
4
 
5
5
  //#region src/kv.d.ts
6
6
  /**
7
- * Options for the PostgreSQL key–value store.
8
- */
7
+ * Options for the PostgreSQL key–value store.
8
+ */
9
9
  interface PostgresKvStoreOptions {
10
10
  /**
11
- * The table name to use for the key–value store.
12
- * `"fedify_kv_v2"` by default.
13
- * @default `"fedify_kv_v2"`
14
- */
11
+ * The table name to use for the key–value store.
12
+ * `"fedify_kv_v2"` by default.
13
+ * @default `"fedify_kv_v2"`
14
+ */
15
15
  readonly tableName?: string;
16
16
  /**
17
- * Whether the table has been initialized. `false` by default.
18
- * @default `false`
19
- */
17
+ * Whether the table has been initialized. `false` by default.
18
+ * @default `false`
19
+ */
20
20
  readonly initialized?: boolean;
21
21
  }
22
22
  /**
23
- * A key–value store that uses PostgreSQL as the underlying storage.
24
- *
25
- * @example
26
- * ```ts
27
- * import { createFederation } from "@fedify/fedify";
28
- * import { PostgresKvStore } from "@fedify/postgres";
29
- * import postgres from "postgres";
30
- *
31
- * const federation = createFederation({
32
- * // ...
33
- * kv: new PostgresKvStore(postgres("postgres://user:pass@localhost/db")),
34
- * });
35
- * ```
36
- */
23
+ * A key–value store that uses PostgreSQL as the underlying storage.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * import { createFederation } from "@fedify/fedify";
28
+ * import { PostgresKvStore } from "@fedify/postgres";
29
+ * import postgres from "postgres";
30
+ *
31
+ * const federation = createFederation({
32
+ * // ...
33
+ * kv: new PostgresKvStore(postgres("postgres://user:pass@localhost/db")),
34
+ * });
35
+ * ```
36
+ */
37
37
  declare class PostgresKvStore implements KvStore {
38
38
  #private;
39
39
  /**
40
- * Creates a new PostgreSQL key–value store.
41
- * @param sql The PostgreSQL client to use.
42
- * @param options The options for the key–value store.
43
- */
40
+ * Creates a new PostgreSQL key–value store.
41
+ * @param sql The PostgreSQL client to use.
42
+ * @param options The options for the key–value store.
43
+ */
44
44
  constructor(sql: Sql<{}>, options?: PostgresKvStoreOptions);
45
45
  get<T = unknown>(key: KvKey): Promise<T | undefined>;
46
46
  set(key: KvKey, value: unknown, options?: KvStoreSetOptions | undefined): Promise<void>;
47
47
  delete(key: KvKey): Promise<void>;
48
48
  /**
49
- * {@inheritDoc KvStore.list}
50
- * @since 1.10.0
51
- */
49
+ * {@inheritDoc KvStore.list}
50
+ * @since 1.10.0
51
+ */
52
52
  list(prefix?: KvKey): AsyncIterable<KvStoreListEntry>;
53
53
  /**
54
- * Creates the table used by the key–value store if it does not already exist.
55
- * Does nothing if the table already exists.
56
- */
54
+ * Creates the table used by the key–value store if it does not already exist.
55
+ * Does nothing if the table already exists.
56
+ */
57
57
  initialize(): Promise<void>;
58
58
  /**
59
- * Drops the table used by the key–value store. Does nothing if the table
60
- * does not exist.
61
- */
59
+ * Drops the table used by the key–value store. Does nothing if the table
60
+ * does not exist.
61
+ */
62
62
  drop(): Promise<void>;
63
63
  }
64
64
  //#endregion
package/dist/mq.d.cts CHANGED
@@ -3,49 +3,49 @@ import { Sql } from "postgres";
3
3
 
4
4
  //#region src/mq.d.ts
5
5
  /**
6
- * Options for the PostgreSQL message queue.
7
- */
6
+ * Options for the PostgreSQL message queue.
7
+ */
8
8
  interface PostgresMessageQueueOptions {
9
9
  /**
10
- * The table name to use for the message queue.
11
- * `"fedify_message_v2"` by default.
12
- * @default `"fedify_message_v2"`
13
- */
10
+ * The table name to use for the message queue.
11
+ * `"fedify_message_v2"` by default.
12
+ * @default `"fedify_message_v2"`
13
+ */
14
14
  readonly tableName?: string;
15
15
  /**
16
- * The channel name to use for the message queue.
17
- * `"fedify_channel"` by default.
18
- * @default `"fedify_channel"`
19
- */
16
+ * The channel name to use for the message queue.
17
+ * `"fedify_channel"` by default.
18
+ * @default `"fedify_channel"`
19
+ */
20
20
  readonly channelName?: string;
21
21
  /**
22
- * Whether the table has been initialized. `false` by default.
23
- * @default `false`
24
- */
22
+ * Whether the table has been initialized. `false` by default.
23
+ * @default `false`
24
+ */
25
25
  readonly initialized?: boolean;
26
26
  /**
27
- * The poll interval for the message queue. 5 seconds by default.
28
- * @default `{ seconds: 5 }`
29
- */
27
+ * The poll interval for the message queue. 5 seconds by default.
28
+ * @default `{ seconds: 5 }`
29
+ */
30
30
  readonly pollInterval?: Temporal.Duration | Temporal.DurationLike;
31
31
  }
32
32
  /**
33
- * A message queue that uses PostgreSQL as the underlying storage.
34
- *
35
- * @example
36
- * ```ts
37
- * import { createFederation } from "@fedify/fedify";
38
- * import { PostgresKvStore, PostgresMessageQueue } from "@fedify/postgres";
39
- * import postgres from "postgres";
40
- *
41
- * const sql = postgres("postgres://user:pass@localhost/db");
42
- *
43
- * const federation = createFederation({
44
- * kv: new PostgresKvStore(sql),
45
- * queue: new PostgresMessageQueue(sql),
46
- * });
47
- * ```
48
- */
33
+ * A message queue that uses PostgreSQL as the underlying storage.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * import { createFederation } from "@fedify/fedify";
38
+ * import { PostgresKvStore, PostgresMessageQueue } from "@fedify/postgres";
39
+ * import postgres from "postgres";
40
+ *
41
+ * const sql = postgres("postgres://user:pass@localhost/db");
42
+ *
43
+ * const federation = createFederation({
44
+ * kv: new PostgresKvStore(sql),
45
+ * queue: new PostgresMessageQueue(sql),
46
+ * });
47
+ * ```
48
+ */
49
49
  declare class PostgresMessageQueue implements MessageQueue {
50
50
  #private;
51
51
  constructor(sql: Sql<{}>, options?: PostgresMessageQueueOptions);
@@ -53,12 +53,12 @@ declare class PostgresMessageQueue implements MessageQueue {
53
53
  enqueueMany(messages: readonly any[], options?: MessageQueueEnqueueOptions): Promise<void>;
54
54
  listen(handler: (message: any) => void | Promise<void>, options?: MessageQueueListenOptions): Promise<void>;
55
55
  /**
56
- * Initializes the message queue table if it does not already exist.
57
- */
56
+ * Initializes the message queue table if it does not already exist.
57
+ */
58
58
  initialize(): Promise<void>;
59
59
  /**
60
- * Drops the message queue table if it exists.
61
- */
60
+ * Drops the message queue table if it exists.
61
+ */
62
62
  drop(): Promise<void>;
63
63
  }
64
64
  //#endregion
package/dist/mq.d.ts CHANGED
@@ -4,49 +4,49 @@ import { MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions } f
4
4
 
5
5
  //#region src/mq.d.ts
6
6
  /**
7
- * Options for the PostgreSQL message queue.
8
- */
7
+ * Options for the PostgreSQL message queue.
8
+ */
9
9
  interface PostgresMessageQueueOptions {
10
10
  /**
11
- * The table name to use for the message queue.
12
- * `"fedify_message_v2"` by default.
13
- * @default `"fedify_message_v2"`
14
- */
11
+ * The table name to use for the message queue.
12
+ * `"fedify_message_v2"` by default.
13
+ * @default `"fedify_message_v2"`
14
+ */
15
15
  readonly tableName?: string;
16
16
  /**
17
- * The channel name to use for the message queue.
18
- * `"fedify_channel"` by default.
19
- * @default `"fedify_channel"`
20
- */
17
+ * The channel name to use for the message queue.
18
+ * `"fedify_channel"` by default.
19
+ * @default `"fedify_channel"`
20
+ */
21
21
  readonly channelName?: string;
22
22
  /**
23
- * Whether the table has been initialized. `false` by default.
24
- * @default `false`
25
- */
23
+ * Whether the table has been initialized. `false` by default.
24
+ * @default `false`
25
+ */
26
26
  readonly initialized?: boolean;
27
27
  /**
28
- * The poll interval for the message queue. 5 seconds by default.
29
- * @default `{ seconds: 5 }`
30
- */
28
+ * The poll interval for the message queue. 5 seconds by default.
29
+ * @default `{ seconds: 5 }`
30
+ */
31
31
  readonly pollInterval?: Temporal.Duration | Temporal.DurationLike;
32
32
  }
33
33
  /**
34
- * A message queue that uses PostgreSQL as the underlying storage.
35
- *
36
- * @example
37
- * ```ts
38
- * import { createFederation } from "@fedify/fedify";
39
- * import { PostgresKvStore, PostgresMessageQueue } from "@fedify/postgres";
40
- * import postgres from "postgres";
41
- *
42
- * const sql = postgres("postgres://user:pass@localhost/db");
43
- *
44
- * const federation = createFederation({
45
- * kv: new PostgresKvStore(sql),
46
- * queue: new PostgresMessageQueue(sql),
47
- * });
48
- * ```
49
- */
34
+ * A message queue that uses PostgreSQL as the underlying storage.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * import { createFederation } from "@fedify/fedify";
39
+ * import { PostgresKvStore, PostgresMessageQueue } from "@fedify/postgres";
40
+ * import postgres from "postgres";
41
+ *
42
+ * const sql = postgres("postgres://user:pass@localhost/db");
43
+ *
44
+ * const federation = createFederation({
45
+ * kv: new PostgresKvStore(sql),
46
+ * queue: new PostgresMessageQueue(sql),
47
+ * });
48
+ * ```
49
+ */
50
50
  declare class PostgresMessageQueue implements MessageQueue {
51
51
  #private;
52
52
  constructor(sql: Sql<{}>, options?: PostgresMessageQueueOptions);
@@ -54,12 +54,12 @@ declare class PostgresMessageQueue implements MessageQueue {
54
54
  enqueueMany(messages: readonly any[], options?: MessageQueueEnqueueOptions): Promise<void>;
55
55
  listen(handler: (message: any) => void | Promise<void>, options?: MessageQueueListenOptions): Promise<void>;
56
56
  /**
57
- * Initializes the message queue table if it does not already exist.
58
- */
57
+ * Initializes the message queue table if it does not already exist.
58
+ */
59
59
  initialize(): Promise<void>;
60
60
  /**
61
- * Drops the message queue table if it exists.
62
- */
61
+ * Drops the message queue table if it exists.
62
+ */
63
63
  drop(): Promise<void>;
64
64
  }
65
65
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/postgres",
3
- "version": "2.1.0-dev.405+f4e278ae",
3
+ "version": "2.1.0-dev.406+61a21e4e",
4
4
  "description": "PostgreSQL drivers for Fedify",
5
5
  "keywords": [
6
6
  "fedify",
@@ -74,13 +74,13 @@
74
74
  },
75
75
  "peerDependencies": {
76
76
  "postgres": "^3.4.7",
77
- "@fedify/fedify": "^2.1.0-dev.405+f4e278ae"
77
+ "@fedify/fedify": "^2.1.0-dev.406+61a21e4e"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@std/async": "npm:@jsr/std__async@^1.0.13",
81
81
  "tsdown": "^0.12.9",
82
82
  "typescript": "^5.9.3",
83
- "@fedify/testing": "^2.1.0-dev.405+f4e278ae",
83
+ "@fedify/testing": "^2.1.0-dev.406+61a21e4e",
84
84
  "@fedify/fixture": "^2.0.0"
85
85
  },
86
86
  "scripts": {