@useparagon/cli 1.0.12 → 1.0.14-canary.1

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 (105) hide show
  1. package/dist/apis/auth.api.d.ts +1 -1
  2. package/dist/apis/auth.api.js.map +1 -1
  3. package/dist/apis/base.api.js +24 -1
  4. package/dist/apis/base.api.js.map +1 -1
  5. package/dist/apis/index.d.ts +1 -1
  6. package/dist/apis/index.js +1 -1
  7. package/dist/apis/index.js.map +1 -1
  8. package/dist/apis/integration.api.d.ts +1 -1
  9. package/dist/apis/integration.api.js +5 -2
  10. package/dist/apis/integration.api.js.map +1 -1
  11. package/dist/apis/project.api.d.ts +1 -1
  12. package/dist/apis/project.api.js +1 -0
  13. package/dist/apis/project.api.js.map +1 -1
  14. package/dist/apis/types/customTrigger.types.d.ts +56 -0
  15. package/dist/apis/types/customTrigger.types.js +3 -0
  16. package/dist/apis/types/customTrigger.types.js.map +1 -0
  17. package/dist/apis/types/error.types.d.ts +12 -0
  18. package/dist/apis/types/error.types.js +3 -0
  19. package/dist/apis/types/error.types.js.map +1 -0
  20. package/dist/apis/types/index.d.ts +5 -0
  21. package/dist/apis/types/index.js +9 -0
  22. package/dist/apis/types/index.js.map +1 -0
  23. package/dist/apis/{api.types.d.ts → types/integration.types.d.ts} +32 -74
  24. package/dist/apis/types/integration.types.js +3 -0
  25. package/dist/apis/types/integration.types.js.map +1 -0
  26. package/dist/apis/types/project.types.d.ts +57 -0
  27. package/dist/apis/{api.types.js → types/project.types.js} +1 -1
  28. package/dist/apis/types/project.types.js.map +1 -0
  29. package/dist/apis/types/resource.types.d.ts +100 -0
  30. package/dist/apis/types/resource.types.js +41 -0
  31. package/dist/apis/types/resource.types.js.map +1 -0
  32. package/dist/apis/types/user.types.d.ts +6 -0
  33. package/dist/apis/types/user.types.js +3 -0
  34. package/dist/apis/types/user.types.js.map +1 -0
  35. package/dist/apis/types/workflow.types.d.ts +8 -0
  36. package/dist/apis/types/workflow.types.js +3 -0
  37. package/dist/apis/types/workflow.types.js.map +1 -0
  38. package/dist/codegen/codegen.types.d.ts +5 -1
  39. package/dist/codegen/codegen.utils.d.ts +3 -1
  40. package/dist/codegen/codegen.utils.js +96 -9
  41. package/dist/codegen/codegen.utils.js.map +1 -1
  42. package/dist/codegen/codegens/integration.codegen.d.ts +5 -2
  43. package/dist/codegen/codegens/integration.codegen.js +40 -7
  44. package/dist/codegen/codegens/integration.codegen.js.map +1 -1
  45. package/dist/codegen/codegens/intent.codegen.d.ts +1 -1
  46. package/dist/codegen/codegens/intent.codegen.js +3 -0
  47. package/dist/codegen/codegens/intent.codegen.js.map +1 -1
  48. package/dist/codegen/codegens/resource.codegen.d.ts +3 -0
  49. package/dist/codegen/codegens/resource.codegen.js +111 -0
  50. package/dist/codegen/codegens/resource.codegen.js.map +1 -0
  51. package/dist/codegen/codegens/source.codegen.d.ts +1 -1
  52. package/dist/codegen/codegens/source.codegen.js +31 -8
  53. package/dist/codegen/codegens/source.codegen.js.map +1 -1
  54. package/dist/codegen/codegens/trigger.codegen.d.ts +3 -0
  55. package/dist/codegen/codegens/trigger.codegen.js +302 -0
  56. package/dist/codegen/codegens/trigger.codegen.js.map +1 -0
  57. package/dist/codegen/codegens/workflow.codegen.d.ts +1 -1
  58. package/dist/codegen/codegens/workflow.codegen.js +43 -22
  59. package/dist/codegen/codegens/workflow.codegen.js.map +1 -1
  60. package/dist/commands/auth/login/login.types.d.ts +1 -1
  61. package/dist/commands/build/build.types.d.ts +1 -1
  62. package/dist/commands/init/init.action.js +1 -0
  63. package/dist/commands/init/init.action.js.map +1 -1
  64. package/dist/commands/new/integration/integration.action.js +2 -0
  65. package/dist/commands/new/integration/integration.action.js.map +1 -1
  66. package/dist/commands/new/new.command.js +3 -1
  67. package/dist/commands/new/new.command.js.map +1 -1
  68. package/dist/commands/new/trigger/index.d.ts +1 -0
  69. package/dist/commands/new/trigger/index.js +5 -0
  70. package/dist/commands/new/trigger/index.js.map +1 -0
  71. package/dist/commands/new/trigger/trigger.action.d.ts +5 -0
  72. package/dist/commands/new/trigger/trigger.action.js +117 -0
  73. package/dist/commands/new/trigger/trigger.action.js.map +1 -0
  74. package/dist/commands/new/trigger/trigger.command.d.ts +8 -0
  75. package/dist/commands/new/trigger/trigger.command.js +25 -0
  76. package/dist/commands/new/trigger/trigger.command.js.map +1 -0
  77. package/dist/commands/new/trigger/trigger.types.d.ts +3 -0
  78. package/dist/commands/new/trigger/trigger.types.js +3 -0
  79. package/dist/commands/new/trigger/trigger.types.js.map +1 -0
  80. package/dist/commands/new/workflow/workflow.action.js +3 -1
  81. package/dist/commands/new/workflow/workflow.action.js.map +1 -1
  82. package/dist/commands/pull/pull.action.js +10 -1
  83. package/dist/commands/pull/pull.action.js.map +1 -1
  84. package/dist/compiler/compiler.types.d.ts +3 -1
  85. package/dist/compiler/compiler.types.js +1 -1
  86. package/dist/compiler/compiler.types.js.map +1 -1
  87. package/dist/compiler/compilers/changeLog.compiler.d.ts +1 -1
  88. package/dist/compiler/compilers/changeLog.compiler.js +5 -4
  89. package/dist/compiler/compilers/changeLog.compiler.js.map +1 -1
  90. package/dist/compiler/compilers/integrations.compiler.d.ts +5 -1
  91. package/dist/compiler/compilers/integrations.compiler.js +59 -2
  92. package/dist/compiler/compilers/integrations.compiler.js.map +1 -1
  93. package/dist/compiler/compilers/project.compiler.d.ts +1 -0
  94. package/dist/compiler/compilers/project.compiler.js +13 -2
  95. package/dist/compiler/compilers/project.compiler.js.map +1 -1
  96. package/dist/compiler/compilers/resources.compiler.d.ts +15 -0
  97. package/dist/compiler/compilers/resources.compiler.js +174 -0
  98. package/dist/compiler/compilers/resources.compiler.js.map +1 -0
  99. package/dist/compiler/compilers/triggers.compiler.d.ts +12 -0
  100. package/dist/compiler/compilers/triggers.compiler.js +175 -0
  101. package/dist/compiler/compilers/triggers.compiler.js.map +1 -0
  102. package/dist/compiler/compilers/workflows.compiler.d.ts +2 -1
  103. package/dist/compiler/compilers/workflows.compiler.js.map +1 -1
  104. package/package.json +2 -2
  105. package/dist/apis/api.types.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { IUser } from './api.types';
