@kyro-cms/core 0.12.15 → 0.12.16
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/dist/WebhookService-ByrpAI4d.d.ts +143 -0
- package/dist/WebhookService-i-Kl3dvf.d.cts +143 -0
- package/dist/api-handler-graphql.d.cts +6 -0
- package/dist/api-handler-graphql.d.ts +6 -0
- package/dist/api-handler-trpc.d.cts +5 -0
- package/dist/api-handler-trpc.d.ts +5 -0
- package/dist/api-handler.d.cts +7 -0
- package/dist/api-handler.d.ts +7 -0
- package/dist/base-iyJTfH-3.d.cts +74 -0
- package/dist/base-oUSURe4_.d.ts +74 -0
- package/dist/cli/index.cjs +0 -0
- package/dist/cli/index.d.cts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/client.d.cts +12 -0
- package/dist/client.d.ts +12 -0
- package/dist/drizzle/index.d.cts +169 -0
- package/dist/drizzle/index.d.ts +169 -0
- package/dist/fields/index.d.cts +7 -0
- package/dist/fields/index.d.ts +7 -0
- package/dist/graphql/index.d.cts +57 -0
- package/dist/graphql/index.d.ts +57 -0
- package/dist/index-Bz9JqRGI.d.cts +86 -0
- package/dist/index-Bz9JqRGI.d.ts +86 -0
- package/dist/index-DNy8jbA2.d.cts +282 -0
- package/dist/index-DVDMEql7.d.ts +282 -0
- package/dist/index.d.cts +1246 -0
- package/dist/index.d.ts +1246 -0
- package/dist/integration.d.cts +14 -0
- package/dist/integration.d.ts +14 -0
- package/dist/mongodb/index.d.cts +134 -0
- package/dist/mongodb/index.d.ts +134 -0
- package/dist/rest/index.d.cts +56 -0
- package/dist/rest/index.d.ts +56 -0
- package/dist/richtext-DrhORshE.d.cts +5 -0
- package/dist/richtext-DrhORshE.d.ts +5 -0
- package/dist/templates/index.d.cts +107 -0
- package/dist/templates/index.d.ts +107 -0
- package/dist/trpc/index.d.cts +142 -0
- package/dist/trpc/index.d.ts +142 -0
- package/dist/types-BcZiluXL.d.cts +569 -0
- package/dist/types-CpjuXbe7.d.cts +150 -0
- package/dist/types-CpjuXbe7.d.ts +150 -0
- package/dist/types-Dc8VAPhF.d.ts +569 -0
- package/dist/types-euTszc-1.d.cts +294 -0
- package/dist/types-euTszc-1.d.ts +294 -0
- package/dist/ws/index.d.cts +88 -0
- package/dist/ws/index.d.ts +88 -0
- package/package.json +22 -25
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { B as BaseAdapter, j as User, R as Request, b as FindResult } from '../types-BcZiluXL.cjs';
|
|
2
|
+
import { j as createWebhookService } from '../WebhookService-i-Kl3dvf.cjs';
|
|
3
|
+
import '../types-euTszc-1.cjs';
|
|
4
|
+
|
|
5
|
+
interface ApiKeyContext {
|
|
6
|
+
userId: string;
|
|
7
|
+
user: Partial<User>;
|
|
8
|
+
permissions: string[];
|
|
9
|
+
apiKeyId: string;
|
|
10
|
+
tenantId?: string;
|
|
11
|
+
role?: string;
|
|
12
|
+
}
|
|
13
|
+
interface KyroContext {
|
|
14
|
+
db: BaseAdapter;
|
|
15
|
+
registry: any;
|
|
16
|
+
user?: User;
|
|
17
|
+
tenantId?: string;
|
|
18
|
+
req: Request;
|
|
19
|
+
apiKey?: ApiKeyContext;
|
|
20
|
+
webhookService?: ReturnType<typeof createWebhookService>;
|
|
21
|
+
settings?: Record<string, any>;
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
declare function createContext(options: {
|
|
25
|
+
db: BaseAdapter;
|
|
26
|
+
registry: any;
|
|
27
|
+
req: Request;
|
|
28
|
+
user?: User;
|
|
29
|
+
tenantId?: string;
|
|
30
|
+
settings?: Record<string, any>;
|
|
31
|
+
}): Promise<KyroContext>;
|
|
32
|
+
|
|
33
|
+
declare function createFindProcedure(ctx: KyroContext): (input: {
|
|
34
|
+
collection: string;
|
|
35
|
+
where?: Record<string, any>;
|
|
36
|
+
sort?: string;
|
|
37
|
+
limit?: number;
|
|
38
|
+
page?: number;
|
|
39
|
+
depth?: number;
|
|
40
|
+
select?: string[];
|
|
41
|
+
draft?: boolean;
|
|
42
|
+
}) => Promise<FindResult<unknown>>;
|
|
43
|
+
declare function createFindByIDProcedure(ctx: KyroContext): (input: {
|
|
44
|
+
collection: string;
|
|
45
|
+
id: string;
|
|
46
|
+
depth?: number;
|
|
47
|
+
select?: string[];
|
|
48
|
+
draft?: boolean;
|
|
49
|
+
}) => Promise<{}>;
|
|
50
|
+
declare function createCreateProcedure(ctx: KyroContext): (input: {
|
|
51
|
+
collection: string;
|
|
52
|
+
data: Record<string, any>;
|
|
53
|
+
depth?: number;
|
|
54
|
+
select?: string[];
|
|
55
|
+
}) => Promise<{
|
|
56
|
+
doc: unknown;
|
|
57
|
+
}>;
|
|
58
|
+
declare function createUpdateProcedure(ctx: KyroContext): (input: {
|
|
59
|
+
collection: string;
|
|
60
|
+
id: string;
|
|
61
|
+
data: Record<string, any>;
|
|
62
|
+
depth?: number;
|
|
63
|
+
select?: string[];
|
|
64
|
+
baseUpdatedAt?: string;
|
|
65
|
+
}) => Promise<{
|
|
66
|
+
doc: unknown;
|
|
67
|
+
}>;
|
|
68
|
+
declare function createDeleteProcedure(ctx: KyroContext): (input: {
|
|
69
|
+
collection: string;
|
|
70
|
+
id: string;
|
|
71
|
+
}) => Promise<{
|
|
72
|
+
doc: unknown;
|
|
73
|
+
message: string;
|
|
74
|
+
}>;
|
|
75
|
+
declare function createCountProcedure(ctx: KyroContext): (input: {
|
|
76
|
+
collection: string;
|
|
77
|
+
where?: Record<string, any>;
|
|
78
|
+
}) => Promise<{
|
|
79
|
+
totalDocs: number;
|
|
80
|
+
}>;
|
|
81
|
+
|
|
82
|
+
declare function createDynamicRouter(ctx: KyroContext): Record<string, any>;
|
|
83
|
+
interface KyroRouter {
|
|
84
|
+
[collectionSlug: string]: {
|
|
85
|
+
find: (input: {
|
|
86
|
+
where?: Record<string, any>;
|
|
87
|
+
sort?: string;
|
|
88
|
+
limit?: number;
|
|
89
|
+
page?: number;
|
|
90
|
+
depth?: number;
|
|
91
|
+
select?: string[];
|
|
92
|
+
draft?: boolean;
|
|
93
|
+
}) => Promise<{
|
|
94
|
+
docs: any[];
|
|
95
|
+
totalDocs: number;
|
|
96
|
+
limit: number;
|
|
97
|
+
totalPages: number;
|
|
98
|
+
page: number;
|
|
99
|
+
pagingCounter: number;
|
|
100
|
+
hasPrevPage: boolean;
|
|
101
|
+
hasNextPage: boolean;
|
|
102
|
+
prevPage: number | null;
|
|
103
|
+
nextPage: number | null;
|
|
104
|
+
}>;
|
|
105
|
+
findByID: (input: {
|
|
106
|
+
id: string;
|
|
107
|
+
depth?: number;
|
|
108
|
+
select?: string[];
|
|
109
|
+
draft?: boolean;
|
|
110
|
+
}) => Promise<any>;
|
|
111
|
+
create: (input: {
|
|
112
|
+
data: Record<string, any>;
|
|
113
|
+
depth?: number;
|
|
114
|
+
select?: string[];
|
|
115
|
+
}) => Promise<{
|
|
116
|
+
doc: any;
|
|
117
|
+
}>;
|
|
118
|
+
update: (input: {
|
|
119
|
+
id: string;
|
|
120
|
+
data: Record<string, any>;
|
|
121
|
+
depth?: number;
|
|
122
|
+
select?: string[];
|
|
123
|
+
baseUpdatedAt?: string;
|
|
124
|
+
}) => Promise<{
|
|
125
|
+
doc: any;
|
|
126
|
+
}>;
|
|
127
|
+
delete: (input: {
|
|
128
|
+
id: string;
|
|
129
|
+
}) => Promise<{
|
|
130
|
+
doc: any;
|
|
131
|
+
message: string;
|
|
132
|
+
}>;
|
|
133
|
+
count: (input: {
|
|
134
|
+
where?: Record<string, any>;
|
|
135
|
+
}) => Promise<{
|
|
136
|
+
totalDocs: number;
|
|
137
|
+
}>;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
declare function createKyroServer(ctx: KyroContext): KyroRouter;
|
|
141
|
+
|
|
142
|
+
export { type KyroContext, type KyroRouter, createContext, createCountProcedure, createCreateProcedure, createDeleteProcedure, createDynamicRouter, createFindByIDProcedure, createFindProcedure, createKyroServer, createUpdateProcedure };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { B as BaseAdapter, j as User, R as Request, b as FindResult } from '../types-Dc8VAPhF.js';
|
|
2
|
+
import { j as createWebhookService } from '../WebhookService-ByrpAI4d.js';
|
|
3
|
+
import '../types-euTszc-1.js';
|
|
4
|
+
|
|
5
|
+
interface ApiKeyContext {
|
|
6
|
+
userId: string;
|
|
7
|
+
user: Partial<User>;
|
|
8
|
+
permissions: string[];
|
|
9
|
+
apiKeyId: string;
|
|
10
|
+
tenantId?: string;
|
|
11
|
+
role?: string;
|
|
12
|
+
}
|
|
13
|
+
interface KyroContext {
|
|
14
|
+
db: BaseAdapter;
|
|
15
|
+
registry: any;
|
|
16
|
+
user?: User;
|
|
17
|
+
tenantId?: string;
|
|
18
|
+
req: Request;
|
|
19
|
+
apiKey?: ApiKeyContext;
|
|
20
|
+
webhookService?: ReturnType<typeof createWebhookService>;
|
|
21
|
+
settings?: Record<string, any>;
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
declare function createContext(options: {
|
|
25
|
+
db: BaseAdapter;
|
|
26
|
+
registry: any;
|
|
27
|
+
req: Request;
|
|
28
|
+
user?: User;
|
|
29
|
+
tenantId?: string;
|
|
30
|
+
settings?: Record<string, any>;
|
|
31
|
+
}): Promise<KyroContext>;
|
|
32
|
+
|
|
33
|
+
declare function createFindProcedure(ctx: KyroContext): (input: {
|
|
34
|
+
collection: string;
|
|
35
|
+
where?: Record<string, any>;
|
|
36
|
+
sort?: string;
|
|
37
|
+
limit?: number;
|
|
38
|
+
page?: number;
|
|
39
|
+
depth?: number;
|
|
40
|
+
select?: string[];
|
|
41
|
+
draft?: boolean;
|
|
42
|
+
}) => Promise<FindResult<unknown>>;
|
|
43
|
+
declare function createFindByIDProcedure(ctx: KyroContext): (input: {
|
|
44
|
+
collection: string;
|
|
45
|
+
id: string;
|
|
46
|
+
depth?: number;
|
|
47
|
+
select?: string[];
|
|
48
|
+
draft?: boolean;
|
|
49
|
+
}) => Promise<{}>;
|
|
50
|
+
declare function createCreateProcedure(ctx: KyroContext): (input: {
|
|
51
|
+
collection: string;
|
|
52
|
+
data: Record<string, any>;
|
|
53
|
+
depth?: number;
|
|
54
|
+
select?: string[];
|
|
55
|
+
}) => Promise<{
|
|
56
|
+
doc: unknown;
|
|
57
|
+
}>;
|
|
58
|
+
declare function createUpdateProcedure(ctx: KyroContext): (input: {
|
|
59
|
+
collection: string;
|
|
60
|
+
id: string;
|
|
61
|
+
data: Record<string, any>;
|
|
62
|
+
depth?: number;
|
|
63
|
+
select?: string[];
|
|
64
|
+
baseUpdatedAt?: string;
|
|
65
|
+
}) => Promise<{
|
|
66
|
+
doc: unknown;
|
|
67
|
+
}>;
|
|
68
|
+
declare function createDeleteProcedure(ctx: KyroContext): (input: {
|
|
69
|
+
collection: string;
|
|
70
|
+
id: string;
|
|
71
|
+
}) => Promise<{
|
|
72
|
+
doc: unknown;
|
|
73
|
+
message: string;
|
|
74
|
+
}>;
|
|
75
|
+
declare function createCountProcedure(ctx: KyroContext): (input: {
|
|
76
|
+
collection: string;
|
|
77
|
+
where?: Record<string, any>;
|
|
78
|
+
}) => Promise<{
|
|
79
|
+
totalDocs: number;
|
|
80
|
+
}>;
|
|
81
|
+
|
|
82
|
+
declare function createDynamicRouter(ctx: KyroContext): Record<string, any>;
|
|
83
|
+
interface KyroRouter {
|
|
84
|
+
[collectionSlug: string]: {
|
|
85
|
+
find: (input: {
|
|
86
|
+
where?: Record<string, any>;
|
|
87
|
+
sort?: string;
|
|
88
|
+
limit?: number;
|
|
89
|
+
page?: number;
|
|
90
|
+
depth?: number;
|
|
91
|
+
select?: string[];
|
|
92
|
+
draft?: boolean;
|
|
93
|
+
}) => Promise<{
|
|
94
|
+
docs: any[];
|
|
95
|
+
totalDocs: number;
|
|
96
|
+
limit: number;
|
|
97
|
+
totalPages: number;
|
|
98
|
+
page: number;
|
|
99
|
+
pagingCounter: number;
|
|
100
|
+
hasPrevPage: boolean;
|
|
101
|
+
hasNextPage: boolean;
|
|
102
|
+
prevPage: number | null;
|
|
103
|
+
nextPage: number | null;
|
|
104
|
+
}>;
|
|
105
|
+
findByID: (input: {
|
|
106
|
+
id: string;
|
|
107
|
+
depth?: number;
|
|
108
|
+
select?: string[];
|
|
109
|
+
draft?: boolean;
|
|
110
|
+
}) => Promise<any>;
|
|
111
|
+
create: (input: {
|
|
112
|
+
data: Record<string, any>;
|
|
113
|
+
depth?: number;
|
|
114
|
+
select?: string[];
|
|
115
|
+
}) => Promise<{
|
|
116
|
+
doc: any;
|
|
117
|
+
}>;
|
|
118
|
+
update: (input: {
|
|
119
|
+
id: string;
|
|
120
|
+
data: Record<string, any>;
|
|
121
|
+
depth?: number;
|
|
122
|
+
select?: string[];
|
|
123
|
+
baseUpdatedAt?: string;
|
|
124
|
+
}) => Promise<{
|
|
125
|
+
doc: any;
|
|
126
|
+
}>;
|
|
127
|
+
delete: (input: {
|
|
128
|
+
id: string;
|
|
129
|
+
}) => Promise<{
|
|
130
|
+
doc: any;
|
|
131
|
+
message: string;
|
|
132
|
+
}>;
|
|
133
|
+
count: (input: {
|
|
134
|
+
where?: Record<string, any>;
|
|
135
|
+
}) => Promise<{
|
|
136
|
+
totalDocs: number;
|
|
137
|
+
}>;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
declare function createKyroServer(ctx: KyroContext): KyroRouter;
|
|
141
|
+
|
|
142
|
+
export { type KyroContext, type KyroRouter, createContext, createCountProcedure, createCreateProcedure, createDeleteProcedure, createDynamicRouter, createFindByIDProcedure, createFindProcedure, createKyroServer, createUpdateProcedure };
|