deesse 0.0.33 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/index.d.ts +1 -15
- package/dist/config/index.js +4 -33
- package/dist/index.d.ts +1 -31
- package/dist/index.js +16 -135
- package/package.json +21 -22
- package/dist/collections/index.d.mts +0 -15
- package/dist/collections/index.d.ts +0 -15
- package/dist/collections/index.js +0 -109
- package/dist/collections/index.mjs +0 -73
- package/dist/config/index.d.mts +0 -15
- package/dist/config/index.mjs +0 -7
- package/dist/index.d.mts +0 -31
- package/dist/index.mjs +0 -97
- package/dist/types-CuxC99zt.d.mts +0 -20
- package/dist/types-CuxC99zt.d.ts +0 -20
package/dist/config/index.d.ts
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type AdminConfig = {
|
|
4
|
-
defaultLanguage?: string;
|
|
5
|
-
};
|
|
6
|
-
type AuthConfig = {};
|
|
7
|
-
type Config = {
|
|
8
|
-
admin: AdminConfig;
|
|
9
|
-
auth: AuthConfig;
|
|
10
|
-
collections: Collection[];
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
declare const buildConfig: (config: Config) => Config;
|
|
14
|
-
|
|
15
|
-
export { type AdminConfig, type AuthConfig, type Config, buildConfig };
|
|
1
|
+
export declare const defineConfig: () => void;
|
package/dist/config/index.js
CHANGED
|
@@ -1,34 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/config/index.ts
|
|
21
|
-
var config_exports = {};
|
|
22
|
-
__export(config_exports, {
|
|
23
|
-
buildConfig: () => buildConfig
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(config_exports);
|
|
26
|
-
|
|
27
|
-
// src/config/build.ts
|
|
28
|
-
var buildConfig = (config) => {
|
|
29
|
-
return config;
|
|
30
|
-
};
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
buildConfig
|
|
34
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineConfig = void 0;
|
|
4
|
+
const defineConfig = () => { };
|
|
5
|
+
exports.defineConfig = defineConfig;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { array, checkbox, collection, createField, date, field, number, relation, richText, text } from './collections/index.js';
|
|
3
|
-
import { C as Collection } from './types-CuxC99zt.js';
|
|
4
|
-
export { F as Field, a as FieldConfig } from './types-CuxC99zt.js';
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
|
|
7
|
-
type Context = {
|
|
8
|
-
db: undefined;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
declare const query: <TCollections extends readonly Collection[], Schema extends z.ZodTypeAny, T>(config: {
|
|
12
|
-
args?: Schema;
|
|
13
|
-
handler: (ctx: Context, args: Schema extends undefined ? undefined : z.infer<Schema>) => Promise<T>;
|
|
14
|
-
}) => (args?: Schema extends undefined ? undefined : z.infer<Schema>) => Promise<T>;
|
|
15
|
-
declare const mutation: <TCollections extends readonly Collection[], Schema extends z.ZodTypeAny, T>(config: {
|
|
16
|
-
args?: Schema;
|
|
17
|
-
handler: (ctx: Context, args: Schema extends undefined ? undefined : z.infer<Schema>) => Promise<T>;
|
|
18
|
-
}) => (args?: Schema extends undefined ? undefined : z.infer<Schema>) => Promise<T>;
|
|
19
|
-
|
|
20
|
-
type CollectionMethods = {
|
|
21
|
-
create: any;
|
|
22
|
-
update: any;
|
|
23
|
-
delete: any;
|
|
24
|
-
find: any;
|
|
25
|
-
};
|
|
26
|
-
type DatabaseFromCollections<TCollections extends readonly Collection[]> = {
|
|
27
|
-
[K in TCollections[number]['slug']]: CollectionMethods;
|
|
28
|
-
};
|
|
29
|
-
type Database<TCollections extends readonly Collection[]> = DatabaseFromCollections<TCollections>;
|
|
30
|
-
|
|
31
|
-
export { Collection, type CollectionMethods, type Context, type Database, type DatabaseFromCollections, mutation, query };
|
|
1
|
+
export * from "./config";
|
package/dist/index.js
CHANGED
|
@@ -1,136 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
array: () => array,
|
|
24
|
-
buildConfig: () => buildConfig,
|
|
25
|
-
checkbox: () => checkbox,
|
|
26
|
-
collection: () => collection,
|
|
27
|
-
createField: () => createField,
|
|
28
|
-
date: () => date,
|
|
29
|
-
field: () => field,
|
|
30
|
-
mutation: () => mutation,
|
|
31
|
-
number: () => number,
|
|
32
|
-
query: () => query,
|
|
33
|
-
relation: () => relation,
|
|
34
|
-
richText: () => richText,
|
|
35
|
-
text: () => text
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(index_exports);
|
|
38
|
-
|
|
39
|
-
// src/config/build.ts
|
|
40
|
-
var buildConfig = (config) => {
|
|
41
|
-
return config;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
// src/collections/fields.ts
|
|
45
|
-
var field = (field2) => {
|
|
46
|
-
return field2;
|
|
47
|
-
};
|
|
48
|
-
var createField = (config) => {
|
|
49
|
-
return void 0;
|
|
50
|
-
};
|
|
51
|
-
var text = () => createField({
|
|
52
|
-
schema: void 0,
|
|
53
|
-
drizzle: void 0,
|
|
54
|
-
admin: {
|
|
55
|
-
component: void 0
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
var number = () => createField({
|
|
59
|
-
schema: void 0,
|
|
60
|
-
drizzle: void 0,
|
|
61
|
-
admin: {
|
|
62
|
-
component: void 0
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
var date = () => createField({
|
|
66
|
-
schema: void 0,
|
|
67
|
-
drizzle: void 0,
|
|
68
|
-
admin: {
|
|
69
|
-
component: void 0
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
var checkbox = () => createField({
|
|
73
|
-
schema: void 0,
|
|
74
|
-
drizzle: void 0,
|
|
75
|
-
admin: {
|
|
76
|
-
component: void 0
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
var array = () => createField({
|
|
80
|
-
schema: void 0,
|
|
81
|
-
drizzle: void 0,
|
|
82
|
-
admin: {
|
|
83
|
-
component: void 0
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
var relation = () => createField({
|
|
87
|
-
schema: void 0,
|
|
88
|
-
drizzle: void 0,
|
|
89
|
-
admin: {
|
|
90
|
-
component: void 0
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
var richText = () => createField({
|
|
94
|
-
schema: void 0,
|
|
95
|
-
drizzle: void 0,
|
|
96
|
-
admin: {
|
|
97
|
-
component: void 0
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
// src/collections/collections.ts
|
|
102
|
-
var collection = (collection2) => {
|
|
103
|
-
return collection2;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// src/database/functions.ts
|
|
107
|
-
var query = (config) => {
|
|
108
|
-
return async (args) => {
|
|
109
|
-
const ctx = { db: void 0 };
|
|
110
|
-
if (config.args) config.args.parse(args ?? {});
|
|
111
|
-
return config.handler(ctx, args ?? {});
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
var mutation = (config) => {
|
|
115
|
-
return async (args) => {
|
|
116
|
-
const ctx = { db: void 0 };
|
|
117
|
-
if (config.args) config.args.parse(args ?? {});
|
|
118
|
-
return config.handler(ctx, args ?? {});
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
122
|
-
0 && (module.exports = {
|
|
123
|
-
array,
|
|
124
|
-
buildConfig,
|
|
125
|
-
checkbox,
|
|
126
|
-
collection,
|
|
127
|
-
createField,
|
|
128
|
-
date,
|
|
129
|
-
field,
|
|
130
|
-
mutation,
|
|
131
|
-
number,
|
|
132
|
-
query,
|
|
133
|
-
relation,
|
|
134
|
-
richText,
|
|
135
|
-
text
|
|
136
|
-
});
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./config"), exports);
|
package/package.json
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "deesse",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "The fullstack
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "deesse",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "The fullstack web framework",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"module": "dist/index.esm.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/**/*",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"build:watch": "tsc --watch",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"author": "",
|
|
20
|
+
"license": "ISC"
|
|
21
|
+
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { F as Field, a as FieldConfig, C as Collection } from '../types-CuxC99zt.mjs';
|
|
2
|
-
|
|
3
|
-
declare const field: (field: Field) => Field;
|
|
4
|
-
declare const createField: (config: FieldConfig) => undefined;
|
|
5
|
-
declare const text: () => undefined;
|
|
6
|
-
declare const number: () => undefined;
|
|
7
|
-
declare const date: () => undefined;
|
|
8
|
-
declare const checkbox: () => undefined;
|
|
9
|
-
declare const array: () => undefined;
|
|
10
|
-
declare const relation: () => undefined;
|
|
11
|
-
declare const richText: () => undefined;
|
|
12
|
-
|
|
13
|
-
declare const collection: (collection: Collection) => Collection;
|
|
14
|
-
|
|
15
|
-
export { Collection, Field, FieldConfig, array, checkbox, collection, createField, date, field, number, relation, richText, text };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { F as Field, a as FieldConfig, C as Collection } from '../types-CuxC99zt.js';
|
|
2
|
-
|
|
3
|
-
declare const field: (field: Field) => Field;
|
|
4
|
-
declare const createField: (config: FieldConfig) => undefined;
|
|
5
|
-
declare const text: () => undefined;
|
|
6
|
-
declare const number: () => undefined;
|
|
7
|
-
declare const date: () => undefined;
|
|
8
|
-
declare const checkbox: () => undefined;
|
|
9
|
-
declare const array: () => undefined;
|
|
10
|
-
declare const relation: () => undefined;
|
|
11
|
-
declare const richText: () => undefined;
|
|
12
|
-
|
|
13
|
-
declare const collection: (collection: Collection) => Collection;
|
|
14
|
-
|
|
15
|
-
export { Collection, Field, FieldConfig, array, checkbox, collection, createField, date, field, number, relation, richText, text };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/collections/index.ts
|
|
21
|
-
var collections_exports = {};
|
|
22
|
-
__export(collections_exports, {
|
|
23
|
-
array: () => array,
|
|
24
|
-
checkbox: () => checkbox,
|
|
25
|
-
collection: () => collection,
|
|
26
|
-
createField: () => createField,
|
|
27
|
-
date: () => date,
|
|
28
|
-
field: () => field,
|
|
29
|
-
number: () => number,
|
|
30
|
-
relation: () => relation,
|
|
31
|
-
richText: () => richText,
|
|
32
|
-
text: () => text
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(collections_exports);
|
|
35
|
-
|
|
36
|
-
// src/collections/fields.ts
|
|
37
|
-
var field = (field2) => {
|
|
38
|
-
return field2;
|
|
39
|
-
};
|
|
40
|
-
var createField = (config) => {
|
|
41
|
-
return void 0;
|
|
42
|
-
};
|
|
43
|
-
var text = () => createField({
|
|
44
|
-
schema: void 0,
|
|
45
|
-
drizzle: void 0,
|
|
46
|
-
admin: {
|
|
47
|
-
component: void 0
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
var number = () => createField({
|
|
51
|
-
schema: void 0,
|
|
52
|
-
drizzle: void 0,
|
|
53
|
-
admin: {
|
|
54
|
-
component: void 0
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
var date = () => createField({
|
|
58
|
-
schema: void 0,
|
|
59
|
-
drizzle: void 0,
|
|
60
|
-
admin: {
|
|
61
|
-
component: void 0
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
var checkbox = () => createField({
|
|
65
|
-
schema: void 0,
|
|
66
|
-
drizzle: void 0,
|
|
67
|
-
admin: {
|
|
68
|
-
component: void 0
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
var array = () => createField({
|
|
72
|
-
schema: void 0,
|
|
73
|
-
drizzle: void 0,
|
|
74
|
-
admin: {
|
|
75
|
-
component: void 0
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
var relation = () => createField({
|
|
79
|
-
schema: void 0,
|
|
80
|
-
drizzle: void 0,
|
|
81
|
-
admin: {
|
|
82
|
-
component: void 0
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
var richText = () => createField({
|
|
86
|
-
schema: void 0,
|
|
87
|
-
drizzle: void 0,
|
|
88
|
-
admin: {
|
|
89
|
-
component: void 0
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// src/collections/collections.ts
|
|
94
|
-
var collection = (collection2) => {
|
|
95
|
-
return collection2;
|
|
96
|
-
};
|
|
97
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
-
0 && (module.exports = {
|
|
99
|
-
array,
|
|
100
|
-
checkbox,
|
|
101
|
-
collection,
|
|
102
|
-
createField,
|
|
103
|
-
date,
|
|
104
|
-
field,
|
|
105
|
-
number,
|
|
106
|
-
relation,
|
|
107
|
-
richText,
|
|
108
|
-
text
|
|
109
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// src/collections/fields.ts
|
|
2
|
-
var field = (field2) => {
|
|
3
|
-
return field2;
|
|
4
|
-
};
|
|
5
|
-
var createField = (config) => {
|
|
6
|
-
return void 0;
|
|
7
|
-
};
|
|
8
|
-
var text = () => createField({
|
|
9
|
-
schema: void 0,
|
|
10
|
-
drizzle: void 0,
|
|
11
|
-
admin: {
|
|
12
|
-
component: void 0
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
var number = () => createField({
|
|
16
|
-
schema: void 0,
|
|
17
|
-
drizzle: void 0,
|
|
18
|
-
admin: {
|
|
19
|
-
component: void 0
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
var date = () => createField({
|
|
23
|
-
schema: void 0,
|
|
24
|
-
drizzle: void 0,
|
|
25
|
-
admin: {
|
|
26
|
-
component: void 0
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
var checkbox = () => createField({
|
|
30
|
-
schema: void 0,
|
|
31
|
-
drizzle: void 0,
|
|
32
|
-
admin: {
|
|
33
|
-
component: void 0
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
var array = () => createField({
|
|
37
|
-
schema: void 0,
|
|
38
|
-
drizzle: void 0,
|
|
39
|
-
admin: {
|
|
40
|
-
component: void 0
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
var relation = () => createField({
|
|
44
|
-
schema: void 0,
|
|
45
|
-
drizzle: void 0,
|
|
46
|
-
admin: {
|
|
47
|
-
component: void 0
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
var richText = () => createField({
|
|
51
|
-
schema: void 0,
|
|
52
|
-
drizzle: void 0,
|
|
53
|
-
admin: {
|
|
54
|
-
component: void 0
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// src/collections/collections.ts
|
|
59
|
-
var collection = (collection2) => {
|
|
60
|
-
return collection2;
|
|
61
|
-
};
|
|
62
|
-
export {
|
|
63
|
-
array,
|
|
64
|
-
checkbox,
|
|
65
|
-
collection,
|
|
66
|
-
createField,
|
|
67
|
-
date,
|
|
68
|
-
field,
|
|
69
|
-
number,
|
|
70
|
-
relation,
|
|
71
|
-
richText,
|
|
72
|
-
text
|
|
73
|
-
};
|
package/dist/config/index.d.mts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { C as Collection } from '../types-CuxC99zt.mjs';
|
|
2
|
-
|
|
3
|
-
type AdminConfig = {
|
|
4
|
-
defaultLanguage?: string;
|
|
5
|
-
};
|
|
6
|
-
type AuthConfig = {};
|
|
7
|
-
type Config = {
|
|
8
|
-
admin: AdminConfig;
|
|
9
|
-
auth: AuthConfig;
|
|
10
|
-
collections: Collection[];
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
declare const buildConfig: (config: Config) => Config;
|
|
14
|
-
|
|
15
|
-
export { type AdminConfig, type AuthConfig, type Config, buildConfig };
|
package/dist/config/index.mjs
DELETED
package/dist/index.d.mts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export { AdminConfig, AuthConfig, Config, buildConfig } from './config/index.mjs';
|
|
2
|
-
export { array, checkbox, collection, createField, date, field, number, relation, richText, text } from './collections/index.mjs';
|
|
3
|
-
import { C as Collection } from './types-CuxC99zt.mjs';
|
|
4
|
-
export { F as Field, a as FieldConfig } from './types-CuxC99zt.mjs';
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
|
|
7
|
-
type Context = {
|
|
8
|
-
db: undefined;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
declare const query: <TCollections extends readonly Collection[], Schema extends z.ZodTypeAny, T>(config: {
|
|
12
|
-
args?: Schema;
|
|
13
|
-
handler: (ctx: Context, args: Schema extends undefined ? undefined : z.infer<Schema>) => Promise<T>;
|
|
14
|
-
}) => (args?: Schema extends undefined ? undefined : z.infer<Schema>) => Promise<T>;
|
|
15
|
-
declare const mutation: <TCollections extends readonly Collection[], Schema extends z.ZodTypeAny, T>(config: {
|
|
16
|
-
args?: Schema;
|
|
17
|
-
handler: (ctx: Context, args: Schema extends undefined ? undefined : z.infer<Schema>) => Promise<T>;
|
|
18
|
-
}) => (args?: Schema extends undefined ? undefined : z.infer<Schema>) => Promise<T>;
|
|
19
|
-
|
|
20
|
-
type CollectionMethods = {
|
|
21
|
-
create: any;
|
|
22
|
-
update: any;
|
|
23
|
-
delete: any;
|
|
24
|
-
find: any;
|
|
25
|
-
};
|
|
26
|
-
type DatabaseFromCollections<TCollections extends readonly Collection[]> = {
|
|
27
|
-
[K in TCollections[number]['slug']]: CollectionMethods;
|
|
28
|
-
};
|
|
29
|
-
type Database<TCollections extends readonly Collection[]> = DatabaseFromCollections<TCollections>;
|
|
30
|
-
|
|
31
|
-
export { Collection, type CollectionMethods, type Context, type Database, type DatabaseFromCollections, mutation, query };
|
package/dist/index.mjs
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
// src/config/build.ts
|
|
2
|
-
var buildConfig = (config) => {
|
|
3
|
-
return config;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
// src/collections/fields.ts
|
|
7
|
-
var field = (field2) => {
|
|
8
|
-
return field2;
|
|
9
|
-
};
|
|
10
|
-
var createField = (config) => {
|
|
11
|
-
return void 0;
|
|
12
|
-
};
|
|
13
|
-
var text = () => createField({
|
|
14
|
-
schema: void 0,
|
|
15
|
-
drizzle: void 0,
|
|
16
|
-
admin: {
|
|
17
|
-
component: void 0
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
var number = () => createField({
|
|
21
|
-
schema: void 0,
|
|
22
|
-
drizzle: void 0,
|
|
23
|
-
admin: {
|
|
24
|
-
component: void 0
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
var date = () => createField({
|
|
28
|
-
schema: void 0,
|
|
29
|
-
drizzle: void 0,
|
|
30
|
-
admin: {
|
|
31
|
-
component: void 0
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
var checkbox = () => createField({
|
|
35
|
-
schema: void 0,
|
|
36
|
-
drizzle: void 0,
|
|
37
|
-
admin: {
|
|
38
|
-
component: void 0
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
var array = () => createField({
|
|
42
|
-
schema: void 0,
|
|
43
|
-
drizzle: void 0,
|
|
44
|
-
admin: {
|
|
45
|
-
component: void 0
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
var relation = () => createField({
|
|
49
|
-
schema: void 0,
|
|
50
|
-
drizzle: void 0,
|
|
51
|
-
admin: {
|
|
52
|
-
component: void 0
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
var richText = () => createField({
|
|
56
|
-
schema: void 0,
|
|
57
|
-
drizzle: void 0,
|
|
58
|
-
admin: {
|
|
59
|
-
component: void 0
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
// src/collections/collections.ts
|
|
64
|
-
var collection = (collection2) => {
|
|
65
|
-
return collection2;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
// src/database/functions.ts
|
|
69
|
-
var query = (config) => {
|
|
70
|
-
return async (args) => {
|
|
71
|
-
const ctx = { db: void 0 };
|
|
72
|
-
if (config.args) config.args.parse(args ?? {});
|
|
73
|
-
return config.handler(ctx, args ?? {});
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
var mutation = (config) => {
|
|
77
|
-
return async (args) => {
|
|
78
|
-
const ctx = { db: void 0 };
|
|
79
|
-
if (config.args) config.args.parse(args ?? {});
|
|
80
|
-
return config.handler(ctx, args ?? {});
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
export {
|
|
84
|
-
array,
|
|
85
|
-
buildConfig,
|
|
86
|
-
checkbox,
|
|
87
|
-
collection,
|
|
88
|
-
createField,
|
|
89
|
-
date,
|
|
90
|
-
field,
|
|
91
|
-
mutation,
|
|
92
|
-
number,
|
|
93
|
-
query,
|
|
94
|
-
relation,
|
|
95
|
-
richText,
|
|
96
|
-
text
|
|
97
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
type Collection = {
|
|
2
|
-
slug: string;
|
|
3
|
-
label?: string;
|
|
4
|
-
group?: string;
|
|
5
|
-
fields: Record<string, Field[]>;
|
|
6
|
-
access?: undefined;
|
|
7
|
-
timestamps?: boolean;
|
|
8
|
-
};
|
|
9
|
-
type Field = {
|
|
10
|
-
type: undefined;
|
|
11
|
-
};
|
|
12
|
-
type FieldConfig = {
|
|
13
|
-
schema: undefined;
|
|
14
|
-
drizzle: undefined;
|
|
15
|
-
admin: {
|
|
16
|
-
component: undefined;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type { Collection as C, Field as F, FieldConfig as a };
|
package/dist/types-CuxC99zt.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
type Collection = {
|
|
2
|
-
slug: string;
|
|
3
|
-
label?: string;
|
|
4
|
-
group?: string;
|
|
5
|
-
fields: Record<string, Field[]>;
|
|
6
|
-
access?: undefined;
|
|
7
|
-
timestamps?: boolean;
|
|
8
|
-
};
|
|
9
|
-
type Field = {
|
|
10
|
-
type: undefined;
|
|
11
|
-
};
|
|
12
|
-
type FieldConfig = {
|
|
13
|
-
schema: undefined;
|
|
14
|
-
drizzle: undefined;
|
|
15
|
-
admin: {
|
|
16
|
-
component: undefined;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type { Collection as C, Field as F, FieldConfig as a };
|