@ldsg/graphql-workflows 0.3.9 → 0.3.11

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,6 +1,6 @@
1
- import { HandlerSpecificResourceSettings } from "@ldsg/handler";
2
- import { ResourceDefinitionSpecificResourceSettings } from "@ldsg/resource-definition";
3
- import { GeneralResourceSettings } from "@ldsg/types";
1
+ import { HandlerSpecificResourceSettings } from '@ldsg/handler';
2
+ import { ResourceDefinitionSpecificResourceSettings } from '@ldsg/resource-definition';
3
+ import { GeneralResourceSettings } from '@ldsg/types';
4
4
  /**
5
5
  * Instantiate Resource Handler General Resource Settings
6
6
  * 实例化资源处理程序普通资源配置
@@ -14,5 +14,5 @@ export declare const INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS: Gen
14
14
  export declare const INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS: HandlerSpecificResourceSettings;
15
15
  export declare const RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS: GeneralResourceSettings;
16
16
  export declare const RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS: ResourceDefinitionSpecificResourceSettings;
17
- export declare const GRAPHQL_GLOBAL_WORKFLOW_PATH_SYMBOL = "*";
17
+ export declare const GRAPHQL_GLOBAL_WORKFLOW_PATH_INFO_STRING = "*:*";
18
18
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,sDAAsD,EAAE,uBAIlE,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,uDAAuD,EAAE,+BAQnE,CAAC;AAEJ,eAAO,MAAM,6CAA6C,EAAE,uBACb,CAAC;AAEhD,eAAO,MAAM,8CAA8C,EAAE,0CAI1D,CAAC;AAEJ,eAAO,MAAM,mCAAmC,MAAM,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,sDAAsD,EAAE,uBAGpE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uDAAuD,EAAE,+BAOrE,CAAC;AAEF,eAAO,MAAM,6CAA6C,EAAE,uBAG3D,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,0CAE5D,CAAC;AAEF,eAAO,MAAM,wCAAwC,QAAQ,CAAC"}
package/dist/constants.js CHANGED
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GRAPHQL_GLOBAL_WORKFLOW_PATH_SYMBOL = exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = void 0;
4
- const graphql_1 = require("@ldsg/graphql");
3
+ exports.GRAPHQL_GLOBAL_WORKFLOW_PATH_INFO_STRING = exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = void 0;
5
4
  /**
6
5
  * Instantiate Resource Handler General Resource Settings
7
6
  * 实例化资源处理程序普通资源配置
8
7
  */
9
8
  exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = {
10
- title: "GraphQL工作流组实例化资源处理程序",
11
- description: "",
9
+ title: 'GraphQL工作流组实例化资源处理程序',
10
+ description: ''
12
11
  };
