@owlmeans/marketing-consent-postgres 0.1.18-rc.13 → 0.1.18-rc.15
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/README.md +1 -1
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/marketing-consent-postgres/SKILL.md +3 -3
- package/build/helper.d.ts +1 -4
- package/build/helper.d.ts.map +1 -1
- package/build/helper.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/types.d.ts +5 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/package.json +12 -12
- package/src/helper.ts +1 -5
- package/src/index.ts +1 -0
- package/src/types.ts +4 -0
- package/tests/context.ts +5 -5
- package/tests/schema.spec.ts +9 -13
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
6
6
|
your project's skill store (`.agents/skills/`):
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
9
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.49
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/marketing-consent-postgres",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-10-
|
|
4
|
+
"version": "0.1.18-rc.15",
|
|
5
|
+
"generatedAt": "2026-10-05T21:03:06.401Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/marketing-consent-postgres
|
|
9
9
|
|
|
10
10
|
**Layer:** Infra extension
|
|
11
|
-
**Install:** `"@owlmeans/marketing-consent-postgres": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/marketing-consent-postgres": "^0.1.18-rc.15"` in `dependencies` (peers `pg`, `ajv`)
|
|
12
12
|
|
|
13
13
|
The Postgres counterpart to `@owlmeans/server-marketing-consent`'s two resources. This package is
|
|
14
14
|
for a **generated target project**, which runs Postgres — the platform's own equivalent for
|
|
@@ -40,7 +40,7 @@ added. This package does nothing to make that safe by itself — it relies on
|
|
|
40
40
|
`@owlmeans/postgres-resource`'s **default** schema-to-table rule: any `array` of objects (or any
|
|
41
41
|
nested `object` property) compiles to a single opaque `jsonb` column, never a child table and never
|
|
42
42
|
one column per field. No `pg:` override is applied here, and none is needed — `tests/schema.spec.ts`
|
|
43
|
-
asserts this directly against `schemaToTableSpec`, which is the one test that would catch a
|
|
43
|
+
asserts this directly against `pgSchemaHelper.schemaToTableSpec`, which is the one test that would catch a
|
|
44
44
|
regression here (in this package, in `postgres-resource`'s compiler, or in a future schema edit
|
|
45
45
|
that accidentally reshapes `decisions` into something path-addressable).
|
|
46
46
|
|
|
@@ -72,7 +72,7 @@ by the first `status`/`save`/`terms` call — `server-marketing-consent`'s own s
|
|
|
72
72
|
`bun test ./tests` — `tests/schema.spec.ts` needs no live database (the jsonb-shape assertion
|
|
73
73
|
above); `tests/resource.spec.ts` is env-gated on `POSTGRES_URL` exactly like
|
|
74
74
|
`@owlmeans/postgres-resource`'s own integration suites (`@owlmeans/test-integration`'s
|
|
75
|
-
`postgresGate()`), and skips cleanly with no server reachable.
|
|
75
|
+
`gateHelper.postgresGate()`), and skips cleanly with no server reachable.
|
|
76
76
|
|
|
77
77
|
## Related
|
|
78
78
|
|
package/build/helper.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { BasicContext } from '@owlmeans/context';
|
|
2
|
-
|
|
3
|
-
dbAlias?: string;
|
|
4
|
-
serviceAlias?: string;
|
|
5
|
-
}
|
|
2
|
+
import type { MarketingConsentPostgresOptions } from './types.js';
|
|
6
3
|
/**
|
|
7
4
|
* Registers the two Postgres resources this package owns, once. A context that already has
|
|
8
5
|
* either resource registered — a repeated call from an app that composes contexts in more than
|
package/build/helper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIrD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAA;AAEjE;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,QACpC,YAAY,CAAC,GAAG,CAAC,SAAS,+BAA+B,KAC7D,IAOF,CAAA"}
|
package/build/helper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAE3G,OAAO,EAAE,+BAA+B,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAA;AAE3G,OAAO,EAAE,+BAA+B,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAA;AAGlG;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC5C,GAAsB,EAAE,IAAsC,EACxD,EAAE;IACR,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,2BAA2B,CAAC,EAAE,CAAC;QAClD,GAAG,CAAC,gBAAgB,CAAC,iCAAiC,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAA;IAC5F,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,yBAAyB,CAAC,EAAE,CAAC;QAChD,GAAG,CAAC,gBAAgB,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAA;IAC1F,CAAC;AACH,CAAC,CAAA"}
|
package/build/index.d.ts
CHANGED
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA"}
|
package/build/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,+BAA+B;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB"}
|
package/build/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/marketing-consent-postgres",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Postgres-backed resources for @owlmeans/marketing-consent — the state and log tables of a generated target project, compiled from the shared AJV schema in @owlmeans/server-marketing-consent.",
|
|
6
6
|
"type": "module",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@owlmeans/context": "^0.1.18-rc.
|
|
27
|
-
"@owlmeans/marketing-consent": "^0.1.18-rc.
|
|
28
|
-
"@owlmeans/postgres-resource": "^0.1.18-rc.
|
|
29
|
-
"@owlmeans/resource": "^0.1.18-rc.
|
|
30
|
-
"@owlmeans/server-marketing-consent": "^0.1.18-rc.
|
|
26
|
+
"@owlmeans/context": "^0.1.18-rc.34",
|
|
27
|
+
"@owlmeans/marketing-consent": "^0.1.18-rc.10",
|
|
28
|
+
"@owlmeans/postgres-resource": "^0.1.18-rc.43",
|
|
29
|
+
"@owlmeans/resource": "^0.1.18-rc.40",
|
|
30
|
+
"@owlmeans/server-marketing-consent": "^0.1.18-rc.15"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"ajv": "*",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@owlmeans/dep-config": "workspace:*",
|
|
38
|
-
"@owlmeans/test": "^0.1.18-rc.
|
|
39
|
-
"@owlmeans/test-integration": "^0.1.18-rc.
|
|
40
|
-
"@types/bun": "^1.4.
|
|
41
|
-
"@types/pg": "^8.
|
|
42
|
-
"ajv": "^8.
|
|
38
|
+
"@owlmeans/test": "^0.1.18-rc.35",
|
|
39
|
+
"@owlmeans/test-integration": "^0.1.18-rc.33",
|
|
40
|
+
"@types/bun": "^1.4.2",
|
|
41
|
+
"@types/pg": "^8.23.1",
|
|
42
|
+
"ajv": "^8.20.0",
|
|
43
43
|
"nodemon": "^3.1.14",
|
|
44
|
-
"pg": "^8.
|
|
44
|
+
"pg": "^8.23.1",
|
|
45
45
|
"typescript": "^7.0.2"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
package/src/helper.ts
CHANGED
|
@@ -2,11 +2,7 @@ import type { BasicContext } from '@owlmeans/context'
|
|
|
2
2
|
import { RES_MARKETING_CONSENT_LOG, RES_MARKETING_CONSENT_STATE } from '@owlmeans/server-marketing-consent'
|
|
3
3
|
|
|
4
4
|
import { makeMarketingConsentLogPostgres, makeMarketingConsentStatePostgres } from './resource.js'
|
|
5
|
-
|
|
6
|
-
export interface MarketingConsentPostgresOptions {
|
|
7
|
-
dbAlias?: string
|
|
8
|
-
serviceAlias?: string
|
|
9
|
-
}
|
|
5
|
+
import type { MarketingConsentPostgresOptions } from './types.js'
|
|
10
6
|
|
|
11
7
|
/**
|
|
12
8
|
* Registers the two Postgres resources this package owns, once. A context that already has
|
package/src/index.ts
CHANGED
package/src/types.ts
ADDED
package/tests/context.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { randomNamespace, gateHelper } from '@owlmeans/test-integration'
|
|
2
2
|
import type { IntegrationGate, PostgresEnv } from '@owlmeans/test-integration'
|
|
3
|
-
import { PgAutoSync,
|
|
3
|
+
import { PgAutoSync, pgDeclarationHelper } from '@owlmeans/postgres-resource'
|
|
4
4
|
import { config, makeServerContext } from '@owlmeans/server-context'
|
|
5
5
|
import type { ServerConfig, ServerContext } from '@owlmeans/server-context'
|
|
6
6
|
import { Pool } from 'pg'
|
|
@@ -17,7 +17,7 @@ import { appendMarketingConsentPostgres } from '../src/index.js'
|
|
|
17
17
|
* importing the sibling package's own `tests/context.ts`, which is test-only source that no
|
|
18
18
|
* package exports.
|
|
19
19
|
*/
|
|
20
|
-
export const gate: IntegrationGate<PostgresEnv> = postgresGate()
|
|
20
|
+
export const gate: IntegrationGate<PostgresEnv> = gateHelper.postgresGate()
|
|
21
21
|
|
|
22
22
|
const url = (): string => gate.env.POSTGRES_URL as string
|
|
23
23
|
|
|
@@ -48,8 +48,8 @@ export const makeSuite = (label: string): Suite => {
|
|
|
48
48
|
|
|
49
49
|
const boot = async (): Promise<Booted> => {
|
|
50
50
|
/** A fresh declaration per suite run — this spec simulates a freshly started process. */
|
|
51
|
-
resetDeclarations(RES_MARKETING_CONSENT_STATE)
|
|
52
|
-
resetDeclarations(RES_MARKETING_CONSENT_LOG)
|
|
51
|
+
pgDeclarationHelper.resetDeclarations(RES_MARKETING_CONSENT_STATE)
|
|
52
|
+
pgDeclarationHelper.resetDeclarations(RES_MARKETING_CONSENT_LOG)
|
|
53
53
|
|
|
54
54
|
const cfg: ServerConfig = config('mc-pg-test', {
|
|
55
55
|
dbs: [{
|
package/tests/schema.spec.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { describe, expect, test } from 'bun:test'
|
|
2
|
-
import { getDeclaration, resetDeclarations, schemaToTableSpec } from '@owlmeans/postgres-resource'
|
|
3
2
|
import {
|
|
4
3
|
MarketingConsentLogSchema, MarketingConsentStateSchema,
|
|
5
4
|
RES_MARKETING_CONSENT_LOG, RES_MARKETING_CONSENT_STATE
|
|
6
5
|
} from '@owlmeans/server-marketing-consent'
|
|
7
6
|
|
|
8
7
|
import { makeMarketingConsentLogPostgres, makeMarketingConsentStatePostgres } from '../src/resource.js'
|
|
8
|
+
import { pgDeclarationHelper, pgSchemaHelper } from '@owlmeans/postgres-resource'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* No live database needed — `schemaToTableSpec` is the same compiler `init()` runs against a
|
|
@@ -15,8 +15,8 @@ import { makeMarketingConsentLogPostgres, makeMarketingConsentStatePostgres } fr
|
|
|
15
15
|
*/
|
|
16
16
|
describe('@owlmeans/marketing-consent-postgres — schema shape', () => {
|
|
17
17
|
test('the maker assigns the imported schema, not a copy', () => {
|
|
18
|
-
resetDeclarations(RES_MARKETING_CONSENT_STATE)
|
|
19
|
-
resetDeclarations(RES_MARKETING_CONSENT_LOG)
|
|
18
|
+
pgDeclarationHelper.resetDeclarations(RES_MARKETING_CONSENT_STATE)
|
|
19
|
+
pgDeclarationHelper.resetDeclarations(RES_MARKETING_CONSENT_LOG)
|
|
20
20
|
|
|
21
21
|
const state = makeMarketingConsentStatePostgres()
|
|
22
22
|
const log = makeMarketingConsentLogPostgres()
|
|
@@ -26,9 +26,7 @@ describe('@owlmeans/marketing-consent-postgres — schema shape', () => {
|
|
|
26
26
|
})
|
|
27
27
|
|
|
28
28
|
test('decisions and terms compile to one jsonb column each, never a child table', () => {
|
|
29
|
-
const spec = schemaToTableSpec(
|
|
30
|
-
RES_MARKETING_CONSENT_STATE, MarketingConsentStateSchema, 'app', 'marketing_consent_state', true
|
|
31
|
-
)
|
|
29
|
+
const spec = pgSchemaHelper.schemaToTableSpec(RES_MARKETING_CONSENT_STATE, MarketingConsentStateSchema, 'app', 'marketing_consent_state', true)
|
|
32
30
|
|
|
33
31
|
const decisions = spec.byProperty.decisions
|
|
34
32
|
const terms = spec.byProperty.terms
|
|
@@ -50,9 +48,7 @@ describe('@owlmeans/marketing-consent-postgres — schema shape', () => {
|
|
|
50
48
|
})
|
|
51
49
|
|
|
52
50
|
test('the log table\'s documents/notices are also single jsonb columns', () => {
|
|
53
|
-
const spec = schemaToTableSpec(
|
|
54
|
-
RES_MARKETING_CONSENT_LOG, MarketingConsentLogSchema, 'app', 'marketing_consent_log', true
|
|
55
|
-
)
|
|
51
|
+
const spec = pgSchemaHelper.schemaToTableSpec(RES_MARKETING_CONSENT_LOG, MarketingConsentLogSchema, 'app', 'marketing_consent_log', true)
|
|
56
52
|
|
|
57
53
|
expect(spec.byProperty.documents.jsonb).toBe(true)
|
|
58
54
|
expect(spec.byProperty.documents.array).toBe(false)
|
|
@@ -61,12 +57,12 @@ describe('@owlmeans/marketing-consent-postgres — schema shape', () => {
|
|
|
61
57
|
})
|
|
62
58
|
|
|
63
59
|
test('the makers declare the indexes the API sketch promises', () => {
|
|
64
|
-
resetDeclarations(RES_MARKETING_CONSENT_STATE)
|
|
65
|
-
resetDeclarations(RES_MARKETING_CONSENT_LOG)
|
|
60
|
+
pgDeclarationHelper.resetDeclarations(RES_MARKETING_CONSENT_STATE)
|
|
61
|
+
pgDeclarationHelper.resetDeclarations(RES_MARKETING_CONSENT_LOG)
|
|
66
62
|
makeMarketingConsentStatePostgres()
|
|
67
63
|
makeMarketingConsentLogPostgres()
|
|
68
64
|
|
|
69
|
-
const stateIndexes = getDeclaration(RES_MARKETING_CONSENT_STATE).indexes
|
|
65
|
+
const stateIndexes = pgDeclarationHelper.getDeclaration(RES_MARKETING_CONSENT_STATE).indexes
|
|
70
66
|
expect(stateIndexes).toContainEqual(
|
|
71
67
|
expect.objectContaining({ name: 'idx_mc_state_subject', columns: ['subject'], unique: true })
|
|
72
68
|
)
|
|
@@ -74,7 +70,7 @@ describe('@owlmeans/marketing-consent-postgres — schema shape', () => {
|
|
|
74
70
|
expect.objectContaining({ name: 'idx_mc_state_user', columns: ['userId'] })
|
|
75
71
|
)
|
|
76
72
|
|
|
77
|
-
const logIndexes = getDeclaration(RES_MARKETING_CONSENT_LOG).indexes
|
|
73
|
+
const logIndexes = pgDeclarationHelper.getDeclaration(RES_MARKETING_CONSENT_LOG).indexes
|
|
78
74
|
expect(logIndexes).toContainEqual(
|
|
79
75
|
expect.objectContaining({ name: 'idx_mc_log_subject_key', columns: ['subject', 'key', 'decidedAt'] })
|
|
80
76
|
)
|