@ldsg/graphql-resolver 0.3.24 → 0.3.26

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.
@@ -1,41 +1,23 @@
1
- import { SpecificResourceSettings } from '@ldsg/types';
2
- export interface GraphQLResolverSpecificResourceSettings extends SpecificResourceSettings {
3
- /**
4
- * 添加到的类型名称
5
- * 'Query' | 'Mutation' | 'User' | 'Post' | ...
6
- */
7
- typeName: string;
8
- /**
9
- * 字段名称
10
- */
11
- fieldName: string;
12
- /**
13
- * 描述
14
- */
15
- description?: string;
16
- /**
17
- * Resolver 所属的对象类型名称
18
- * 'User' | 'Post' | 'UserForm' | ...
19
- */
20
- objectTypeName: string;
21
- /**
22
- * Resolver 方法名称
23
- * 'findById' | 'dataLoaderMany' | 'submit' | ...
24
- */
25
- resolverName: string;
26
- /**
27
- * PrepareArgs 配置
28
- * 可以是字符串(jsonata 表达式)或对象(直接映射)
29
- */
30
- prepareArgs?: string | {
31
- [key: string]: any;
32
- };
33
- /**
34
- * Projection 配置
35
- */
36
- projection?: ProjectionConfig;
37
- }
38
- export type ProjectionConfig = {
39
- [key: string]: 0 | 1 | boolean;
40
- };
1
+ import { z } from 'zod';
2
+ export declare const ProjectionConfigSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodBoolean]>>;
3
+ export type ProjectionConfig = z.infer<typeof ProjectionConfigSchema>;
4
+ export declare const GraphQLResolverSpecificResourceSettingsSchema: z.ZodObject<{
5
+ typeName: z.ZodString;
6
+ fieldName: z.ZodString;
7
+ description: z.ZodOptional<z.ZodString>;
8
+ objectTypeName: z.ZodString;
9
+ resolverName: z.ZodString;
10
+ prepareArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
11
+ projection: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodBoolean]>>>;
12
+ }, z.core.$catchall<z.ZodAny>>;
13
+ export declare const SpecificResourceSettingsSchema: z.ZodObject<{
14
+ typeName: z.ZodString;
15
+ fieldName: z.ZodString;
16
+ description: z.ZodOptional<z.ZodString>;
17
+ objectTypeName: z.ZodString;
18
+ resolverName: z.ZodString;
19
+ prepareArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
20
+ projection: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodBoolean]>>>;
21
+ }, z.core.$catchall<z.ZodAny>>;
22
+ export type GraphQLResolverSpecificResourceSettings = z.infer<typeof GraphQLResolverSpecificResourceSettingsSchema>;
41
23
  //# sourceMappingURL=specific-resource-settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"specific-resource-settings.d.ts","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,uCAAwC,SAAQ,wBAAwB;IACvF;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAE9C;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;CAChC,CAAC"}
1
+ {"version":3,"file":"specific-resource-settings.d.ts","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,sBAAsB,iGAGlC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,6CAA6C;;;;;;;;8BAyCtC,CAAC;AAErB,eAAO,MAAM,8BAA8B;;;;;;;;8BAAgD,CAAC;AAC5F,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAC3D,OAAO,6CAA6C,CACrD,CAAC"}
@@ -1,3 +1,43 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SpecificResourceSettingsSchema = exports.GraphQLResolverSpecificResourceSettingsSchema = exports.ProjectionConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.ProjectionConfigSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.literal(0), zod_1.z.literal(1), zod_1.z.boolean()]));
6
+ exports.GraphQLResolverSpecificResourceSettingsSchema = zod_1.z
7
+ .object({
8
+ /**
9
+ * 添加到的类型名称
10
+ * 'Query' | 'Mutation' | 'User' | 'Post' | ...
11
+ */
12
+ typeName: zod_1.z.string(),
13
+ /**
14
+ * 字段名称
15
+ */
16
+ fieldName: zod_1.z.string(),
17
+ /**
18
+ * 描述
19
+ */
20
+ description: zod_1.z.string().optional(),
21
+ /**
22
+ * Resolver 所属的对象类型名称
23
+ * 'User' | 'Post' | 'UserForm' | ...
24
+ */
25
+ objectTypeName: zod_1.z.string(),
26
+ /**
27
+ * Resolver 方法名称
28
+ * 'findById' | 'dataLoaderMany' | 'submit' | ...
29
+ */
30
+ resolverName: zod_1.z.string(),
31
+ /**
32
+ * PrepareArgs 配置
33
+ * Key-Value 对象,值是 jsonata 表达式字符串
34
+ */
35
+ prepareArgs: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
36
+ /**
37
+ * Projection 配置
38
+ */
39
+ projection: exports.ProjectionConfigSchema.optional()
40
+ })
41
+ .catchall(zod_1.z.any());
42
+ exports.SpecificResourceSettingsSchema = exports.GraphQLResolverSpecificResourceSettingsSchema;
3
43
  //# sourceMappingURL=specific-resource-settings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"specific-resource-settings.js","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"specific-resource-settings.js","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAC5C,OAAC,CAAC,MAAM,EAAE,EACV,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CACnD,CAAC;AAIW,QAAA,6CAA6C,GAAG,OAAC;KAC3D,MAAM,CAAC;IACN;;;OAGG;IACH,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IAEpB;;OAEG;IACH,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IAErB;;OAEG;IACH,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAElC;;;OAGG;IACH,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE;IAE1B;;;OAGG;IACH,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IAExB;;;OAGG;IACH,WAAW,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAExD;;OAEG;IACH,UAAU,EAAE,8BAAsB,CAAC,QAAQ,EAAE;CAC9C,CAAC;KACD,QAAQ,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAER,QAAA,8BAA8B,GAAG,qDAA6C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldsg/graphql-resolver",
3
- "version": "0.3.24",
3
+ "version": "0.3.26",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -13,10 +13,11 @@
13
13
  "dependencies": {
14
14
  "graphql-compose": "^9.1.0",
15
15
  "tslib": "^2.8.1",
16
- "@ldsg/resource": "0.3.24",
17
- "@ldsg/resource-definition": "0.3.24",
18
- "@ldsg/graphql": "0.3.24",
19
- "@ldsg/handler": "0.3.24"
16
+ "zod": "^4.1.11",
17
+ "@ldsg/resource": "0.3.26",
18
+ "@ldsg/resource-definition": "0.3.26",
19
+ "@ldsg/graphql": "0.3.26",
20
+ "@ldsg/handler": "0.3.26"
20
21
  },
21
22
  "devDependencies": {
22
23
  "@types/jest": "^29.5.2",
@@ -26,7 +27,7 @@
26
27
  "ts-jest": "^29.1.5",
27
28
  "ts-node": "^10.9.2",
28
29
  "typescript": "^5.8.3",
29
- "@ldsg/types": "0.3.24"
30
+ "@ldsg/types": "0.3.26"
30
31
  },
31
32
  "publishConfig": {
32
33
  "access": "public"