@useparagon/cli 0.0.1-canary.39 → 0.0.1-canary.4

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.
Files changed (180) hide show
  1. package/dist/apis/api.types.d.ts +8 -71
  2. package/dist/apis/auth.api.js +7 -5
  3. package/dist/apis/auth.api.js.map +1 -1
  4. package/dist/apis/base.api.d.ts +0 -3
  5. package/dist/apis/base.api.js +52 -51
  6. package/dist/apis/base.api.js.map +1 -1
  7. package/dist/apis/event.api.d.ts +2 -0
  8. package/dist/apis/event.api.js +10 -0
  9. package/dist/apis/event.api.js.map +1 -0
  10. package/dist/apis/index.d.ts +2 -0
  11. package/dist/apis/index.js +2 -0
  12. package/dist/apis/index.js.map +1 -1
  13. package/dist/apis/integration.api.d.ts +3 -3
  14. package/dist/apis/integration.api.js +10 -18
  15. package/dist/apis/integration.api.js.map +1 -1
  16. package/dist/apis/project.api.d.ts +1 -1
  17. package/dist/apis/project.api.js +17 -40
  18. package/dist/apis/project.api.js.map +1 -1
  19. package/dist/apis/workflow.api.d.ts +2 -0
  20. package/dist/apis/workflow.api.js +10 -0
  21. package/dist/apis/workflow.api.js.map +1 -0
  22. package/dist/codegen/codegen.types.d.ts +4 -12
  23. package/dist/codegen/codegen.utils.d.ts +1 -2
  24. package/dist/codegen/codegen.utils.js +28 -63
  25. package/dist/codegen/codegen.utils.js.map +1 -1
  26. package/dist/codegen/codegens/condition.codegen.js +35 -38
  27. package/dist/codegen/codegens/condition.codegen.js.map +1 -1
  28. package/dist/codegen/codegens/event.codegen.js +3 -4
  29. package/dist/codegen/codegens/event.codegen.js.map +1 -1
  30. package/dist/codegen/codegens/integration.codegen.d.ts +3 -3
  31. package/dist/codegen/codegens/integration.codegen.js +32 -138
  32. package/dist/codegen/codegens/integration.codegen.js.map +1 -1
  33. package/dist/codegen/codegens/source.codegen.d.ts +1 -3
  34. package/dist/codegen/codegens/source.codegen.js +31 -120
  35. package/dist/codegen/codegens/source.codegen.js.map +1 -1
  36. package/dist/codegen/codegens/workflow.codegen.js +111 -253
  37. package/dist/codegen/codegens/workflow.codegen.js.map +1 -1
  38. package/dist/commands/auth/login/login.action.js +31 -28
  39. package/dist/commands/auth/login/login.action.js.map +1 -1
  40. package/dist/commands/auth/login/login.command.js +4 -5
  41. package/dist/commands/auth/login/login.command.js.map +1 -1
  42. package/dist/commands/auth/login/login.utils.js +19 -26
  43. package/dist/commands/auth/login/login.utils.js.map +1 -1
  44. package/dist/commands/auth/logout/logout.action.js +5 -3
  45. package/dist/commands/auth/logout/logout.action.js.map +1 -1
  46. package/dist/commands/auth/logout/logout.command.js +3 -3
  47. package/dist/commands/auth/logout/logout.command.js.map +1 -1
  48. package/dist/commands/auth/me/me.action.js +6 -10
  49. package/dist/commands/auth/me/me.action.js.map +1 -1
  50. package/dist/commands/auth/me/me.command.js +3 -3
  51. package/dist/commands/auth/me/me.command.js.map +1 -1
  52. package/dist/commands/build/build.action.js +27 -27
  53. package/dist/commands/build/build.action.js.map +1 -1
  54. package/dist/commands/build/build.command.js +5 -9
  55. package/dist/commands/build/build.command.js.map +1 -1
  56. package/dist/commands/build/build.types.d.ts +0 -1
  57. package/dist/commands/build/build.utils.d.ts +1 -1
  58. package/dist/commands/build/build.utils.js +9 -11
  59. package/dist/commands/build/build.utils.js.map +1 -1
  60. package/dist/commands/command.loader.js +8 -10
  61. package/dist/commands/command.loader.js.map +1 -1
  62. package/dist/commands/init/init.action.d.ts +1 -1
  63. package/dist/commands/init/init.action.js +68 -93
  64. package/dist/commands/init/init.action.js.map +1 -1
  65. package/dist/commands/init/init.command.js +8 -14
  66. package/dist/commands/init/init.command.js.map +1 -1
  67. package/dist/commands/init/init.constants.js +23 -0
  68. package/dist/commands/init/init.constants.js.map +1 -0
  69. package/dist/commands/init/init.types.d.ts +0 -1
  70. package/dist/commands/init/init.utils.d.ts +11 -0
  71. package/dist/commands/init/init.utils.js +50 -0
  72. package/dist/commands/init/init.utils.js.map +1 -0
  73. package/dist/commands/push/push.action.js +11 -9
  74. package/dist/commands/push/push.action.js.map +1 -1
  75. package/dist/commands/push/push.command.js +4 -4
  76. package/dist/commands/push/push.command.js.map +1 -1
  77. package/dist/compiler/compiler.types.d.ts +2 -3
  78. package/dist/compiler/compiler.utils.d.ts +1 -1
  79. package/dist/compiler/compiler.utils.js +4 -8
  80. package/dist/compiler/compiler.utils.js.map +1 -1
  81. package/dist/compiler/compilers/events.compiler.js +28 -24
  82. package/dist/compiler/compilers/events.compiler.js.map +1 -1
  83. package/dist/compiler/compilers/integrations.compiler.js +52 -148
  84. package/dist/compiler/compilers/integrations.compiler.js.map +1 -1
  85. package/dist/compiler/compilers/persona.compiler.js +11 -4
  86. package/dist/compiler/compilers/persona.compiler.js.map +1 -1
  87. package/dist/compiler/compilers/project.compiler.d.ts +0 -1
  88. package/dist/compiler/compilers/project.compiler.js +23 -49
  89. package/dist/compiler/compilers/project.compiler.js.map +1 -1
  90. package/dist/compiler/compilers/workflows.compiler.js +33 -46
  91. package/dist/compiler/compilers/workflows.compiler.js.map +1 -1
  92. package/dist/compiler/ts.compiler.d.ts +3 -1
  93. package/dist/compiler/ts.compiler.js +18 -18
  94. package/dist/compiler/ts.compiler.js.map +1 -1
  95. package/dist/config/config.constants.d.ts +0 -1
  96. package/dist/config/config.constants.js +1 -2
  97. package/dist/config/config.constants.js.map +1 -1
  98. package/dist/config/config.types.d.ts +0 -4
  99. package/dist/config/config.utils.d.ts +3 -4
  100. package/dist/config/config.utils.js +37 -65
  101. package/dist/config/config.utils.js.map +1 -1
  102. package/dist/helpers/constants.d.ts +0 -1
  103. package/dist/helpers/constants.js +1 -2
  104. package/dist/helpers/constants.js.map +1 -1
  105. package/dist/helpers/file.d.ts +1 -3
  106. package/dist/helpers/file.js +15 -44
  107. package/dist/helpers/file.js.map +1 -1
  108. package/dist/helpers/strings.d.ts +0 -1
  109. package/dist/helpers/strings.js +1 -34
  110. package/dist/helpers/strings.js.map +1 -1
  111. package/dist/index.js +0 -10
  112. package/dist/index.js.map +1 -1
  113. package/dist/logger/logger.js +1 -5
  114. package/dist/logger/logger.js.map +1 -1
  115. package/dist/templates/configurations/typescript/tsconfig.json +2 -3
  116. package/dist/templates/javascript/src/events/hello-world.js +13 -0
  117. package/dist/templates/javascript/src/integrations/slack/config.js +11 -0
  118. package/dist/templates/javascript/src/integrations/slack/workflows/example-workflow.js +30 -0
  119. package/dist/templates/typescript/src/events/hello-world.ts +21 -0
  120. package/dist/templates/typescript/src/integrations/slack/config.ts +18 -0
  121. package/dist/templates/typescript/src/integrations/slack/workflows/example-workflow.ts +30 -0
  122. package/dist/templates/typescript/tsconfig.json +31 -0
  123. package/package.json +16 -20
  124. package/dist/codegen/codegens/intent.codegen.d.ts +0 -5
  125. package/dist/codegen/codegens/intent.codegen.js +0 -179
  126. package/dist/codegen/codegens/intent.codegen.js.map +0 -1
  127. package/dist/commands/install/index.d.ts +0 -1
  128. package/dist/commands/install/index.js +0 -5
  129. package/dist/commands/install/index.js.map +0 -1
  130. package/dist/commands/install/install.action.d.ts +0 -5
  131. package/dist/commands/install/install.action.js +0 -15
  132. package/dist/commands/install/install.action.js.map +0 -1
  133. package/dist/commands/install/install.command.d.ts +0 -8
  134. package/dist/commands/install/install.command.js +0 -24
  135. package/dist/commands/install/install.command.js.map +0 -1
  136. package/dist/commands/install/install.constants.js +0 -68
  137. package/dist/commands/install/install.constants.js.map +0 -1
  138. package/dist/commands/install/install.types.d.ts +0 -7
  139. package/dist/commands/install/install.types.js +0 -3
  140. package/dist/commands/install/install.types.js.map +0 -1
  141. package/dist/commands/install/install.utils.d.ts +0 -8
  142. package/dist/commands/install/install.utils.js +0 -130
  143. package/dist/commands/install/install.utils.js.map +0 -1
  144. package/dist/commands/new/index.d.ts +0 -1
  145. package/dist/commands/new/index.js +0 -5
  146. package/dist/commands/new/index.js.map +0 -1
  147. package/dist/commands/new/integration/index.d.ts +0 -1
  148. package/dist/commands/new/integration/index.js +0 -5
  149. package/dist/commands/new/integration/index.js.map +0 -1
  150. package/dist/commands/new/integration/integration.action.d.ts +0 -5
  151. package/dist/commands/new/integration/integration.action.js +0 -52
  152. package/dist/commands/new/integration/integration.action.js.map +0 -1
  153. package/dist/commands/new/integration/integration.command.d.ts +0 -8
  154. package/dist/commands/new/integration/integration.command.js +0 -26
  155. package/dist/commands/new/integration/integration.command.js.map +0 -1
  156. package/dist/commands/new/integration/integration.types.d.ts +0 -1
  157. package/dist/commands/new/integration/integration.types.js +0 -3
  158. package/dist/commands/new/integration/integration.types.js.map +0 -1
  159. package/dist/commands/new/new.command.d.ts +0 -5
  160. package/dist/commands/new/new.command.js +0 -16
  161. package/dist/commands/new/new.command.js.map +0 -1
  162. package/dist/commands/new/new.utils.d.ts +0 -1
  163. package/dist/commands/new/new.utils.js +0 -18
  164. package/dist/commands/new/new.utils.js.map +0 -1
  165. package/dist/commands/new/workflow/index.d.ts +0 -1
  166. package/dist/commands/new/workflow/index.js +0 -5
  167. package/dist/commands/new/workflow/index.js.map +0 -1
  168. package/dist/commands/new/workflow/workflow.action.d.ts +0 -5
  169. package/dist/commands/new/workflow/workflow.action.js +0 -94
  170. package/dist/commands/new/workflow/workflow.action.js.map +0 -1
  171. package/dist/commands/new/workflow/workflow.command.d.ts +0 -8
  172. package/dist/commands/new/workflow/workflow.command.js +0 -25
  173. package/dist/commands/new/workflow/workflow.command.js.map +0 -1
  174. package/dist/commands/new/workflow/workflow.types.d.ts +0 -3
  175. package/dist/commands/new/workflow/workflow.types.js +0 -3
  176. package/dist/commands/new/workflow/workflow.types.js.map +0 -1
  177. package/dist/helpers/sets.d.ts +0 -1
  178. package/dist/helpers/sets.js +0 -10
  179. package/dist/helpers/sets.js.map +0 -1
  180. /package/dist/commands/{install/install.constants.d.ts → init/init.constants.d.ts} +0 -0
