@ldsg/graphql-workflow 0.3.6

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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2014-present Sebastian McKenzie and other contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # LDSG Graphql Workflow Resource
@@ -0,0 +1,17 @@
1
+ import { HandlerSpecificResourceSettings } from "@ldsg/handler";
2
+ import { ResourceDefinitionSpecificResourceSettings } from "@ldsg/resource-definition";
3
+ import { GeneralResourceSettings } from "@ldsg/types";
4
+ /**
5
+ * Instantiate Resource Handler General Resource Settings
6
+ * 实例化资源处理程序普通资源配置
7
+ */
8
+ export declare const INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS: GeneralResourceSettings;
9
+ /**
10
+ * Instantiate Resource Handler Specific Resource Settings
11
+ * 实例化资源处理程序特殊资源配置
12
+ * 框架通过此实例化此资源
13
+ */
14
+ export declare const INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS: HandlerSpecificResourceSettings;
15
+ export declare const RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS: GeneralResourceSettings;
16
+ export declare const RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS: ResourceDefinitionSpecificResourceSettings;
17
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +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,uBACd,CAAC;AAE/C,eAAO,MAAM,8CAA8C,EAAE,0CAI1D,CAAC"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ 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_workflows_1 = require("@ldsg/graphql-workflows");
5
+ /**
6
+ * Instantiate Resource Handler General Resource Settings
7
+ * 实例化资源处理程序普通资源配置
8
+ */
9
+ exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = {
10
+ title: "GraphQL工作流实例化资源处理程序",
11
+ description: "",
12
+ };
13
+ /**
14
+ * Instantiate Resource Handler Specific Resource Settings
15
+ * 实例化资源处理程序特殊资源配置
16
+ * 框架通过此实例化此资源
17
+ */
18
+ exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
19
+ code: `export * from "@ldsg/graphql-workflow";`,
20
+ dependencies: [
21
+ {
22
+ name: "@ldsg/graphql-workflow",
23
+ },
24
+ ],
25
+ };
26
+ exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = { title: "GraphQL工作流资源定义", description: "" };
27
+ exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = {
28
+ kind: "graphql-workflow",
29
+ parentKind: graphql_workflows_1.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
30
+ };
@@ -0,0 +1,8 @@
1
+ import { Handler, HandlerExtendedResourceSettings } from "@ldsg/handler";
2
+ import { InstantiateResourceParams, InstantiateResourceRes } from "@ldsg/resource";
3
+ import { GraphqlWorkflowResource } from "./resource";
4
+ import { GraphqlWorkflowSpecificResourceSettings } from "./types";
5
+ export declare const handler: Handler<[
6
+ InstantiateResourceParams<HandlerExtendedResourceSettings<GraphqlWorkflowSpecificResourceSettings>>
7
+ ], InstantiateResourceRes<GraphqlWorkflowResource>>;
8
+ //# sourceMappingURL=handler.d.ts.map
@@ -0,0 +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,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,uCAAuC,EAAE,MAAM,SAAS,CAAC;AAElE,eAAO,MAAM,OAAO,EAAE,OAAO,CAC3B;IACE,yBAAyB,CACvB,+BAA+B,CAAC,uCAAuC,CAAC,CACzE;CACF,EACD,sBAAsB,CAAC,uBAAuB,CAAC,CAC1B,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handler = void 0;
4
+ const instantiate_resource_1 = require("./instantiate-resource");
5
+ exports.handler = instantiate_resource_1.instantiateResource;
@@ -0,0 +1,6 @@
1
+ export * from "./constants";
2
+ export * from "./handler";
3
+ export * from "./instantiate-resource";
4
+ export * from "./resource";
5
+ export * from "./types";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
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("./constants"), exports);
18
+ __exportStar(require("./handler"), exports);
19
+ __exportStar(require("./instantiate-resource"), exports);
20
+ __exportStar(require("./resource"), exports);
21
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,6 @@
1
+ import { HandlerExtendedResourceSettings } from "@ldsg/handler";
2
+ import { InstantiateResource } from "@ldsg/resource";
3
+ import { GraphqlWorkflowResource } from "./resource";
4
+ import { GraphqlWorkflowSpecificResourceSettings } from "./types";
5
+ export declare const instantiateResource: InstantiateResource<HandlerExtendedResourceSettings<GraphqlWorkflowSpecificResourceSettings>, GraphqlWorkflowResource>;
6
+ //# sourceMappingURL=instantiate-resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instantiate-resource.d.ts","sourceRoot":"","sources":["../src/instantiate-resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,uCAAuC,EAAE,MAAM,SAAS,CAAC;AAElE,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CACnD,+BAA+B,CAAC,uCAAuC,CAAC,EACxE,uBAAuB,CAWxB,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.instantiateResource = void 0;
4
+ const resource_1 = require("./resource");
5
+ const instantiateResource = (params) => {
6
+ const { resourceConstructorParams } = params;
7
+ const resource = new resource_1.GraphqlWorkflowResource(resourceConstructorParams);
8
+ const res = {
9
+ resource,
10
+ };
11
+ return res;
12
+ };
13
+ exports.instantiateResource = instantiateResource;
@@ -0,0 +1,7 @@
1
+ import { GetGraphqlWorkflowInfo } from "@ldsg/graphql-workflows";
2
+ import { Resource } from "@ldsg/resource";
3
+ import { GraphqlWorkflowSpecificResourceSettings } from "./types";
4
+ export declare class GraphqlWorkflowResource extends Resource<GraphqlWorkflowSpecificResourceSettings> {
5
+ getGraphqlWorkflowInfo: GetGraphqlWorkflowInfo;
6
+ }
7
+ //# sourceMappingURL=resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,uCAAuC,EAAE,MAAM,SAAS,CAAC;AAElE,qBAAa,uBAAwB,SAAQ,QAAQ,CAAC,uCAAuC,CAAC;IAC5F,sBAAsB,EAAE,sBAAsB,CAkB5C;CACH"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GraphqlWorkflowResource = void 0;
4
+ const resource_1 = require("@ldsg/resource");
5
+ class GraphqlWorkflowResource extends resource_1.Resource {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.getGraphqlWorkflowInfo = () => {
9
+ const { settings: { graphqlPathInfoString }, getResourcesFromSettings, } = this;
10
+ const { workflowResource } = getResourcesFromSettings();
11
+ const { workflowInfo } = workflowResource.getWorkflowInfo();
12
+ const res = {
13
+ graphqlPathInfoString,
14
+ workflowInfo,
15
+ };
16
+ return res;
17
+ };
18
+ }
19
+ }
20
+ exports.GraphqlWorkflowResource = GraphqlWorkflowResource;
@@ -0,0 +1,2 @@
1
+ export * from "./specific-resource-settings";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
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("./specific-resource-settings"), exports);
@@ -0,0 +1,13 @@
1
+ import { SpecificResourceSettings } from "@ldsg/types";
2
+ export interface GraphqlWorkflowSpecificResourceSettings extends SpecificResourceSettings {
3
+ /**
4
+ * GraphQL Path Info String
5
+ * include key and typename
6
+ */
7
+ graphqlPathInfoString: string;
8
+ /**
9
+ * Workflow Resource Id
10
+ */
11
+ workflowResourceId: string;
12
+ }
13
+ //# sourceMappingURL=specific-resource-settings.d.ts.map
@@ -0,0 +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,uCACf,SAAQ,wBAAwB;IAChC;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@ldsg/graphql-workflow",
3
+ "version": "0.3.6",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "files": [
7
+ "dist/"
8
+ ],
9
+ "types": "dist",
10
+ "keywords": [],
11
+ "author": "wanxger",
12
+ "license": "MIT",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "dependencies": {
17
+ "graphql-compose": "^9.1.0",
18
+ "graphql-yoga": "^5.13.4",
19
+ "@ldsg/handler": "0.3.6",
20
+ "@ldsg/resource": "0.3.6",
21
+ "@ldsg/resource-definition": "0.3.6"
22
+ },
23
+ "devDependencies": {
24
+ "@types/supertest": "^6.0.0",
25
+ "graphql": "16.11.0",
26
+ "supertest": "^6.3.4",
27
+ "@ldsg/application": "0.3.6",
28
+ "@ldsg/graphql-workflows": "0.3.6",
29
+ "@ldsg/types": "0.3.6"
30
+ },
31
+ "scripts": {
32
+ "build": "tsc --project tsconfig.build.json",
33
+ "clean": "rm -rf dist"
34
+ }
35
+ }