13
12
  /**
14
13
  * Instantiate Resource Handler Specific Resource Settings
@@ -19,13 +18,15 @@ exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
19
18
  code: `export * from "@ldsg/graphql-workflows";`,
20
19
  dependencies: [
21
20
  {
22
- name: "@ldsg/graphql-workflows",
23
- },
24
- ],
21
+ name: '@ldsg/graphql-workflows'
22
+ }
23
+ ]
24
+ };
25
+ exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = {
26
+ title: 'GraphQL工作流组资源定义',
27
+ description: ''
25
28
  };
26
- exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = { title: "GraphQL工作流组资源定义", description: "" };
27
29
  exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = {
28
- kind: "graphql-workflows",
29
- parentKind: graphql_1.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
30
+ kind: 'graphql_workflows'
30
31
  };
31
- exports.GRAPHQL_GLOBAL_WORKFLOW_PATH_SYMBOL = "*";
32
+ exports.GRAPHQL_GLOBAL_WORKFLOW_PATH_INFO_STRING = '*:*';
package/dist/handler.d.ts CHANGED
@@ -1,8 +1,6 @@
1
- import { Handler, HandlerExtendedResourceSettings } from "@ldsg/handler";
2
- import { InstantiateResourceParams, InstantiateResourceRes } from "@ldsg/resource";
3
- import { GraphqlWorkflowsResource } from "./resource";
4
- import { GraphqlWorkflowsSpecificResourceSettings } from "./types";
5
- export declare const handler: Handler<[
6
- InstantiateResourceParams<HandlerExtendedResourceSettings<GraphqlWorkflowsSpecificResourceSettings>>
7
- ], InstantiateResourceRes<GraphqlWorkflowsResource>>;
1
+ import { Handler, HandlerExtendedResourceSettings } from '@ldsg/handler';
2
+ import { InstantiateResourceParams, InstantiateResourceRes } from '@ldsg/resource';
3
+ import { GraphqlWorkflowsResource } from './resource';
4
+ import { GraphqlWorkflowsSpecificResourceSettings } from './types';
5
+ export declare const handler: Handler<InstantiateResourceParams<HandlerExtendedResourceSettings<GraphqlWorkflowsSpecificResourceSettings>>, InstantiateResourceRes<GraphqlWorkflowsResource>>;
8
6
  //# sourceMappingURL=handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,wCAAwC,EAAE,MAAM,SAAS,CAAC;AAEnE,eAAO,MAAM,OAAO,EAAE,OAAO,CAC3B;IACE,yBAAyB,CACvB,+BAA+B,CAAC,wCAAwC,CAAC,CAC1E;CACF,EACD,sBAAsB,CAAC,wBAAwB,CAAC,CAC3B,CAAC"}
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,wCAAwC,EAAE,MAAM,SAAS,CAAC;AAEnE,eAAO,MAAM,OAAO,EAAE,OAAO,CAC3B,yBAAyB,CAAC,+BAA+B,CAAC,wCAAwC,CAAC,CAAC,EACpG,sBAAsB,CAAC,wBAAwB,CAAC,CAC3B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export * from "./constants";
2
- export * from "./handler";
3
- export * from "./instantiate-resource";
4
- export * from "./resource";
5
- export * from "./types";
1
+ export * from './constants';
2
+ export * from './handler';
3
+ export * from './instantiate-resource';
4
+ export * from './resource';
5
+ export * from './types';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
- import { HandlerExtendedResourceSettings } from "@ldsg/handler";
2
- import { InstantiateResource } from "@ldsg/resource";
3
- import { GraphqlWorkflowsResource } from "./resource";
4
- import { GraphqlWorkflowsSpecificResourceSettings } from "./types";
1
+ import { HandlerExtendedResourceSettings } from '@ldsg/handler';
2
+ import { InstantiateResource } from '@ldsg/resource';
3
+ import { GraphqlWorkflowsResource } from './resource';
4
+ import { GraphqlWorkflowsSpecificResourceSettings } from './types';
5
5
  export declare const instantiateResource: InstantiateResource<HandlerExtendedResourceSettings<GraphqlWorkflowsSpecificResourceSettings>, GraphqlWorkflowsResource>;
6
6
  //# sourceMappingURL=instantiate-resource.d.ts.map
@@ -6,7 +6,7 @@ const instantiateResource = (params) => {
6
6
  const { resourceConstructorParams } = params;
7
7
  const resource = new resource_1.GraphqlWorkflowsResource(resourceConstructorParams);
8
8
  const res = {
9
- resource,
9
+ resource
10
10
  };
11
11
  return res;
12
12
  };
@@ -1,6 +1,6 @@
1
- import { GetGraphqlMiddlewareInfo } from "@ldsg/graphql";
2
- import { Resource } from "@ldsg/resource";
3
- import { GraphqlWorkflowsSpecificResourceSettings } from "./types";
1
+ import { GetGraphqlMiddlewareInfo } from '@ldsg/graphql';
2
+ import { Resource } from '@ldsg/resource';
3
+ import { GraphqlWorkflowsSpecificResourceSettings } from './types';
4
4
  export declare class GraphqlWorkflowsResource extends Resource<GraphqlWorkflowsSpecificResourceSettings> {
5
5
  getGraphqlMiddlewareInfo: GetGraphqlMiddlewareInfo;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAyB,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C,OAAO,EAEL,wCAAwC,EACzC,MAAM,SAAS,CAAC;AAGjB,qBAAa,wBAAyB,SAAQ,QAAQ,CAAC,wCAAwC,CAAC;IAC9F,wBAAwB,EAAE,wBAAwB,CA8FhD;CACH"}
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAyB,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C,OAAO,EAA0B,wCAAwC,EAAE,MAAM,SAAS,CAAC;AAG3F,qBAAa,wBAAyB,SAAQ,QAAQ,CAAC,wCAAwC,CAAC;IAC9F,wBAAwB,EAAE,wBAAwB,CAsFhD;CACH"}
package/dist/resource.js CHANGED
@@ -10,26 +10,25 @@ class GraphqlWorkflowsResource extends resource_1.Resource {
10
10
  this.getGraphqlMiddlewareInfo = () => {
11
11
  const { id, getFilteredResources } = this;
12
12
  const { resources } = getFilteredResources({
13
- parentId: id,
13
+ parentId: id
14
14
  });
15
15
  const graphqlPathInfoStringToWorkflowInfoMap = {};
16
16
  resources.forEach((resource) => {
17
17
  var _a;
18
18
  const graphqlWorkflowInfo = (_a = resource.getGraphqlWorkflowInfo) === null || _a === void 0 ? void 0 : _a.call(resource);
19
19
  if (graphqlWorkflowInfo) {
20
- const { graphqlPathInfoString, workflowInfo } = graphqlWorkflowInfo;
21
- graphqlPathInfoStringToWorkflowInfoMap[graphqlPathInfoString] =
22
- workflowInfo;
20
+ const { fieldName, typeName, workflowInfo } = graphqlWorkflowInfo;
21
+ const graphqlPathInfoString = `${typeName}:${fieldName}`;
22
+ graphqlPathInfoStringToWorkflowInfoMap[graphqlPathInfoString] = workflowInfo;
23
23
  }
24
24
  });
25
25
  /**
26
26
  * GraphQL 全局工作流
27
27
  */