@@ -1,51 +1,8 @@
1
- import { AuthenticationScheme, IStep } from '@useparagon/core';
1
+ import { IStep } from '@useparagon/core/';
2
2
  import { IEvent } from '@useparagon/core/event';
3
- import { InputSource, SerializedInput, SidebarInputType } from '@useparagon/core/inputs';
3
+ import { InputSource, SerializedInput } from '@useparagon/core/inputs';
4
4
  import { IPersona } from '@useparagon/core/persona';
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
- };
5
+ import { OrConditions } from '@useparagon/core/resolvers';
49
6
  export type IntegrationWorkflowMeta = {
50
7
  id: string;
51
8
  infoText?: string;
@@ -68,42 +25,23 @@ export type ModalConfig = {
68
25
  inputs?: SerializedInput[];
69
26
  };
70
27
  };
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
- }
86
28
  export interface WorkflowBuild {
87
29
  id: string;
88
30
  name: string;
89
31
  steps: IStep[];
90
32
  }
91
33
  export interface IntegrationBuild {
92
- id: string;
93
34
  config: {
94
35
  values: ModalConfig;
95
36
  };
96
- workflows: Record<string, WorkflowBuild | undefined>;
97
- dependencies?: IntegrationDependencies;
98
- customIntegration?: ICustomIntegration;
37
+ workflows: Record<string, WorkflowBuild>;
38
+ inputs?: InputSource[];
99
39
  }
