@nixxie-cms/core 1.0.3 → 2.0.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/CHANGELOG.md +36 -0
- package/CHANGES-1.1.md +134 -0
- package/context/dist/nixxie-cms-core-context.cjs.js +4 -3
- package/context/dist/nixxie-cms-core-context.esm.js +3 -2
- package/dist/declarations/src/access.d.ts +2 -2
- package/dist/declarations/src/access.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/components/Navigation.d.ts +2 -2
- package/dist/declarations/src/admin-ui/components/Navigation.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/context.d.ts +6 -6
- package/dist/declarations/src/admin-ui/context.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/utils/Fields.d.ts +3 -3
- package/dist/declarations/src/admin-ui/utils/Fields.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/utils/filters.d.ts +5 -5
- package/dist/declarations/src/admin-ui/utils/filters.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/utils/useCreateItem.d.ts +3 -3
- package/dist/declarations/src/admin-ui/utils/useCreateItem.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/utils/utils.d.ts +2 -2
- package/dist/declarations/src/admin-ui/utils/utils.d.ts.map +1 -1
- package/dist/declarations/src/context.d.ts +1 -1
- package/dist/declarations/src/context.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/bigInt/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/bigInt/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/bytes/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/bytes/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/calendarDay/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/calendarDay/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/checkbox/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/checkbox/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/decimal/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/decimal/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/file/index.d.ts +4 -4
- package/dist/declarations/src/fields/types/file/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/float/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/float/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/image/index.d.ts +4 -4
- package/dist/declarations/src/fields/types/image/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/integer/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/integer/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/json/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/json/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/multiselect/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/multiselect/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/multiselect/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/password/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/password/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/relationship/index.d.ts +8 -8
- package/dist/declarations/src/fields/types/relationship/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/relationship/views/ComboboxMany.d.ts +3 -3
- package/dist/declarations/src/fields/types/relationship/views/ComboboxMany.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/relationship/views/ComboboxSingle.d.ts +3 -3
- package/dist/declarations/src/fields/types/relationship/views/ComboboxSingle.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/relationship/views/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/relationship/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/relationship/views/types.d.ts +3 -3
- package/dist/declarations/src/fields/types/relationship/views/types.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/select/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/select/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/text/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/text/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/timestamp/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/timestamp/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/virtual/index.d.ts +7 -7
- package/dist/declarations/src/fields/types/virtual/index.d.ts.map +1 -1
- package/dist/declarations/src/helpers.d.ts +249 -13
- package/dist/declarations/src/helpers.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts +9 -4
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/internal-unstable/admin-ui/pages/ListPage/index.d.ts.map +1 -1
- package/dist/declarations/src/lib/admin-meta.d.ts +11 -11
- package/dist/declarations/src/lib/admin-meta.d.ts.map +1 -1
- package/dist/declarations/src/lib/core/access-control.d.ts +18 -18
- package/dist/declarations/src/lib/core/access-control.d.ts.map +1 -1
- package/dist/declarations/src/lib/core/cascade.d.ts +47 -0
- package/dist/declarations/src/lib/core/cascade.d.ts.map +1 -0
- package/dist/declarations/src/lib/core/initialise-lists.d.ts +27 -24
- package/dist/declarations/src/lib/core/initialise-lists.d.ts.map +1 -1
- package/dist/declarations/src/lib/env.d.ts +9 -0
- package/dist/declarations/src/lib/env.d.ts.map +1 -0
- package/dist/declarations/src/lib/system.d.ts +1 -1
- package/dist/declarations/src/lib/system.d.ts.map +1 -1
- package/dist/declarations/src/list-features.d.ts +162 -0
- package/dist/declarations/src/list-features.d.ts.map +1 -0
- package/dist/declarations/src/schema.d.ts +24 -23
- package/dist/declarations/src/schema.d.ts.map +1 -1
- package/dist/declarations/src/session.d.ts +75 -0
- package/dist/declarations/src/session.d.ts.map +1 -1
- package/dist/declarations/src/types/admin-meta.d.ts +11 -11
- package/dist/declarations/src/types/admin-meta.d.ts.map +1 -1
- package/dist/declarations/src/types/config/access-control.d.ts +42 -42
- package/dist/declarations/src/types/config/access-control.d.ts.map +1 -1
- package/dist/declarations/src/types/config/fields.d.ts +19 -19
- package/dist/declarations/src/types/config/fields.d.ts.map +1 -1
- package/dist/declarations/src/types/config/hooks.d.ts +131 -131
- package/dist/declarations/src/types/config/hooks.d.ts.map +1 -1
- package/dist/declarations/src/types/config/index.d.ts +190 -8
- package/dist/declarations/src/types/config/index.d.ts.map +1 -1
- package/dist/declarations/src/types/config/lists.d.ts +146 -108
- package/dist/declarations/src/types/config/lists.d.ts.map +1 -1
- package/dist/declarations/src/types/context.d.ts +507 -47
- package/dist/declarations/src/types/context.d.ts.map +1 -1
- package/dist/declarations/src/types/next-fields.d.ts +28 -28
- package/dist/declarations/src/types/next-fields.d.ts.map +1 -1
- package/dist/declarations/src/types/type-info.d.ts +3 -3
- package/dist/declarations/src/types/type-info.d.ts.map +1 -1
- package/dist/{express-455ae20c.cjs.js → express-84d534c2.cjs.js} +6 -6
- package/dist/{express-7559ca2d.esm.js → express-d0a4ce99.esm.js} +6 -6
- package/dist/{index-15c8f81e.esm.js → index-5d8b0b4e.esm.js} +363 -183
- package/dist/index-6055753b.cjs.js +393 -0
- package/dist/{index-42045902.cjs.js → index-ac29f382.cjs.js} +363 -185
- package/dist/index-f1703b7b.esm.js +386 -0
- package/dist/nixxie-cms-core.cjs.js +1388 -30
- package/dist/nixxie-cms-core.esm.js +1362 -24
- package/dist/{non-null-graphql-add6bb3d.cjs.js → non-null-graphql-4a44c122.cjs.js} +1 -1
- package/dist/{non-null-graphql-a84ed64d.esm.js → non-null-graphql-8c5feaae.esm.js} +1 -1
- package/dist/{resolve-hooks-165a9ce2.cjs.js → resolve-hooks-10a5f84c.cjs.js} +240 -6
- package/dist/{resolve-hooks-6813a045.esm.js → resolve-hooks-9e676794.esm.js} +238 -7
- package/dist/{system-a321642d.cjs.js → system-6b37a5f8.cjs.js} +33 -7
- package/dist/{system-03e49e4f.esm.js → system-e591d821.esm.js} +33 -7
- package/fields/dist/nixxie-cms-core-fields.cjs.js +29 -576
- package/fields/dist/nixxie-cms-core-fields.esm.js +18 -565
- package/fields/types/bytes/dist/nixxie-cms-core-fields-types-bytes.cjs.js +4 -2
- package/fields/types/bytes/dist/nixxie-cms-core-fields-types-bytes.esm.js +4 -2
- package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.cjs.js +1 -6
- package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.esm.js +1 -6
- package/fields/types/password/dist/nixxie-cms-core-fields-types-password.cjs.js +4 -2
- package/fields/types/password/dist/nixxie-cms-core-fields-types-password.esm.js +4 -2
- package/internal-unstable/artifacts/dist/nixxie-cms-core-internal-unstable-artifacts.cjs.js +4 -3
- package/internal-unstable/artifacts/dist/nixxie-cms-core-internal-unstable-artifacts.esm.js +4 -3
- package/package.json +4 -4
- package/scripts/cli/dist/nixxie-cms-core-scripts-cli.cjs.js +4 -3
- package/scripts/cli/dist/nixxie-cms-core-scripts-cli.esm.js +4 -3
- package/scripts/dist/nixxie-cms-core-scripts.cjs.js +4 -3
- package/scripts/dist/nixxie-cms-core-scripts.esm.js +4 -3
- package/session/dist/nixxie-cms-core-session.cjs.js +286 -0
- package/session/dist/nixxie-cms-core-session.esm.js +279 -1
- package/src/access.ts +25 -25
- package/src/admin-ui/admin-meta-graphql.ts +5 -5
- package/src/admin-ui/components/CreateButtonLink.tsx +46 -46
- package/src/admin-ui/components/Navigation.tsx +3 -3
- package/src/admin-ui/context.tsx +6 -6
- package/src/admin-ui/utils/Fields.tsx +241 -241
- package/src/admin-ui/utils/actionData.ts +36 -36
- package/src/admin-ui/utils/filters.ts +148 -148
- package/src/admin-ui/utils/useCreateItem.ts +171 -171
- package/src/admin-ui/utils/utils.tsx +127 -127
- package/src/context.ts +1 -1
- package/src/fields/non-null-graphql.ts +115 -115
- package/src/fields/types/bigInt/index.ts +6 -6
- package/src/fields/types/bytes/index.ts +6 -6
- package/src/fields/types/calendarDay/index.ts +18 -19
- package/src/fields/types/checkbox/index.ts +6 -6
- package/src/fields/types/decimal/index.ts +6 -6
- package/src/fields/types/file/index.ts +8 -8
- package/src/fields/types/float/index.ts +6 -6
- package/src/fields/types/image/index.ts +8 -8
- package/src/fields/types/integer/index.ts +6 -6
- package/src/fields/types/json/index.ts +5 -5
- package/src/fields/types/multiselect/index.ts +7 -7
- package/src/fields/types/multiselect/views/index.tsx +149 -151
- package/src/fields/types/password/index.ts +6 -6
- package/src/fields/types/relationship/index.ts +13 -13
- package/src/fields/types/relationship/views/ComboboxMany.tsx +110 -110
- package/src/fields/types/relationship/views/ComboboxSingle.tsx +115 -115
- package/src/fields/types/relationship/views/ContextualActions.tsx +139 -139
- package/src/fields/types/relationship/views/index.tsx +492 -492
- package/src/fields/types/relationship/views/types.ts +46 -46
- package/src/fields/types/relationship/views/useApolloQuery.ts +185 -185
- package/src/fields/types/relationship/views/useFilter.tsx +109 -109
- package/src/fields/types/select/index.ts +6 -6
- package/src/fields/types/text/index.ts +6 -6
- package/src/fields/types/timestamp/index.ts +23 -21
- package/src/fields/types/virtual/index.ts +11 -11
- package/src/helpers.ts +773 -42
- package/src/index.ts +66 -24
- package/src/internal-unstable/admin-ui/pages/ItemPage/common.tsx +4 -4
- package/src/internal-unstable/admin-ui/pages/ItemPage/index.tsx +5 -5
- package/src/internal-unstable/admin-ui/pages/ListPage/index.tsx +8 -8
- package/src/lib/admin-meta.ts +369 -369
- package/src/lib/context/createContext.ts +6 -0
- package/src/lib/core/access-control.ts +434 -434
- package/src/lib/core/cascade.ts +236 -0
- package/src/lib/core/initialise-lists.ts +49 -33
- package/src/lib/core/mutations/index.ts +7 -0
- package/src/lib/core/mutations/nested-mutation-many-input-resolvers.ts +145 -145
- package/src/lib/core/mutations/nested-mutation-one-input-resolvers.ts +71 -71
- package/src/lib/core/queries/output-field.ts +178 -178
- package/src/lib/env.ts +50 -0
- package/src/lib/id-field.ts +2 -2
- package/src/lib/system.ts +221 -207
- package/src/lib/typescript-schema-printer.ts +227 -227
- package/src/list-features.ts +476 -0
- package/src/schema.ts +92 -22
- package/src/session.ts +225 -0
- package/src/types/admin-meta.ts +218 -218
- package/src/types/config/access-control.ts +186 -186
- package/src/types/config/fields.ts +96 -96
- package/src/types/config/hooks.ts +529 -529
- package/src/types/config/index.ts +206 -7
- package/src/types/config/lists.ts +606 -565
- package/src/types/context.ts +592 -55
- package/src/types/next-fields.ts +31 -31
- package/src/types/type-info.ts +38 -38
- package/src/types/type-tests.ts +21 -21
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @nixxie-cms/core
|
|
2
|
+
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 450043a:
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 0fe028d: feat: add `@nixxie-cms/ai-rag` — a custom, RAG-trained AI assistant
|
|
12
|
+
|
|
13
|
+
New package that auto-creates a `KnowledgeBase` source list, indexes it into embeddings,
|
|
14
|
+
and answers questions grounded in that content with citations and hallucination guarding.
|
|
15
|
+
Generation via Anthropic / OpenAI / Gemini / Llama (Ollama); embeddings via OpenAI /
|
|
16
|
+
Gemini / Llama. Pluggable vector store (SQL-backed default that runs on any database).
|
|
17
|
+
Surfaces: programmatic service (`context.services.aiRag`), HTTP chat route with SSE
|
|
18
|
+
streaming, GraphQL queries/mutations, and an Admin UI console. Highly configurable
|
|
19
|
+
(prompts, temperature, models, chunking, scheduled/incremental indexing, token limits,
|
|
20
|
+
grounding checks). Register with `ragPlugin()`.
|
|
21
|
+
|
|
22
|
+
`@nixxie-cms/core` gains the `NixxieAiRagService` type and `context.services.aiRag`.
|
|
23
|
+
|
|
24
|
+
- 690e433: Add five backend service packages and wire them into core config + context:
|
|
25
|
+
- **`@nixxie-cms/versioning`** — content revision history. Snapshot item data, list/diff versions, restore an older revision (as a new snapshot so history is never lost), and prune. In-memory and NDJSON file backends. Available as `context.services.versioning`.
|
|
26
|
+
- **`@nixxie-cms/workflow`** — editorial state machine (e.g. draft → review → published). Enforces allowed transitions, records per-item history, and exposes `can`/`available`. In-memory and file-backed history. Available as `context.services.workflow`.
|
|
27
|
+
- **`@nixxie-cms/api-keys`** — scoped, revocable machine-to-machine access tokens. Only key hashes are stored; plaintext is shown once at issue time. Supports scope authorization, expiry and revocation, with in-memory and file backends. Available as `context.services.apiKeys`.
|
|
28
|
+
- **`@nixxie-cms/logger`** — structured, level-aware logging with bound child loggers and pluggable sinks (JSON and pretty console sinks included). Available as `context.services.logger`.
|
|
29
|
+
- **`@nixxie-cms/backup`** — content export / import / seed over a pluggable data source, plus a `nixxieDataSource(context)` helper built on `context.db`. Supports JSON and NDJSON archives and create/upsert imports. Available as `context.services.backup`.
|
|
30
|
+
|
|
31
|
+
`core` gains the corresponding service contracts (`NixxieVersioningService`, `NixxieWorkflowService`, `NixxieApiKeysService`, `NixxieLoggerService`, `NixxieBackupService`), new optional `config()` keys, and `context.services` entries.
|
|
32
|
+
|
|
33
|
+
- 2c0d28c: Expand the `defineList` schema-builder layer with a more complete, less-boilerplate alternative to the classic `list()` API:
|
|
34
|
+
- New composable mixins: `withSlug`, `withPublishing`, `withSEO`, `withSortable` (alongside the existing `withTimestamps`, `withSoftDelete`, `withAudit`).
|
|
35
|
+
- New `accessPresets` helper (`public`, `authenticated`, `publicReadAuthenticatedWrite`, `readOnly`, `owner(field)`) so common access patterns are named rather than hand-written.
|
|
36
|
+
- `defineList` now defaults `access` to `accessPresets.public` when omitted, so a minimal list is just its fields.
|
package/CHANGES-1.1.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# @nixxie-cms/core 1.1
|
|
2
|
+
|
|
3
|
+
New core surface in this release. Everything below is exported from `@nixxie-cms/core`
|
|
4
|
+
unless noted otherwise.
|
|
5
|
+
|
|
6
|
+
## Plugins
|
|
7
|
+
|
|
8
|
+
A `NixxiePlugin` is one object that can contribute `collections`, transform the config
|
|
9
|
+
(`extendConfig`) and run setup after the database connects (`onConnect`). Register via
|
|
10
|
+
`config({ plugins: [...] })`; plugins apply in array order.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
config({
|
|
14
|
+
plugins: [
|
|
15
|
+
{
|
|
16
|
+
name: 'my-plugin',
|
|
17
|
+
collections: { MyPluginLog: collection({ fields: { /* ... */ } }) },
|
|
18
|
+
extendConfig: config => ({ ...config /* register services, wrap hooks, ... */ }),
|
|
19
|
+
onConnect: async context => { /* runs before db.onConnect */ },
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Environment validation
|
|
26
|
+
|
|
27
|
+
Declare required environment variables on the config — a misconfigured deployment fails
|
|
28
|
+
at boot with one aggregated, readable error. `validateEnv()` is also exported for
|
|
29
|
+
standalone use.
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
config({
|
|
33
|
+
env: {
|
|
34
|
+
DATABASE_URL: { description: 'Postgres connection string' },
|
|
35
|
+
SESSION_SECRET: { pattern: /^.{32,}$/ },
|
|
36
|
+
PORT: { required: false, default: '3000' },
|
|
37
|
+
},
|
|
38
|
+
// or simply: env: ['DATABASE_URL', 'SESSION_SECRET']
|
|
39
|
+
})
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Persistent sessions (`@nixxie-cms/core/session`)
|
|
43
|
+
|
|
44
|
+
`persistentSessions()` stores sessions in a collection (cookie carries only an opaque
|
|
45
|
+
token), so they survive restarts and can be revoked server-side. Pairs with
|
|
46
|
+
`sessionCollection()`:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { persistentSessions, sessionCollection } from '@nixxie-cms/core/session'
|
|
50
|
+
|
|
51
|
+
config({
|
|
52
|
+
collections: { UserSession: sessionCollection(), ...collections },
|
|
53
|
+
session: persistentSessions({ collection: 'UserSession' }),
|
|
54
|
+
})
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Helpers (all in `@nixxie-cms/core/session`):
|
|
58
|
+
|
|
59
|
+
- `listSessions(context, itemId)` — a user's active sessions (tokens stripped)
|
|
60
|
+
- `revokeSession(context, sessionId)` / `revokeUserSessions(context, itemId)`
|
|
61
|
+
- `pruneSessions(context)` — delete expired/revoked rows; run from a scheduled job
|
|
62
|
+
- `startImpersonation(context, itemId)` / `endImpersonation(context)` — sign in as
|
|
63
|
+
another user, recording `impersonatedBy` in the session; works with any session
|
|
64
|
+
strategy (authorisation is up to the caller)
|
|
65
|
+
|
|
66
|
+
## New mixins
|
|
67
|
+
|
|
68
|
+
For `defineCollection({ mixins: [...] })`:
|
|
69
|
+
|
|
70
|
+
- `withTreeStructure(listKey)` — self-referential `parent`/`children` with cycle prevention
|
|
71
|
+
- `withTenant({ ref })` + `tenantAccessFilter()` — multi-tenancy field + row scoping
|
|
72
|
+
- `withScheduledPublishing()` + `applyScheduledPublishing(context, listKey)` —
|
|
73
|
+
`publishAt`/`unpublishAt`, enacted from a cron job
|
|
74
|
+
- `withLocale({ locales })` — `locale` select + shared `translationKey` grouping translations
|
|
75
|
+
- `withApproval()` + `submitForApproval` / `approveChanges` / `rejectChanges` — proposed
|
|
76
|
+
edits wait in a `pendingChanges` buffer for review
|
|
77
|
+
- `withExpiry()` + `purgeExpired(context, listKey)` — `expiresAt` for content with a shelf life
|
|
78
|
+
- `withViewCount()` + `recordView(context, listKey, itemId)` — race-safe view counter
|
|
79
|
+
that bypasses hooks
|
|
80
|
+
|
|
81
|
+
## Declarative collection features
|
|
82
|
+
|
|
83
|
+
`defineCollection()` accepts new feature keys, compiled into hooks and access filters:
|
|
84
|
+
|
|
85
|
+
- `computed` — persisted derived fields, recalculated on every create/update
|
|
86
|
+
(`computed: { total: ({ merged }) => merged.price * merged.quantity }`)
|
|
87
|
+
- `constraints` — `uniqueTogether: [['translationKey', 'locale']]` compound uniqueness,
|
|
88
|
+
plus named cross-field `checks` that return an error message to reject the write
|
|
89
|
+
- `defaultFilter` — a where-filter (or session-aware function) ANDed into every
|
|
90
|
+
query/update/delete, including the Admin UI
|
|
91
|
+
- `stateMachine` — legal status transitions on a select field, with optional
|
|
92
|
+
`"from->to"` guards that return `false` or an error string
|
|
93
|
+
- `policies` — declarative row-level access: per operation, the first rule whose `when`
|
|
94
|
+
matches the session supplies the filter; no match means no access
|
|
95
|
+
- `events` — emit `<prefix>.created/.updated/.deleted` through `context.services.webhooks`
|
|
96
|
+
- `searchable` — keep a search index in sync through `context.services.search`
|
|
97
|
+
- `versioned` — snapshot every create/update into `context.services.versioning`
|
|
98
|
+
|
|
99
|
+
## Cascade deletion
|
|
100
|
+
|
|
101
|
+
Referential-integrity rules on any collection, run inside the delete pipeline through
|
|
102
|
+
the normal mutation APIs (target hooks/events fire; cascades recurse with cycle
|
|
103
|
+
protection):
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
collection({
|
|
107
|
+
// when a Post is deleted:
|
|
108
|
+
cascade: [
|
|
109
|
+
{ collection: 'Comment', field: 'post', action: 'delete' },
|
|
110
|
+
{ collection: 'Draft', field: 'original', action: 'setNull' },
|
|
111
|
+
{ collection: 'Order', field: 'product', action: 'restrict' },
|
|
112
|
+
{ collection: 'Note', field: 'post', action: 'softDelete' }, // stamps deletedAt
|
|
113
|
+
],
|
|
114
|
+
})
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`previewDelete(context, listKey, itemId)` computes — without changing anything — the
|
|
118
|
+
full tree a delete would touch, for delete confirmations:
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
const preview = await previewDelete(context, 'Post', postId)
|
|
122
|
+
// preview.totals → { Comment: { delete: 47 }, Draft: { setNull: 3 } }
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`cleanupOrphans(context, { collection, field, action? })` is the companion sweep for
|
|
126
|
+
records whose to-one relationship points at nothing (e.g. rows that pre-date a cascade
|
|
127
|
+
rule); designed for a cron job.
|
|
128
|
+
|
|
129
|
+
## Service `init` lifecycle
|
|
130
|
+
|
|
131
|
+
Runtime services can implement `init(context)` (`NixxieInitableService`): core calls it
|
|
132
|
+
once with a sudo context after the database connects. This is how the database-backed
|
|
133
|
+
stores in @nixxie-cms/audit, /versioning, /workflow, /jobs and /webhooks reach
|
|
134
|
+
`context.prisma` without a circular boot dependency.
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var system = require('../../dist/system-
|
|
5
|
+
var system = require('../../dist/system-6b37a5f8.cjs.js');
|
|
6
6
|
require('node:crypto');
|
|
7
7
|
require('node:path');
|
|
8
8
|
require('../../dist/admin-meta-18d0c276.cjs.js');
|
|
9
9
|
require('graphql');
|
|
10
10
|
require('@graphql-ts/schema');
|
|
11
|
-
require('../../dist/resolve-hooks-
|
|
11
|
+
require('../../dist/resolve-hooks-10a5f84c.cjs.js');
|
|
12
12
|
require('pluralize');
|
|
13
13
|
require('../../dist/next-fields-49c025ef.cjs.js');
|
|
14
14
|
require('decimal.js');
|
|
15
15
|
require('@graphql-ts/extend');
|
|
16
16
|
require('graphql-upload/GraphQLUpload.js');
|
|
17
|
+
require('node:async_hooks');
|
|
17
18
|
require('../../dist/utils-e74e3527.cjs.js');
|
|
18
19
|
require('../../dist/utils-1b632a8f.cjs.js');
|
|
19
20
|
require('../../access/dist/nixxie-cms-core-access.cjs.js');
|
|
@@ -28,4 +29,4 @@ require('@opentelemetry/api');
|
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
|
|
31
|
-
exports.
|
|
32
|
+
exports.createNixxieContext = system.createNixxieContext;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { c as createNixxieContext } from '../../dist/system-e591d821.esm.js';
|
|
2
2
|
import 'node:crypto';
|
|
3
3
|
import 'node:path';
|
|
4
4
|
import '../../dist/admin-meta-14c60fec.esm.js';
|
|
5
5
|
import 'graphql';
|
|
6
6
|
import '@graphql-ts/schema';
|
|
7
|
-
import '../../dist/resolve-hooks-
|
|
7
|
+
import '../../dist/resolve-hooks-9e676794.esm.js';
|
|
8
8
|
import 'pluralize';
|
|
9
9
|
import '../../dist/next-fields-9bf04ed8.esm.js';
|
|
10
10
|
import 'decimal.js';
|
|
11
11
|
import '@graphql-ts/extend';
|
|
12
12
|
import 'graphql-upload/GraphQLUpload.js';
|
|
13
|
+
import 'node:async_hooks';
|
|
13
14
|
import '../../dist/utils-ef2cd0f4.esm.js';
|
|
14
15
|
import '../../dist/utils-0cc426c8.esm.js';
|
|
15
16
|
import '../../access/dist/nixxie-cms-core-access.esm.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { MaybePromise } from "./types/utils.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BaseCollectionTypeInfo } from "./types/index.js";
|
|
3
3
|
export declare function allowAll(): boolean;
|
|
4
4
|
export declare function denyAll(): boolean;
|
|
5
|
-
export declare function unfiltered<
|
|
5
|
+
export declare function unfiltered<CollectionTypeInfo extends BaseCollectionTypeInfo>(): MaybePromise<boolean | CollectionTypeInfo['inputs']['where']>;
|
|
6
6
|
export declare function allOperations<F>(f: F): {
|
|
7
7
|
query: F;
|
|
8
8
|
create: F;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access.d.ts","sourceRoot":"../../../src","sources":["access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,yBAAqB;AACjD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"access.d.ts","sourceRoot":"../../../src","sources":["access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,yBAAqB;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,yBAAe;AAErD,wBAAgB,QAAQ,YAEvB;AAED,wBAAgB,OAAO,YAEtB;AAED,wBAAgB,UAAU,CAAC,kBAAkB,SAAS,sBAAsB,KAAK,YAAY,CAC3F,OAAO,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAChD,CAEA;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;;;;;EAOpC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode, type PropsWithChildren } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function getHrefFromList(list: Pick<
|
|
2
|
+
import type { CollectionMeta } from "../../types/index.js";
|
|
3
|
+
export declare function getHrefFromList(list: Pick<CollectionMeta, 'path' | 'isSingleton'>): string;
|
|
4
4
|
type NavItemProps = {
|
|
5
5
|
href: string;
|
|
6
6
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigation.d.ts","sourceRoot":"../../../../../src/admin-ui/components","sources":["Navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAA8B,MAAM,OAAO,CAAA;AAK1F,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Navigation.d.ts","sourceRoot":"../../../../../src/admin-ui/components","sources":["Navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAA8B,MAAM,OAAO,CAAA;AAK1F,OAAO,KAAK,EAAE,cAAc,EAAE,6BAAmB;AAOjD,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,aAAa,CAAC,UAEjF;AAMD,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,SAAS,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,YAAY,2CAiExE;AAuMD,KAAK,uBAAuB,GAAG;IAC7B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,wBAAgB,UAAU,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,uBAAuB,2CAiD7E;AAMD,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAEtD;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAa3D;AAED,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAaxD;AAED,kBAAkB;AAClB,wBAAgB,sBAAsB,SAErC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type { AdminConfig,
|
|
2
|
+
import type { AdminConfig, BaseCollectionTypeInfo, ConditionalFilter, ConditionalFilterCase, FieldViews, CollectionMeta } from "../types/index.js";
|
|
3
3
|
import { type ErrorLike, useQuery } from "./apollo.js";
|
|
4
4
|
type NixxieContextType = {
|
|
5
5
|
adminConfig: AdminConfig | null;
|
|
@@ -7,7 +7,7 @@ type NixxieContextType = {
|
|
|
7
7
|
error?: ErrorLike | null;
|
|
8
8
|
fieldViews: FieldViews;
|
|
9
9
|
lists: {
|
|
10
|
-
[list: string]:
|
|
10
|
+
[list: string]: CollectionMeta;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
type NixxieProviderProps = {
|
|
@@ -18,7 +18,7 @@ type NixxieProviderProps = {
|
|
|
18
18
|
};
|
|
19
19
|
export declare function NixxieProvider(props: NixxieProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export declare function useNixxie(): NixxieContextType;
|
|
21
|
-
export declare function useList(listKey: string):
|
|
21
|
+
export declare function useList(listKey: string): CollectionMeta;
|
|
22
22
|
export declare function useField(listKey: string, fieldKey: string): import("../types/index.js").FieldMeta;
|
|
23
23
|
export declare function useListItem(listKey: string, itemId: string | null): useQuery.Result<{
|
|
24
24
|
item: Record<string, unknown> | null;
|
|
@@ -28,15 +28,15 @@ export declare function useListItem(listKey: string, itemId: string | null): use
|
|
|
28
28
|
fields: {
|
|
29
29
|
key: string;
|
|
30
30
|
itemView: {
|
|
31
|
-
fieldMode: ConditionalFilter<'edit' | 'read' | 'hidden', 'read' | 'hidden',
|
|
31
|
+
fieldMode: ConditionalFilter<'edit' | 'read' | 'hidden', 'read' | 'hidden', BaseCollectionTypeInfo>;
|
|
32
32
|
fieldPosition: 'form' | 'sidebar';
|
|
33
|
-
isRequired: ConditionalFilterCase<
|
|
33
|
+
isRequired: ConditionalFilterCase<BaseCollectionTypeInfo>;
|
|
34
34
|
} | null;
|
|
35
35
|
}[];
|
|
36
36
|
actions: {
|
|
37
37
|
key: string;
|
|
38
38
|
itemView: {
|
|
39
|
-
actionMode: ConditionalFilter<'enabled' | 'disabled' | 'hidden', 'disabled' | 'hidden',
|
|
39
|
+
actionMode: ConditionalFilter<'enabled' | 'disabled' | 'hidden', 'disabled' | 'hidden', BaseCollectionTypeInfo>;
|
|
40
40
|
} | null;
|
|
41
41
|
}[];
|
|
42
42
|
} | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"../../../../src/admin-ui","sources":["context.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAiD,MAAM,OAAO,CAAA;AAQrF,OAAO,KAAK,EACV,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"../../../../src/admin-ui","sources":["context.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAiD,MAAM,OAAO,CAAA;AAQrF,OAAO,KAAK,EACV,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,cAAc,EACf,0BAAgB;AAEjB,OAAO,EAGL,KAAK,SAAS,EAGd,QAAQ,EACT,oBAAgB;AAGjB,KAAK,iBAAiB,GAAG;IACvB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAA;IAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAAA;CAC1C,CAAA;AASD,KAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAiJD,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAkBxD;AAED,wBAAgB,SAAS,sBAExB;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,kBAKtC;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,yCAKzD;AAGD,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,QAAQ,CAAC,MAAM,CAChB;IACE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IACpC,MAAM,EAAE;QACN,SAAS,EAAE;YACT,IAAI,EAAE;gBACJ,MAAM,EAAE;oBACN,GAAG,EAAE,MAAM,CAAA;oBACX,QAAQ,EAAE;wBACR,SAAS,EAAE,iBAAiB,CAC1B,MAAM,GAAG,MAAM,GAAG,QAAQ,EAC1B,MAAM,GAAG,QAAQ,EACjB,sBAAsB,CACvB,CAAA;wBACD,aAAa,EAAE,MAAM,GAAG,SAAS,CAAA;wBACjC,UAAU,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,CAAA;qBAC1D,GAAG,IAAI,CAAA;iBACT,EAAE,CAAA;gBACH,OAAO,EAAE;oBACP,GAAG,EAAE,MAAM,CAAA;oBACX,QAAQ,EAAE;wBACR,UAAU,EAAE,iBAAiB,CAC3B,SAAS,GAAG,UAAU,GAAG,QAAQ,EACjC,UAAU,GAAG,QAAQ,EACrB,sBAAsB,CACvB,CAAA;qBACF,GAAG,IAAI,CAAA;iBACT,EAAE,CAAA;aACJ,GAAG,IAAI,CAAA;SACT,CAAA;KACF,CAAA;CACF,EACD;IAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CACvC,CAoEA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseCollectionTypeInfo, ConditionalFilter, ConditionalFilterCase, FieldGroupMeta, FieldMeta } from "../../types/index.js";
|
|
2
2
|
export declare function Fields({ view, position, fields, groups, forceValidation, invalidFields, onChange, value: itemValue, fieldModes, fieldPositions, isRequireds, }: {
|
|
3
3
|
view: 'createView' | 'itemView';
|
|
4
4
|
position: 'form' | 'sidebar';
|
|
@@ -8,9 +8,9 @@ export declare function Fields({ view, position, fields, groups, forceValidation
|
|
|
8
8
|
invalidFields: ReadonlySet<string>;
|
|
9
9
|
onChange(value: Record<string, unknown>): void;
|
|
10
10
|
value: Record<string, unknown>;
|
|
11
|
-
fieldModes?: Record<string, ConditionalFilter<'read' | 'edit' | 'hidden', 'read' | 'hidden',
|
|
11
|
+
fieldModes?: Record<string, ConditionalFilter<'read' | 'edit' | 'hidden', 'read' | 'hidden', BaseCollectionTypeInfo>>;
|
|
12
12
|
fieldPositions?: Record<string, 'form' | 'sidebar'>;
|
|
13
|
-
isRequireds: Record<string, ConditionalFilterCase<
|
|
13
|
+
isRequireds: Record<string, ConditionalFilterCase<BaseCollectionTypeInfo>>;
|
|
14
14
|
}): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export declare function GroupIndicatorLine(): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
//# sourceMappingURL=Fields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fields.d.ts","sourceRoot":"../../../../../src/admin-ui/utils","sources":["Fields.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"Fields.d.ts","sourceRoot":"../../../../../src/admin-ui/utils","sources":["Fields.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,SAAS,EACV,6BAAmB;AAIpB,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,MAAW,EACX,eAAe,EACf,aAAa,EACb,QAAQ,EACR,KAAK,EAAE,SAAS,EAChB,UAAe,EACf,cAAmB,EACnB,WAAW,GACZ,EAAE;IACD,IAAI,EAAE,YAAY,GAAG,UAAU,CAAA;IAC/B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACjC,eAAe,EAAE,OAAO,CAAA;IACxB,MAAM,CAAC,EAAE,cAAc,EAAE,CAAA;IACzB,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IAC9C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,UAAU,CAAC,EAAE,MAAM,CACjB,MAAM,EACN,iBAAiB,CAAC,MAAM,GAAG,MAAM,GAAG,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,sBAAsB,CAAC,CACzF,CAAA;IACD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IACnD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,CAAC,CAAA;CAC3E,2CAiGA;AAiFD,wBAAgB,kBAAkB,4CAcjC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ActionMeta,
|
|
1
|
+
import type { ActionMeta, BaseCollectionTypeInfo, ConditionalFilter, ConditionalFilterCase, FieldMeta } from "../../types/index.js";
|
|
2
2
|
type SerializedItem = Record<string, unknown>;
|
|
3
|
-
export declare function testFilter(filter: ConditionalFilterCase<
|
|
3
|
+
export declare function testFilter(filter: ConditionalFilterCase<BaseCollectionTypeInfo> | undefined, serialized: SerializedItem): boolean;
|
|
4
4
|
export declare function serializeItemForConditionalFilters(fields: Record<string, FieldMeta>, itemValue: Record<string, unknown>): SerializedItem;
|
|
5
|
-
export declare function resolveActionMode(actionMode: ConditionalFilter<'enabled' | 'disabled' | 'hidden', 'disabled' | 'hidden',
|
|
6
|
-
export declare function resolveFieldMode(fieldMode: ConditionalFilter<'edit' | 'read' | 'hidden', 'read' | 'hidden',
|
|
5
|
+
export declare function resolveActionMode(actionMode: ConditionalFilter<'enabled' | 'disabled' | 'hidden', 'disabled' | 'hidden', BaseCollectionTypeInfo>, serialized: SerializedItem): 'enabled' | 'disabled' | 'hidden';
|
|
6
|
+
export declare function resolveFieldMode(fieldMode: ConditionalFilter<'edit' | 'read' | 'hidden', 'read' | 'hidden', BaseCollectionTypeInfo>, serialized: SerializedItem, view: 'createView' | 'itemView'): "hidden" | "edit" | "read";
|
|
7
7
|
export declare function isActionAvailable(action: ActionMeta, { actionMode }: ActionMeta['listView'] | ActionMeta['itemView']): boolean;
|
|
8
|
-
export declare function getConditionalFilterFieldKeys(actionMode: ConditionalFilter<string, string,
|
|
8
|
+
export declare function getConditionalFilterFieldKeys(actionMode: ConditionalFilter<string, string, BaseCollectionTypeInfo>): string[];
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=filters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.d.ts","sourceRoot":"../../../../../src/admin-ui/utils","sources":["filters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"filters.d.ts","sourceRoot":"../../../../../src/admin-ui/utils","sources":["filters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACV,6BAAmB;AAEpB,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AA+B7C,wBAAgB,UAAU,CACxB,MAAM,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,GAAG,SAAS,EACjE,UAAU,EAAE,cAAc,GACzB,OAAO,CAyBT;AAED,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACjC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,cAAc,CAMhB;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,iBAAiB,CAC3B,SAAS,GAAG,UAAU,GAAG,QAAQ,EACjC,UAAU,GAAG,QAAQ,EACrB,sBAAsB,CACvB,EACD,UAAU,EAAE,cAAc,GACzB,SAAS,GAAG,UAAU,GAAG,QAAQ,CAKnC;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,iBAAiB,CAAC,MAAM,GAAG,MAAM,GAAG,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,sBAAsB,CAAC,EACnG,UAAU,EAAE,cAAc,EAC1B,IAAI,EAAE,YAAY,GAAG,UAAU,8BAMhC;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,UAAU,EAClB,EAAE,UAAU,EAAE,EAAE,UAAU,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,GAC9D,OAAO,CAMT;AAED,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,sBAAsB,CAAC,GACpE,MAAM,EAAE,CA6BV"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComponentProps } from 'react';
|
|
2
2
|
import type { Fields } from "./index.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { CollectionMeta } from "../../types/index.js";
|
|
4
4
|
import { type ErrorLike } from "../apollo.js";
|
|
5
5
|
type CreateItemHookResult = {
|
|
6
6
|
state: 'editing' | 'loading' | 'created';
|
|
@@ -12,13 +12,13 @@ type CreateItemHookResult = {
|
|
|
12
12
|
label: string | null;
|
|
13
13
|
} | undefined>;
|
|
14
14
|
};
|
|
15
|
-
export declare function useCreateItem(list:
|
|
15
|
+
export declare function useCreateItem(list: CollectionMeta): CreateItemHookResult;
|
|
16
16
|
type BuildItemHookResult = {
|
|
17
17
|
state: 'editing';
|
|
18
18
|
error?: ErrorLike;
|
|
19
19
|
props: ComponentProps<typeof Fields>;
|
|
20
20
|
build: () => Promise<Record<string, unknown> | undefined>;
|
|
21
21
|
};
|
|
22
|
-
export declare function useBuildItem(list:
|
|
22
|
+
export declare function useBuildItem(list: CollectionMeta, fieldKeys?: string[]): BuildItemHookResult;
|
|
23
23
|
export {};
|
|
24
24
|
//# sourceMappingURL=useCreateItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateItem.d.ts","sourceRoot":"../../../../../src/admin-ui/utils","sources":["useCreateItem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAwC,MAAM,OAAO,CAAA;AAIjF,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAS;AAO/B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useCreateItem.d.ts","sourceRoot":"../../../../../src/admin-ui/utils","sources":["useCreateItem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAwC,MAAM,OAAO,CAAA;AAIjF,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAS;AAO/B,OAAO,KAAK,EAAE,cAAc,EAAE,6BAAmB;AACjD,OAAO,EAAE,KAAK,SAAS,EAA4C,qBAAiB;AAGpF,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IACxC,uBAAuB,EAAE,OAAO,CAAA;IAChC,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAA;IACpC,MAAM,EAAE,MAAM,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,SAAS,CAAC,CAAA;CACxE,CAAA;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,oBAAoB,CAoGxE;AAED,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAA;IACpC,KAAK,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAAA;CAC1D,CAAA;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,GAAE,MAAM,EAAO,GAAG,mBAAmB,CAqChG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseCollectionTypeInfo, ConditionalFilterCase, FieldController, FieldMeta } from "../../types/index.js";
|
|
2
2
|
export declare function getRootGraphQLFieldsFromFieldController(controller: FieldController<any, any>): string[];
|
|
3
|
-
export declare function useInvalidFields(fields: Record<string, FieldMeta>, item: Record<string, unknown>, isRequireds: Record<string, ConditionalFilterCase<
|
|
3
|
+
export declare function useInvalidFields(fields: Record<string, FieldMeta>, item: Record<string, unknown>, isRequireds: Record<string, ConditionalFilterCase<BaseCollectionTypeInfo>>): ReadonlySet<string>;
|
|
4
4
|
export declare function makeDefaultValueState(fields: Record<string, FieldMeta>): Record<string, unknown>;
|
|
5
5
|
export declare function deserializeItemToValue(fields: Record<string, FieldMeta>, item: Record<string, unknown | null>): Record<string, unknown>;
|
|
6
6
|
export declare function serializeValueToOperationItem(operation: 'create' | 'update', fields: Record<string, FieldMeta>, value: Record<string, unknown>, valueReference?: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"../../../../../src/admin-ui/utils","sources":["utils.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"../../../../../src/admin-ui/utils","sources":["utils.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,SAAS,EACV,6BAAmB;AAepB,wBAAgB,uCAAuC,CAAC,UAAU,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,YAM5F;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,CAAC,GACzE,WAAW,CAAC,MAAM,CAAC,CAiBrB;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,2BAMtE;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,2BAWrC;AAED,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,2BAqBzC;AAED,wBAAgB,aAAa,CAC3B,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WAiBzC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { createNixxieContext } from "./lib/system.js";
|
|
2
2
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"../../../src","sources":["context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"../../../src","sources":["context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,wBAAoB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SimpleFieldTypeInfo } from "../../../types/index.js";
|
|
2
|
-
import { type
|
|
3
|
-
export type BigIntFieldConfig<
|
|
2
|
+
import { type BaseCollectionTypeInfo, type CommonFieldConfig, type FieldTypeFunc } from "../../../types/index.js";
|
|
3
|
+
export type BigIntFieldConfig<CollectionTypeInfo extends BaseCollectionTypeInfo> = CommonFieldConfig<CollectionTypeInfo, SimpleFieldTypeInfo<'BigInt'>> & {
|
|
4
4
|
isIndexed?: boolean | 'unique';
|
|
5
5
|
defaultValue?: bigint | null | {
|
|
6
6
|
kind: 'autoincrement';
|
|
@@ -16,5 +16,5 @@ export type BigIntFieldConfig<ListTypeInfo extends BaseListTypeInfo> = CommonFie
|
|
|
16
16
|
extendPrismaSchema?: (field: string) => string;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
export declare function bigInt<
|
|
19
|
+
export declare function bigInt<CollectionTypeInfo extends BaseCollectionTypeInfo>(config?: BigIntFieldConfig<CollectionTypeInfo>): FieldTypeFunc<CollectionTypeInfo>;
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../../../src/fields/types/bigInt","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gCAAsB;AACzD,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../../../src/fields/types/bigInt","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gCAAsB;AACzD,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAGnB,gCAAsB;AAMvB,MAAM,MAAM,iBAAiB,CAAC,kBAAkB,SAAS,sBAAsB,IAAI,iBAAiB,CAClG,kBAAkB,EAClB,mBAAmB,CAAC,QAAQ,CAAC,CAC9B,GAAG;IACF,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAA;IACxD,UAAU,CAAC,EAAE;QACX,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;IACD,EAAE,CAAC,EAAE;QACH,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;KAC/C,CAAA;CACF,CAAA;AAOD,wBAAgB,MAAM,CAAC,kBAAkB,SAAS,sBAAsB,EACtE,MAAM,GAAE,iBAAiB,CAAC,kBAAkB,CAAM,GACjD,aAAa,CAAC,kBAAkB,CAAC,CA8InC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type BaseCollectionTypeInfo, type CommonFieldConfig, type FieldTypeFunc } from "../../../types/index.js";
|
|
2
2
|
import type { GArg, GInputObjectType, GList, GNonNull, GScalarType, InferValueFromInputType } from '@graphql-ts/schema';
|
|
3
3
|
export type FieldTypeInfo = {
|
|
4
4
|
item: Uint8Array | null;
|
|
@@ -14,7 +14,7 @@ export type FieldTypeInfo = {
|
|
|
14
14
|
update: Uint8Array | null | undefined;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
export type BytesFieldConfig<
|
|
17
|
+
export type BytesFieldConfig<CollectionTypeInfo extends BaseCollectionTypeInfo> = CommonFieldConfig<CollectionTypeInfo, FieldTypeInfo> & {
|
|
18
18
|
isIndexed?: boolean | 'unique';
|
|
19
19
|
graphql?: {
|
|
20
20
|
scalar?: GScalarType<Uint8Array, string>;
|
|
@@ -52,7 +52,7 @@ export type TextFieldMeta = {
|
|
|
52
52
|
isNullable: boolean;
|
|
53
53
|
defaultValue: string | null;
|
|
54
54
|
};
|
|
55
|
-
export declare function bytes<
|
|
55
|
+
export declare function bytes<CollectionTypeInfo extends BaseCollectionTypeInfo>(config?: BytesFieldConfig<CollectionTypeInfo>): FieldTypeFunc<CollectionTypeInfo>;
|
|
56
56
|
type BytesFilterType = GInputObjectType<{
|
|
57
57
|
equals?: GArg<GScalarType<Uint8Array, string>>;
|
|
58
58
|
in?: GArg<GList<GNonNull<GScalarType<Uint8Array, string>>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../../../src/fields/types/bytes","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../../../src/fields/types/bytes","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAGnB,gCAAsB;AAKvB,OAAO,KAAK,EACV,IAAI,EACJ,gBAAgB,EAChB,KAAK,EACL,QAAQ,EACR,WAAW,EACX,uBAAuB,EACxB,MAAM,oBAAoB,CAAA;AAE3B,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;IACvB,MAAM,EAAE;QACN,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,CAAA;QACrC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,CAAA;QACrC,KAAK,EAAE,uBAAuB,CAAC,eAAe,CAAC,GAAG,SAAS,CAAA;QAC3D,WAAW,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,CAAA;QAC1C,OAAO,EAAE,SAAS,CAAA;KACnB,CAAA;IACD,MAAM,EAAE;QACN,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,CAAA;QACrC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,CAAA;KACtC,CAAA;CACF,CAAA;AAED,MAAM,MAAM,gBAAgB,CAAC,kBAAkB,SAAS,sBAAsB,IAAI,iBAAiB,CACjG,kBAAkB,EAClB,aAAa,CACd,GAAG;IACF,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAC9B,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,WAAW,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;KACzC,CAAA;IACD,UAAU,CAAC,EAAE;QACX;;WAEG;QACH,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB;;WAEG;QACH,MAAM,CAAC,EAAE;YAAE,GAAG,CAAC,EAAE,MAAM,CAAC;YAAC,GAAG,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KACxC,CAAA;IACD,YAAY,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IAChC,EAAE,CAAC,EAAE;QACH,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;QAC9C;;;;;;;WAOG;QACH,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B,CAAA;AAED,wBAAgB,KAAK,CAAC,kBAAkB,SAAS,sBAAsB,EACrE,MAAM,GAAE,gBAAgB,CAAC,kBAAkB,CAAM,GAChD,aAAa,CAAC,kBAAkB,CAAC,CA4HnC;AAED,KAAK,eAAe,GAAG,gBAAgB,CAAC;IACtC,MAAM,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAA;IAC9C,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3D,KAAK,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IAC9D,GAAG,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,CAAA;CAC5B,CAAC,CAAA;AA8BF,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAA;IACxC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,UAAU,CAAA;IACpC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,oDA8BA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export type CalendarDayFieldConfig<
|
|
1
|
+
import { type BaseCollectionTypeInfo, type CommonFieldConfig, type FieldTypeFunc, type SimpleFieldTypeInfo } from "../../../types/index.js";
|
|
2
|
+
export type CalendarDayFieldConfig<CollectionTypeInfo extends BaseCollectionTypeInfo> = CommonFieldConfig<CollectionTypeInfo, SimpleFieldTypeInfo<'String' | 'DateTime'>> & {
|
|
3
3
|
isIndexed?: boolean | 'unique';
|
|
4
4
|
validation?: {
|
|
5
5
|
isRequired?: boolean;
|
|
@@ -11,5 +11,5 @@ export type CalendarDayFieldConfig<ListTypeInfo extends BaseListTypeInfo> = Comm
|
|
|
11
11
|
map?: string;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
export declare function calendarDay<
|
|
14
|
+
export declare function calendarDay<CollectionTypeInfo extends BaseCollectionTypeInfo>(config?: CalendarDayFieldConfig<CollectionTypeInfo>): FieldTypeFunc<CollectionTypeInfo>;
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../../../src/fields/types/calendarDay","sources":["index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../../../src/fields/types/calendarDay","sources":["index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EAGzB,gCAAsB;AAKvB,MAAM,MAAM,sBAAsB,CAAC,kBAAkB,SAAS,sBAAsB,IAClF,iBAAiB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,GAAG,UAAU,CAAC,CAAC,GAAG;IAClF,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAC9B,UAAU,CAAC,EAAE;QACX,UAAU,CAAC,EAAE,OAAO,CAAA;KACrB,CAAA;IACD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,EAAE,CAAC,EAAE;QACH,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;QAC9C,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;CACF,CAAA;AAEH,wBAAgB,WAAW,CAAC,kBAAkB,SAAS,sBAAsB,EAC3E,MAAM,GAAE,sBAAsB,CAAC,kBAAkB,CAAM,GACtD,aAAa,CAAC,kBAAkB,CAAC,CAiGnC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { SimpleFieldTypeInfo } from "../../../types/index.js";
|
|
2
|
-
import { type
|
|
3
|
-
export type CheckboxFieldConfig<
|
|
2
|
+
import { type BaseCollectionTypeInfo, type CommonFieldConfig, type FieldTypeFunc } from "../../../types/index.js";
|
|
3
|
+
export type CheckboxFieldConfig<CollectionTypeInfo extends BaseCollectionTypeInfo> = CommonFieldConfig<CollectionTypeInfo, SimpleFieldTypeInfo<'Boolean'>> & {
|
|
4
4
|
defaultValue?: boolean;
|
|
5
5
|
db?: {
|
|
6
6
|
map?: string;
|
|
7
7
|
extendPrismaSchema?: (field: string) => string;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
export declare function checkbox<
|
|
10
|
+
export declare function checkbox<CollectionTypeInfo extends BaseCollectionTypeInfo>(config?: CheckboxFieldConfig<CollectionTypeInfo>): FieldTypeFunc<CollectionTypeInfo>;
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../../../src/fields/types/checkbox","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gCAAsB;AACzD,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../../../src/fields/types/checkbox","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gCAAsB;AACzD,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAGnB,gCAAsB;AAMvB,MAAM,MAAM,mBAAmB,CAAC,kBAAkB,SAAS,sBAAsB,IAAI,iBAAiB,CACpG,kBAAkB,EAClB,mBAAmB,CAAC,SAAS,CAAC,CAC/B,GAAG;IACF,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,EAAE,CAAC,EAAE;QACH,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;KAC/C,CAAA;CACF,CAAA;AAED,wBAAgB,QAAQ,CAAC,kBAAkB,SAAS,sBAAsB,EACxE,MAAM,GAAE,mBAAmB,CAAC,kBAAkB,CAAM,GACnD,aAAa,CAAC,kBAAkB,CAAC,CAgDnC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SimpleFieldTypeInfo } from "../../../types/index.js";
|
|
2
|
-
import { type
|
|
3
|
-
export type DecimalFieldConfig<
|
|
2
|
+
import { type BaseCollectionTypeInfo, type CommonFieldConfig, type FieldTypeFunc } from "../../../types/index.js";
|
|
3
|
+
export type DecimalFieldConfig<CollectionTypeInfo extends BaseCollectionTypeInfo> = CommonFieldConfig<CollectionTypeInfo, SimpleFieldTypeInfo<'Decimal'>> & {
|
|
4
4
|
isIndexed?: boolean | 'unique';
|
|
5
5
|
defaultValue?: string | null;
|
|
6
6
|
validation?: {
|
|
@@ -16,5 +16,5 @@ export type DecimalFieldConfig<ListTypeInfo extends BaseListTypeInfo> = CommonFi
|
|
|
16
16
|
extendPrismaSchema?: (field: string) => string;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
export declare function decimal<
|
|
19
|
+
export declare function decimal<CollectionTypeInfo extends BaseCollectionTypeInfo>(config?: DecimalFieldConfig<CollectionTypeInfo>): FieldTypeFunc<CollectionTypeInfo>;
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../../../src/fields/types/decimal","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gCAAsB;AACzD,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../../../src/fields/types/decimal","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gCAAsB;AACzD,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAInB,gCAAsB;AAMvB,MAAM,MAAM,kBAAkB,CAAC,kBAAkB,SAAS,sBAAsB,IAAI,iBAAiB,CACnG,kBAAkB,EAClB,mBAAmB,CAAC,SAAS,CAAC,CAC/B,GAAG;IACF,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,UAAU,CAAC,EAAE;QACX,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,EAAE,CAAC,EAAE;QACH,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;KAC/C,CAAA;CACF,CAAA;AAUD,wBAAgB,OAAO,CAAC,kBAAkB,SAAS,sBAAsB,EACvE,MAAM,GAAE,kBAAkB,CAAC,kBAAkB,CAAM,GAClD,aAAa,CAAC,kBAAkB,CAAC,CAyInC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseCollectionTypeInfo, CommonFieldConfig, FieldTypeFunc, MaybePromise, StorageStrategy } from "../../../types/index.js";
|
|
2
2
|
import type { InferValueFromInputType } from '@graphql-ts/schema';
|
|
3
3
|
export type FieldTypeInfo = {
|
|
4
4
|
item: undefined;
|
|
@@ -14,8 +14,8 @@ export type FieldTypeInfo = {
|
|
|
14
14
|
update: undefined;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
export type FileFieldConfig<
|
|
18
|
-
storage: StorageStrategy<
|
|
17
|
+
export type FileFieldConfig<CollectionTypeInfo extends BaseCollectionTypeInfo> = CommonFieldConfig<CollectionTypeInfo, FieldTypeInfo> & {
|
|
18
|
+
storage: StorageStrategy<CollectionTypeInfo['all']>;
|
|
19
19
|
transformName?: (originalFilename: string) => MaybePromise<string>;
|
|
20
20
|
db?: {
|
|
21
21
|
extendPrismaSchema?: (field: string) => string;
|
|
@@ -29,6 +29,6 @@ declare const FileFieldInput: import("@graphql-ts/schema").GInputObjectType<{
|
|
|
29
29
|
createReadStream(): import("fs").ReadStream;
|
|
30
30
|
}>, {}>>, false>;
|
|
31
31
|
}, false>;
|
|
32
|
-
export declare function file<
|
|
32
|
+
export declare function file<CollectionTypeInfo extends BaseCollectionTypeInfo>(config: FileFieldConfig<CollectionTypeInfo>): FieldTypeFunc<CollectionTypeInfo>;
|
|
33
33
|
export {};
|
|
34
34
|
//# sourceMappingURL=index.d.ts.map
|