28
- const graphqlGlobalWorkflowInfo = graphqlPathInfoStringToWorkflowInfoMap[constants_1.GRAPHQL_GLOBAL_WORKFLOW_PATH_SYMBOL];
28
+ const graphqlGlobalWorkflowInfo = graphqlPathInfoStringToWorkflowInfoMap[constants_1.GRAPHQL_GLOBAL_WORKFLOW_PATH_INFO_STRING];
29
29
  const workflowMiddleware = async (resolve, source, args, context, info) => {
30
- const { path } = info;
31
30
  const { graphqlPathInfoString } = (0, utils_1.getGraphqlPathInfoString)({
32
- path,
31
+ info
33
32
  });
34
33
  /**
35
34
  * GraphQL 字段工作流
@@ -43,12 +42,13 @@ class GraphqlWorkflowsResource extends resource_1.Resource {
43
42
  args,
44
43
  context,
45
44
  info,
46
- fieldWorkflowInfo: graphqlFieldWorkflowInfo,
45
+ fieldWorkflowInfo: graphqlFieldWorkflowInfo
47
46
  };
48
47
  const executeRes = await graphqlGlobalWorkflowInfo.execute({
49
- variables,
48
+ context,
49
+ variables
50
50
  });
51
- res = executeRes.variables;
51
+ res = executeRes.variables.result;
52
52
  }
53
53
  else if (graphqlFieldWorkflowInfo) {
54
54
  const variables = {
@@ -56,12 +56,13 @@ class GraphqlWorkflowsResource extends resource_1.Resource {
56
56
  source,
57
57
  args,
58
58
  context,
59
- info,
59
+ info
60
60
  };
61
61
  const executeRes = await graphqlFieldWorkflowInfo.execute({
62
- variables,
62
+ context,
63
+ variables
63
64
  });
64
- res = executeRes.variables;
65
+ res = executeRes.variables.result;
65
66
  }
66
67
  else {
67
68
  res = await resolve(source, args, context, info);
@@ -70,7 +71,7 @@ class GraphqlWorkflowsResource extends resource_1.Resource {
70
71
  };
71
72
  const res = {
72
73
  sort: 0,
73
- middleware: workflowMiddleware,
74
+ middleware: workflowMiddleware
74
75
  };
75
76
  return res;
76
77
  };
@@ -1,4 +1,4 @@
1
- import { GraphQLResolveInfo } from "graphql";
2
- export type GraphqlPathFragmentInfo = Pick<GraphQLResolveInfo["path"], "key" | "typename">;
1
+ import { GraphQLResolveInfo } from 'graphql';
2
+ export type GraphqlPathFragmentInfo = Pick<GraphQLResolveInfo['path'], 'key' | 'typename'>;
3
3
  export type GraphqlPathFragmentInfos = GraphqlPathFragmentInfo[];
4
4
  //# sourceMappingURL=graphql-path-fragment-info.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-path-fragment-info.d.ts","sourceRoot":"","sources":["../../src/types/graphql-path-fragment-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,kBAAkB,CAAC,MAAM,CAAC,EAC1B,KAAK,GAAG,UAAU,CACnB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"graphql-path-fragment-info.d.ts","sourceRoot":"","sources":["../../src/types/graphql-path-fragment-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC,CAAC;AAE3F,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,EAAE,CAAC"}
@@ -1,6 +1,16 @@
1
- import { WorkflowInfo } from "@ldsg/workflow";
1
+ import { WorkflowInfo } from '@ldsg/workflow';
2
2
  export interface GraphqlWorkflowInfo {
3
- graphqlPathInfoString: string;
3
+ /**
4
+ * GraphQL Type Name
5
+ */
6
+ typeName: string;
7
+ /**
8
+ * GraphQL Field Name
9
+ */
10
+ fieldName: string;
11
+ /**
12
+ * Workflow Info
13
+ */
4
14
  workflowInfo: WorkflowInfo;
5
15
  }