100
40
  export interface ProjectBuild {
101
41
  projectId: string;
102
- projectName?: string;
103
42
  events: Record<string, IEvent>;
104
43
  persona: IPersona;
105
- integrations: Record<string, IntegrationBuild | undefined>;
106
- secrets: ISecret[];
44
+ integrations: Record<string, IntegrationBuild>;
107
45
  }
108
46
  export type IUser = {
109
47
  firstName: string;
@@ -111,7 +49,6 @@ export type IUser = {
111
49
  lastName: string;
112
50
  email: string;
113
51
  };
114
- export type IntegrationMetadata = {
115
- name: string;
116
- title: string;
52
+ export type IntegrationDependencies = {
53
+ inputSources: InputSource[];
117
54
  };
@@ -1,14 +1,16 @@
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"));
4
6
  const base_api_1 = require("./base.api");
5
- const getMe = async (overrideConfig) => {
7
+ const getMe = (overrideConfig) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
6
8
  try {
7
- return await (0, base_api_1.get)('graphite/auth/me', overrideConfig);
9
+ return yield (0, base_api_1.get)('auth/me', overrideConfig);
8
10
  }
9
- catch (error) {
10
- return (0, base_api_1.logApiError)('Failed to get user.', error);
11
+ catch (err) {
12
+ logger_1.default.fatal(`Error while getting user information : ${err}`);
11
13
  }
12
- };
14
+ });
13
15
  exports.getMe = getMe;
14
16
  //# sourceMappingURL=auth.api.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"auth.api.js","sourceRoot":"","sources":["../../src/apis/auth.api.ts"],"names":[],"mappings":";;;;AAAA,+DAA+B;AAE/B,yCAAiC;AAO1B,MAAM,KAAK,GAAG,CAAO,cAG3B,EAAkB,EAAE;IACnB,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,cAAG,EAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,gBAAM,CAAC,KAAK,CAAC,0CAA0C,GAAG,EAAE,CAAC,CAAC;IAChE,CAAC;AACH,CAAC,CAAA,CAAC;AATW,QAAA,KAAK,SAShB"}
@@ -1,7 +1,4 @@
1
- import { IProfile } from '../config';
2
- export declare const getProfile: () => Promise<IProfile>;
3
1
  export declare const getToken: () => Promise<string>;
4
- export declare const logApiError: (apiDescription: string, error: any) => never;
5
2
  export declare const get: (path: string, options?: {
6
3
  token: string;
7
4
  baseUrl: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.put = exports.post = exports.get = exports.logApiError = exports.getToken = exports.getProfile = void 0;
3
+ exports.put = exports.post = exports.get = exports.getToken = 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,83 +8,84 @@ const config_1 = require("../config");
8
8
  const http_1 = require("../helpers/http");
9
9
  let _token;
10
10
  let _baseUrl;
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 () => {
11
+ const getBaseUrl = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
22
12
  if (_baseUrl) {
23
13
  return _baseUrl;
24
14
  }
25
15
  try {
26
- const profileConfig = await (0, config_1.getConfigForProfile)(config_1.SystemFile.PROFILES, config_1.DEFAULT_PROFILE);
16
+ const profileConfig = yield (0, config_1.getConfigForProfile)(config_1.SystemFile.PROFILES, config_1.DEFAULT_PROFILE);
27
17
  if (!profileConfig.services[config_1.Service.ZEUS]) {
28
18
  logger_1.default.fatal('Api url is not present in config.');
29
19
  }
30
- _currentProfile = profileConfig;
31
20
  _baseUrl = (0, http_1.sanitizeUrl)(profileConfig.services[config_1.Service.ZEUS]);
32
21
  return _baseUrl;
33
22
  }
34
- catch {
23
+ catch (_a) {
35
24
  logger_1.default.fatal('User not logged in.');
36
25
  }
37
- };
38
- const getToken = async () => {
26
+ });
27
+ const getToken = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
39
28
  if (_token) {
40
29
  return _token;
41
30
  }
42
31
  try {
43
- const credential = await (0, config_1.getConfigForProfile)(config_1.SystemFile.CREDENTIALS, config_1.DEFAULT_PROFILE);
32
+ const credential = yield (0, config_1.getConfigForProfile)(config_1.SystemFile.CREDENTIALS, config_1.DEFAULT_PROFILE);
44
33
  _token = credential.token;
45
34
  if (!_token) {
46
35
  logger_1.default.fatal('Token value not present in config.');
47
36
  }
48
37
  return _token;
49
38
  }
50
- catch {
39
+ catch (_b) {
51
40
  logger_1.default.fatal('User not logged in.');
52
41
  }
53
- };
42
+ });
54
43
  exports.getToken = getToken;
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;
44
+ const handleError = (error) => {
45
+ throw new Error(error.message);
70
46
  };
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
+ });
71
62
  exports.get = get;
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
- };
63
+ const post = (path, data) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
64
+ try {
65
+ const response = yield axios_1.default.post(`${yield getBaseUrl()}/${path}`, data, {
66
+ headers: {
67
+ Authorization: `Bearer ${yield (0, exports.getToken)()}`,
68
+ },
69
+ });
70
+ return response.data;
71
+ }
72
+ catch (error) {
73
+ handleError(error);
74
+ }
75
+ });
80
76
  exports.post = post;
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
- };
77
+ const put = (path, data) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
78
+ try {
79
+ const response = yield axios_1.default.put(`${yield getBaseUrl()}/${path}`, data, {
80
+ headers: {
81
+ Authorization: `Bearer ${yield (0, exports.getToken)()}`,
82
+ },
83
+ });
84
+ return response.data;
85
+ }
86
+ catch (error) {
87
+ handleError(error);
88
+ }
89
+ });
89
90
  exports.put = put;
