@amodalai/core 0.1.3 → 0.1.5
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/src/repo/connection-schemas.d.ts +6 -6
- package/dist/src/repo/connection-schemas.js +2 -2
- package/dist/src/repo/connection-schemas.js.map +1 -1
- package/dist/src/repo/spec-syncer.js +21 -4
- package/dist/src/repo/spec-syncer.js.map +1 -1
- package/dist/src/runtime/connection-bridge.d.ts +1 -1
- package/dist/src/runtime/connection-bridge.js +2 -4
- package/dist/src/runtime/connection-bridge.js.map +1 -1
- package/dist/src/snapshot/snapshot-types.d.ts +24 -24
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -8,8 +8,8 @@ import { z } from 'zod';
|
|
|
8
8
|
* Schema for spec.json — the structural layer of a connection.
|
|
9
9
|
*/
|
|
10
10
|
export declare const ConnectionSpecSchema: z.ZodObject<{
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
baseUrl: z.ZodString;
|
|
12
|
+
specUrl: z.ZodOptional<z.ZodString>;
|
|
13
13
|
format: z.ZodEnum<["openapi", "graphql", "grpc", "rest", "aws-api"]>;
|
|
14
14
|
auth: z.ZodOptional<z.ZodObject<{
|
|
15
15
|
type: z.ZodString;
|
|
@@ -54,14 +54,14 @@ export declare const ConnectionSpecSchema: z.ZodObject<{
|
|
|
54
54
|
exclude_paths?: string[] | undefined;
|
|
55
55
|
}>>;
|
|
56
56
|
}, "strip", z.ZodTypeAny, {
|
|
57
|
-
|
|
57
|
+
baseUrl: string;
|
|
58
58
|
format: "openapi" | "graphql" | "grpc" | "rest" | "aws-api";
|
|
59
59
|
filter?: {
|
|
60
60
|
tags?: string[] | undefined;
|
|
61
61
|
include_paths?: string[] | undefined;
|
|
62
62
|
exclude_paths?: string[] | undefined;
|
|
63
63
|
} | undefined;
|
|
64
|
-
|
|
64
|
+
specUrl?: string | undefined;
|
|
65
65
|
auth?: {
|
|
66
66
|
type: string;
|
|
67
67
|
token?: string | undefined;
|
|
@@ -74,14 +74,14 @@ export declare const ConnectionSpecSchema: z.ZodObject<{
|
|
|
74
74
|
notify_drift: boolean;
|
|
75
75
|
} | undefined;
|
|
76
76
|
}, {
|
|
77
|
-
|
|
77
|
+
baseUrl: string;
|
|
78
78
|
format: "openapi" | "graphql" | "grpc" | "rest" | "aws-api";
|
|
79
79
|
filter?: {
|
|
80
80
|
tags?: string[] | undefined;
|
|
81
81
|
include_paths?: string[] | undefined;
|
|
82
82
|
exclude_paths?: string[] | undefined;
|
|
83
83
|
} | undefined;
|
|
84
|
-
|
|
84
|
+
specUrl?: string | undefined;
|
|
85
85
|
auth?: {
|
|
86
86
|
type: string;
|
|
87
87
|
token?: string | undefined;
|
|
@@ -8,8 +8,8 @@ import { z } from 'zod';
|
|
|
8
8
|
* Schema for spec.json — the structural layer of a connection.
|
|
9
9
|
*/
|
|
10
10
|
export const ConnectionSpecSchema = z.object({
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
baseUrl: z.string().min(1),
|
|
12
|
+
specUrl: z.string().min(1).optional(),
|
|
13
13
|
format: z.enum(['openapi', 'graphql', 'grpc', 'rest', 'aws-api']),
|
|
14
14
|
auth: z
|
|
15
15
|
.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-schemas.js","sourceRoot":"","sources":["../../../src/repo/connection-schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,
|
|
1
|
+
{"version":3,"file":"connection-schemas.js","sourceRoot":"","sources":["../../../src/repo/connection-schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CA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AC,CAAC;IAClC,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,oBAAoB,CAAC;IACrD,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,QAAQ,EAAE;IAC7D,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpF,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;QACnC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACtC,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;KAC5C,CAAC;SACD,QAAQ,EAAE;IACb,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE;CAChE,CAAC,CAAC"}
|
|
@@ -27,9 +27,17 @@ export async function buildSyncPlan(connection) {
|
|
|
27
27
|
unchanged: connection.surface.map((ep) => `${ep.method} ${ep.path}`),
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
// Derive spec URL from the
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
// Derive spec URL from the specUrl field
|
|
31
|
+
if (!connection.spec.specUrl) {
|
|
32
|
+
return {
|
|
33
|
+
connectionName: connection.name,
|
|
34
|
+
added: [],
|
|
35
|
+
removed: [],
|
|
36
|
+
changed: [],
|
|
37
|
+
unchanged: connection.surface.map((ep) => `${ep.method} ${ep.path}`),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const specUrl = connection.spec.specUrl.replace(/\/$/, '');
|
|
33
41
|
// Build auth for the spec fetch
|
|
34
42
|
let auth;
|
|
35
43
|
if (connection.spec.auth) {
|
|
@@ -57,7 +65,16 @@ export async function buildSyncPlan(connection) {
|
|
|
57
65
|
};
|
|
58
66
|
}
|
|
59
67
|
async function buildGraphQLSyncPlan(connection) {
|
|
60
|
-
|
|
68
|
+
if (!connection.spec.specUrl) {
|
|
69
|
+
return {
|
|
70
|
+
connectionName: connection.name,
|
|
71
|
+
added: [],
|
|
72
|
+
removed: [],
|
|
73
|
+
changed: [],
|
|
74
|
+
unchanged: connection.surface.map((ep) => `${ep.method} ${ep.path}`),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const baseUrl = connection.spec.specUrl.replace(/\/$/, '');
|
|
61
78
|
let auth;
|
|
62
79
|
if (connection.spec.auth) {
|
|
63
80
|
const token = connection.spec.auth.token ?? '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-syncer.js","sourceRoot":"","sources":["../../../src/repo/spec-syncer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAC,0BAA0B,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAU/D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,UAA4B;IAC9D,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACzC,OAAO,oBAAoB,CAAC,UAAU,CAAC,CAAC;IA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AK,EAAE;aAC7D,CAAC;QACJ,CAAC;aAAM,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACnD,IAAI,GAAG;gBACL,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,WAAW;gBAClD,KAAK,EAAE,KAAK;aACb,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,0BAA0B,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClE,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IACvE,MAAM,KAAK,GAAG,kBAAkB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IAE7D,OAAO;QACL,cAAc,EAAE,UAAU,CAAC,IAAI;QAC/B,GAAG,KAAK;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -9,7 +9,7 @@ import type { AccessConfig } from '../repo/connection-schemas.js';
|
|
|
9
9
|
/**
|
|
10
10
|
* Build a ConnectionsMap from LoadedConnections.
|
|
11
11
|
*
|
|
12
|
-
* Each entry has: base_url (from spec.baseUrl
|
|
12
|
+
* Each entry has: base_url (from spec.baseUrl), _request_config with auth details,
|
|
13
13
|
* and any injected credential values for {{VAR}} template resolution.
|
|
14
14
|
*/
|
|
15
15
|
export declare function buildConnectionsMap(connections: Map<string, LoadedConnection>, credentials?: Record<string, Record<string, string>>): ConnectionsMap;
|
|
@@ -28,7 +28,7 @@ function resolveEnvRef(value, credentials) {
|
|
|
28
28
|
/**
|
|
29
29
|
* Build a ConnectionsMap from LoadedConnections.
|
|
30
30
|
*
|
|
31
|
-
* Each entry has: base_url (from spec.baseUrl
|
|
31
|
+
* Each entry has: base_url (from spec.baseUrl), _request_config with auth details,
|
|
32
32
|
* and any injected credential values for {{VAR}} template resolution.
|
|
33
33
|
*/
|
|
34
34
|
export function buildConnectionsMap(connections, credentials) {
|
|
@@ -36,9 +36,7 @@ export function buildConnectionsMap(connections, credentials) {
|
|
|
36
36
|
for (const [name, conn] of connections) {
|
|
37
37
|
const connCredentials = credentials?.[name];
|
|
38
38
|
const auth = buildAuthHeaders(conn, connCredentials);
|
|
39
|
-
|
|
40
|
-
const baseUrl = conn.spec.baseUrl ?? conn.spec.source;
|
|
41
|
-
const resolvedBaseUrl = resolveEnvRef(baseUrl, connCredentials);
|
|
39
|
+
const resolvedBaseUrl = resolveEnvRef(conn.spec.baseUrl, connCredentials);
|
|
42
40
|
const entry = {
|
|
43
41
|
base_url: resolvedBaseUrl,
|
|
44
42
|
_request_config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-bridge.js","sourceRoot":"","sources":["../../../src/runtime/connection-bridge.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;GAIG;AACH,SAAS,aAAa,CAAC,KAAa,EAAE,WAAoC;IACxE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE/B,mCAAmC;IACnC,IAAI,WAAW,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE,CAAC;QACtD,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,2BAA2B;IAC3B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,mDAAmD;IACnD,OAAO,KAAK,OAAO,IAAI,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,WAA0C,EAC1C,WAAoD;IAEpD,MAAM,MAAM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AE,CAAC;QAC/B,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,eAAe,CAAC;QAClD,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC;QAC3C,OAAO,CAAC,EAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,IAAI,KAAK,EAAE,EAAC,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,WAAW,CAAC;QAC9C,OAAO,CAAC,EAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAC,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC9B,+DAA+D;QAC/D,qCAAqC;QACrC,OAAO,CAAC,EAAC,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,KAAK,EAAE,EAAC,CAAC,CAAC;IACvE,CAAC;IAED,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC/B,oDAAoD;QACpD,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,eAAe,CAAC;QAClD,OAAO,CAAC,EAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAC,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -10,8 +10,8 @@ import { z } from 'zod';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const SnapshotConnectionSchema: z.ZodObject<{
|
|
12
12
|
spec: z.ZodObject<{
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
baseUrl: z.ZodString;
|
|
14
|
+
specUrl: z.ZodOptional<z.ZodString>;
|
|
15
15
|
format: z.ZodEnum<["openapi", "graphql", "grpc", "rest", "aws-api"]>;
|
|
16
16
|
auth: z.ZodOptional<z.ZodObject<{
|
|
17
17
|
type: z.ZodString;
|
|
@@ -56,14 +56,14 @@ export declare const SnapshotConnectionSchema: z.ZodObject<{
|
|
|
56
56
|
exclude_paths?: string[] | undefined;
|
|
57
57
|
}>>;
|
|
58
58
|
}, "strip", z.ZodTypeAny, {
|
|
59
|
-
|
|
59
|
+
baseUrl: string;
|
|
60
60
|
format: "openapi" | "graphql" | "grpc" | "rest" | "aws-api";
|
|
61
61
|
filter?: {
|
|
62
62
|
tags?: string[] | undefined;
|
|
63
63
|
include_paths?: string[] | undefined;
|
|
64
64
|
exclude_paths?: string[] | undefined;
|
|
65
65
|
} | undefined;
|
|
66
|
-
|
|
66
|
+
specUrl?: string | undefined;
|
|
67
67
|
auth?: {
|
|
68
68
|
type: string;
|
|
69
69
|
token?: string | undefined;
|
|
@@ -76,14 +76,14 @@ export declare const SnapshotConnectionSchema: z.ZodObject<{
|
|
|
76
76
|
notify_drift: boolean;
|
|
77
77
|
} | undefined;
|
|
78
78
|
}, {
|
|
79
|
-
|
|
79
|
+
baseUrl: string;
|
|
80
80
|
format: "openapi" | "graphql" | "grpc" | "rest" | "aws-api";
|
|
81
81
|
filter?: {
|
|
82
82
|
tags?: string[] | undefined;
|
|
83
83
|
include_paths?: string[] | undefined;
|
|
84
84
|
exclude_paths?: string[] | undefined;
|
|
85
85
|
} | undefined;
|
|
86
|
-
|
|
86
|
+
specUrl?: string | undefined;
|
|
87
87
|
auth?: {
|
|
88
88
|
type: string;
|
|
89
89
|
token?: string | undefined;
|
|
@@ -308,14 +308,14 @@ export declare const SnapshotConnectionSchema: z.ZodObject<{
|
|
|
308
308
|
rules: z.ZodOptional<z.ZodString>;
|
|
309
309
|
}, "strip", z.ZodTypeAny, {
|
|
310
310
|
spec: {
|
|
311
|
-
|
|
311
|
+
baseUrl: string;
|
|
312
312
|
format: "openapi" | "graphql" | "grpc" | "rest" | "aws-api";
|
|
313
313
|
filter?: {
|
|
314
314
|
tags?: string[] | undefined;
|
|
315
315
|
include_paths?: string[] | undefined;
|
|
316
316
|
exclude_paths?: string[] | undefined;
|
|
317
317
|
} | undefined;
|
|
318
|
-
|
|
318
|
+
specUrl?: string | undefined;
|
|
319
319
|
auth?: {
|
|
320
320
|
type: string;
|
|
321
321
|
token?: string | undefined;
|
|
@@ -376,14 +376,14 @@ export declare const SnapshotConnectionSchema: z.ZodObject<{
|
|
|
376
376
|
rules?: string | undefined;
|
|
377
377
|
}, {
|
|
378
378
|
spec: {
|
|
379
|
-
|
|
379
|
+
baseUrl: string;
|
|
380
380
|
format: "openapi" | "graphql" | "grpc" | "rest" | "aws-api";
|
|
381
381
|
filter?: {
|
|
382
382
|
tags?: string[] | undefined;
|
|
383
383
|
include_paths?: string[] | undefined;
|
|
384
384
|
exclude_paths?: string[] | undefined;
|
|
385
385
|
} | undefined;
|
|
386
|
-
|
|
386
|
+
specUrl?: string | undefined;
|
|
387
387
|
auth?: {
|
|
388
388
|
type: string;
|
|
389
389
|
token?: string | undefined;
|
|
@@ -882,8 +882,8 @@ export declare const DeploySnapshotSchema: z.ZodObject<{
|
|
|
882
882
|
}>;
|
|
883
883
|
connections: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
884
884
|
spec: z.ZodObject<{
|
|
885
|
-
|
|
886
|
-
|
|
885
|
+
baseUrl: z.ZodString;
|
|
886
|
+
specUrl: z.ZodOptional<z.ZodString>;
|
|
887
887
|
format: z.ZodEnum<["openapi", "graphql", "grpc", "rest", "aws-api"]>;
|
|
888
888
|
auth: z.ZodOptional<z.ZodObject<{
|
|
889
889
|
type: z.ZodString;
|
|
@@ -928,14 +928,14 @@ export declare const DeploySnapshotSchema: z.ZodObject<{
|
|
|
928
928
|
exclude_paths?: string[] | undefined;
|
|
929
929
|
}>>;
|
|
930
930
|
}, "strip", z.ZodTypeAny, {
|
|
931
|
-
|
|
931
|
+
baseUrl: string;
|
|
932
932
|
format: "openapi" | "graphql" | "grpc" | "rest" | "aws-api";
|
|
933
933
|
filter?: {
|
|
934
934
|
tags?: string[] | undefined;
|
|
935
935
|
include_paths?: string[] | undefined;
|
|
936
936
|
exclude_paths?: string[] | undefined;
|
|
937
937
|
} | undefined;
|
|
938
|
-
|
|
938
|
+
specUrl?: string | undefined;
|
|
939
939
|
auth?: {
|
|
940
940
|
type: string;
|
|
941
941
|
token?: string | undefined;
|
|
@@ -948,14 +948,14 @@ export declare const DeploySnapshotSchema: z.ZodObject<{
|
|
|
948
948
|
notify_drift: boolean;
|
|
949
949
|
} | undefined;
|
|
950
950
|
}, {
|
|
951
|
-
|
|
951
|
+
baseUrl: string;
|
|
952
952
|
format: "openapi" | "graphql" | "grpc" | "rest" | "aws-api";
|
|
953
953
|
filter?: {
|
|
954
954
|
tags?: string[] | undefined;
|
|
955
955
|
include_paths?: string[] | undefined;
|
|
956
956
|
exclude_paths?: string[] | undefined;
|
|
957
957
|
} | undefined;
|
|
958
|
-
|
|
958
|
+
specUrl?: string | undefined;
|
|
959
959
|
auth?: {
|
|
960
960
|
type: string;
|
|
961
961
|
token?: string | undefined;
|
|
@@ -1180,14 +1180,14 @@ export declare const DeploySnapshotSchema: z.ZodObject<{
|
|
|
1180
1180
|
rules: z.ZodOptional<z.ZodString>;
|
|
1181
1181
|
}, "strip", z.ZodTypeAny, {
|
|
1182
1182
|
spec: {
|
|
1183
|
-
|
|
1183
|
+
baseUrl: string;
|
|
1184
1184
|
format: "openapi" | "graphql" | "grpc" | "rest" | "aws-api";
|
|
1185
1185
|
filter?: {
|
|
1186
1186
|
tags?: string[] | undefined;
|
|
1187
1187
|
include_paths?: string[] | undefined;
|
|
1188
1188
|
exclude_paths?: string[] | undefined;
|
|
1189
1189
|
} | undefined;
|
|
1190
|
-
|
|
1190
|
+
specUrl?: string | undefined;
|
|
1191
1191
|
auth?: {
|
|
1192
1192
|
type: string;
|
|
1193
1193
|
token?: string | undefined;
|
|
@@ -1248,14 +1248,14 @@ export declare const DeploySnapshotSchema: z.ZodObject<{
|
|
|
1248
1248
|
rules?: string | undefined;
|
|
1249
1249
|
}, {
|
|
1250
1250
|
spec: {
|
|
1251
|
-
|
|
1251
|
+
baseUrl: string;
|
|
1252
1252
|
format: "openapi" | "graphql" | "grpc" | "rest" | "aws-api";
|
|
1253
1253
|
filter?: {
|
|
1254
1254
|
tags?: string[] | undefined;
|
|
1255
1255
|
include_paths?: string[] | undefined;
|
|
1256
1256
|
exclude_paths?: string[] | undefined;
|
|
1257
1257
|
} | undefined;
|
|
1258
|
-
|
|
1258
|
+
specUrl?: string | undefined;
|
|
1259
1259
|
auth?: {
|
|
1260
1260
|
type: string;
|
|
1261
1261
|
token?: string | undefined;
|
|
@@ -1552,14 +1552,14 @@ export declare const DeploySnapshotSchema: z.ZodObject<{
|
|
|
1552
1552
|
source: "cli" | "github" | "admin-ui";
|
|
1553
1553
|
connections: Record<string, {
|
|
1554
1554
|
spec: {
|
|
1555
|
-
|
|
1555
|
+
baseUrl: string;
|
|
1556
1556
|
format: "openapi" | "graphql" | "grpc" | "rest" | "aws-api";
|
|
1557
1557
|
filter?: {
|
|
1558
1558
|
tags?: string[] | undefined;
|
|
1559
1559
|
include_paths?: string[] | undefined;
|
|
1560
1560
|
exclude_paths?: string[] | undefined;
|
|
1561
1561
|
} | undefined;
|
|
1562
|
-
|
|
1562
|
+
specUrl?: string | undefined;
|
|
1563
1563
|
auth?: {
|
|
1564
1564
|
type: string;
|
|
1565
1565
|
token?: string | undefined;
|
|
@@ -1740,14 +1740,14 @@ export declare const DeploySnapshotSchema: z.ZodObject<{
|
|
|
1740
1740
|
source: "cli" | "github" | "admin-ui";
|
|
1741
1741
|
connections: Record<string, {
|
|
1742
1742
|
spec: {
|
|
1743
|
-
|
|
1743
|
+
baseUrl: string;
|
|
1744
1744
|
format: "openapi" | "graphql" | "grpc" | "rest" | "aws-api";
|
|
1745
1745
|
filter?: {
|
|
1746
1746
|
tags?: string[] | undefined;
|
|
1747
1747
|
include_paths?: string[] | undefined;
|
|
1748
1748
|
exclude_paths?: string[] | undefined;
|
|
1749
1749
|
} | undefined;
|
|
1750
|
-
|
|
1750
|
+
specUrl?: string | undefined;
|
|
1751
1751
|
auth?: {
|
|
1752
1752
|
type: string;
|
|
1753
1753
|
token?: string | undefined;
|