1
+ import { IUser } from './types';
2
2
  export declare const getMe: (overrideConfig?: {
3
3
  baseUrl: string;
4
4
  token: string;
@@ -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,yCAA8C;AAQvC,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"}
@@ -53,8 +53,31 @@ const getToken = async () => {
53
53
  }
54
54
  };
55
55
  exports.getToken = getToken;
56
+ const flattenValidationError = (error) => {
57
+ if (Array.isArray(error)) {
58
+ return error
59
+ .flatMap((error) => {
60
+ return [error, flattenValidationError(error.children || [])].flatMap((error) => typeof error === 'string' ? error : flattenValidationError(error));
61
+ })
62
+ .filter((errorString) => errorString)
63
+ .join(', ');
64
+ }
65
+ return Object.values(error.constraints || {}).join(', ');
66
+ };
56
67
  const logApiError = (apiDescription, error) => {
57
- const errorMessage = error['response']?.['data']?.['message'] || error.message;
68
+ let errorMessage = error.message;
69
+ const errorData = error['response']?.['data'];
70
+ if (typeof error.message === 'string') {
71
+ errorMessage = error.message;
72
+ }
73
+ else if (errorData &&
74
+ errorData.statusCode === 400 &&
75
+ Array.isArray(errorData.message)) {
76
+ errorMessage = flattenValidationError(error.message);
77
+ }
78
+ else if (error) {
79
+ errorMessage = JSON.stringify(error);
80
+ }
58
81
  logger_1.default.fatal(`${apiDescription}
59
82
  - Details: ${errorMessage}`);
60
83
  };
@@ -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;AAE9C,MAAM,WAAW,GAAW,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAMlE,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,4BAAmB,EACvD,mBAAU,CAAC,QAAQ,EACnB,wBAAe,CAChB,CAAC;QAEF,IAAI,CAAC,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,CAAC;IACH,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC,CAAC;AAbW,QAAA,GAAG,OAad;AAOK,MAAM,IAAI,GAAG,KAAK,EAAoB,IAAY,EAAE,IAAO,EAAE,EAAE;IACpE,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAAC,GAAG,MAAM,UAAU,EAAE,IAAI,IAAI,EAAE,EAAE,IAAI,EAAE;QACvE,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,MAAM,IAAA,gBAAQ,GAAE,EAAE;YAC3C,WAAW,EAAE,WAAW;SACzB;KACF,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC,CAAC;AATW,QAAA,IAAI,QASf;AAOK,MAAM,GAAG,GAAG,KAAK,EAAoB,IAAY,EAAE,IAAO,EAAE,EAAE;IACnE,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,MAAM,UAAU,EAAE,IAAI,IAAI,EAAE,EAAE,IAAI,EAAE;QACtE,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,MAAM,IAAA,gBAAQ,GAAE,EAAE;YAC3C,WAAW,EAAE,WAAW;SACzB;KACF,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC,CAAC;AATW,QAAA,GAAG,OASd"}
@@ -1,4 +1,4 @@
1
- export * from './api.types';
2
1
  export * from './auth.api';
3
2
  export * from './integration.api';
4
3
  export * from './project.api';
4
+ export * from './types';
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./api.types"), exports);
5
4
  tslib_1.__exportStar(require("./auth.api"), exports);
6
5
  tslib_1.__exportStar(require("./integration.api"), exports);
7
6
  tslib_1.__exportStar(require("./project.api"), exports);
7
+ tslib_1.__exportStar(require("./types"), exports);
8
8
  //# 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,qDAA2B;AAC3B,4DAAkC;AAClC,wDAA8B;AAC9B,kDAAwB"}
@@ -1,3 +1,3 @@
1
- import { IntegrationDependencies, IntegrationMetadata } from './api.types';
1
+ import { IntegrationDependencies, IntegrationMetadata } from './types';
2
2
  export declare const getIntegrationDependencies: (integrations: string[]) => Promise<Record<string, IntegrationDependencies>>;
3
3
  export declare const getDefaultIntegrations: () => Promise<IntegrationMetadata[]>;
@@ -7,9 +7,12 @@ const getIntegrationDependencies = async (integrations) => {
7
7
  const nativeIntegrations = integrations.filter((integration) => !(0, core_1.isCustomIntegration)(integration));
8
8
  try {
9
9
  const integrationTypes = await (0, base_api_1.post)('graphite/integrations', {
10
- integrations: nativeIntegrations
10
+ integrations: nativeIntegrations,
11
11
  });
12
- return Object.fromEntries(nativeIntegrations.map((integration, index) => ([integration, integrationTypes[index]])));
12
+ return Object.fromEntries(nativeIntegrations.map((integration, index) => [
13
+ integration,
14
+ integrationTypes[index],
15
+ ]));
13
16
  }
14
17
  catch (error) {
15
18
  return (0, base_api_1.logApiError)('Failed to get integration data.', error);
@@ -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;IACrH,IAAI,CAAC;QACH,MAAM,gB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KAAK,EAAE,EAAE,CAAC;YAC7C,WAAW;YACX,gBAAgB,CAAC,KAAK,CAAC;SACxB,CAAC,CACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAA,sBAAW,EAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC,CAAC;AAtBW,QAAA,0BAA0B,8BAsBrC;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"}
@@ -1,4 +1,4 @@
1
- import { ProjectBuild, ProjectComparison } from './api.types';
1
+ import { ProjectBuild, ProjectComparison } from './types';
2
2
  export declare const getProjectList: () => Promise<{
3
3
  title: string;
4
4
  id: string;
@@ -39,6 +39,7 @@ const getProjectBuild = async (projectId) => {
39
39
  events: {},
40
40
  secrets: [],
41
41
  persona: { meta: {} },
42
+ resources: {},
42
43
  };
43
44
  }
44
45
  return (0, base_api_1.logApiError)('Failed to get project.', error);
@@ -1 +1 @@
1
- {"version":3,"file":"project.api.js","sourceRoot":"","sources":["../../src/apis/project.api.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AAOvD,yCAAyD;AACzD,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,kB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AA,WAAW,eAMtB;AAEK,MAAM,yBAAyB,GAAG,KAAK,EAC5C,mBAAiC,EACL,EAAE;IAC9B,IAAI,CAAC;QACH,MAAM,UAAU,GAAsB,MAAM,IAAA,eAAI,EAC9C,qBAAqB,mBAAmB,CAAC,SAAS,aAAa,EAC/D,mBAAmB,CACpB,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAA,sBAAW,EAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC;AACH,CAAC,CAAC;AAbW,QAAA,yBAAyB,6BAapC"}
@@ -0,0 +1,56 @@
1
+ import { DataType, KeyedSource, TokenizedSource } from '@useparagon/core/resolvers';
2
+ import { HttpMethod, RequestBodyType } from '@useparagon/core/steps/library/request';
3
+ import { CustomTriggerPayloadValidationScheme, SetupResponseType, TriggerSubscription, WebhookTriggerLevel } from '@useparagon/core/triggers/customTrigger';
4
+ export type CustomTriggerSetupResponse = {
5
+ type: SetupResponseType.DEFAULT | SetupResponseType.ECHO_REQUEST_BODY;
6
+ } | {
7
+ type: SetupResponseType.CUSTOM_CODE;
8
+ code: string;
9
+ parameters: KeyedSource<DataType.STRING>[];
10
+ };
11
+ export type CustomTriggerPayloadValidationOption = {
12
+ scheme: CustomTriggerPayloadValidationScheme.NONE;
13
+ } | {
14
+ scheme: CustomTriggerPayloadValidationScheme.CUSTOM;
15
+ parameters: KeyedSource<DataType.STRING>[];
16
+ code: string;
17
+ } | {
18
+ scheme: CustomTriggerPayloadValidationScheme.SHA_1_BASE64_PAYLOAD_BODY | CustomTriggerPayloadValidationScheme.SHA_1_HEX_PAYLOAD_BODY | CustomTriggerPayloadValidationScheme.SHA_256_BASE64_PAYLOAD_BODY | CustomTriggerPayloadValidationScheme.SHA_256_HEX_PAYLOAD_BODY;
19
+ webhookSecret: TokenizedSource<DataType.STRING>;
20
+ webhookSignatureHeader: TokenizedSource<DataType.STRING>;
21
+ };
22
+ export type CustomTriggerSetupOption = {
23
+ url: TokenizedSource<DataType.STRING>;
24
+ httpMethod: HttpMethod;
25
+ params: KeyedSource<DataType.STRING>[];
26
+ headers: KeyedSource<DataType.STRING>[];
27
+ body: KeyedSource[];
28
+ bodyType?: RequestBodyType;
29
+ rawBody?: TokenizedSource<DataType.STRING>;
30
+ response?: CustomTriggerSetupResponse;
31
+ };
32
+ export type CustomTriggerTearDownOption = {
33
+ url: TokenizedSource<DataType.STRING>;
34
+ httpMethod: HttpMethod;
35
+ params: KeyedSource<DataType.STRING>[];
36
+ headers: KeyedSource<DataType.STRING>[];
37
+ body: KeyedSource[];
38
+ bodyType?: RequestBodyType;
39
+ rawBody?: TokenizedSource<DataType.STRING>;
40
+ };
41
+ export type CustomTriggerOptions = {
42
+ triggerSubscription: TriggerSubscription;
43
+ triggerLevel: WebhookTriggerLevel;
44
+ setup: CustomTriggerSetupOption;
45
+ tearDown: CustomTriggerTearDownOption;
46
+ providerId?: TokenizedSource<DataType.STRING>;
47
+ payloadValidationOptions?: CustomTriggerPayloadValidationOption;
48
+ profileConfigKey?: TokenizedSource<DataType.STRING>;
49
+ };
50
+ export interface ICustomTrigger {
51
+ id: string;
52
+ name: string;
53
+ description: string;
54
+ options: CustomTriggerOptions;
55
+ isConfigured: boolean;
56
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=customTrigger.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customTrigger.types.js","sourceRoot":"","sources":["../../../src/apis/types/customTrigger.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ export type ValidationError = {
2
+ target?: Record<string, any>;
3
+ property: string;
4
+ value?: any;
5
+ constraints?: {
6
+ [type: string]: string;
7
+ };
8
+ children?: ValidationError[];
9
+ contexts?: {
10
+ [type: string]: any;
11
+ };
12
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=error.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.types.js","sourceRoot":"","sources":["../../../src/apis/types/error.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export * from './customTrigger.types';
2
+ export * from './integration.types';
3
+ export * from './project.types';
4
+ export * from './user.types';
5
+ export * from './workflow.types';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./customTrigger.types"), exports);
5
+ tslib_1.__exportStar(require("./integration.types"), exports);
6
+ tslib_1.__exportStar(require("./project.types"), exports);
7
+ tslib_1.__exportStar(require("./user.types"), exports);
8
+ tslib_1.__exportStar(require("./workflow.types"), exports);
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/apis/types/index.ts"],"names":[],"mappings":";;;AAAA,gEAAsC;AACtC,8DAAoC;AACpC,0DAAgC;AAChC,uDAA6B;AAC7B,2DAAiC"}
@@ -1,11 +1,30 @@
1
- import { AuthenticationScheme, IStep } from '@useparagon/core';
2
- import { IEvent } from '@useparagon/core/event';
1
+ import { AuthenticationScheme } from '@useparagon/core';
3
2
  import { InputSource, SerializedInput, SidebarInputType } from '@useparagon/core/inputs';
4
- import { ConnectPortalThemeValues } from '@useparagon/core/integration';
5
- import { IPersona } from '@useparagon/core/persona';
6
- import { DataType, Operator, OrConditions, TokenizedSource } from '@useparagon/core/resolvers';
7
- import { ISecret, SecretDTO } from '@useparagon/core/secret';
8
- import { RequestAuthorization } from '@useparagon/core/steps/library/request';
3
+ import { ConnectPortalThemeValues, ConnectUserProfileConfigStrategy } from '@useparagon/core/integration';
4
+ import { DataType, KeyedSource, Operator, OrConditions, TokenizedSource } from '@useparagon/core/resolvers';
5
+ import { HttpMethod, RequestAuthorization, RequestBodyType } from '@useparagon/core/steps/library/request';
6
+ import { ICustomTrigger } from './customTrigger.types';
7
+ import { WorkflowBuild } from './workflow.types';
8
+ type EmptyStrategy = {
9
+ strategy?: undefined;
10
+ };
11
+ export type HTTPStrategyConfig = {
12
+ strategy: ConnectUserProfileConfigStrategy.HTTP;
13
+ userProfileRequestUrl: TokenizedSource<DataType.STRING>;
14
+ urlParameters: Array<KeyedSource<DataType.STRING>>;
15
+ headers: Array<KeyedSource<DataType.STRING>>;
16
+ rawBody: TokenizedSource<DataType.STRING>;
17
+ body: Array<KeyedSource<DataType.ANY>>;
18
+ requireSuccess: boolean;
19
+ requestMethod: HttpMethod;
20
+ requestBodyType: RequestBodyType;
21
+ };
22
+ export type JWTStrategyConfig = {
23
+ strategy: ConnectUserProfileConfigStrategy.JWT;
24
+ tokenPayload: TokenizedSource<DataType.STRING>;
25
+ requireSuccess: boolean;
26
+ };
27
+ export type UserProfileConfig = EmptyStrategy | HTTPStrategyConfig | JWTStrategyConfig;
9
28
  export type InputKeyVisibilityConfig = {
10
29
  inputId: string;
11
30
  path?: string[];
@@ -84,14 +103,12 @@ export interface ICustomIntegration {
84
103
  testEndpointPath?: TokenizedSource<DataType.STRING>;
85
104
  apiAuthorization?: RequestAuthorization;
86
105
  isPublished?: boolean;
106
+ userProfileConfig?: UserProfileConfig;
87
107
  }
88
- export interface WorkflowBuild {
89
- id: string;
108
+ export type IntegrationMetadata = {
90
109
  name: string;
91
- steps: IStep[];
92
- isDraft?: boolean;
93
- dateCreated?: string;
94
- }
110
+ title: string;
111
+ };
95
112
  export interface IntegrationBuild {
96
113
  id: string;
97
114
  config: {
@@ -102,65 +119,6 @@ export interface IntegrationBuild {
102
119
  active?: boolean;
103
120
  dependencies?: IntegrationDependencies;
104
121
  customIntegration?: ICustomIntegration;
122
+ customTriggers?: Record<string, ICustomTrigger>;
105
123
  }
106
- export interface ProjectBuild {
107
- projectId: string;
108
- projectName?: string;
109
- events: Record<string, IEvent>;
110
- persona: IPersona;
111
- integrations: Record<string, IntegrationBuild | undefined>;
112
- secrets: (ISecret | SecretDTO)[];
113
- }
114
- export type EntityDiffBase = {
115
- added: string[];
116
- deleted: string[];
117
- updated: string[];
118
- };
119
- export declare enum ProjectEntity {
120
- AppEvent = "events",
121
- CustomIntegration = "customIntegrations",
122
- Integration = "integrations",
123
- IntegrationConfig = "configs",
124
- Workflow = "workflows",
125
- Step = "steps",
126
- Secret = "secret"
127
- }
128
- export type ProjectComparison = {
129
- comparisonDiff: Partial<Record<ProjectEntity, EntityDiffBase>>;
130
- defaultEnabledWorkflows: WorkflowDefaultEnableChangeLog[];
131
- requiredSettings: IntegrationInputChangeLog[];
132
- integrationsRequiredOauthConfig: string[];
133
- disabledIntegrations: string[];
134
- integrationNameMap: Record<string, string>;
135
- };
136
- export type AffectedPersona = {
137
- personaId: string;
138
- endUserId: string;
139
- integrationId: string;
140
- connectCredentialId: string;
141
- name: string | undefined;
142
- email: string | undefined;
143
- };
144
- export type IntegrationInputChangeLog = {
145
- inputTitle: string;
146
- integrationId: string;
147
- integrationType: string;
148
- affectedUsers: AffectedPersona[];
149
- workflowId?: string;
150
- };
151
- export type WorkflowDefaultEnableChangeLog = {
152
- integrationId: string;
153
- integrationType: string;
154
- affectedUsers: AffectedPersona[];
155
- workflowId: string;
156
- };
157
- export type IUser = {
158
- firstName: string;
159
- middleName: string;
160
- lastName: string;
161
- email: string;
162
- };
163
- export type IntegrationMetadata = {
164
- name: string;
165
- title: string;
166
- };
124
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=integration.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.types.js","sourceRoot":"","sources":["../../../src/apis/types/integration.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,57 @@
1
+ import { IEvent } from '@useparagon/core/event';
2
+ import { IPersona } from '@useparagon/core/persona';
3
+ import { ISecret, SecretDTO } from '@useparagon/core/secret';
4
+ import { IntegrationBuild } from './integration.types';
5
+ import { ResourceBuild } from './resource.types';
6
+ export interface ProjectBuild {
7
+ projectId: string;
8
+ projectName?: string;
9
+ events: Record<string, IEvent>;
10
+ persona: IPersona;
11
+ integrations: Record<string, IntegrationBuild | undefined>;
12
+ secrets: (ISecret | SecretDTO)[];
13
+ resources: Record<string, ResourceBuild>;
14
+ }
15
+ export type EntityDiffBase = {
16
+ added: string[];
17
+ deleted: string[];
18
+ updated: string[];
19
+ };
20
+ export declare enum ProjectEntity {
21
+ AppEvent = "events",
22
+ CustomIntegration = "customIntegrations",
23
+ Integration = "integrations",
24
+ IntegrationConfig = "configs",
25
+ Workflow = "workflows",
26
+ Step = "steps",
27
+ Secret = "secret"
28
+ }
29
+ export type ProjectComparison = {
30
+ comparisonDiff: Partial<Record<ProjectEntity, EntityDiffBase>>;
31
+ defaultEnabledWorkflows: WorkflowDefaultEnableChangeLog[];
32
+ requiredSettings: IntegrationInputChangeLog[];
33
+ integrationsRequiredOauthConfig: string[];
34
+ disabledIntegrations: string[];
35
+ integrationNameMap: Record<string, string>;
36
+ };
37
+ export type AffectedPersona = {
38
+ personaId: string;
39
+ endUserId: string;
40
+ integrationId: string;
41
+ connectCredentialId: string;
42
+ name: string | undefined;
43
+ email: string | undefined;
44
+ };
45
+ export type IntegrationInputChangeLog = {
46
+ inputTitle: string;
47
+ integrationId: string;
48
+ integrationType: string;
49
+ affectedUsers: AffectedPersona[];
50
+ workflowId?: string;
51
+ };
52
+ export type WorkflowDefaultEnableChangeLog = {
53
+ integrationId: string;
54
+ integrationType: string;
55
+ affectedUsers: AffectedPersona[];
56
+ workflowId: string;
57
+ };
@@ -11,4 +11,4 @@ var ProjectEntity;
11
11
  ProjectEntity["Step"] = "steps";
12
12
  ProjectEntity["Secret"] = "secret";
13
13
  })(ProjectEntity || (exports.ProjectEntity = ProjectEntity = {}));
14
- //# sourceMappingURL=api.types.js.map
14
+ //# sourceMappingURL=project.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.types.js","sourceRoot":"","sources":["../../../src/apis/types/project.types.ts"],"names":[],"mappings":";;;AA2DA,IAAY,aAQX;AARD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,yDAAwC,CAAA;IACxC,6CAA4B,CAAA;IAC5B,8CAA6B,CAAA;IAC7B,uCAAsB,CAAA;IACtB,+BAAc,CAAA;IACd,kCAAiB,CAAA;AACnB,CAAC,EARW,aAAa,6BAAb,aAAa,QAQxB"}
@@ -0,0 +1,100 @@
1
+ import { DataType, KeyedSource, TokenizedSource } from '@useparagon/core/resolvers';
2
+ import { HttpMethod, RequestBodyType } from '@useparagon/core/steps/library/request';
3
+ import { UserProfileConfig } from '../types/integration.types';
4
+ import { ICustomTrigger } from './customTrigger.types';
5
+ export declare enum OAUTH_CLIENT_CREDENTIAL_REQUEST_TYPE {
6
+ BodyParam = "body-param",
7
+ BasicAuthHeader = "basic-auth-header"
8
+ }
9
+ export declare enum ResourceCategory {
10
+ API = "api"
11
+ }
12
+ export declare enum ResourceAuthorizationType {
13
+ NONE = "none",
14
+ OAUTH = "oauth",
15
+ OAUTH_CLIENT_CREDENTIAL = "oauth_client_credential",
16
+ API_KEY = "api_key"
17
+ }
18
+ export declare enum ResourceConfigurationStep {
19
+ Step1_basicInfo = "step1_basicInfo",
20
+ Step2_OAuth = "step2_oauthInfo",
21
+ Step2_Client_Credential = "step2_client_credential",
22
+ Step2_API = "step2_apiInfo",
23
+ Step3_Request = "step3_request",
24
+ Step4_Test = "step4_test"
25
+ }
26
+ export declare enum ResourceRequestAuthenticationType {
27
+ BEARER_TOKEN = "bearer",
28
+ BASIC = "basic",
29
+ QUERY_PARAMS = "query_params",
30
+ AUTH_HEADER = "auth_header"
31
+ }
32
+ export declare enum ResourceConnectionScope {
33
+ APP = "APP",
34
+ USER = "USER"
35
+ }
36
+ export type ResolvedTestRequestOptions = {
37
+ url: string;
38
+ headers: Record<string, string>;
39
+ httpMethod: HttpMethod;
40
+ body: any;
41
+ };
42
+ export type APIResourceOptions = {
43
+ type: ResourceCategory.API;
44
+ testRequestOptions?: {
45
+ url: TokenizedSource<DataType.STRING>;
46
+ headers: KeyedSource<DataType.STRING>[];
47
+ params: KeyedSource<DataType.STRING>[];
48
+ httpMethod: `${HttpMethod}`;
49
+ bodyType: `${RequestBodyType}`;
50
+ body: KeyedSource<DataType.ANY>[];
51
+ rawBody: TokenizedSource<DataType.STRING>;
52
+ };
53
+ userProfileConfig?: UserProfileConfig;
54
+ requestOptions: {
55
+ apiBaseUrl: TokenizedSource<DataType.STRING>;
56
+ authentication: {
57
+ type: 'bearer';
58
+ token: TokenizedSource<DataType.STRING>;
59
+ } | {
60
+ type: 'basic';
61
+ userName: TokenizedSource<DataType.STRING>;
62
+ password: TokenizedSource<DataType.STRING>;
63
+ } | {
64
+ type: 'query_params';
65
+ params: KeyedSource<DataType.STRING>[];
66
+ } | {
67
+ type: 'auth_header';
68
+ headers: KeyedSource<DataType.STRING>[];
69
+ };
70
+ };
71
+ authorizationOptions: {
72
+ type: ResourceAuthorizationType.NONE;
73
+ } | {
74
+ type: ResourceAuthorizationType.OAUTH;
75
+ accessTokenUrl: TokenizedSource<DataType.STRING>;
76
+ scopes?: string;
77
+ userInputs: string[];
78
+ includeClientIdClientSecretInExchange?: boolean;
79
+ } | {
80
+ type: ResourceAuthorizationType.API_KEY;
81
+ userInputs?: string[];
82
+ } | {
83
+ type: ResourceAuthorizationType.OAUTH_CLIENT_CREDENTIAL;
84
+ accessTokenUrl: TokenizedSource<DataType.STRING>;
85
+ audience?: string;
86
+ scopes?: string;
87
+ userInputs: string[];
88
+ includeClientIdClientSecretInExchange?: boolean;
89
+ };
90
+ };
91
+ export interface ResourceBuild {
92
+ id: string;
93
+ name: string;
94
+ category: ResourceCategory;
95
+ connectionScope: `${ResourceConnectionScope}`;
96
+ options: APIResourceOptions;
97
+ slug: string;
98
+ isPublished: boolean;
99
+ customTriggers?: Record<string, ICustomTrigger>;
100
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResourceConnectionScope = exports.ResourceRequestAuthenticationType = exports.ResourceConfigurationStep = exports.ResourceAuthorizationType = exports.ResourceCategory = exports.OAUTH_CLIENT_CREDENTIAL_REQUEST_TYPE = void 0;
4
+ var OAUTH_CLIENT_CREDENTIAL_REQUEST_TYPE;
5
+ (function (OAUTH_CLIENT_CREDENTIAL_REQUEST_TYPE) {
6
+ OAUTH_CLIENT_CREDENTIAL_REQUEST_TYPE["BodyParam"] = "body-param";
7
+ OAUTH_CLIENT_CREDENTIAL_REQUEST_TYPE["BasicAuthHeader"] = "basic-auth-header";
8
+ })(OAUTH_CLIENT_CREDENTIAL_REQUEST_TYPE || (exports.OAUTH_CLIENT_CREDENTIAL_REQUEST_TYPE = OAUTH_CLIENT_CREDENTIAL_REQUEST_TYPE = {}));
9
+ var ResourceCategory;
10
+ (function (ResourceCategory) {
11
+ ResourceCategory["API"] = "api";
12
+ })(ResourceCategory || (exports.ResourceCategory = ResourceCategory = {}));
13
+ var ResourceAuthorizationType;
14
+ (function (ResourceAuthorizationType) {
15
+ ResourceAuthorizationType["NONE"] = "none";
16
+ ResourceAuthorizationType["OAUTH"] = "oauth";
17
+ ResourceAuthorizationType["OAUTH_CLIENT_CREDENTIAL"] = "oauth_client_credential";
18
+ ResourceAuthorizationType["API_KEY"] = "api_key";
19
+ })(ResourceAuthorizationType || (exports.ResourceAuthorizationType = ResourceAuthorizationType = {}));
20
+ var ResourceConfigurationStep;
21
+ (function (ResourceConfigurationStep) {
22
+ ResourceConfigurationStep["Step1_basicInfo"] = "step1_basicInfo";
23
+ ResourceConfigurationStep["Step2_OAuth"] = "step2_oauthInfo";
24
+ ResourceConfigurationStep["Step2_Client_Credential"] = "step2_client_credential";
25
+ ResourceConfigurationStep["Step2_API"] = "step2_apiInfo";
26
+ ResourceConfigurationStep["Step3_Request"] = "step3_request";
27
+ ResourceConfigurationStep["Step4_Test"] = "step4_test";
28
+ })(ResourceConfigurationStep || (exports.ResourceConfigurationStep = ResourceConfigurationStep = {}));
29
+ var ResourceRequestAuthenticationType;
30
+ (function (ResourceRequestAuthenticationType) {
31
+ ResourceRequestAuthenticationType["BEARER_TOKEN"] = "bearer";
32
+ ResourceRequestAuthenticationType["BASIC"] = "basic";
33
+ ResourceRequestAuthenticationType["QUERY_PARAMS"] = "query_params";
34
+ ResourceRequestAuthenticationType["AUTH_HEADER"] = "auth_header";
35
+ })(ResourceRequestAuthenticationType || (exports.ResourceRequestAuthenticationType = ResourceRequestAuthenticationType = {}));
36
+ var ResourceConnectionScope;
37
+ (function (ResourceConnectionScope) {
38
+ ResourceConnectionScope["APP"] = "APP";
39
+ ResourceConnectionScope["USER"] = "USER";
40
+ })(ResourceConnectionScope || (exports.ResourceConnectionScope = ResourceConnectionScope = {}));
41
+ //# sourceMappingURL=resource.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.types.js","sourceRoot":"","sources":["../../../src/apis/types/resource.types.ts"],"names":[],"mappings":";;;AAaA,IAAY,oCAGX;AAHD,WAAY,oCAAoC;IAC9C,gEAAwB,CAAA;IACxB,6EAAqC,CAAA;AACvC,CAAC,EAHW,oCAAoC,oDAApC,oCAAoC,QAG/C;AAED,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;AACb,CAAC,EAFW,gBAAgB,gCAAhB,gBAAgB,QAE3B;AAED,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACnC,0CAAa,CAAA;IACb,4CAAe,CAAA;IACf,gFAAmD,CAAA;IACnD,gDAAmB,CAAA;AACrB,CAAC,EALW,yBAAyB,yCAAzB,yBAAyB,QAKpC;AAED,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACnC,gEAAmC,CAAA;IACnC,4DAA+B,CAAA;IAC/B,gFAAmD,CAAA;IACnD,wDAA2B,CAAA;IAC3B,4DAA+B,CAAA;IAC/B,sDAAyB,CAAA;AAC3B,CAAC,EAPW,yBAAyB,yCAAzB,yBAAyB,QAOpC;AAED,IAAY,iCAKX;AALD,WAAY,iCAAiC;IAC3C,4DAAuB,CAAA;IACvB,oDAAe,CAAA;IACf,kEAA6B,CAAA;IAC7B,gEAA2B,CAAA;AAC7B,CAAC,EALW,iCAAiC,iDAAjC,iCAAiC,QAK5C;AAED,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,sCAAW,CAAA;IACX,wCAAa,CAAA;AACf,CAAC,EAHW,uBAAuB,uCAAvB,uBAAuB,QAGlC"}
@@ -0,0 +1,6 @@
1
+ export type IUser = {
2
+ firstName: string;
3
+ middleName: string;
4
+ lastName: string;
5
+ email: string;
6
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=user.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.types.js","sourceRoot":"","sources":["../../../src/apis/types/user.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { IStep } from '@useparagon/core';
2
+ export interface WorkflowBuild {
3
+ id: string;
4
+ name: string;
5
+ steps: IStep[];
6
+ isDraft?: boolean;
7
+ dateCreated?: string;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=workflow.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.types.js","sourceRoot":"","sources":["../../../src/apis/types/workflow.types.ts"],"names":[],"mappings":""}