90
91
  //# 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;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,IAAqB,EAAE;IAC7C,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,aAAa,GAAa,MAAM,IAAA,4BAAm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CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACH,CAAC,CAAA,CAAC;AAZW,QAAA,IAAI,QAYf;AAOK,MAAM,GAAG,GAAG,CAAyB,IAAY,EAAE,IAAO,EAAE,EAAE;IACnE,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,MAAM,UAAU,EAAE,IAAI,IAAI,EAAE,EAAE,IAAI,EAAE;YACtE,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,MAAM,IAAA,gBAAQ,GAAE,EAAE;aAC5C;SACF,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACH,CAAC,CAAA,CAAC;AAZW,QAAA,GAAG,OAYd"}
@@ -0,0 +1,2 @@
1
+ import { IEvent } from '@useparagon/core/event';
2
+ export declare const getEventsByProject: (projectId: string) => Promise<IEvent[]>;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEventsByProject = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const base_api_1 = require("./base.api");
6
+ const getEventsByProject = (projectId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
7
+ return (0, base_api_1.get)(`projects/${projectId}/events`);
8
+ });
9
+ exports.getEventsByProject = getEventsByProject;
10
+ //# sourceMappingURL=event.api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.api.js","sourceRoot":"","sources":["../../src/apis/event.api.ts"],"names":[],"mappings":";;;;AAEA,yCAAiC;AAO1B,MAAM,kBAAkB,GAAG,CAChC,SAAiB,EACE,EAAE;IACrB,OAAO,IAAA,cAAG,EAAC,YAAY,SAAS,SAAS,CAAC,CAAC;AAC7C,CAAC,CAAA,CAAC;AAJW,QAAA,kBAAkB,sBAI7B"}
@@ -1,4 +1,6 @@
1
1
  export * from './api.types';