6
16
  export type GetGraphqlWorkflowInfo = () => GraphqlWorkflowInfo;
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-workflow-info.ts.d.ts","sourceRoot":"","sources":["../../src/types/graphql-workflow-info.ts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,mBAAmB;IAClC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"graphql-workflow-info.ts.d.ts","sourceRoot":"","sources":["../../src/types/graphql-workflow-info.ts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,mBAAmB,CAAC"}
@@ -1,4 +1,4 @@
1
- export * from "./graphql-path-fragment-info";
2
- export * from "./graphql-workflow-info.ts";
3
- export * from "./specific-resource-settings";
1
+ export * from './graphql-path-fragment-info';
2
+ export * from './graphql-workflow-info.ts';
3
+ export * from './specific-resource-settings';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { SpecificResourceSettings } from "@ldsg/types";
1
+ import { SpecificResourceSettings } from '@ldsg/types';
2
2
  export interface GraphqlWorkflowsSpecificResourceSettings extends SpecificResourceSettings {
3
3
  }
4
4
  //# 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,wCACf,SAAQ,wBAAwB;CAAG"}
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,wCAAyC,SAAQ,wBAAwB;CAAG"}
@@ -1,6 +1,6 @@
1
- import { GraphQLResolveInfo } from "graphql";
1
+ import { GraphQLResolveInfo } from 'graphql';
2
2
  interface GetGraphqlPathInfoStringParmas {
3
- path: GraphQLResolveInfo["path"];
3
+ info: GraphQLResolveInfo;
4
4
  }
