@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
package/package.json CHANGED
@@ -1,23 +1,32 @@
1
1
  {
2
2
  "name": "@useparagon/cli",
3
- "version": "0.0.1-canary.39",
3
+ "version": "0.0.1-canary.4",
4
4
  "description": "CLI for WaC (Workflows as Code)",
5
5
  "repository": "https://github.com/useparagon/paragraph",
6
- "packageManager": "pnpm@8.10.5",
6
+ "packageManager": "yarn@3.4.1",
7
7
  "main": "dist/index.js",
8
8
  "files": [
9
- "./dist/",
10
- "!./dist/.tsbuildinfo"
9
+ "./dist/"
11
10
  ],
12
11
  "bin": {
13
12
  "para": "./dist/index.js"
14
13
  },
14
+ "scripts": {
15
+ "build:dev:watch": "tsc -b tsconfig.release.json -w",
16
+ "build:dev": "tsc -b tsconfig.release.json",
17
+ "build:watch": "tsc -b tsconfig.release.json -w",
18
+ "build": "yarn clean && tsc -b tsconfig.release.json && cp -r ./templates/ ./dist/",
19
+ "clean": "rimraf ./dist",
20
+ "release:publish:canary": "yarn npm publish --access restricted --tag next",
21
+ "start:dev": "ts-node -r tsconfig-paths/register src/index.ts"
22
+ },
15
23
  "dependencies": {
16
24
  "@trivago/prettier-plugin-sort-imports": "^4.2.0",
25
+ "@types/prompts": "^2.4.6",
26
+ "@useparagon/core": "0.0.1-canary.4",
17
27
  "axios": "^1.6.1",
18
28
  "chalk": "4.1.2",
19
29
  "commander": "^10.0.0",
20
- "cross-spawn": "^7.0.3",
21
30
  "express": "^4.18.2",
22
31
  "figlet": "^1.6.0",
23
32
  "fs-extra": "^11.1.0",
@@ -25,22 +34,18 @@
25
34
  "out-url": "^1.1.3",
26
35
  "pino": "^8.11.0",
27
36
  "pino-pretty": "^10.0.0",
28
- "prettier": "^3.1.1",
37
+ "prettier": "^3.1.0",
29
38
  "prettier-plugin-organize-imports": "^3.2.3",
30
39
  "prompts": "^2.4.2",
31
40
  "rimraf": "~4.4.0",
32
41
  "spinnies": "^0.5.1",
33
- "tslib": "2.3.1",
34
- "uuid": "^9.0.0",
35
- "@useparagon/core": "0.0.1-canary.39"
42
+ "tslib": "2.3.1"
36
43
  },
37
44
  "devDependencies": {
38
- "@types/cross-spawn": "^6.0.2",
39
45
  "@types/express": "^4.17.21",
40
46
  "@types/figlet": "^1.5.6",
41
47
  "@types/fs-extra": "^11.0.1",
42
48
  "@types/node": "^18.13.0",
43
- "@types/prompts": "^2.4.6",
44
49
  "@types/spinnies": "^0.5.1",
45
50
  "@types/uuid": "^9.0.1",
46
51
  "@typescript-eslint/eslint-plugin": "^5.21.0",
@@ -52,14 +57,5 @@
52
57
  "ts-node": "10.9.1",
53
58
  "tsconfig-paths": "^4.2.0",
54
59
  "typescript": "^5.3.2"
55
- },
56
- "scripts": {
57
- "build:dev:watch": "tsc -b tsconfig.release.json -w",
58
- "build:dev": "tsc -b tsconfig.release.json",
59
- "build:watch": "tsc -b tsconfig.release.json -w",
60
- "build": "tsc -b tsconfig.release.json && node ./scripts/copy-template.js",
61
- "clean": "rimraf ./dist",
62
- "release:publish:canary": "pnpm publish --tag next",
63
- "start:dev": "ts-node -r tsconfig-paths/register src/index.ts"
64
60
  }
65
61
  }