2
2
  export * from './auth.api';
3
+ export * from './event.api';
3
4
  export * from './integration.api';
4
5
  export * from './project.api';
6
+ export * from './workflow.api';
@@ -3,6 +3,8 @@ 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);
6
7
  tslib_1.__exportStar(require("./integration.api"), exports);
7
8
  tslib_1.__exportStar(require("./project.api"), exports);
9
+ tslib_1.__exportStar(require("./workflow.api"), exports);
8
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,qDAA2B;AAC3B,4DAAkC;AAClC,wDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,qDAA2B;AAC3B,sDAA4B;AAC5B,4DAAkC;AAClC,wDAA8B;AAC9B,yDAA+B"}
@@ -1,3 +1,3 @@
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
+ import { IntegrationDependencies } from './api.types';
2
+ export declare const getIntegrationDependencies: (projectId: string, integration: string) => Promise<IntegrationDependencies>;
3
+ export declare const getDefaultIntegrations: (projectId: string) => Promise<string[]>;
@@ -1,28 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getDefaultIntegrations = exports.getIntegrationDependencies = void 0;
4
- const core_1 = require("@useparagon/core");
4
+ const tslib_1 = require("tslib");
5
+ const logger_1 = tslib_1.__importDefault(require("../logger"));
5
6
  const base_api_1 = require("./base.api");
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
- };
7
+ const getIntegrationDependencies = (projectId, integration) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
+ return (0, base_api_1.get)(`projects/${projectId}/integrations/${integration}/dependencies`);
9
+ });
18
10
  exports.getIntegrationDependencies = getIntegrationDependencies;