5
5
  interface GetGraphqlPathInfoStringRes {
6
6
  graphqlPathInfoString: string;
@@ -1 +1 @@
1
- {"version":3,"file":"get-graphql-path-info-string.d.ts","sourceRoot":"","sources":["../../src/utils/get-graphql-path-info-string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG7C,UAAU,8BAA8B;IACtC,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,UAAU,2BAA2B;IACnC,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,MAAM,wBAAwB,GAAG,CACrC,MAAM,EAAE,8BAA8B,KACnC,2BAA2B,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,wBAoBtC,CAAC"}
1
+ {"version":3,"file":"get-graphql-path-info-string.d.ts","sourceRoot":"","sources":["../../src/utils/get-graphql-path-info-string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,UAAU,8BAA8B;IACtC,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,UAAU,2BAA2B;IACnC,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,MAAM,wBAAwB,GAAG,CACrC,MAAM,EAAE,8BAA8B,KACnC,2BAA2B,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,wBAUtC,CAAC"}
@@ -1,23 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getGraphqlPathInfoString = void 0;
4
- const get_graphql_path_fragment_infos_1 = require("./get-graphql-path-fragment-infos");
5
4
  /**
6
5
  * 获取路径信息字符串
7
6
  */
8
7
  const getGraphqlPathInfoString = (params) => {
9
- const { path } = params;
10
- const { graphqlPathFragmentInfos } = (0, get_graphql_path_fragment_infos_1.getGraphqlPathFragmentInfos)({
11
- path,
12
- });
13
- const graphqlPathInfoString = graphqlPathFragmentInfos
14
- .map((graphqlPathFragmentInfo) => {
15
- const { key, typename } = graphqlPathFragmentInfo;
16
- return `${typename}:${key}`;
17
- })
18
- .join(".");
8
+ const { info } = params;
9
+ const graphqlPathInfoString = `${info.parentType.name}:${info.fieldName}`;
19
10
  const res = {
20
- graphqlPathInfoString,
11
+ graphqlPathInfoString
21
12
  };
22
13
  return res;
23
14
  };
@@ -1,3 +1,2 @@
1
- export * from "./get-graphql-path-fragment-infos";
2
- export * from "./get-graphql-path-info-string";
1
+ export * from './get-graphql-path-info-string';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
@@ -14,5 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./get-graphql-path-fragment-infos"), exports);
18
17
  __exportStar(require("./get-graphql-path-info-string"), exports);
package/package.json CHANGED
@@ -1,32 +1,39 @@
1
1
  {
2
2
  "name": "@ldsg/graphql-workflows",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "description": "",
5
+ "keywords": [],
6
+ "license": "MIT",
7
+ "author": "wanxger",
5
8
  "main": "dist/index.js",
9
+ "types": "dist",
6
10
  "files": [
7
11
  "dist/"
8
12
  ],
9
- "types": "dist",
10
- "keywords": [],
11
- "author": "wanxger",
12
- "license": "MIT",
13
- "publishConfig": {
14
- "access": "public"
15
- },
16
13
  "dependencies": {
17
14
  "graphql-compose": "^9.1.0",
15
+ "graphql-middleware": "^6.1.35",
18
16
  "graphql-yoga": "^5.13.4",
19
- "@ldsg/handler": "0.3.9",
20
- "@ldsg/resource": "0.3.9",
21
- "@ldsg/resource-definition": "0.3.9"
17
+ "@ldsg/handler": "0.3.10",
18
+ "@ldsg/resource-definition": "0.3.10",
19
+ "@ldsg/workflow": "0.3.11",
20
+ "@ldsg/resource": "0.3.10"
22
21
  },
23
22
  "devDependencies": {
23
+ "@types/jest": "^29.5.2",
24
24
  "@types/supertest": "^6.0.0",
25
25
  "graphql": "16.11.0",
26
+ "jest": "^29.5.0",
26
27
  "supertest": "^6.3.4",
27
- "@ldsg/application": "0.3.9",
28
- "@ldsg/graphql": "0.3.9",
29
- "@ldsg/types": "0.3.9"
28
+ "ts-jest": "^29.1.5",
29
+ "ts-node": "^10.9.2",
30
+ "typescript": "^5.8.3",
31
+ "@ldsg/application": "0.3.10",
32
+ "@ldsg/types": "0.3.10",
33
+ "@ldsg/graphql": "0.3.11"
34
+ },
35
+ "publishConfig": {
36
+ "access": "public"
30
37
  },
31
38
  "scripts": {
32
39
  "build": "tsc --project tsconfig.build.json",
@@ -1,15 +0,0 @@
1
- import { GraphQLResolveInfo } from "graphql";
2
- import { GraphqlPathFragmentInfos } from "../types";
3
- interface GetGraphqlPathFragmentInfosParmas {
4
- path: GraphQLResolveInfo["path"];
5
- }
6
- interface GetGraphqlPathFragmentInfosRes {
7
- graphqlPathFragmentInfos: GraphqlPathFragmentInfos;
8
- }
9
- export type GetGraphqlPathFragmentInfos = (params: GetGraphqlPathFragmentInfosParmas) => GetGraphqlPathFragmentInfosRes;
10
- /**
11
- * 获取路径片段信息组
12
- */
13
- export declare const getGraphqlPathFragmentInfos: GetGraphqlPathFragmentInfos;
14
- export {};
15
- //# sourceMappingURL=get-graphql-path-fragment-infos.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-graphql-path-fragment-infos.d.ts","sourceRoot":"","sources":["../../src/utils/get-graphql-path-fragment-infos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEpD,UAAU,iCAAiC;IACzC,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,UAAU,8BAA8B;IACtC,wBAAwB,EAAE,wBAAwB,CAAC;CACpD;AAED,MAAM,MAAM,2BAA2B,GAAG,CACxC,MAAM,EAAE,iCAAiC,KACtC,8BAA8B,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,2BAuBzC,CAAC"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getGraphqlPathFragmentInfos = void 0;
4
- /**
5
- * 获取路径片段信息组
6
- */
7
- const getGraphqlPathFragmentInfos = (params) => {
8
- const { path } = params;
9
- const graphqlPathFragmentInfos = [];
10
- let current = path;
11
- while (current) {
12
- graphqlPathFragmentInfos.unshift({
13
- key: current.key,
14
- typename: current.typename,
15
- });
16
- current = current.prev;
17
- }
18
- const res = {
19
- graphqlPathFragmentInfos,
20
- };
21
- return res;
22
- };
23
- exports.getGraphqlPathFragmentInfos = getGraphqlPathFragmentInfos;