@ldsg/graphql-workflows 0.3.10 → 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.
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/resource.js +4 -4
- package/dist/types/graphql-workflow-info.ts.d.ts +11 -1
- package/dist/types/graphql-workflow-info.ts.d.ts.map +1 -1
- package/dist/utils/get-graphql-path-info-string.d.ts +1 -1
- package/dist/utils/get-graphql-path-info-string.d.ts.map +1 -1
- package/dist/utils/get-graphql-path-info-string.js +2 -11
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/package.json +5 -5
- package/dist/utils/get-graphql-path-fragment-infos.d.ts +0 -15
- package/dist/utils/get-graphql-path-fragment-infos.d.ts.map +0 -1
- package/dist/utils/get-graphql-path-fragment-infos.js +0 -23
package/dist/constants.d.ts
CHANGED
|
@@ -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
|
|
17
|
+
export declare const GRAPHQL_GLOBAL_WORKFLOW_PATH_INFO_STRING = "*:*";
|
|
18
18
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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;
|
|
4
4
|
/**
|
|
5
5
|
* Instantiate Resource Handler General Resource Settings
|
|
6
6
|
* 实例化资源处理程序普通资源配置
|
|
@@ -27,6 +27,6 @@ exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = {
|
|
|
27
27
|
description: ''
|
|
28
28
|
};
|
|
29
29
|
exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = {
|
|
30
|
-
kind: '
|
|
30
|
+
kind: 'graphql_workflows'
|
|
31
31
|
};
|
|
32
|
-
exports.
|
|
32
|
+
exports.GRAPHQL_GLOBAL_WORKFLOW_PATH_INFO_STRING = '*:*';
|
package/dist/resource.js
CHANGED
|
@@ -17,18 +17,18 @@ class GraphqlWorkflowsResource extends resource_1.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 {
|
|
20
|
+
const { fieldName, typeName, workflowInfo } = graphqlWorkflowInfo;
|
|
21
|
+
const graphqlPathInfoString = `${typeName}:${fieldName}`;
|
|
21
22
|
graphqlPathInfoStringToWorkflowInfoMap[graphqlPathInfoString] = workflowInfo;
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
25
|
/**
|
|
25
26
|
* GraphQL 全局工作流
|
|
26
27
|
*/
|
|
27
|
-
const graphqlGlobalWorkflowInfo = graphqlPathInfoStringToWorkflowInfoMap[constants_1.
|
|
28
|
+
const graphqlGlobalWorkflowInfo = graphqlPathInfoStringToWorkflowInfoMap[constants_1.GRAPHQL_GLOBAL_WORKFLOW_PATH_INFO_STRING];
|
|
28
29
|
const workflowMiddleware = async (resolve, source, args, context, info) => {
|
|
29
|
-
const { path } = info;
|
|
30
30
|
const { graphqlPathInfoString } = (0, utils_1.getGraphqlPathInfoString)({
|
|
31
|
-
|
|
31
|
+
info
|
|
32
32
|
});
|
|
33
33
|
/**
|
|
34
34
|
* GraphQL 字段工作流
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { WorkflowInfo } from '@ldsg/workflow';
|
|
2
2
|
export interface GraphqlWorkflowInfo {
|
|
3
|
-
|
|
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,
|
|
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 +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;
|
|
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,21 +1,12 @@
|
|
|
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 {
|
|
10
|
-
const
|
|
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
11
|
graphqlPathInfoString
|
|
21
12
|
};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/graphql-workflows",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"graphql-compose": "^9.1.0",
|
|
15
15
|
"graphql-middleware": "^6.1.35",
|
|
16
16
|
"graphql-yoga": "^5.13.4",
|
|
17
|
-
"@ldsg/resource": "0.3.10",
|
|
18
17
|
"@ldsg/handler": "0.3.10",
|
|
19
18
|
"@ldsg/resource-definition": "0.3.10",
|
|
20
|
-
"@ldsg/workflow": "0.3.
|
|
19
|
+
"@ldsg/workflow": "0.3.11",
|
|
20
|
+
"@ldsg/resource": "0.3.10"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/jest": "^29.5.2",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"ts-node": "^10.9.2",
|
|
30
30
|
"typescript": "^5.8.3",
|
|
31
31
|
"@ldsg/application": "0.3.10",
|
|
32
|
-
"@ldsg/
|
|
33
|
-
"@ldsg/
|
|
32
|
+
"@ldsg/types": "0.3.10",
|
|
33
|
+
"@ldsg/graphql": "0.3.11"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
@@ -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,2BAqBzC,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;
|