19
- const getDefaultIntegrations = async () => {
11
+ const getDefaultIntegrations = (projectId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
20
12
  try {
21
- return await (0, base_api_1.get)('graphite/integrations');
13
+ return yield (0, base_api_1.get)(`projects/${projectId}/integrations`);
22
14
  }
23
- catch (error) {
24
- return (0, base_api_1.logApiError)('Failed to list native integrations.', error);
15
+ catch (err) {
16
+ logger_1.default.fatal(`Could not get integrations list : ${err}`);
25
17
  }
26
- };
18
+ });
27
19
  exports.getDefaultIntegrations = getDefaultIntegrations;
28
20
  //# sourceMappingURL=integration.api.js.map
@@ -1 +1 @@
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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C;QACb,gBAAM,CAAC,KAAK,CAAC,qCAAqC,GAAG,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC,CAAA,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: (build: ProjectBuild) => Promise<void>;
7
+ export declare const syncProject: (projectId: string, build: ProjectBuild) => Promise<void>;
@@ -1,57 +1,34 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.syncProject = exports.getProjectBuild = exports.getProjectList = void 0;
4
- const core_1 = require("@useparagon/core");
4
+ const tslib_1 = require("tslib");
5
+ const logger_1 = tslib_1.__importDefault(require("../logger"));
5
6
  const base_api_1 = require("./base.api");
6
- const integration_api_1 = require("./integration.api");
7
- const getProjectList = async () => {
7
+ const getProjectList = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
8
  try {
9
- return await (0, base_api_1.get)('graphite/projects');
9
+ return yield (0, base_api_1.get)('graphite/projects');
10
10
  }
11
- catch (error) {
12
- return (0, base_api_1.logApiError)('Failed to list projects.', error);
11
+ catch (err) {
12
+ logger_1.default.fatal(`Error while getting projects list : ${err}`);
13
13
  }
14
- };
14
+ });
15
15
  exports.getProjectList = getProjectList;
16
- const getProjectBuild = async (projectId) => {
16
+ const getProjectBuild = (projectId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
17
17
  try {
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
- };
18
+ return yield (0, base_api_1.get)(`graphite/projects/${projectId}`);
33
19
  }
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);
20
+ catch (err) {
21
+ logger_1.default.fatal(`Error while getting project : ${err}`);
45
22
  }
46
- };
23
+ });
47
24
  exports.getProjectBuild = getProjectBuild;
48
- const syncProject = async (build) => {
25
+ const syncProject = (projectId, build) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
49
26
  try {
50
- await (0, base_api_1.put)('graphite/projects', build);
27
+ yield (0, base_api_1.put)(`graphite/projects/${projectId}`, build);
51
28
  }
52
- catch (error) {
53
- return (0, base_api_1.logApiError)('Failed to push changes to cloud.', error);
29
+ catch (err) {
30
+ logger_1.default.fatal(`Error while syncing project : ${err}`);
54
31
  }
55
- };
32
+ });
56
33
  exports.syncProject = syncProject;
57
34
  //# sourceMappingURL=project.api.js.map
