wgc 0.54.3 → 0.55.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.
- package/dist/commands/graph/monograph/commands/create.js +12 -2
- package/dist/commands/graph/monograph/commands/create.js.map +1 -1
- package/dist/commands/graph/monograph/commands/update.js +15 -5
- package/dist/commands/graph/monograph/commands/update.js.map +1 -1
- package/dist/commands/router/commands/compose.js +2 -1
- package/dist/commands/router/commands/compose.js.map +1 -1
- package/dist/commands/subgraph/commands/create.js +13 -3
- package/dist/commands/subgraph/commands/create.js.map +1 -1
- package/dist/commands/subgraph/commands/publish.js +11 -1
- package/dist/commands/subgraph/commands/publish.js.map +1 -1
- package/dist/commands/subgraph/commands/update.js +11 -4
- package/dist/commands/subgraph/commands/update.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +16 -0
- package/dist/utils.js.map +1 -1
- package/package.json +5 -5
|
@@ -4,9 +4,11 @@ import { EnumStatusCode } from '@wundergraph/cosmo-connect/dist/common/common_pb
|
|
|
4
4
|
import { Command, program } from 'commander';
|
|
5
5
|
import { resolve } from 'pathe';
|
|
6
6
|
import pc from 'picocolors';
|
|
7
|
-
import { parseGraphQLSubscriptionProtocol } from '@wundergraph/cosmo-shared';
|
|
7
|
+
import { parseGraphQLSubscriptionProtocol, parseGraphQLWebsocketSubprotocol } from '@wundergraph/cosmo-shared';
|
|
8
8
|
import ora from 'ora';
|
|
9
9
|
import { getBaseHeaders } from '../../../../core/config.js';
|
|
10
|
+
import { validateSubscriptionProtocols } from '../../../../utils.js';
|
|
11
|
+
import { websocketSubprotocolDescription } from '../../../../constants.js';
|
|
10
12
|
export default (opts) => {
|
|
11
13
|
const command = new Command('create');
|
|
12
14
|
command.description('Creates a monograph on the control plane.');
|
|
@@ -16,6 +18,7 @@ export default (opts) => {
|
|
|
16
18
|
command.requiredOption('-u, --graph-url <url>', 'The url of your GraphQL server that is accessible from the router.');
|
|
17
19
|
command.option('--subscription-url [url]', 'The url used for subscriptions. If empty, it defaults to graph url.');
|
|
18
20
|
command.option('--subscription-protocol <protocol>', 'The protocol to use when subscribing to the graph. The supported protocols are ws, sse, and sse_post.');
|
|
21
|
+
command.option('--websocket-subprotocol <protocol>', websocketSubprotocolDescription);
|
|
19
22
|
command.option('--admission-webhook-url <url>', 'The admission webhook url. This is the url that the controlplane will use to implement admission control for the monograph. This is optional.', []);
|
|
20
23
|
command.option('--readme <path-to-readme>', 'The markdown file which describes the graph.');
|
|
21
24
|
command.action(async (name, options) => {
|
|
@@ -27,7 +30,11 @@ export default (opts) => {
|
|
|
27
30
|
program.error(pc.red(pc.bold(`The readme file '${pc.bold(readmeFile)}' does not exist. Please check the path and try again.`)));
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
|
-
|
|
33
|
+
validateSubscriptionProtocols({
|
|
34
|
+
subscriptionProtocol: options.subscriptionProtocol,
|
|
35
|
+
websocketSubprotocol: options.websocketSubprotocol,
|
|
36
|
+
});
|
|
37
|
+
const spinner = ora('Monograph is being created...').start();
|
|
31
38
|
const resp = await opts.client.platform.createMonograph({
|
|
32
39
|
name,
|
|
33
40
|
namespace: options.namespace,
|
|
@@ -38,6 +45,9 @@ export default (opts) => {
|
|
|
38
45
|
subscriptionProtocol: options.subscriptionProtocol
|
|
39
46
|
? parseGraphQLSubscriptionProtocol(options.subscriptionProtocol)
|
|
40
47
|
: undefined,
|
|
48
|
+
websocketSubprotocol: options.websocketSubprotocol
|
|
49
|
+
? parseGraphQLWebsocketSubprotocol(options.websocketSubprotocol)
|
|
50
|
+
: undefined,
|
|
41
51
|
admissionWebhookURL: options.admissionWebhookUrl,
|
|
42
52
|
}, {
|
|
43
53
|
headers: getBaseHeaders(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/commands/graph/monograph/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/commands/graph/monograph/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,gCAAgC,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC/G,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAE3E,eAAe,CAAC,IAAwB,EAAE,EAAE;IAC1C,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtC,OAAO,CAAC,WAAW,CAAC,2CAA2C,CAAC,CAAC;IACjE,OAAO,CAAC,QAAQ,CAAC,QAAQ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CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
|
-
import { Command, program } from 'commander';
|
|
4
|
-
import pc from 'picocolors';
|
|
5
3
|
import { EnumStatusCode } from '@wundergraph/cosmo-connect/dist/common/common_pb';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { parseGraphQLSubscriptionProtocol, parseGraphQLWebsocketSubprotocol } from '@wundergraph/cosmo-shared';
|
|
5
|
+
import { Command, program } from 'commander';
|
|
8
6
|
import ora from 'ora';
|
|
7
|
+
import { resolve } from 'pathe';
|
|
8
|
+
import pc from 'picocolors';
|
|
9
|
+
import { websocketSubprotocolDescription } from '../../../../constants.js';
|
|
9
10
|
import { getBaseHeaders } from '../../../../core/config.js';
|
|
11
|
+
import { validateSubscriptionProtocols } from '../../../../utils.js';
|
|
10
12
|
export default (opts) => {
|
|
11
13
|
const command = new Command('update');
|
|
12
14
|
command.description('Updates a monograph on the control plane.');
|
|
@@ -16,6 +18,7 @@ export default (opts) => {
|
|
|
16
18
|
command.option('-u, --graph-url <url>', 'The url of your GraphQL server that is accessible from the router.');
|
|
17
19
|
command.option('--subscription-url [url]', 'The url used for subscriptions. If empty, it defaults to same url used for routing.');
|
|
18
20
|
command.option('--subscription-protocol <protocol>', 'The protocol to use when subscribing to the graph. The supported protocols are ws, sse, and sse_post.');
|
|
21
|
+
command.option('--websocket-subprotocol <protocol>', websocketSubprotocolDescription);
|
|
19
22
|
command.option('--readme <path-to-readme>', 'The markdown file which describes the subgraph.');
|
|
20
23
|
command.action(async (name, options) => {
|
|
21
24
|
var _a, _b, _c;
|
|
@@ -26,7 +29,11 @@ export default (opts) => {
|
|
|
26
29
|
program.error(pc.red(pc.bold(`The readme file '${pc.bold(readmeFile)}' does not exist. Please check the path and try again.`)));
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
|
-
|
|
32
|
+
validateSubscriptionProtocols({
|
|
33
|
+
subscriptionProtocol: options.subscriptionProtocol,
|
|
34
|
+
websocketSubprotocol: options.websocketSubprotocol,
|
|
35
|
+
});
|
|
36
|
+
const spinner = ora('Monograph is being updated...').start();
|
|
30
37
|
const resp = await opts.client.platform.updateMonograph({
|
|
31
38
|
name,
|
|
32
39
|
namespace: options.namespace,
|
|
@@ -36,6 +43,9 @@ export default (opts) => {
|
|
|
36
43
|
subscriptionProtocol: options.subscriptionProtocol
|
|
37
44
|
? parseGraphQLSubscriptionProtocol(options.subscriptionProtocol)
|
|
38
45
|
: undefined,
|
|
46
|
+
websocketSubprotocol: options.websocketSubprotocol
|
|
47
|
+
? parseGraphQLWebsocketSubprotocol(options.websocketSubprotocol)
|
|
48
|
+
: undefined,
|
|
39
49
|
readme: readmeFile ? await readFile(readmeFile, 'utf8') : undefined,
|
|
40
50
|
}, {
|
|
41
51
|
headers: getBaseHeaders(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../src/commands/graph/monograph/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../src/commands/graph/monograph/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAE,gCAAgC,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC/G,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAA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EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC7D,IAAI,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,EAAE;gBAC1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,CAAC,CAAC,CAAC,CAAC;aACtD;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -62,7 +62,7 @@ export default (opts) => {
|
|
|
62
62
|
fieldConfigurations: result.federationResult.fieldConfigurations,
|
|
63
63
|
schemaVersionId: '',
|
|
64
64
|
subgraphs: config.subgraphs.map((s, index) => {
|
|
65
|
-
var _a, _b;
|
|
65
|
+
var _a, _b, _c, _d;
|
|
66
66
|
const subgraphConfig = result.federationResult.subgraphConfigBySubgraphName.get(s.name);
|
|
67
67
|
const schema = subgraphConfig === null || subgraphConfig === void 0 ? void 0 : subgraphConfig.schema;
|
|
68
68
|
const configurationDataMap = subgraphConfig === null || subgraphConfig === void 0 ? void 0 : subgraphConfig.configurationDataMap;
|
|
@@ -73,6 +73,7 @@ export default (opts) => {
|
|
|
73
73
|
sdl: sdls[index],
|
|
74
74
|
subscriptionUrl: ((_a = s.subscription) === null || _a === void 0 ? void 0 : _a.url) || s.routing_url,
|
|
75
75
|
subscriptionProtocol: ((_b = s.subscription) === null || _b === void 0 ? void 0 : _b.protocol) || 'ws',
|
|
76
|
+
websocketSubprotocol: ((_c = s.subscription) === null || _c === void 0 ? void 0 : _c.protocol) === 'ws' ? ((_d = s.subscription) === null || _d === void 0 ? void 0 : _d.websocketSubprotocol) || 'auto' : undefined,
|
|
76
77
|
schema,
|
|
77
78
|
configurationDataMap,
|
|
78
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../../src/commands/router/commands/compose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../../src/commands/router/commands/compose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAyBzE,eAAe,CAAC,IAAwB,EAAE,EAAE;IAC1C,MAAM,OAAO,GAAG,IAAI,OA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C,SAAS;oBAChG,MAAM;oBACN,oBAAoB;iBACrB,CAAC;YACJ,CAAC,CAAC;SACH,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,GAAG,EAAE;YACf,MAAM,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC;SAC3D;aAAM;YACL,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC;SAC1C;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
1
|
import { existsSync } from 'node:fs';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { EnumStatusCode } from '@wundergraph/cosmo-connect/dist/common/common_pb';
|
|
4
|
-
import { parseGraphQLSubscriptionProtocol, splitLabel } from '@wundergraph/cosmo-shared';
|
|
4
|
+
import { parseGraphQLSubscriptionProtocol, parseGraphQLWebsocketSubprotocol, splitLabel, } from '@wundergraph/cosmo-shared';
|
|
5
5
|
import { Command, program } from 'commander';
|
|
6
|
+
import ora from 'ora';
|
|
6
7
|
import { resolve } from 'pathe';
|
|
7
8
|
import pc from 'picocolors';
|
|
8
|
-
import ora from 'ora';
|
|
9
9
|
import { getBaseHeaders } from '../../../core/config.js';
|
|
10
|
+
import { validateSubscriptionProtocols } from '../../../utils.js';
|
|
11
|
+
import { websocketSubprotocolDescription } from '../../../constants.js';
|
|
10
12
|
export default (opts) => {
|
|
11
13
|
const command = new Command('create');
|
|
12
14
|
command.description('Creates a federated subgraph on the control plane.');
|
|
@@ -16,6 +18,7 @@ export default (opts) => {
|
|
|
16
18
|
command.option('--label [labels...]', 'The labels to apply to the subgraph. The labels are passed in the format <key>=<value> <key>=<value>.');
|
|
17
19
|
command.option('--subscription-url [url]', 'The url used for subscriptions. If empty, it defaults to same url used for routing.');
|
|
18
20
|
command.option('--subscription-protocol <protocol>', 'The protocol to use when subscribing to the subgraph. The supported protocols are ws, sse, and sse_post.');
|
|
21
|
+
command.option('--websocket-subprotocol <protocol>', websocketSubprotocolDescription);
|
|
19
22
|
command.option('--readme <path-to-readme>', 'The markdown file which describes the subgraph.');
|
|
20
23
|
command.action(async (name, options) => {
|
|
21
24
|
var _a, _b, _c;
|
|
@@ -26,6 +29,10 @@ export default (opts) => {
|
|
|
26
29
|
program.error(pc.red(pc.bold(`The readme file '${pc.bold(readmeFile)}' does not exist. Please check the path and try again.`)));
|
|
27
30
|
}
|
|
28
31
|
}
|
|
32
|
+
validateSubscriptionProtocols({
|
|
33
|
+
subscriptionProtocol: options.subscriptionProtocol,
|
|
34
|
+
websocketSubprotocol: options.websocketSubprotocol,
|
|
35
|
+
});
|
|
29
36
|
const spinner = ora('Subgraph is being created...').start();
|
|
30
37
|
const resp = await opts.client.platform.createFederatedSubgraph({
|
|
31
38
|
name,
|
|
@@ -37,6 +44,9 @@ export default (opts) => {
|
|
|
37
44
|
subscriptionProtocol: options.subscriptionProtocol
|
|
38
45
|
? parseGraphQLSubscriptionProtocol(options.subscriptionProtocol)
|
|
39
46
|
: undefined,
|
|
47
|
+
websocketSubprotocol: options.websocketSubprotocol
|
|
48
|
+
? parseGraphQLWebsocketSubprotocol(options.websocketSubprotocol)
|
|
49
|
+
: undefined,
|
|
40
50
|
readme: readmeFile ? await readFile(readmeFile, 'utf8') : undefined,
|
|
41
51
|
}, {
|
|
42
52
|
headers: getBaseHeaders(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/subgraph/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/subgraph/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,M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AAC,oBAAoB,CAAC;gBAChE,CAAC,CAAC,SAAS;YACb,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;SACpE,EACD;YACE,OAAO,EAAE,cAAc,EAAE;SAC1B,CACF,CAAC;QAEF,IAAI,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,IAAI,MAAK,cAAc,CAAC,EAAE,EAAE;YAC7C,OAAO,CAAC,OAAO,CAAC,oCAAoC,CAAC,CAAC;SACvD;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;YAC3C,IAAI,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,EAAE;gBAC1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,CAAC,CAAC,CAAC,CAAC;aACtD;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -6,8 +6,10 @@ import ora from 'ora';
|
|
|
6
6
|
import { resolve } from 'pathe';
|
|
7
7
|
import pc from 'picocolors';
|
|
8
8
|
import { EnumStatusCode } from '@wundergraph/cosmo-connect/dist/common/common_pb';
|
|
9
|
-
import { parseGraphQLSubscriptionProtocol, splitLabel } from '@wundergraph/cosmo-shared';
|
|
9
|
+
import { parseGraphQLSubscriptionProtocol, parseGraphQLWebsocketSubprotocol, splitLabel, } from '@wundergraph/cosmo-shared';
|
|
10
10
|
import { getBaseHeaders } from '../../../core/config.js';
|
|
11
|
+
import { validateSubscriptionProtocols } from '../../../utils.js';
|
|
12
|
+
import { websocketSubprotocolDescription } from '../../../constants.js';
|
|
11
13
|
export default (opts) => {
|
|
12
14
|
const command = new Command('publish');
|
|
13
15
|
command.description("Publishes a subgraph on the control plane. If the subgraph doesn't exists, it will be created.\nIf the publication leads to composition errors, the errors will be visible in the Studio.\nThe router will continue to work with the latest valid schema.\nConsider using the 'wgc subgraph check' command to check for composition errors before publishing.");
|
|
@@ -19,6 +21,7 @@ export default (opts) => {
|
|
|
19
21
|
command.option('--unset-labels', 'This will remove all labels. It will not add new labels if both this and --labels option is passed.');
|
|
20
22
|
command.option('--subscription-url [url]', 'The url used for subscriptions. If empty, it defaults to same url used for routing.');
|
|
21
23
|
command.option('--subscription-protocol <protocol>', 'The protocol to use when subscribing to the subgraph. The supported protocols are ws, sse, and sse_post.');
|
|
24
|
+
command.option('--websocket-subprotocol <protocol>', websocketSubprotocolDescription);
|
|
22
25
|
command.option('--fail-on-composition-error', 'If set, the command will fail if the composition of the federated graph fails.', false);
|
|
23
26
|
command.option('--fail-on-admission-webhook-error', 'If set, the command will fail if the admission webhook fails.', false);
|
|
24
27
|
command.action(async (name, options) => {
|
|
@@ -32,6 +35,10 @@ export default (opts) => {
|
|
|
32
35
|
if (schema.trim().length === 0) {
|
|
33
36
|
program.error(pc.red(pc.bold(`The schema file '${pc.bold(schemaFile)}' is empty. Please provide a valid schema.`)));
|
|
34
37
|
}
|
|
38
|
+
validateSubscriptionProtocols({
|
|
39
|
+
subscriptionProtocol: options.subscriptionProtocol,
|
|
40
|
+
websocketSubprotocol: options.websocketSubprotocol,
|
|
41
|
+
});
|
|
35
42
|
const spinner = ora('Subgraph is being published...').start();
|
|
36
43
|
const resp = await opts.client.platform.publishFederatedSubgraph({
|
|
37
44
|
name,
|
|
@@ -44,6 +51,9 @@ export default (opts) => {
|
|
|
44
51
|
subscriptionProtocol: options.subscriptionProtocol
|
|
45
52
|
? parseGraphQLSubscriptionProtocol(options.subscriptionProtocol)
|
|
46
53
|
: undefined,
|
|
54
|
+
websocketSubprotocol: options.websocketSubprotocol
|
|
55
|
+
? parseGraphQLWebsocketSubprotocol(options.websocketSubprotocol)
|
|
56
|
+
: undefined,
|
|
47
57
|
labels: options.label.map((label) => splitLabel(label)),
|
|
48
58
|
unsetLabels: !!options.unsetLabels,
|
|
49
59
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../../src/commands/subgraph/commands/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../../src/commands/subgraph/commands/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EACL,gCAAgC,EAChC,gCAAgC,EAChC,UAAU,GACX,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO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O,CAAC,CAAC;gBACP,OAAO,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;gBAC3C,IAAI,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,EAAE;oBAC1B,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,CAAC,CAAC,CAAC,CAAC;iBACxD;gBACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACjB;SACF;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -4,10 +4,12 @@ import Table from 'cli-table3';
|
|
|
4
4
|
import { Command, program } from 'commander';
|
|
5
5
|
import pc from 'picocolors';
|
|
6
6
|
import { EnumStatusCode } from '@wundergraph/cosmo-connect/dist/common/common_pb';
|
|
7
|
-
import { splitLabel, parseGraphQLSubscriptionProtocol,
|
|
7
|
+
import { splitLabel, parseGraphQLSubscriptionProtocol, parseGraphQLWebsocketSubprotocol, } from '@wundergraph/cosmo-shared';
|
|
8
8
|
import { resolve } from 'pathe';
|
|
9
9
|
import ora from 'ora';
|
|
10
10
|
import { getBaseHeaders } from '../../../core/config.js';
|
|
11
|
+
import { validateSubscriptionProtocols } from '../../../utils.js';
|
|
12
|
+
import { websocketSubprotocolDescription } from '../../../constants.js';
|
|
11
13
|
export default (opts) => {
|
|
12
14
|
const command = new Command('update');
|
|
13
15
|
command.description('Updates a subgraph on the control plane.');
|
|
@@ -18,6 +20,7 @@ export default (opts) => {
|
|
|
18
20
|
command.option('--unset-labels', 'This will remove all labels. It will not add new labels if both this and --labels option is passed.');
|
|
19
21
|
command.option('--subscription-url <url>', 'The url used for subscriptions. If empty, it defaults to same url used for routing.');
|
|
20
22
|
command.option('--subscription-protocol <protocol>', 'The protocol to use when subscribing to the subgraph. The supported protocols are ws, sse, and sse_post.');
|
|
23
|
+
command.option('--websocket-subprotocol <protocol>', websocketSubprotocolDescription);
|
|
21
24
|
command.option('--readme <path-to-readme>', 'The markdown file which describes the subgraph.');
|
|
22
25
|
command.action(async (name, options) => {
|
|
23
26
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -28,9 +31,10 @@ export default (opts) => {
|
|
|
28
31
|
program.error(pc.red(pc.bold(`The readme file '${pc.bold(readmeFile)}' does not exist. Please check the path and try again.`)));
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
validateSubscriptionProtocols({
|
|
35
|
+
subscriptionProtocol: options.subscriptionProtocol,
|
|
36
|
+
websocketSubprotocol: options.websocketSubprotocol,
|
|
37
|
+
});
|
|
34
38
|
const spinner = ora('Subgraph is being updated...').start();
|
|
35
39
|
const resp = await opts.client.platform.updateSubgraph({
|
|
36
40
|
name,
|
|
@@ -48,6 +52,9 @@ export default (opts) => {
|
|
|
48
52
|
subscriptionProtocol: options.subscriptionProtocol
|
|
49
53
|
? parseGraphQLSubscriptionProtocol(options.subscriptionProtocol)
|
|
50
54
|
: undefined,
|
|
55
|
+
websocketSubprotocol: options.websocketSubprotocol
|
|
56
|
+
? parseGraphQLWebsocketSubprotocol(options.websocketSubprotocol)
|
|
57
|
+
: undefined,
|
|
51
58
|
readme: readmeFile ? await readFile(readmeFile, 'utf8') : undefined,
|
|
52
59
|
}, {
|
|
53
60
|
headers: getBaseHeaders(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/subgraph/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,MAAM,YAAY,CAAC;AAC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AM;aACP;YACD,OAAO,CAAC,CAAC;gBACP,OAAO,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;gBAC3C,IAAI,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,EAAE;oBAC1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,CAAC,CAAC,CAAC,CAAC;iBACtD;gBACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACjB;SACF;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const websocketSubprotocolDescription = "The subprotocol to use when subscribing to the subgraph. The supported protocols are auto (default), graphql-ws, and graphql-transport-ws. Should be used only if the subscription protocol is ws. For more information see https://cosmo-docs.wundergraph.com/router/subscriptions/websocket-subprotocols.";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const websocketSubprotocolDescription = 'The subprotocol to use when subscribing to the subgraph. The supported protocols are auto (default), graphql-ws, and graphql-transport-ws. Should be used only if the subscription protocol is ws. For more information see https://cosmo-docs.wundergraph.com/router/subscriptions/websocket-subprotocols.';
|
|
2
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,+BAA+B,GAC1C,6SAA6S,CAAC"}
|