@appknit-project/appknit-internal-sdk 1.0.1-0

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 ADDED
@@ -0,0 +1,87 @@
1
+ ## Appknit platform SDK
2
+
3
+ Library for injecting in together with client code in Execution MS
4
+
5
+ NPM package [here](https://www.npmjs.com/package/appknit-platform-sdk).
6
+
7
+ ## Usage
8
+
9
+ Client's code
10
+ ```
11
+ const options = {
12
+ url: "https://en4tapktc2xtb.x.pipedream.net/test/vm",
13
+ method: "post",
14
+ headers: { "Content-Type": "application/json;charset=utf-8" },
15
+ data: {x: 123, y: "smth"}
16
+ };
17
+
18
+ const res1 = await sdk.axios(options);
19
+ const res2 = await sdk.axios(options);
20
+ const res3 = await sdk.axios(options);
21
+
22
+ output = [].push(res1.data, res2.data, res3.data);
23
+ ```
24
+
25
+ ExecutionMS response
26
+ ```
27
+ [
28
+ {
29
+ request_type: 'outgoing_http_request',
30
+ request_url: 'https://en4tapktc2xtb.x.pipedream.net/test/vm',
31
+ request_method: 'post',
32
+ request_headers: { 'Content-Type': 'application/json;charset=utf-8' },
33
+ request_data: {x: 123, y: "smth"},
34
+ response_status_code: 200,
35
+ response_status_text: 'OK',
36
+ response_headers: {
37
+ 'access-control-allow-origin': '*',
38
+ 'content-type': 'application/json; charset=utf-8',
39
+ date: 'Fri, 03 Jul 2020 16:37:20 GMT',
40
+ 'x-pd-status': 'sent to primary',
41
+ 'x-powered-by': 'Express',
42
+ 'content-length': '16',
43
+ connection: 'Close'
44
+ },
45
+ response_body: { success: true }
46
+ },
47
+ {
48
+ request_type: 'outgoing_http_request',
49
+ request_url: 'https://en4tapktc2xtb.x.pipedream.net/test/vm',
50
+ request_method: 'post',
51
+ request_headers: { 'Content-Type': 'application/json;charset=utf-8' },
52
+ request_data: {x: 123, y: "smth"},
53
+ response_status_code: 200,
54
+ response_status_text: 'OK',
55
+ response_headers: {
56
+ 'access-control-allow-origin': '*',
57
+ 'content-type': 'application/json; charset=utf-8',
58
+ date: 'Fri, 03 Jul 2020 16:37:21 GMT',
59
+ 'x-pd-status': 'sent to primary',
60
+ 'x-powered-by': 'Express',
61
+ 'content-length': '16',
62
+ connection: 'Close'
63
+ },
64
+ response_body: { success: true }
65
+ },
66
+ {
67
+ request_type: 'outgoing_http_request',
68
+ request_url: 'https://en4tapktc2xtb.x.pipedream.net/test/vm',
69
+ request_method: 'post',
70
+ request_headers: { 'Content-Type': 'application/json;charset=utf-8' },
71
+ request_data: {x: 123, y: "smth"},
72
+ response_status_code: 200,
73
+ response_status_text: 'OK',
74
+ response_headers: {
75
+ 'access-control-allow-origin': '*',
76
+ 'content-type': 'application/json; charset=utf-8',
77
+ date: 'Fri, 03 Jul 2020 16:37:21 GMT',
78
+ 'x-pd-status': 'sent to primary',
79
+ 'x-powered-by': 'Express',
80
+ 'content-length': '16',
81
+ connection: 'Close'
82
+ },
83
+ response_body: { success: true }
84
+ }
85
+ ]
86
+ ```
87
+
@@ -0,0 +1,44 @@
1
+ import { AppknitSDK, ISdkMetadata, SdkAccessKeyProvider, SdkAdhocDataProvider, SdkApplicationDataProvider, SdkContext, SdkCredentialsProvider, SdkEnvironmentDataProvider, SdkGrpcStorageProvider, SdkImportCSVProvider, SdkMarketPlaceProvider, SdkMemberDataProvider, SdkMigrationPathProvider, SdkOrgDataProvider, SdkProfileAddressDataProvider, SdkProfileCqaDataProvider, SdkProfileDataProvider, SdkProfileEmailDataProvider, SdkProfileNameDataProvider, SdkProfileOIDAuthDataProvider, SdkProfilePersonalizationDataProvider, SdkProfilePhoneDataProvider, SdkProfileSAMLAuthDataProvider, SdkProfileSessionDataProvider, SdkRevisionDataProvider, SdkFlowInvocationTracerGrpcProvider, SdkMongoProvider, IAppknitPlatformSDKProviders } from '@appknit-project/appknit-platform-sdk-v2';
2
+ export interface IAppknitInternalPlatformSDKProviders extends IAppknitPlatformSDKProviders {
3
+ adhocDataProvider: SdkAdhocDataProvider;
4
+ applicationDataProvider: SdkApplicationDataProvider;
5
+ memberDataProvider: SdkMemberDataProvider;
6
+ migrationPathProvider: SdkMigrationPathProvider;
7
+ environmentDataProvider: SdkEnvironmentDataProvider;
8
+ marketPlaceProvider: SdkMarketPlaceProvider;
9
+ orgDataProvider: SdkOrgDataProvider;
10
+ mongoProvider: SdkMongoProvider;
11
+ flowInvocationTracerGrpc: SdkFlowInvocationTracerGrpcProvider;
12
+ revisionDataProvider: SdkRevisionDataProvider;
13
+ importCsvDataProvider: SdkImportCSVProvider;
14
+ accessKeyProvider: SdkAccessKeyProvider;
15
+ credentialsProvider: SdkCredentialsProvider;
16
+ profileDataProvider: SdkProfileDataProvider;
17
+ profileAddressDataProvider: SdkProfileAddressDataProvider;
18
+ profilePersonalizationDataProvider: SdkProfilePersonalizationDataProvider;
19
+ profileCqaDataProvider: SdkProfileCqaDataProvider;
20
+ profileEmailDataProvider: SdkProfileEmailDataProvider;
21
+ profileNameDataProvider: SdkProfileNameDataProvider;
22
+ profileOIDAuthDataProvider: SdkProfileOIDAuthDataProvider;
23
+ profilePhoneDataProvider: SdkProfilePhoneDataProvider;
24
+ profileSAMLAuthDataProvider: SdkProfileSAMLAuthDataProvider;
25
+ profileSessionDataProvider: SdkProfileSessionDataProvider;
26
+ storageGrpcProvider: SdkGrpcStorageProvider;
27
+ }
28
+ export declare class AppknitInternalSDK extends AppknitSDK {
29
+ adhocDataProvider: SdkAdhocDataProvider;
30
+ applicationDataProvider: SdkApplicationDataProvider;
31
+ memberDataProvider: SdkMemberDataProvider;
32
+ migrationPathProvider: SdkMigrationPathProvider;
33
+ environmentDataProvider: SdkEnvironmentDataProvider;
34
+ marketPlaceProvider: SdkMarketPlaceProvider;
35
+ orgDataProvider: SdkOrgDataProvider;
36
+ mongoProvider: SdkMongoProvider;
37
+ flowInvocationTracerGrpc: SdkFlowInvocationTracerGrpcProvider;
38
+ revisionDataProvider: SdkRevisionDataProvider;
39
+ importCsvDataProvider: SdkImportCSVProvider;
40
+ accessKeyProvider: SdkAccessKeyProvider;
41
+ credentialsProvider: SdkCredentialsProvider;
42
+ storageGrpcProvider: SdkGrpcStorageProvider;
43
+ constructor(context: SdkContext, SdkMetadata?: ISdkMetadata, providers?: IAppknitInternalPlatformSDKProviders);
44
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppknitInternalSDK = void 0;
4
+ const appknit_platform_sdk_v2_1 = require("@appknit-project/appknit-platform-sdk-v2");
5
+ class AppknitInternalSDK extends appknit_platform_sdk_v2_1.AppknitSDK {
6
+ constructor(context, SdkMetadata, providers) {
7
+ super(context, SdkMetadata, providers);
8
+ if (providers === null || providers === void 0 ? void 0 : providers.adhocDataProvider) {
9
+ this.adhocDataProvider = providers.adhocDataProvider;
10
+ }
11
+ if (providers === null || providers === void 0 ? void 0 : providers.applicationDataProvider) {
12
+ this.applicationDataProvider = providers.applicationDataProvider;
13
+ }
14
+ if (providers === null || providers === void 0 ? void 0 : providers.memberDataProvider) {
15
+ this.memberDataProvider = providers.memberDataProvider;
16
+ }
17
+ if (providers === null || providers === void 0 ? void 0 : providers.migrationPathProvider) {
18
+ this.migrationPathProvider = providers.migrationPathProvider;
19
+ }
20
+ if (providers === null || providers === void 0 ? void 0 : providers.environmentDataProvider) {
21
+ this.environmentDataProvider = providers.environmentDataProvider;
22
+ }
23
+ if (providers === null || providers === void 0 ? void 0 : providers.marketPlaceProvider) {
24
+ this.marketPlaceProvider = providers.marketPlaceProvider;
25
+ }
26
+ if (providers === null || providers === void 0 ? void 0 : providers.orgDataProvider) {
27
+ this.orgDataProvider = providers.orgDataProvider;
28
+ }
29
+ if (providers === null || providers === void 0 ? void 0 : providers.mongoProvider) {
30
+ this.mongoProvider = providers.mongoProvider;
31
+ }
32
+ if (providers === null || providers === void 0 ? void 0 : providers.flowInvocationTracerGrpc) {
33
+ this.flowInvocationTracerGrpc = providers.flowInvocationTracerGrpc;
34
+ }
35
+ if (providers === null || providers === void 0 ? void 0 : providers.revisionDataProvider) {
36
+ this.revisionDataProvider = providers.revisionDataProvider;
37
+ }
38
+ if (providers === null || providers === void 0 ? void 0 : providers.importCsvDataProvider) {
39
+ this.importCsvDataProvider = providers.importCsvDataProvider;
40
+ }
41
+ if (providers === null || providers === void 0 ? void 0 : providers.accessKeyProvider) {
42
+ this.accessKeyProvider = providers.accessKeyProvider;
43
+ }
44
+ if (providers === null || providers === void 0 ? void 0 : providers.credentialsProvider) {
45
+ this.credentialsProvider = providers.credentialsProvider;
46
+ }
47
+ if (providers === null || providers === void 0 ? void 0 : providers.storageGrpcProvider) {
48
+ this.storageGrpcProvider = providers.storageGrpcProvider;
49
+ }
50
+ }
51
+ }
52
+ exports.AppknitInternalSDK = AppknitInternalSDK;
53
+ //# sourceMappingURL=sdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":";;;AAAA,sFA6BkD;AA4BlD,MAAa,kBAAmB,SAAQ,oCAAU;IAgBhD,YAAY,OAAmB,EAAE,WAA0B,EAAE,SAAgD;QAC3G,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,iBAAiB,EAAE;YAChC,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC,iBAAiB,CAAC;SACtD;QACD,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,uBAAuB,EAAE;YACtC,IAAI,CAAC,uBAAuB,GAAG,SAAS,CAAC,uBAAuB,CAAC;SAClE;QACD,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,kBAAkB,EAAE;YACjC,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC,kBAAkB,CAAC;SACxD;QACD,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,qBAAqB,EAAE;YACpC,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC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,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC,mBAAmB,CAAC;SAC1D;IACH,CAAC;CACF;AA7DD,gDA6DC"}
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "@appknit-project/appknit-internal-sdk",
3
+ "version": "1.0.1-0",
4
+ "description": "",
5
+ "homepage": "https://appknit.io",
6
+ "engines": {
7
+ "node": ">=10.0.0",
8
+ "npm": ">=6.0.0"
9
+ },
10
+ "main": "dist/src/index.js",
11
+ "types": "dist/src/index.d.ts",
12
+ "files": [
13
+ "dist/src/**"
14
+ ],
15
+ "scripts": {
16
+ "prebuild": "./node_modules/.bin/rimraf dist",
17
+ "build": "./node_modules/.bin/tsc",
18
+ "format": "./node_modules/.bin/prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
19
+ "lint": "./node_modules/.bin/eslint \"{src,tests}/**/*.ts\"",
20
+ "lint-fix": "./node_modules/.bin/eslint \"{src,tests}/**/*.ts\" --fix",
21
+ "test": "./node_modules/.bin/jest --config ./jest.config.js --forceExit",
22
+ "test:watch": "./node_modules/.bin/jest --watch",
23
+ "test:cov": "./node_modules/.bin/jest --coverage --collect-coverage --config ./jest.config.js --forceExit",
24
+ "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest",
25
+ "test:e2e": "./node_modules/.bin/jest --config ./jest-e2e.config.js --forceExit"
26
+ },
27
+ "author": "Appknit Inc <appknit.io>",
28
+ "license": "MIT",
29
+ "dependencies": {
30
+ "@appknit-project/appknit-platform-sdk-v2": "^1.2.41-0"
31
+ },
32
+ "devDependencies": {
33
+ "@types/jest": "25.1.4",
34
+ "@typescript-eslint/eslint-plugin": "^4.14.1",
35
+ "@typescript-eslint/parser": "^4.14.1",
36
+ "eslint": "^7.4.0",
37
+ "eslint-config-prettier": "^6.10.0",
38
+ "eslint-plugin-editorconfig": "^2.1.3",
39
+ "eslint-plugin-import": "^2.20.1",
40
+ "husky": "^4.2.5",
41
+ "jest": "^26.6.3",
42
+ "nock": "^13.0.4",
43
+ "prettier": "^2",
44
+ "rimraf": "^3.0.2",
45
+ "ts-jest": "^26.5.6",
46
+ "ts-loader": "^6.2.1",
47
+ "ts-node": "^8.6.2",
48
+ "tsconfig-paths": "^3.9.0",
49
+ "typescript": "^4.1.3"
50
+ },
51
+ "jest": {
52
+ "moduleFileExtensions": [
53
+ "js",
54
+ "json",
55
+ "ts"
56
+ ],
57
+ "rootDir": ".",
58
+ "testRegex": ".spec.ts$",
59
+ "transform": {
60
+ "^.+\\.(t|j)s$": "ts-jest"
61
+ },
62
+ "coverageDirectory": "./coverage",
63
+ "coverageThreshold": {
64
+ "global": {
65
+ "branches": 0,
66
+ "functions": 0,
67
+ "lines": 0,
68
+ "statements": 0
69
+ }
70
+ },
71
+ "testEnvironment": "node",
72
+ "roots": [
73
+ "<rootDir>/tests/"
74
+ ]
75
+ },
76
+ "husky": {
77
+ "hooks": {
78
+ "pre-commit": "yarn lint && yarn test:cov"
79
+ }
80
+ }
81
+ }