@@ -1 +1 @@
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,YAAY,GAAiB,MAAM,IAAA,cAAG,EAC1C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AAA,sBAAW,EAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;AACH,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB"}
1
+ {"version":3,"file":"project.api.js","sourceRoot":"","sources":["../../src/apis/project.api.ts"],"names":[],"mappings":";;;;AAAA,+DAA+B;AAE/B,yCAAsC;AAM/B,MAAM,cAAc,GAAG,GAE5B,EAAE;IACF,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,cAAG,EAAC,mBAAmB,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,gBAAM,CAAC,KAAK,CAAC,uCAAuC,GAAG,EAAE,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC,CAAA,CAAC;AARW,QAAA,cAAc,kBAQzB;AAOK,MAAM,eAAe,GAAG,CAC7B,SAAiB,EACM,EAAE;IACzB,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,cAAG,EAAC,qBAAqB,SAAS,EAAE,CAAC,CAAC;IACrD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,gBAAM,CAAC,KAAK,CAAC,iCAAiC,GAAG,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC,CAAA,CAAC;AARW,QAAA,eAAe,mBAQ1B;AAMK,MAAM,WAAW,GAAG,CACzB,SAAiB,EACjB,KAAmB,EACJ,EAAE;IACjB,IAAI,CAAC;QACH,MAAM,IAAA,cAAG,EAAC,qBAAqB,SAAS,EAAE,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,gBAAM,CAAC,KAAK,CAAC,iCAAiC,GAAG,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC,CAAA,CAAC;AATW,QAAA,WAAW,eAStB"}
@@ -0,0 +1,2 @@
1
+ import { IStep } from '@useparagon/core';
2
+ export declare const getWorkflowSteps: (projectId: string, workflowId: string) => Promise<IStep[]>;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWorkflowSteps = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const base_api_1 = require("./base.api");
6
+ const getWorkflowSteps = (projectId, workflowId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
7
+ return (0, base_api_1.get)(`projects/${projectId}/workflows/${workflowId}/steps`);
8
+ });
9
+ exports.getWorkflowSteps = getWorkflowSteps;
10
+ //# sourceMappingURL=workflow.api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.api.js","sourceRoot":"","sources":["../../src/apis/workflow.api.ts"],"names":[],"mappings":";;;;AAEA,yCAAiC;AAQ1B,MAAM,gBAAgB,GAAG,CAC9B,SAAiB,EACjB,UAAkB,EACA,EAAE;IACpB,OAAO,IAAA,cAAG,EAAC,YAAY,SAAS,cAAc,UAAU,QAAQ,CAAC,CAAC;AACpE,CAAC,CAAA,CAAC;AALW,QAAA,gBAAgB,oBAK3B"}
@@ -1,29 +1,21 @@
1
- import { IStep } from '@useparagon/core';
1
+ import { IEvent } from '@useparagon/core/event';
2
2
  import { InputSource, SerializedInput } from '@useparagon/core/inputs';
3
- import { ISecret } from '@useparagon/core/secret';
4
- import { IntegrationDependencies, IntegrationWorkflowMeta } from '../apis/api.types';
3
+ import { IntegrationWorkflowMeta } from '../apis/api.types';
5
4
  export type ProjectDependencies = {
6
- eventIdToNameMap: Record<string, string>;
7
- secrets: ISecret[];
5
+ events: Record<string, IEvent>;
8
6
  };
9
7
  export type WorkflowDependencies = ProjectDependencies & {
10
8
  integration: {
11
9
  name: string;
12
- dependencies?: IntegrationDependencies;
13
10
  };
14
11
  workflowMeta: IntegrationWorkflowMeta;
15
12
  sharedInputs: SerializedInput[];
16
13
  inputSources: InputSource[];
17
14
  };
18
15
  export type StepDependencies = {
19
- integration: WorkflowDependencies['integration'];
20
16
  sharedInputs: SerializedInput[];
21
17
  inputs: SerializedInput[];
22
18
  inputSources: InputSource[];
23
19
  stepIdToVariableMap: Record<string, string>;
24
- eventIdToNameMap: Record<string, string>;
25
- stepIdToStepMap: Record<string, IStep>;
26
- secrets: ISecret[];
27
- currentStepId?: string;
28
- upstreamStepIds: Set<string>;
20
+ events: Record<string, IEvent>;
29
21
  };
@@ -1,5 +1,4 @@
1
- import { IntegrationBuild, IntegrationIntent, IntentInputKeyConfig, ProjectBuild } from '../apis/api.types';
1
+ import { IntegrationBuild, 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[];