@useparagon/cli 0.0.1-canary.4 → 0.0.1-canary.41
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/apis/api.types.d.ts +71 -8
- package/dist/apis/auth.api.js +5 -7
- package/dist/apis/auth.api.js.map +1 -1
- package/dist/apis/base.api.d.ts +3 -0
- package/dist/apis/base.api.js +51 -52
- package/dist/apis/base.api.js.map +1 -1
- package/dist/apis/index.d.ts +0 -2
- package/dist/apis/index.js +0 -2
- package/dist/apis/index.js.map +1 -1
- package/dist/apis/integration.api.d.ts +3 -3
- package/dist/apis/integration.api.js +18 -10
- package/dist/apis/integration.api.js.map +1 -1
- package/dist/apis/project.api.d.ts +1 -1
- package/dist/apis/project.api.js +40 -17
- package/dist/apis/project.api.js.map +1 -1
- package/dist/codegen/codegen.types.d.ts +12 -4
- package/dist/codegen/codegen.utils.d.ts +2 -1
- package/dist/codegen/codegen.utils.js +63 -28
- package/dist/codegen/codegen.utils.js.map +1 -1
- package/dist/codegen/codegens/condition.codegen.js +38 -35
- package/dist/codegen/codegens/condition.codegen.js.map +1 -1
- package/dist/codegen/codegens/event.codegen.js +4 -3
- package/dist/codegen/codegens/event.codegen.js.map +1 -1
- package/dist/codegen/codegens/integration.codegen.d.ts +3 -3
- package/dist/codegen/codegens/integration.codegen.js +177 -31
- package/dist/codegen/codegens/integration.codegen.js.map +1 -1
- package/dist/codegen/codegens/intent.codegen.d.ts +6 -0
- package/dist/codegen/codegens/intent.codegen.js +192 -0
- package/dist/codegen/codegens/intent.codegen.js.map +1 -0
- package/dist/codegen/codegens/source.codegen.d.ts +3 -1
- package/dist/codegen/codegens/source.codegen.js +120 -31
- package/dist/codegen/codegens/source.codegen.js.map +1 -1
- package/dist/codegen/codegens/workflow.codegen.js +275 -111
- package/dist/codegen/codegens/workflow.codegen.js.map +1 -1
- package/dist/commands/auth/login/login.action.js +29 -31
- package/dist/commands/auth/login/login.action.js.map +1 -1
- package/dist/commands/auth/login/login.command.js +5 -4
- package/dist/commands/auth/login/login.command.js.map +1 -1
- package/dist/commands/auth/login/login.utils.js +26 -19
- package/dist/commands/auth/login/login.utils.js.map +1 -1
- package/dist/commands/auth/logout/logout.action.js +3 -5
- package/dist/commands/auth/logout/logout.action.js.map +1 -1
- package/dist/commands/auth/logout/logout.command.js +3 -3
- package/dist/commands/auth/logout/logout.command.js.map +1 -1
- package/dist/commands/auth/me/me.action.js +10 -6
- package/dist/commands/auth/me/me.action.js.map +1 -1
- package/dist/commands/auth/me/me.command.js +3 -3
- package/dist/commands/auth/me/me.command.js.map +1 -1
- package/dist/commands/build/build.action.js +27 -27
- package/dist/commands/build/build.action.js.map +1 -1
- package/dist/commands/build/build.command.js +9 -5
- package/dist/commands/build/build.command.js.map +1 -1
- package/dist/commands/build/build.types.d.ts +1 -0
- package/dist/commands/build/build.utils.d.ts +1 -1
- package/dist/commands/build/build.utils.js +11 -9
- package/dist/commands/build/build.utils.js.map +1 -1
- package/dist/commands/command.loader.js +12 -8
- package/dist/commands/command.loader.js.map +1 -1
- package/dist/commands/init/init.action.d.ts +1 -1
- package/dist/commands/init/init.action.js +93 -68
- package/dist/commands/init/init.action.js.map +1 -1
- package/dist/commands/init/init.command.js +14 -8
- package/dist/commands/init/init.command.js.map +1 -1
- package/dist/commands/init/init.types.d.ts +1 -0
- package/dist/commands/install/index.d.ts +1 -0
- package/dist/commands/install/index.js +5 -0
- package/dist/commands/install/index.js.map +1 -0
- package/dist/commands/install/install.action.d.ts +5 -0
- package/dist/commands/install/install.action.js +15 -0
- package/dist/commands/install/install.action.js.map +1 -0
- package/dist/commands/install/install.command.d.ts +8 -0
- package/dist/commands/install/install.command.js +24 -0
- package/dist/commands/install/install.command.js.map +1 -0
- package/dist/commands/install/install.constants.js +68 -0
- package/dist/commands/install/install.constants.js.map +1 -0
- package/dist/commands/install/install.types.d.ts +7 -0
- package/dist/commands/install/install.types.js +3 -0
- package/dist/commands/install/install.types.js.map +1 -0
- package/dist/commands/install/install.utils.d.ts +8 -0
- package/dist/commands/install/install.utils.js +193 -0
- package/dist/commands/install/install.utils.js.map +1 -0
- package/dist/commands/new/index.d.ts +1 -0
- package/dist/commands/new/index.js +5 -0
- package/dist/commands/new/index.js.map +1 -0
- package/dist/commands/new/integration/index.d.ts +1 -0
- package/dist/commands/new/integration/index.js +5 -0
- package/dist/commands/new/integration/index.js.map +1 -0
- package/dist/commands/new/integration/integration.action.d.ts +5 -0
- package/dist/commands/new/integration/integration.action.js +52 -0
- package/dist/commands/new/integration/integration.action.js.map +1 -0
- package/dist/commands/new/integration/integration.command.d.ts +8 -0
- package/dist/commands/new/integration/integration.command.js +26 -0
- package/dist/commands/new/integration/integration.command.js.map +1 -0
- package/dist/commands/new/integration/integration.types.d.ts +1 -0
- package/dist/commands/new/integration/integration.types.js +3 -0
- package/dist/commands/new/integration/integration.types.js.map +1 -0
- package/dist/commands/new/new.command.d.ts +5 -0
- package/dist/commands/new/new.command.js +16 -0
- package/dist/commands/new/new.command.js.map +1 -0
- package/dist/commands/new/new.utils.d.ts +1 -0
- package/dist/commands/new/new.utils.js +18 -0
- package/dist/commands/new/new.utils.js.map +1 -0
- package/dist/commands/new/workflow/index.d.ts +1 -0
- package/dist/commands/new/workflow/index.js +5 -0
- package/dist/commands/new/workflow/index.js.map +1 -0
- package/dist/commands/new/workflow/workflow.action.d.ts +5 -0
- package/dist/commands/new/workflow/workflow.action.js +94 -0
- package/dist/commands/new/workflow/workflow.action.js.map +1 -0
- package/dist/commands/new/workflow/workflow.command.d.ts +8 -0
- package/dist/commands/new/workflow/workflow.command.js +25 -0
- package/dist/commands/new/workflow/workflow.command.js.map +1 -0
- package/dist/commands/new/workflow/workflow.types.d.ts +3 -0
- package/dist/commands/new/workflow/workflow.types.js +3 -0
- package/dist/commands/new/workflow/workflow.types.js.map +1 -0
- package/dist/commands/pull/index.d.ts +1 -0
- package/dist/commands/pull/index.js +5 -0
- package/dist/commands/pull/index.js.map +1 -0
- package/dist/commands/pull/pull.action.d.ts +5 -0
- package/dist/commands/pull/pull.action.js +48 -0
- package/dist/commands/pull/pull.action.js.map +1 -0
- package/dist/commands/pull/pull.command.d.ts +8 -0
- package/dist/commands/pull/pull.command.js +26 -0
- package/dist/commands/pull/pull.command.js.map +1 -0
- package/dist/commands/pull/pull.types.d.ts +1 -0
- package/dist/commands/pull/pull.types.js +3 -0
- package/dist/commands/pull/pull.types.js.map +1 -0
- package/dist/commands/push/push.action.js +9 -11
- package/dist/commands/push/push.action.js.map +1 -1
- package/dist/commands/push/push.command.js +4 -4
- package/dist/commands/push/push.command.js.map +1 -1
- package/dist/compiler/compiler.types.d.ts +3 -2
- package/dist/compiler/compiler.utils.d.ts +1 -1
- package/dist/compiler/compiler.utils.js +8 -4
- package/dist/compiler/compiler.utils.js.map +1 -1
- package/dist/compiler/compilers/events.compiler.js +24 -28
- package/dist/compiler/compilers/events.compiler.js.map +1 -1
- package/dist/compiler/compilers/integrations.compiler.js +148 -52
- package/dist/compiler/compilers/integrations.compiler.js.map +1 -1
- package/dist/compiler/compilers/persona.compiler.js +4 -11
- package/dist/compiler/compilers/persona.compiler.js.map +1 -1
- package/dist/compiler/compilers/project.compiler.d.ts +1 -0
- package/dist/compiler/compilers/project.compiler.js +49 -23
- package/dist/compiler/compilers/project.compiler.js.map +1 -1
- package/dist/compiler/compilers/workflows.compiler.js +55 -32
- package/dist/compiler/compilers/workflows.compiler.js.map +1 -1
- package/dist/compiler/ts.compiler.d.ts +1 -3
- package/dist/compiler/ts.compiler.js +18 -18
- package/dist/compiler/ts.compiler.js.map +1 -1
- package/dist/config/config.constants.d.ts +1 -0
- package/dist/config/config.constants.js +2 -1
- package/dist/config/config.constants.js.map +1 -1
- package/dist/config/config.types.d.ts +4 -0
- package/dist/config/config.utils.d.ts +4 -3
- package/dist/config/config.utils.js +65 -37
- package/dist/config/config.utils.js.map +1 -1
- package/dist/helpers/constants.d.ts +1 -0
- package/dist/helpers/constants.js +2 -1
- package/dist/helpers/constants.js.map +1 -1
- package/dist/helpers/file.d.ts +3 -1
- package/dist/helpers/file.js +44 -15
- package/dist/helpers/file.js.map +1 -1
- package/dist/helpers/sets.d.ts +1 -0
- package/dist/helpers/sets.js +10 -0
- package/dist/helpers/sets.js.map +1 -0
- package/dist/helpers/strings.d.ts +1 -0
- package/dist/helpers/strings.js +34 -1
- package/dist/helpers/strings.js.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/logger/logger.js +5 -1
- package/dist/logger/logger.js.map +1 -1
- package/dist/templates/configurations/typescript/tsconfig.json +3 -2
- package/package.json +20 -16
- package/dist/apis/event.api.d.ts +0 -2
- package/dist/apis/event.api.js +0 -10
- package/dist/apis/event.api.js.map +0 -1
- package/dist/apis/workflow.api.d.ts +0 -2
- package/dist/apis/workflow.api.js +0 -10
- package/dist/apis/workflow.api.js.map +0 -1
- package/dist/commands/init/init.constants.js +0 -23
- package/dist/commands/init/init.constants.js.map +0 -1
- package/dist/commands/init/init.utils.d.ts +0 -11
- package/dist/commands/init/init.utils.js +0 -50
- package/dist/commands/init/init.utils.js.map +0 -1
- package/dist/templates/javascript/src/events/hello-world.js +0 -13
- package/dist/templates/javascript/src/integrations/slack/config.js +0 -11
- package/dist/templates/javascript/src/integrations/slack/workflows/example-workflow.js +0 -30
- package/dist/templates/typescript/src/events/hello-world.ts +0 -21
- package/dist/templates/typescript/src/integrations/slack/config.ts +0 -18
- package/dist/templates/typescript/src/integrations/slack/workflows/example-workflow.ts +0 -30
- package/dist/templates/typescript/tsconfig.json +0 -31
- /package/dist/commands/{init/init.constants.d.ts → install/install.constants.d.ts} +0 -0
package/dist/apis/api.types.d.ts
CHANGED
|
@@ -1,8 +1,51 @@
|
|
|
1
|
-
import { IStep } from '@useparagon/core
|
|
1
|
+
import { AuthenticationScheme, IStep } from '@useparagon/core';
|
|
2
2
|
import { IEvent } from '@useparagon/core/event';
|
|
3
|
-
import { InputSource, SerializedInput } from '@useparagon/core/inputs';
|
|
3
|
+
import { InputSource, SerializedInput, SidebarInputType } from '@useparagon/core/inputs';
|
|
4
4
|
import { IPersona } from '@useparagon/core/persona';
|
|
5
|
-
import { OrConditions } from '@useparagon/core/resolvers';
|
|
5
|
+
import { DataType, Operator, OrConditions, TokenizedSource } from '@useparagon/core/resolvers';
|
|
6
|
+
import { ISecret } from '@useparagon/core/secret';
|
|
7
|
+
import { RequestAuthorization } from '@useparagon/core/steps/library/request';
|
|
8
|
+
export type InputKeyVisibilityConfig = {
|
|
9
|
+
inputId: string;
|
|
10
|
+
path?: string[];
|
|
11
|
+
} | string;
|
|
12
|
+
export type GraphiteEnumInput = {
|
|
13
|
+
value: string;
|
|
14
|
+
dependentInputs?: IntentInputKeyConfig[];
|
|
15
|
+
} | string;
|
|
16
|
+
export type IntentInputKeyConfig = {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
subtitle?: string;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
dependentInputs?: IntentInputKeyConfig[];
|
|
23
|
+
defaultValue?: unknown;
|
|
24
|
+
} & ({
|
|
25
|
+
type: SidebarInputType.TextArea | SidebarInputType.Switch | SidebarInputType.BooleanInput | SidebarInputType.Code | SidebarInputType.Text | SidebarInputType.ValueText | 'UNDEFINED';
|
|
26
|
+
} | {
|
|
27
|
+
type: SidebarInputType.Enum | SidebarInputType.EditableEnum;
|
|
28
|
+
values: GraphiteEnumInput[];
|
|
29
|
+
} | {
|
|
30
|
+
type: SidebarInputType.Conditional;
|
|
31
|
+
supportedOperators?: Operator[];
|
|
32
|
+
disableOrCondition?: boolean;
|
|
33
|
+
supportedKeys?: {
|
|
34
|
+
inputId: string;
|
|
35
|
+
visibleOnInputs?: Array<InputKeyVisibilityConfig | string>;
|
|
36
|
+
}[];
|
|
37
|
+
});
|
|
38
|
+
export type IntegrationIntent = {
|
|
39
|
+
name: string;
|
|
40
|
+
title: string;
|
|
41
|
+
inputs: IntentInputKeyConfig[];
|
|
42
|
+
output: any[];
|
|
43
|
+
};
|
|
44
|
+
export type IntegrationDependencies = {
|
|
45
|
+
inputs: InputSource[];
|
|
46
|
+
intents: IntegrationIntent[];
|
|
47
|
+
triggers: IntegrationIntent[];
|
|
48
|
+
};
|
|
6
49
|
export type IntegrationWorkflowMeta = {
|
|
7
50
|
id: string;
|
|
8
51
|
infoText?: string;
|
|
@@ -25,23 +68,42 @@ export type ModalConfig = {
|
|
|
25
68
|
inputs?: SerializedInput[];
|
|
26
69
|
};
|
|
27
70
|
};
|
|
71
|
+
export interface ICustomIntegration {
|
|
72
|
+
id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
authenticationType?: AuthenticationScheme;
|
|
75
|
+
inputFields: SerializedInput[];
|
|
76
|
+
oauthAuthorizationUrl?: TokenizedSource<DataType.STRING>;
|
|
77
|
+
oauthAccessTokenUrl?: TokenizedSource<DataType.STRING>;
|
|
78
|
+
oauthScopes?: string;
|
|
79
|
+
oauthIncludeClientAuthorizationHeader?: boolean;
|
|
80
|
+
usePKCEInCodeExchange?: boolean;
|
|
81
|
+
apiBaseUrl?: TokenizedSource<DataType.STRING>;
|
|
82
|
+
testEndpointPath?: TokenizedSource<DataType.STRING>;
|
|
83
|
+
apiAuthorization?: RequestAuthorization;
|
|
84
|
+
isPublished?: boolean;
|
|
85
|
+
}
|
|
28
86
|
export interface WorkflowBuild {
|
|
29
87
|
id: string;
|
|
30
88
|
name: string;
|
|
31
89
|
steps: IStep[];
|
|
32
90
|
}
|
|
33
91
|
export interface IntegrationBuild {
|
|
92
|
+
id: string;
|
|
34
93
|
config: {
|
|
35
94
|
values: ModalConfig;
|
|
36
95
|
};
|
|
37
|
-
workflows: Record<string, WorkflowBuild>;
|
|
38
|
-
|
|
96
|
+
workflows: Record<string, WorkflowBuild | undefined>;
|
|
97
|
+
dependencies?: IntegrationDependencies;
|
|
98
|
+
customIntegration?: ICustomIntegration;
|
|
39
99
|
}
|
|
40
100
|
export interface ProjectBuild {
|
|
41
101
|
projectId: string;
|
|
102
|
+
projectName?: string;
|
|
42
103
|
events: Record<string, IEvent>;
|
|
43
104
|
persona: IPersona;
|
|
44
|
-
integrations: Record<string, IntegrationBuild>;
|
|
105
|
+
integrations: Record<string, IntegrationBuild | undefined>;
|
|
106
|
+
secrets: ISecret[];
|
|
45
107
|
}
|
|
46
108
|
export type IUser = {
|
|
47
109
|
firstName: string;
|
|
@@ -49,6 +111,7 @@ export type IUser = {
|
|
|
49
111
|
lastName: string;
|
|
50
112
|
email: string;
|
|
51
113
|
};
|
|
52
|
-
export type
|
|
53
|
-
|
|
114
|
+
export type IntegrationMetadata = {
|
|
115
|
+
name: string;
|
|
116
|
+
title: string;
|
|
54
117
|
};
|
package/dist/apis/auth.api.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMe = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const logger_1 = tslib_1.__importDefault(require("../logger"));
|
|
6
4
|
const base_api_1 = require("./base.api");
|
|
7
|
-
const getMe = (overrideConfig) =>
|
|
5
|
+
const getMe = async (overrideConfig) => {
|
|
8
6
|
try {
|
|
9
|
-
return
|
|
7
|
+
return await (0, base_api_1.get)('graphite/auth/me', overrideConfig);
|
|
10
8
|
}
|
|
11
|
-
catch (
|
|
12
|
-
|
|
9
|
+
catch (error) {
|
|
10
|
+
return (0, base_api_1.logApiError)('Failed to get user.', error);
|
|
13
11
|
}
|
|
14
|
-
}
|
|
12
|
+
};
|
|
15
13
|
exports.getMe = getMe;
|
|
16
14
|
//# sourceMappingURL=auth.api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.api.js","sourceRoot":"","sources":["../../src/apis/auth.api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.api.js","sourceRoot":"","sources":["../../src/apis/auth.api.ts"],"names":[],"mappings":";;;AACA,yCAA8C;AAOvC,MAAM,KAAK,GAAG,KAAK,EAAE,cAG3B,EAAkB,EAAE;IACnB,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,cAAG,EAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;IACvD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAA,sBAAW,EAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;AACH,CAAC,CAAC;AATW,QAAA,KAAK,SAShB"}
|
package/dist/apis/base.api.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { IProfile } from '../config';
|
|
2
|
+
export declare const getProfile: () => Promise<IProfile>;
|
|
1
3
|
export declare const getToken: () => Promise<string>;
|
|
4
|
+
export declare const logApiError: (apiDescription: string, error: any) => never;
|
|
2
5
|
export declare const get: (path: string, options?: {
|
|
3
6
|
token: string;
|
|
4
7
|
baseUrl: string;
|
package/dist/apis/base.api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.put = exports.post = exports.get = exports.getToken = void 0;
|
|
3
|
+
exports.put = exports.post = exports.get = exports.logApiError = exports.getToken = exports.getProfile = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
6
6
|
const logger_1 = tslib_1.__importDefault(require("../logger"));
|
|
@@ -8,84 +8,83 @@ const config_1 = require("../config");
|
|
|
8
8
|
const http_1 = require("../helpers/http");
|
|
9
9
|
let _token;
|
|
10
10
|
let _baseUrl;
|
|
11
|
-
|
|
11
|
+
let _currentProfile;
|
|
12
|
+
const getProfile = async () => {
|
|
13
|
+
if (_currentProfile) {
|
|
14
|
+
return _currentProfile;
|
|
15
|
+
}
|
|
16
|
+
const profileConfig = await (0, config_1.getConfigForProfile)(config_1.SystemFile.PROFILES, config_1.DEFAULT_PROFILE);
|
|
17
|
+
_currentProfile = profileConfig;
|
|
18
|
+
return _currentProfile;
|
|
19
|
+
};
|
|
20
|
+
exports.getProfile = getProfile;
|
|
21
|
+
const getBaseUrl = async () => {
|
|
12
22
|
if (_baseUrl) {
|
|
13
23
|
return _baseUrl;
|
|
14
24
|
}
|
|
15
25
|
try {
|
|
16
|
-
const profileConfig =
|
|
26
|
+
const profileConfig = await (0, config_1.getConfigForProfile)(config_1.SystemFile.PROFILES, config_1.DEFAULT_PROFILE);
|
|
17
27
|
if (!profileConfig.services[config_1.Service.ZEUS]) {
|
|
18
28
|
logger_1.default.fatal('Api url is not present in config.');
|
|
19
29
|
}
|
|
30
|
+
_currentProfile = profileConfig;
|
|
20
31
|
_baseUrl = (0, http_1.sanitizeUrl)(profileConfig.services[config_1.Service.ZEUS]);
|
|
21
32
|
return _baseUrl;
|
|
22
33
|
}
|
|
23
|
-
catch
|
|
34
|
+
catch {
|
|
24
35
|
logger_1.default.fatal('User not logged in.');
|
|
25
36
|
}
|
|
26
|
-
}
|
|
27
|
-
const getToken = () =>
|
|
37
|
+
};
|
|
38
|
+
const getToken = async () => {
|
|
28
39
|
if (_token) {
|
|
29
40
|
return _token;
|
|
30
41
|
}
|
|
31
42
|
try {
|
|
32
|
-
const credential =
|
|
43
|
+
const credential = await (0, config_1.getConfigForProfile)(config_1.SystemFile.CREDENTIALS, config_1.DEFAULT_PROFILE);
|
|
33
44
|
_token = credential.token;
|
|
34
45
|
if (!_token) {
|
|
35
46
|
logger_1.default.fatal('Token value not present in config.');
|
|
36
47
|
}
|
|
37
48
|
return _token;
|
|
38
49
|
}
|
|
39
|
-
catch
|
|
50
|
+
catch {
|
|
40
51
|
logger_1.default.fatal('User not logged in.');
|
|
41
52
|
}
|
|
42
|
-
}
|
|
53
|
+
};
|
|
43
54
|
exports.getToken = getToken;
|
|
44
|
-
const
|
|
45
|
-
|
|
55
|
+
const logApiError = (apiDescription, error) => {
|
|
56
|
+
const errorMessage = error['response']?.['data']?.['message'] || error.message;
|
|
57
|
+
logger_1.default.fatal(`${apiDescription}
|
|
58
|
+
- Details: ${errorMessage}`);
|
|
59
|
+
};
|
|
60
|
+
exports.logApiError = logApiError;
|
|
61
|
+
const get = async (path, options) => {
|
|
62
|
+
const apiBaseUrl = options ? options.baseUrl : await getBaseUrl();
|
|
63
|
+
const token = options ? options.token : await (0, exports.getToken)();
|
|
64
|
+
const response = await axios_1.default.get(`${apiBaseUrl}/${path}`, {
|
|
65
|
+
headers: {
|
|
66
|
+
Authorization: `Bearer ${token}`,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
return response.data;
|
|
46
70
|
};
|
|
47
|
-
const get = (path, options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
const apiBaseUrl = options ? options.baseUrl : yield getBaseUrl();
|
|
49
|
-
const token = options ? options.token : yield (0, exports.getToken)();
|
|
50
|
-
try {
|
|
51
|
-
const response = yield axios_1.default.get(`${apiBaseUrl}/${path}`, {
|
|
52
|
-
headers: {
|
|
53
|
-
Authorization: `Bearer ${token}`,
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
return response.data;
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
handleError(error);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
71
|
exports.get = get;
|
|
63
|
-
const post = (path, data) =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
handleError(error);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
72
|
+
const post = async (path, data) => {
|
|
73
|
+
const response = await axios_1.default.post(`${await getBaseUrl()}/${path}`, data, {
|
|
74
|
+
headers: {
|
|
75
|
+
Authorization: `Bearer ${await (0, exports.getToken)()}`,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
return response.data;
|
|
79
|
+
};
|
|
76
80
|
exports.post = post;
|
|
77
|
-
const put = (path, data) =>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
handleError(error);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
81
|
+
const put = async (path, data) => {
|
|
82
|
+
const response = await axios_1.default.put(`${await getBaseUrl()}/${path}`, data, {
|
|
83
|
+
headers: {
|
|
84
|
+
Authorization: `Bearer ${await (0, exports.getToken)()}`,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
return response.data;
|
|
88
|
+
};
|
|
90
89
|
exports.put = put;
|
|
91
90
|
//# sourceMappingURL=base.api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.api.js","sourceRoot":"","sources":["../../src/apis/base.api.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,+DAA+B;AAE/B,sCAOmB;AACnB,0CAA8C;AAM9C,IAAI,MAA0B,CAAC;AAC/B,IAAI,QAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"base.api.js","sourceRoot":"","sources":["../../src/apis/base.api.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,+DAA+B;AAE/B,sCAOmB;AACnB,0CAA8C;AAM9C,IAAI,MAA0B,CAAC;AAC/B,IAAI,QAA4B,CAAC;AACjC,IAAI,eAAqC,CAAC;AAMnC,MAAM,UAAU,GAAG,KAAK,IAAuB,EAAE;IACtD,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,MAAM,aAAa,GAAa,MAAM,IAAA,4BAAmB,EACvD,mBAAU,CAAC,QAAQ,EACnB,wBAAe,CAChB,CAAC;IAEF,eAAe,GAAG,aAAa,CAAC;IAChC,OAAO,eAAe,CAAC;AACzB,CAAC,CAAC;AAXW,QAAA,UAAU,cAWrB;AAMF,MAAM,UAAU,GAAG,KAAK,I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M,UAAU,EAAE,IAAI,IAAI,EAAE,EAAE,IAAI,EAAE;QACtE,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,MAAM,IAAA,gBAAQ,GAAE,EAAE;SAC5C;KACF,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC,CAAC;AARW,QAAA,GAAG,OAQd"}
|
package/dist/apis/index.d.ts
CHANGED
package/dist/apis/index.js
CHANGED
|
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./api.types"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./auth.api"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./event.api"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./integration.api"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./project.api"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./workflow.api"), exports);
|
|
10
8
|
//# sourceMappingURL=index.js.map
|
package/dist/apis/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,qDAA2B;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,qDAA2B;AAC3B,4DAAkC;AAClC,wDAA8B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IntegrationDependencies } from './api.types';
|
|
2
|
-
export declare const getIntegrationDependencies: (
|
|
3
|
-
export declare const getDefaultIntegrations: (
|
|
1
|
+
import { IntegrationDependencies, IntegrationMetadata } from './api.types';
|
|
2
|
+
export declare const getIntegrationDependencies: (integrations: string[]) => Promise<Record<string, IntegrationDependencies>>;
|
|
3
|
+
export declare const getDefaultIntegrations: () => Promise<IntegrationMetadata[]>;
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDefaultIntegrations = exports.getIntegrationDependencies = void 0;
|
|
4
|
-
const
|
|
5
|
-
const logger_1 = tslib_1.__importDefault(require("../logger"));
|
|
4
|
+
const core_1 = require("@useparagon/core");
|
|
6
5
|
const base_api_1 = require("./base.api");
|
|
7
|
-
const getIntegrationDependencies = (
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const getIntegrationDependencies = async (integrations) => {
|
|
7
|
+
const nativeIntegrations = integrations.filter((integration) => !(0, core_1.isCustomIntegration)(integration));
|
|
8
|
+
try {
|
|
9
|
+
const integrationTypes = await (0, base_api_1.post)('graphite/integrations', {
|
|
10
|
+
integrations: nativeIntegrations
|
|
11
|
+
});
|
|
12
|
+
return Object.fromEntries(nativeIntegrations.map((integration, index) => ([integration, integrationTypes[index]])));
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
return (0, base_api_1.logApiError)('Failed to get integration data.', error);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
10
18
|
exports.getIntegrationDependencies = getIntegrationDependencies;
|
|
11
|
-
const getDefaultIntegrations = (
|
|
19
|
+
const getDefaultIntegrations = async () => {
|
|
12
20
|
try {
|
|
13
|
-
return
|
|
21
|
+
return await (0, base_api_1.get)('graphite/integrations');
|
|
14
22
|
}
|
|
15
|
-
catch (
|
|
16
|
-
|
|
23
|
+
catch (error) {
|
|
24
|
+
return (0, base_api_1.logApiError)('Failed to list native integrations.', error);
|
|
17
25
|
}
|
|
18
|
-
}
|
|
26
|
+
};
|
|
19
27
|
exports.getDefaultIntegrations = getDefaultIntegrations;
|
|
20
28
|
//# sourceMappingURL=integration.api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.api.js","sourceRoot":"","sources":["../../src/apis/integration.api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"integration.api.js","sourceRoot":"","sources":["../../src/apis/integration.api.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AAGvD,yCAAoD;AAM7C,MAAM,0BAA0B,GAAG,KAAK,EAC7C,YAAsB,EAC4B,EAAE;IACpD,MAAM,kBAAkB,GAAa,YAAY,CAAC,MAAM,CAAC,CAAC,WAAmB,EAAE,EAAE,CAAC,CAAC,IAAA,0BAAmB,EAAC,WAAW,CAAC,CAAC,CAAC;IACrH,IAAI,CAAC;QACH,MAAM,gBAAgB,GAA8B,MAAM,IAAA,eAAI,EAAC,uBAAuB,EAAE;YACtF,YAAY,EAAE,kBAAkB;SACjC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAA,sBAAW,EAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC,CAAC;AAZW,QAAA,0BAA0B,8BAYrC;AAMK,MAAM,sBAAsB,GAAG,KAAK,IAEzC,EAAE;IACF,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,cAAG,EAAC,uBAAuB,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAA,sBAAW,EAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;AACH,CAAC,CAAC;AARW,QAAA,sBAAsB,0BAQjC"}
|
|
@@ -4,4 +4,4 @@ export declare const getProjectList: () => Promise<{
|
|
|
4
4
|
id: string;
|
|
5
5
|
}[]>;
|
|
6
6
|
export declare const getProjectBuild: (projectId: string) => Promise<ProjectBuild>;
|
|
7
|
-
export declare const syncProject: (
|
|
7
|
+
export declare const syncProject: (build: ProjectBuild) => Promise<void>;
|
package/dist/apis/project.api.js
CHANGED
|
@@ -1,34 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.syncProject = exports.getProjectBuild = exports.getProjectList = void 0;
|
|
4
|
-
const
|
|
5
|
-
const logger_1 = tslib_1.__importDefault(require("../logger"));
|
|
4
|
+
const core_1 = require("@useparagon/core");
|
|
6
5
|
const base_api_1 = require("./base.api");
|
|
7
|
-
const
|
|
6
|
+
const integration_api_1 = require("./integration.api");
|
|
7
|
+
const getProjectList = async () => {
|
|
8
8
|
try {
|
|
9
|
-
return
|
|
9
|
+
return await (0, base_api_1.get)('graphite/projects');
|
|
10
10
|
}
|
|
11
|
-
catch (
|
|
12
|
-
|
|
11
|
+
catch (error) {
|
|
12
|
+
return (0, base_api_1.logApiError)('Failed to list projects.', error);
|
|
13
13
|
}
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
15
|
exports.getProjectList = getProjectList;
|
|
16
|
-
const getProjectBuild = (projectId) =>
|
|
16
|
+
const getProjectBuild = async (projectId) => {
|
|
17
17
|
try {
|
|
18
|
-
|
|
18
|
+
const projectBuild = await (0, base_api_1.get)(`graphite/projects/${projectId}`);
|
|
19
|
+
const integrations = Object.keys(projectBuild.integrations);
|
|
20
|
+
const integrationDependencies = await (0, integration_api_1.getIntegrationDependencies)(integrations);
|
|
21
|
+
return {
|
|
22
|
+
...projectBuild,
|
|
23
|
+
integrations: Object.fromEntries(Object.entries(projectBuild.integrations).map(([integration, build]) => [
|
|
24
|
+
integration,
|
|
25
|
+
(0, core_1.isCustomIntegration)(integration) || !build
|
|
26
|
+
? build
|
|
27
|
+
: {
|
|
28
|
+
...build,
|
|
29
|
+
dependencies: integrationDependencies[integration],
|
|
30
|
+
},
|
|
31
|
+
])),
|
|
32
|
+
};
|
|
19
33
|
}
|
|
20
|
-
catch (
|
|
21
|
-
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error && error['response']?.['data']?.['status'] === 404) {
|
|
36
|
+
return {
|
|
37
|
+
projectId,
|
|
38
|
+
integrations: {},
|
|
39
|
+
events: {},
|
|
40
|
+
secrets: [],
|
|
41
|
+
persona: { meta: {} },
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return (0, base_api_1.logApiError)('Failed to get project.', error);
|
|
22
45
|
}
|
|
23
|
-
}
|
|
46
|
+
};
|
|
24
47
|
exports.getProjectBuild = getProjectBuild;
|
|
25
|
-
const syncProject = (
|
|
48
|
+
const syncProject = async (build) => {
|
|
26
49
|
try {
|
|
27
|
-
|
|
50
|
+
await (0, base_api_1.put)('graphite/projects', build);
|
|
28
51
|
}
|
|
29
|
-
catch (
|
|
30
|
-
|
|
52
|
+
catch (error) {
|
|
53
|
+
return (0, base_api_1.logApiError)('Failed to push changes to cloud.', error);
|
|
31
54
|
}
|
|
32
|
-
}
|
|
55
|
+
};
|
|
33
56
|
exports.syncProject = syncProject;
|
|
34
57
|
//# sourceMappingURL=project.api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.api.js","sourceRoot":"","sources":["../../src/apis/project.api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project.api.js","sourceRoot":"","sources":["../../src/apis/project.api.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AAMvD,yCAAmD;AACnD,uDAA+D;AAMxD,MAAM,cAAc,GAAG,KAAK,IAEjC,EAAE;IACF,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,cAAG,EAAC,mBAAmB,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAA,sBAAW,EAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;AACH,CAAC,CAAC;AARW,QAAA,cAAc,kBAQzB;AAOK,MAAM,eAAe,GAAG,KAAK,EAClC,SAAiB,EACM,EAAE;IACzB,IAAI,CAAC;QACH,MAAM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C,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAA,sBAAW,EAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;AACH,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB"}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IStep } from '@useparagon/core';
|
|
2
2
|
import { InputSource, SerializedInput } from '@useparagon/core/inputs';
|
|
3
|
-
import {
|
|
3
|
+
import { ISecret } from '@useparagon/core/secret';
|
|
4
|
+
import { IntegrationDependencies, IntegrationWorkflowMeta } from '../apis/api.types';
|
|
4
5
|
export type ProjectDependencies = {
|
|
5
|
-
|
|
6
|
+
eventIdToNameMap: Record<string, string>;
|
|
7
|
+
secrets: ISecret[];
|
|
6
8
|
};
|
|
7
9
|
export type WorkflowDependencies = ProjectDependencies & {
|
|
8
10
|
integration: {
|
|
9
11
|
name: string;
|
|
12
|
+
dependencies?: IntegrationDependencies;
|
|
10
13
|
};
|
|
11
14
|
workflowMeta: IntegrationWorkflowMeta;
|
|
12
15
|
sharedInputs: SerializedInput[];
|
|
13
16
|
inputSources: InputSource[];
|
|
14
17
|
};
|
|
15
18
|
export type StepDependencies = {
|
|
19
|
+
integration: WorkflowDependencies['integration'];
|
|
16
20
|
sharedInputs: SerializedInput[];
|
|
17
21
|
inputs: SerializedInput[];
|
|
18
22
|
inputSources: InputSource[];
|
|
19
23
|
stepIdToVariableMap: Record<string, string>;
|
|
20
|
-
|
|
24
|
+
eventIdToNameMap: Record<string, string>;
|
|
25
|
+
stepIdToStepMap: Record<string, IStep>;
|
|
26
|
+
secrets: ISecret[];
|
|
27
|
+
currentStepId?: string;
|
|
28
|
+
upstreamStepIds: Set<string>;
|
|
21
29
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { IntegrationBuild, ProjectBuild } from '../apis/api.types';
|
|
1
|
+
import { IntegrationBuild, IntegrationIntent, IntentInputKeyConfig, ProjectBuild } from '../apis/api.types';
|
|
2
2
|
import { ProjectDependencies } from '../compiler/compiler.types';
|
|
3
3
|
export declare const generateIntegrationFiles: (integrationName: string, integrationOutput: IntegrationBuild, projectDependencies: ProjectDependencies, projectRoot: string) => Promise<void>;
|
|
4
4
|
export declare const generateProjectFiles: (projectBuild: ProjectBuild, projectRoot: string) => Promise<void>;
|
|
5
|
+
export declare const getInputsForIntent: (intent: IntegrationIntent) => IntentInputKeyConfig[];
|