@rotorsoft/act-pg 0.2.0 → 0.4.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/config.d.ts DELETED
@@ -1,24 +0,0 @@
1
- export declare const config: Readonly<{
2
- pg: {
3
- host: string;
4
- user: string;
5
- password: string;
6
- database: string;
7
- port: number;
8
- };
9
- } & {
10
- name: string;
11
- version: string;
12
- description: string;
13
- author: string | {
14
- name: string;
15
- email?: string | undefined;
16
- };
17
- license: string;
18
- dependencies: Record<string, string>;
19
- env: "development" | "test" | "staging" | "production";
20
- logLevel: "error" | "fatal" | "warn" | "info" | "debug" | "trace";
21
- logSingleLine: boolean;
22
- sleepMs: number;
23
- }>;
24
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;EAoBlB,CAAC"}
package/dist/config.js DELETED
@@ -1,21 +0,0 @@
1
- import { extend, config as target } from "@rotorsoft/act";
2
- import { z } from "zod/v4";
3
- const { PG_HOST, PG_USER, PG_PASSWORD, PG_DATABASE, PG_PORT } = process.env;
4
- export const config = extend({
5
- pg: {
6
- host: PG_HOST || "localhost",
7
- user: PG_USER || "postgres",
8
- password: PG_PASSWORD || "postgres",
9
- database: PG_DATABASE || "postgres",
10
- port: Number.parseInt(PG_PORT || "5432"),
11
- },
12
- }, z.object({
13
- pg: z.object({
14
- host: z.string().min(1),
15
- user: z.string().min(1),
16
- password: z.string().min(1),
17
- database: z.string().min(1),
18
- port: z.number().int().min(1000).max(65535),
19
- }),
20
- }), target());
21
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAE5E,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAC1B;IACE,EAAE,EAAE;QACF,IAAI,EAAE,OAAO,IAAI,WAAW;QAC5B,IAAI,EAAE,OAAO,IAAI,UAAU;QAC3B,QAAQ,EAAE,WAAW,IAAI,UAAU;QACnC,QAAQ,EAAE,WAAW,IAAI,UAAU;QACnC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,IAAI,MAAM,CAAC;KACzC;CACF,EACD,CAAC,CAAC,MAAM,CAAC;IACP,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;QACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACvB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;KAC5C,CAAC;CACH,CAAC,EACF,MAAM,EAAE,CACT,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- /** @module act-pg */
2
- export * from "./config";
3
- export * from "./PostgresStore";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC"}
package/dist/seed.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const seed_store: (table: string) => string;
2
- //# sourceMappingURL=seed.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../src/seed.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,MA4C1C,CAAC"}
package/dist/seed.js DELETED
@@ -1,46 +0,0 @@
1
- export const seed_store = (table) => `
2
- -- events
3
- CREATE TABLE IF NOT EXISTS public."${table}"
4
- (
5
- id serial PRIMARY KEY,
6
- name varchar(100) COLLATE pg_catalog."default" NOT NULL,
7
- data jsonb,
8
- stream varchar(100) COLLATE pg_catalog."default" NOT NULL,
9
- version int NOT NULL,
10
- created timestamptz NOT NULL DEFAULT now(),
11
- meta jsonb
12
- ) TABLESPACE pg_default;
13
-
14
- CREATE UNIQUE INDEX IF NOT EXISTS "${table}_stream_ix"
15
- ON public."${table}" USING btree (stream COLLATE pg_catalog."default" ASC, version ASC)
16
- TABLESPACE pg_default;
17
-
18
- CREATE INDEX IF NOT EXISTS "${table}_name_ix"
19
- ON public."${table}" USING btree (name COLLATE pg_catalog."default" ASC)
20
- TABLESPACE pg_default;
21
-
22
- CREATE INDEX IF NOT EXISTS "${table}_created_id_ix"
23
- ON public."${table}" USING btree (created ASC, id ASC)
24
- TABLESPACE pg_default;
25
-
26
- CREATE INDEX IF NOT EXISTS "${table}_correlation_ix"
27
- ON public."${table}" USING btree ((meta ->> 'correlation'::text) COLLATE pg_catalog."default" ASC NULLS LAST)
28
- TABLESPACE pg_default;
29
-
30
- -- streams
31
- CREATE TABLE IF NOT EXISTS public."${table}_streams"
32
- (
33
- stream varchar(100) COLLATE pg_catalog."default" PRIMARY KEY,
34
- at int not null default(-1),
35
- retry smallint not null default(0),
36
- blocked boolean not null default(false),
37
- leased_at int,
38
- leased_by uuid,
39
- leased_until timestamptz
40
- ) TABLESPACE pg_default;
41
-
42
- -- supports order by { blocked, at } when fetching
43
- CREATE INDEX IF NOT EXISTS "${table}_streams_fetch_ix"
44
- ON public."${table}_streams" USING btree (blocked, at) TABLESPACE pg_default;
45
- `;
46
- //# sourceMappingURL=seed.js.map
package/dist/seed.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"seed.js","sourceRoot":"","sources":["../src/seed.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC;;qCAEhB,KAAK;;;;;;;;;;;qCAWL,KAAK;eAC3B,KAAK;;;8BAGU,KAAK;eACpB,KAAK;;;8BAGU,KAAK;eACpB,KAAK;;;8BAGU,KAAK;eACpB,KAAK;;;;qCAIiB,KAAK;;;;;;;;;;;;8BAYZ,KAAK;eACpB,KAAK;CACnB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,OAAO,MAAM,KAAG,MAAM,GAAG,IASjE,CAAC"}
package/dist/utils.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Date reviver when parsing JSON strings with the following formats:
3
- * - YYYY-MM-DDTHH:MM:SS.sssZ
4
- * - YYYY-MM-DDTHH:MM:SS.sss+HH:MM
5
- * - YYYY-MM-DDTHH:MM:SS.sss-HH:MM
6
- */
7
- const ISO_8601 = /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(\.\d+)?(Z|[+-][0-2][0-9]:[0-5][0-9])?$/;
8
- export const dateReviver = (key, value) => {
9
- if (typeof value === "string" && ISO_8601.test(value)) {
10
- try {
11
- return new Date(value);
12
- }
13
- catch {
14
- return value;
15
- }
16
- }
17
- return value;
18
- };
19
- //# sourceMappingURL=utils.js.map
package/dist/utils.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,QAAQ,GACZ,yIAAyI,CAAC;AAC5I,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,KAAa,EAAiB,EAAE;IACvE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACtD,IAAI,CAAC;YACH,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
File without changes