@@ -1,5 +0,0 @@
1
- import { IntegrationIntent, IntentInputKeyConfig } from '../../apis/api.types';
2
- export declare const createInputKeyValueType: (input: IntentInputKeyConfig, _parentInput?: IntentInputKeyConfig) => string;
3
- export declare const createInputsTypes: (inputs: IntentInputKeyConfig[], parentInput?: IntentInputKeyConfig) => string;
4
- export declare const createIntentTypeCode: (inputConfigs: IntentInputKeyConfig[]) => string;
5
- export declare const createIntentsCode: (intentConfigs: IntegrationIntent[]) => string;
@@ -1,179 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createIntentsCode = exports.createIntentTypeCode = exports.createInputsTypes = exports.createInputKeyValueType = void 0;
4
- const inputs_1 = require("@useparagon/core/inputs");
5
- const resolvers_1 = require("@useparagon/core/resolvers");
6
- const utils_1 = require("@useparagon/core/utils");
7
- const source_codegen_1 = require("./source.codegen");
8
- const createInputKeyValueType = (input, _parentInput) => {
9
- const sanitizedInputId = (0, source_codegen_1.sanitizeObjectKey)(input.id);
10
- return `
11
- /**
12
- * ${input.title}${input.subtitle ? `\n* ${input.subtitle}` : ''}
13
- * ${input.placeholder
14
- ? `\n* **Example**:
15
- * ${'```'}
16
- * ${input.placeholder.split(/\n/g).join('\n*')}
17
- * ${'```'}`
18
- : ''}
19
- */
20
- ${input.required ? `${sanitizedInputId}` : `${sanitizedInputId}?`}: ${(() => {
21
- switch (input.type) {
22
- case inputs_1.SidebarInputType.Enum:
23
- case inputs_1.SidebarInputType.EditableEnum:
24
- return (input.values ?? [])
25
- .map((enumInput) => `'${typeof enumInput === 'string'
26
- ? enumInput
27
- : enumInput.value}'`)
28
- .join('|');
29
- case inputs_1.SidebarInputType.TextArea:
30
- case inputs_1.SidebarInputType.Text:
31
- case inputs_1.SidebarInputType.ValueText:
32
- return 'string';
33
- case inputs_1.SidebarInputType.Conditional:
34
- const supportedOperators = input.supportedOperators || [];
35
- if (supportedOperators.length) {
36
- const nonSupportedOperators = Object.entries(resolvers_1.Operator)
37
- .filter(([_key, value]) => !supportedOperators.includes(value))
38
- .map(([key]) => `Operator.${key}`);
39
- if (!nonSupportedOperators.length) {
40
- return 'ConditionalInput';
41
- }
42
- return `ConditionalInput<${nonSupportedOperators.join(' | ')}>`;
43
- }
44
- return 'ConditionalInput';
45
- case inputs_1.SidebarInputType.BooleanInput:
46
- case inputs_1.SidebarInputType.Switch:
47
- return 'boolean';
48
- case inputs_1.SidebarInputType.Code:
49
- return 'object';
50
- default:
51
- return 'undefined';
52
- }
53
- })()};`;
54
- };
55
- exports.createInputKeyValueType = createInputKeyValueType;
56
- const createInputsTypes = (inputs, parentInput) => {
57
- return `{
58
- ${inputs
59
- .map((input) => (0, exports.createInputKeyValueType)(input, parentInput))
60
- .join('\n')}
61
- }`;
62
- };
63
- exports.createInputsTypes = createInputsTypes;
64
- const createIntentTypeCode = (inputConfigs) => {
65
- const [rootInputConfigs, nonRootInputConfigs] = inputConfigs.reduce((accumulator, inputConfig) => {
66
- const [rootInputs, nonRootInputs] = accumulator;
67
- let hasDependentInputs = false;
68
- if (inputConfig.type === inputs_1.SidebarInputType.Enum ||
69
- inputConfig.type === inputs_1.SidebarInputType.EditableEnum) {
70
- hasDependentInputs = Boolean(inputConfig.dependentInputs?.length ||
71
- inputConfig.values.some((enumValue) => typeof enumValue !== 'string' &&
72
- enumValue.dependentInputs?.length));
73
- }
74
- else {
75
- hasDependentInputs = Boolean(inputConfig.dependentInputs?.length);
76
- }
77
- if (hasDependentInputs) {
78
- return [rootInputs, [...nonRootInputs, inputConfig]];
79
- }
80
- return [[...rootInputs, inputConfig], nonRootInputs];
81
- }, [[], []]);
82
- let typeStr = (0, exports.createInputsTypes)(rootInputConfigs);
83
- for (const inputConfig of nonRootInputConfigs) {
84
- if (inputConfig.type !== inputs_1.SidebarInputType.Enum) {
85
- continue;
86
- }
87
- if (inputConfig.required) {
88
- typeStr += ' & (';
89
- }
90
- else {
91
- typeStr += ` & ( ${(0, exports.createInputsTypes)([
92
- { ...inputConfig, type: 'UNDEFINED' },
93
- ])}`;
94
- }
95
- if (inputConfig.dependentInputs?.length) {
96
- typeStr += (0, exports.createIntentTypeCode)([
97
- {
98
- ...inputConfig,
99
- required: true,
100
- dependentInputs: [],
101
- },
102
- ...inputConfig.dependentInputs,
103
- ]);
104
- }
105
- else {
106
- const enumValues = inputConfig.values;
107
- const enumWithStringValues = [];
108
- for (const enumValue of enumValues) {
109
- if (typeof enumValue === 'string' ||
110
- !enumValue.dependentInputs?.length) {
111
- enumWithStringValues.push(typeof enumValue === 'string' ? enumValue : enumValue.value);
112
- continue;
113
- }
114
- typeStr += ` | ( ${(0, exports.createIntentTypeCode)([
115
- {
116
- ...inputConfig,
117
- required: true,
118
- values: [
119
- {
120
- value: enumValue.value,
121
- dependentInputs: [],
122
- },
123
- ],
124
- },
125
- ...(enumValue.dependentInputs || []),
126
- ])} )`;
127
- }
128
- if (enumWithStringValues.length) {
129
- typeStr += ` | ( ${(0, exports.createIntentTypeCode)([
130
- {
131
- ...inputConfig,
132
- required: true,
133
- values: enumWithStringValues,
134
- },
135
- ])} )`;
136
- }
137
- }
138
- typeStr += ')';
139
- }
140
- return typeStr;
141
- };
142
- exports.createIntentTypeCode = createIntentTypeCode;
143
- const createIntentsCode = (intentConfigs) => {
144
- const intentToInputTypeMap = {};
145
- let sourceCode = `
146
- import { Operator } from "@useparagon/core/resolvers";
147
- import { ConditionalInput } from "@useparagon/core/steps/library/conditional";
148
- `;
149
- for (const intentConfig of intentConfigs) {
150
- const sanitizedIntentName = (0, utils_1.toPascalCase)(intentConfig.name.toLowerCase().split('_').join(' '));
151
- const intentCode = intentConfig.inputs
152
- ? (0, exports.createIntentTypeCode)(intentConfig.inputs)
153
- : 'any';
154
- sourceCode = `${sourceCode}
155
-
156
- /**
157
- * ${intentConfig.title} intent type
158
- */
159
- type ${sanitizedIntentName} = ${intentCode};
160
- `;
161
- intentToInputTypeMap[intentConfig.name] = sanitizedIntentName;
162
- }
163
- sourceCode = `${sourceCode}
164
-
165
- export type IntentToInputOutput = {
166
- ${intentConfigs
167
- .map((intentConfig) => `
168
- /**
169
- * ${intentConfig.name}
170
- */
171
- ${intentConfig.name} : [${intentToInputTypeMap[intentConfig.name]},any];
172
- `)
173
- .join('')}
174
- }
175
- `;
176
- return sourceCode;
177
- };
178
- exports.createIntentsCode = createIntentsCode;
179
- //# sourceMappingURL=intent.codegen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent.codegen.js","sourceRoot":"","sources":["../../../src/codegen/codegens/intent.codegen.ts"],"names":[],"mappings":";;;AAAA,oDAA2D;AAC3D,0DAAsD;AACtD,kDAAsD;AAOtD,qDAAqD;AAQ9C,MAAM,uBAAuB,GAAG,CACrC,KAA2B,EAC3B,YAAmC,EAC3B,EAAE;IACV,MAAM,gBAAgB,GAAW,IAAA,kCAAiB,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC7D,OAAO;;aAEI,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;cAE7D,KAAK,CAAC,WAAW;QACf,CA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IAAI,CAAC,GAAG,CAAC,CACrD,CAAC;QACF,MAAM,UAAU,GAAW,YAAY,CAAC,MAAM;YAC5C,CAAC,CAAC,IAAA,4BAAoB,EAAC,YAAY,CAAC,MAAM,CAAC;YAC3C,CAAC,CAAC,KAAK,CAAC;QAEV,UAAU,GAAG,GAAG,UAAU;;;SAGrB,YAAY,CAAC,KAAK;;YAEf,mBAAmB,MAAM,UAAU;KAC1C,CAAC;QAEF,oBAAoB,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC;IAChE,CAAC;IAED,UAAU,GAAG,GAAG,UAAU;;;MAGtB,aAAa;SACZ,GAAG,CACF,CAAC,YAAY,EAAE,EAAE,CAAC;;aAEb,YAAY,CAAC,IAAI;;UAEpB,YAAY,CAAC,IAAI,OAAO,oBAAoB,CAAC,YAAY,CAAC,IAAI,CAAC;KACpE,CACE;SACA,IAAI,CAAC,EAAE,CAAC;;GAEZ,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AA3CW,QAAA,iBAAiB,qBA2C5B"}
@@ -1 +0,0 @@
1
- export * from './install.command';
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./install.command"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/install/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC"}
@@ -1,5 +0,0 @@
1
- import { IAction } from '../command.interface';
2
- import { InstallCommandOptions } from './install.types';
3
- export declare class InstallAction implements IAction<InstallCommandOptions, void> {
4
- handle(_options: InstallCommandOptions): Promise<void>;
5
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InstallAction = void 0;
4
- const base_api_1 = require("../../apis/base.api");
5
- const config_1 = require("../../config");
6
- const install_utils_1 = require("./install.utils");
7
- class InstallAction {
8
- async handle(_options) {
9
- const { rootPath } = await (0, config_1.getParagraphProjectDetails)();
10
- await (0, base_api_1.getToken)();
11
- return (0, install_utils_1.installDependencies)(rootPath);
12
- }
13
- }
14
- exports.InstallAction = InstallAction;
15
- //# sourceMappingURL=install.action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.action.js","sourceRoot":"","sources":["../../../src/commands/install/install.action.ts"],"names":[],"mappings":";;;AAAA,kDAA+C;AAC/C,yCAA0D;AAG1D,mDAAsD;AAKtD,MAAa,aAAa;IAIxB,KAAK,CAAC,MAAM,CAAC,QAA+B;QAE1C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAA,mCAA0B,GAAE,CAAC;QAGxD,MAAM,IAAA,mBAAQ,GAAE,CAAC;QAEjB,OAAO,IAAA,mCAAmB,EAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;CACF;AAbD,sCAaC"}
@@ -1,8 +0,0 @@
1
- import { Command } from 'commander';
2
- import { ICommand } from '../command.interface';
3
- export declare class InstallCommand implements ICommand {
4
- private actionHandler;
5
- constructor();
6
- load(program: Command): void;
7
- private sanitizeOptions;
8
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InstallCommand = void 0;
4
- const install_action_1 = require("./install.action");
5
- class InstallCommand {
6
- actionHandler;
7
- constructor() {
8
- this.actionHandler = new install_action_1.InstallAction();
9
- }
10
- load(program) {
11
- program
12
- .command('install')
13
- .description('Install project dependencies')
14
- .action(async (rawOptions) => {
15
- const options = this.sanitizeOptions(rawOptions);
16
- return this.actionHandler.handle(options);
17
- });
18
- }
19
- sanitizeOptions(rawOptions) {
20
- return rawOptions;
21
- }
22
- }
23
- exports.InstallCommand = InstallCommand;
24
- //# sourceMappingURL=install.command.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.command.js","sourceRoot":"","sources":["../../../src/commands/install/install.command.ts"],"names":[],"mappings":";;;AAIA,qDAAiD;AAMjD,MAAa,cAAc;IACjB,aAAa,CAAgB;IAErC;QACE,IAAI,CAAC,aAAa,GAAG,IAAI,8BAAa,EAAE,CAAC;IAC3C,CAAC;IAKD,IAAI,CAAC,OAAgB;QACnB,OAAO;aACJ,OAAO,CAAC,SAAS,CAAC;aAClB,WAAW,CAAC,8BAA8B,CAAC;aAC3C,MAAM,CAAC,KAAK,EAAE,UAAiC,EAAE,EAAE;YAClD,MAAM,OAAO,GAA0B,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;YACxE,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACP,CAAC;IAOO,eAAe,CACrB,UAAiC;QAEjC,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AA9BD,wCA8BC"}
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultPackageJson = void 0;
4
- exports.defaultPackageJson = {
5
- name: 'default-package.json',
6
- version: '0.0.0',
7
- private: true,
8
- engines: {
9
- node: '>=14.17',
10
- },
11
- scripts: {
12
- build: 'para build'
13
- },
14
- dependencies: {
15
- '@useparagon/core': require('../../../package.json').version,
16
- tslib: '2.3.1',
17
- },
18
- devDependencies: {
19
- "@sendgrid/mail": "^7.6.0",
20
- "@types/analytics-node": "^3.1.14",
21
- "@types/archiver": "^5.3.2",
22
- "@types/bluebird": "^3.5.42",
23
- "@types/cloudflare": "^2.7.13",
24
- "@types/html-pdf": "^3.0.3",
25
- "@types/jsforce": "^1.11.5",
26
- "@types/jsonwebtoken": "^9.0.5",
27
- "@types/lodash": "^4.14.202",
28
- "@types/luxon": "^3.3.7",
29
- "@types/mailgun-js": "^0.22.18",
30
- "@types/mssql": "^9.1.4",
31
- "@types/node": "^18.13.0",
32
- "@types/node-fetch": "^2.6.0",
33
- "@types/number-to-words": "^1.2.3",
34
- "@types/oauth": "^0.9.4",
35
- "@types/pg": "^8.10.9",
36
- "@types/postlight__mercury-parser": "^2.2.7",
37
- "@trivago/prettier-plugin-sort-imports": "^4.2.0",
38
- "@types/ramda": "^0.29.9",
39
- "@types/snowflake-sdk": "^1.6.20",
40
- "@types/ssh2-sftp-client": "^5.2.2",
41
- "@types/underscore": "^1.11.15",
42
- "@types/underscore.string": "^0.0.41",
43
- "@types/unzipper": "^0.10.9",
44
- "@types/uuid": "^9.0.1",
45
- "aws-sdk": "^2.630.0",
46
- "cheerio": "^1.0.0-rc.3",
47
- "csv": "^5.3.2",
48
- "date-fns": "^2.14.0",
49
- "fast-xml-parser": "^3.20.3",
50
- "firebase": "^9.0.2",
51
- "form-data": "^3.0.0",
52
- "mailgun.js": "^8.0.2",
53
- "moment": "^2.24.0",
54
- "mysql2": "^2.1.0",
55
- "neo4j-driver": "^5.5.0",
56
- "promise-parallel-throttle": "^3.3.0",
57
- prettier: '^3.1.0',
58
- 'prettier-plugin-organize-imports': '^3.2.3',
59
- "redis": "^4.6.7",
60
- "sendpulse-api": "^1.1.4",
61
- "slack": "^11.0.2",
62
- "twilio": "^3.42.1",
63
- "typescript": "^5.3.2",
64
- "unzipper": "^0.10.11",
65
- 'url': "^0.11.0"
66
- },
67
- };
68
- //# sourceMappingURL=install.constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.constants.js","sourceRoot":"","sources":["../../../src/commands/install/install.constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,kBAAkB,GAAwB;IACnD,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,IAAI;IACb,OAAO,EAAE;QACL,IAAI,EAAE,SAAS;KAClB;IACD,OAAO,EAAE;QACL,KAAK,EAAE,YAAY;KACtB;IAID,YAAY,EAAE;QACV,kBAAkB,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC,OAAO;QAC5D,KAAK,EAAE,OAAO;KACjB;IAID,eAAe,EAAE;QACb,gBAAgB,EAAE,Q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@@ -1,7 +0,0 @@
1
- export type InstallCommandOptions = {};
2
- export type GenericResolve<T = any> = {
3
- (value?: T): void;
4
- };
5
- export type GenericReject<T = Error> = {
6
- (error: T): void;
7
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=install.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.types.js","sourceRoot":"","sources":["../../../src/commands/install/install.types.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import { IntegrationDependencies } from '../../apis';
2
- import { KNOWN_PACKAGE_MANAGERS } from './../../helpers/constants';
3
- export declare const getPkgManager: () => (typeof KNOWN_PACKAGE_MANAGERS)[number];
4
- export declare const getCurrentPkgManager: (projectPath?: string) => (typeof KNOWN_PACKAGE_MANAGERS)[number];
5
- export declare const spawnAsync: (command: string, args: string[], path: string) => Promise<number>;
6
- export declare const sanitizeAppName: (appName: string) => string;
7
- export declare const installDependencies: (projectRoot: string, integrationToDependencies?: Record<string, IntegrationDependencies>) => Promise<void>;
8
- export declare const installIntegrationTypes: (projectRoot: string, integrationToDependencies: Record<string, IntegrationDependencies>) => Promise<void>;
@@ -1,130 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.installIntegrationTypes = exports.installDependencies = exports.sanitizeAppName = exports.spawnAsync = exports.getCurrentPkgManager = exports.getPkgManager = void 0;
4
- const tslib_1 = require("tslib");
5
- const cross_spawn_1 = require("cross-spawn");
6
- const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
7
- const path_1 = tslib_1.__importDefault(require("path"));
8
- const rimraf_1 = tslib_1.__importDefault(require("rimraf"));
9
- const core_1 = require("@useparagon/core");
10
- const apis_1 = require("../../apis");
11
- const integration_codegen_1 = require("../../codegen/codegens/integration.codegen");
12
- const intent_codegen_1 = require("../../codegen/codegens/intent.codegen");
13
- const file_1 = require("../../helpers/file");
14
- const new_utils_1 = require("../new/new.utils");
15
- const getPkgManager = () => {
16
- const userAgent = process.env.npm_config_user_agent || '';
17
- if (userAgent.startsWith('yarn')) {
18
- return 'yarn';
19
- }
20
- if (userAgent.startsWith('pnpm')) {
21
- return 'pnpm';
22
- }
23
- if (userAgent.startsWith('bun')) {
24
- return 'bun';
25
- }
26
- return 'npm';
27
- };
28
- exports.getPkgManager = getPkgManager;
29
- const getCurrentPkgManager = (projectPath = process.cwd()) => {
30
- if (fs_extra_1.default.existsSync(path_1.default.join(projectPath, 'package-lock.json'))) {
31
- return 'npm';
32
- }
33
- else if (fs_extra_1.default.existsSync(path_1.default.join(projectPath, 'yarn.lock'))) {
34
- return 'yarn';
35
- }
36
- else if (fs_extra_1.default.existsSync(path_1.default.join(projectPath, 'pnpm-lock.yaml'))) {
37
- return 'pnpm';
38
- }
39
- else if (fs_extra_1.default.existsSync(path_1.default.join(projectPath, 'bun.lockb'))) {
40
- return 'bun';
41
- }
42
- return (0, exports.getPkgManager)();
43
- };
44
- exports.getCurrentPkgManager = getCurrentPkgManager;
45
- const spawnAsync = (command, args, path) => {
46
- return new Promise((resolve, reject) => {
47
- const childProcess = (0, cross_spawn_1.spawn)(command, args, {
48
- stdio: 'inherit',
49
- env: {
50
- ...process.env,
51
- NODE_ENV: 'development',
52
- },
53
- cwd: path,
54
- });
55
- childProcess.on('exit', (code) => {
56
- if (code !== 0) {
57
- return reject(new Error(`Failed command '${command} ${args.join(' ')}' with exit code ${code}`));
58
- }
59
- return resolve(code);
60
- });
61
- });
62
- };
63
- exports.spawnAsync = spawnAsync;
64
- const sanitizeAppName = (appName) => {
65
- return appName
66
- .replace(/([a-z\d])([A-Z])/g, '$1-$2')
67
- .toLowerCase()
68
- .replace(/\s/g, '-');
69
- };
70
- exports.sanitizeAppName = sanitizeAppName;
71
- const installDependencies = async (projectRoot, integrationToDependencies) => {
72
- if (!integrationToDependencies) {
73
- const userIntegrations = await (0, new_utils_1.getCurrentActiveIntegrations)(projectRoot);
74
- integrationToDependencies =
75
- await (0, apis_1.getIntegrationDependencies)(userIntegrations);
76
- }
77
- const packageManager = (0, exports.getCurrentPkgManager)(projectRoot);
78
- await (0, exports.spawnAsync)(packageManager, ['install'], projectRoot);
79
- const integrationPackageDir = path_1.default.join(projectRoot, 'node_modules', '@useparagon', 'types');
80
- await (0, rimraf_1.default)(integrationPackageDir);
81
- await (0, exports.installIntegrationTypes)(projectRoot, integrationToDependencies);
82
- };
83
- exports.installDependencies = installDependencies;
84
- const installIntegrationTypes = async (projectRoot, integrationToDependencies) => {
85
- const integrationPackageDir = path_1.default.join(projectRoot, 'node_modules', '@useparagon', 'types');
86
- for (const [integration, dependencies] of Object.entries(integrationToDependencies)) {
87
- if ((0, core_1.isCustomIntegration)(integration)) {
88
- continue;
89
- }
90
- const sanitizedDependencies = dependencies ?? {
91
- inputs: [],
92
- triggers: [],
93
- intents: [],
94
- };
95
- const integrationPath = path_1.default.join(integrationPackageDir, integration);
96
- await fs_extra_1.default.promises.mkdir(integrationPath, { recursive: true });
97
- const intentsCode = (0, intent_codegen_1.createIntentsCode)(dependencies.intents);
98
- const triggersCode = (0, intent_codegen_1.createIntentsCode)(dependencies.triggers);
99
- const typesCode = (0, integration_codegen_1.typesForIntegration)(integration, sanitizedDependencies);
100
- const utilCode = `
101
- /**
102
- * this should be used whenever we are creating inputs for integrations/workflows
103
- */
104
- exports.createInputs = (inputs)=>inputs;
105
-
106
- /**
107
- * inputs for ${integration}
108
- */
109
- exports.inputs = ${JSON.stringify(sanitizedDependencies.inputs, null, 2)};
110
-
111
- /**
112
- * triggers for ${integration}
113
- */
114
- exports.triggers = ${JSON.stringify(sanitizedDependencies.triggers, null, 2)};
115
-
116
- /**
117
- * intents for ${integration}
118
- */
119
- exports.intents = ${JSON.stringify(sanitizedDependencies.intents, null, 2)};
120
- `;
121
- await Promise.all([
122
- (0, file_1.writeSourceToFile)(integrationPath, 'intents', intentsCode, 'd.ts'),
123
- (0, file_1.writeSourceToFile)(integrationPath, 'triggers', triggersCode, 'd.ts'),
124
- (0, file_1.writeSourceToFile)(integrationPath, 'index', typesCode, 'd.ts'),
125
- (0, file_1.writeSourceToFile)(integrationPath, 'index', utilCode, 'js'),
126
- ]);
127
- }
128
- };
129
- exports.installIntegrationTypes = installIntegrationTypes;
130
- //# sourceMappingURL=install.utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.utils.js","sourceRoot":"","sources":["../../../src/commands/install/install.utils.ts"],"names":[],"mappings":";;;;AACA,6CAAoC;AACpC,gEAA0B;AAC1B,wDAAwB;AACxB,4DAA4B;AAE5B,2CAAuD;AAEvD,qCAGoB;AACpB,oFAAiF;AACjF,0EAA0E;AAC1E,6CAAuD;AACvD,gDAAgE;AAOzD,MAAM,aAAa,GAAG,GAA4C,EAAE;IACzE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC;IAE1D,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAhBW,QAAA,aAAa,iBAgBxB;AAMK,MAAM,oBAAoB,GAAG,CAClC,cAAsB,OAAO,CAAC,GAAG,EAAE,EACM,EAAE;IAC3C,IAAI,kBAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC;QAC/D,OAAO,KAAK,CAAC;IACf,CAAC;SAAM,IAAI,kBAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC;QAC9D,OAAO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new.command';
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./new.command"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/new/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B"}
@@ -1 +0,0 @@
1
- export * from './integration.command';
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./integration.command"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/new/integration/index.ts"],"names":[],"mappings":";;;AAAA,gEAAsC"}
@@ -1,5 +0,0 @@
1
- import { IAction } from '../../command.interface';
2
- import { IntegrationCommandOptions } from './integration.types';
3
- export declare class IntegrationAction implements IAction<IntegrationCommandOptions, void> {
4
- handle(_options: IntegrationCommandOptions): Promise<void>;
5
- }