@supernova-studio/model 0.47.19 → 0.47.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +214 -61
- package/dist/index.d.ts +214 -61
- package/dist/index.js +26 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/export/export-destinations.ts +16 -0
- package/src/integrations/integration.ts +8 -6
- package/src/utils/errors.ts +6 -1
package/package.json
CHANGED
|
@@ -20,6 +20,10 @@ export const ExporterDestinationGithub = z.object({
|
|
|
20
20
|
// Location
|
|
21
21
|
branch: z.string(),
|
|
22
22
|
relativePath: nullishToOptional(z.string()),
|
|
23
|
+
|
|
24
|
+
// Legacy deprecated fields. Use `credentialId` instead
|
|
25
|
+
connectionId: z.string().optional(),
|
|
26
|
+
userId: z.number().optional(),
|
|
23
27
|
});
|
|
24
28
|
|
|
25
29
|
export const ExporterDestinationAzure = z.object({
|
|
@@ -36,6 +40,10 @@ export const ExporterDestinationAzure = z.object({
|
|
|
36
40
|
|
|
37
41
|
// Maybe not needed
|
|
38
42
|
url: nullishToOptional(z.string()),
|
|
43
|
+
|
|
44
|
+
// Legacy deprecated fields. Use `credentialId` instead
|
|
45
|
+
connectionId: z.string().optional(),
|
|
46
|
+
userId: z.number().optional(),
|
|
39
47
|
});
|
|
40
48
|
|
|
41
49
|
export const ExporterDestinationGitlab = z.object({
|
|
@@ -50,6 +58,10 @@ export const ExporterDestinationGitlab = z.object({
|
|
|
50
58
|
|
|
51
59
|
// Maybe not needed
|
|
52
60
|
url: nullishToOptional(z.string()),
|
|
61
|
+
|
|
62
|
+
// Legacy deprecated fields. Use `credentialId` instead
|
|
63
|
+
connectionId: z.string().optional(),
|
|
64
|
+
userId: z.number().optional(),
|
|
53
65
|
});
|
|
54
66
|
|
|
55
67
|
export const ExporterDestinationBitbucket = z.object({
|
|
@@ -63,6 +75,10 @@ export const ExporterDestinationBitbucket = z.object({
|
|
|
63
75
|
// Location
|
|
64
76
|
branch: z.string(),
|
|
65
77
|
relativePath: nullishToOptional(z.string()),
|
|
78
|
+
|
|
79
|
+
// Legacy deprecated fields. Use `credentialId` instead
|
|
80
|
+
connectionId: z.string().optional(),
|
|
81
|
+
userId: z.number().optional(),
|
|
66
82
|
});
|
|
67
83
|
|
|
68
84
|
export const ExportDestinationsMap = z.object({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { nullishToOptional } from "../helpers";
|
|
2
3
|
import { UserMinified } from "../users/user-minified";
|
|
3
4
|
|
|
4
5
|
export const IntegrationDesignSystem = z.object({
|
|
@@ -15,12 +16,12 @@ export const IntegrationCredentialsType = z.enum(["OAuth2", "PAT", "GithubApp"])
|
|
|
15
16
|
export type IntegrationCredentialsType = z.infer<typeof IntegrationCredentialsType>;
|
|
16
17
|
|
|
17
18
|
export const IntegrationCredentialsProfile = z.object({
|
|
18
|
-
id: z.string(),
|
|
19
|
-
email: z.string()
|
|
20
|
-
handle: z.string()
|
|
21
|
-
type: z.string()
|
|
22
|
-
avatarUrl: z.string()
|
|
23
|
-
organization: z.string()
|
|
19
|
+
id: nullishToOptional(z.string()),
|
|
20
|
+
email: nullishToOptional(z.string()),
|
|
21
|
+
handle: nullishToOptional(z.string()),
|
|
22
|
+
type: nullishToOptional(z.string()),
|
|
23
|
+
avatarUrl: nullishToOptional(z.string()),
|
|
24
|
+
organization: nullishToOptional(z.string()),
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
export type IntegrationCredentialsProfile = z.infer<typeof IntegrationCredentialsProfile>;
|
|
@@ -37,6 +38,7 @@ export const IntegrationCredentials = z.object({
|
|
|
37
38
|
expiresAt: z.coerce.date().optional(),
|
|
38
39
|
refreshedAt: z.coerce.date().optional(),
|
|
39
40
|
username: z.string().optional(),
|
|
41
|
+
appInstallationId: z.string().optional(),
|
|
40
42
|
profile: IntegrationCredentialsProfile.optional(),
|
|
41
43
|
customUrl: z.string().optional(),
|
|
42
44
|
user: UserMinified.optional(),
|
package/src/utils/errors.ts
CHANGED
|
@@ -17,7 +17,8 @@ export type SupernovaExceptionType =
|
|
|
17
17
|
| "MissingIntegration"
|
|
18
18
|
| "NoAccess"
|
|
19
19
|
| "MissingCredentials"
|
|
20
|
-
| "ValidationError"
|
|
20
|
+
| "ValidationError"
|
|
21
|
+
| "ThirdPartyError";
|
|
21
22
|
|
|
22
23
|
export class SupernovaException extends Error {
|
|
23
24
|
static wrongFormat(message?: string): SupernovaException {
|
|
@@ -92,6 +93,10 @@ export class SupernovaException extends Error {
|
|
|
92
93
|
return new SupernovaException("MissingCredentials", message);
|
|
93
94
|
}
|
|
94
95
|
|
|
96
|
+
static thirdPartyError(message?: string): SupernovaException {
|
|
97
|
+
return new SupernovaException("ThirdPartyError", message);
|
|
98
|
+
}
|
|
99
|
+
|
|
95
100
|
//
|
|
96
101
|
// To refactor
|
|
97
102
|
//
|