@xano/cli 0.0.82-beta.1 → 0.0.82-beta.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.
- package/README.md +4 -0
- package/dist/commands/tenant/deploy_platform/index.d.ts +1 -0
- package/dist/commands/tenant/deploy_platform/index.js +30 -0
- package/dist/commands/tenant/deploy_release/index.d.ts +1 -0
- package/dist/commands/tenant/deploy_release/index.js +30 -0
- package/oclif.manifest.json +1803 -1783
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -346,6 +346,10 @@ xano tenant deploy_platform <tenant_name> --platform_id 5
|
|
|
346
346
|
|
|
347
347
|
# Deploy a release by name
|
|
348
348
|
xano tenant deploy_release <tenant_name> --release v1.0
|
|
349
|
+
|
|
350
|
+
# Deploy with a license override file
|
|
351
|
+
xano tenant deploy_platform <tenant_name> --platform_id 5 --license ./license.yaml
|
|
352
|
+
xano tenant deploy_release <tenant_name> --release v1.0 --license ./license.yaml
|
|
349
353
|
```
|
|
350
354
|
|
|
351
355
|
#### Tenant License
|
|
@@ -6,6 +6,7 @@ export default class TenantDeployPlatform extends BaseCommand {
|
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
+
license: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
platform_id: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -17,9 +17,15 @@ export default class TenantDeployPlatform extends BaseCommand {
|
|
|
17
17
|
Deployed platform 5 to tenant: My Tenant (my-tenant)
|
|
18
18
|
`,
|
|
19
19
|
`$ xano tenant deploy_platform t1234-abcd-xyz1 --platform_id 5 -o json`,
|
|
20
|
+
`$ xano tenant deploy_platform t1234-abcd-xyz1 --platform_id 5 --license ./license.yaml`,
|
|
20
21
|
];
|
|
21
22
|
static flags = {
|
|
22
23
|
...BaseCommand.baseFlags,
|
|
24
|
+
license: Flags.string({
|
|
25
|
+
char: 'l',
|
|
26
|
+
description: 'Path to a license override file to apply after deploy',
|
|
27
|
+
required: false,
|
|
28
|
+
}),
|
|
23
29
|
output: Flags.string({
|
|
24
30
|
char: 'o',
|
|
25
31
|
default: 'summary',
|
|
@@ -76,6 +82,28 @@ Deployed platform 5 to tenant: My Tenant (my-tenant)
|
|
|
76
82
|
this.error(`API request failed with status ${response.status}: ${response.statusText}\n${errorText}`);
|
|
77
83
|
}
|
|
78
84
|
const tenant = (await response.json());
|
|
85
|
+
// Apply license override if provided
|
|
86
|
+
if (flags.license) {
|
|
87
|
+
const licensePath = path.resolve(flags.license);
|
|
88
|
+
if (!fs.existsSync(licensePath)) {
|
|
89
|
+
this.error(`License file not found: ${licensePath}`);
|
|
90
|
+
}
|
|
91
|
+
const licenseValue = fs.readFileSync(licensePath, 'utf8');
|
|
92
|
+
const licenseUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/tenant/${tenantName}/license`;
|
|
93
|
+
const licenseResponse = await this.verboseFetch(licenseUrl, {
|
|
94
|
+
body: JSON.stringify({ value: licenseValue }),
|
|
95
|
+
headers: {
|
|
96
|
+
accept: 'application/json',
|
|
97
|
+
Authorization: `Bearer ${profile.access_token}`,
|
|
98
|
+
'Content-Type': 'application/json',
|
|
99
|
+
},
|
|
100
|
+
method: 'POST',
|
|
101
|
+
}, flags.verbose, profile.access_token);
|
|
102
|
+
if (!licenseResponse.ok) {
|
|
103
|
+
const errorText = await licenseResponse.text();
|
|
104
|
+
this.error(`License override failed with status ${licenseResponse.status}: ${licenseResponse.statusText}\n${errorText}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
79
107
|
if (flags.output === 'json') {
|
|
80
108
|
this.log(JSON.stringify(tenant, null, 2));
|
|
81
109
|
}
|
|
@@ -86,6 +114,8 @@ Deployed platform 5 to tenant: My Tenant (my-tenant)
|
|
|
86
114
|
this.log(` State: ${tenant.state}`);
|
|
87
115
|
if (tenant.platform?.name)
|
|
88
116
|
this.log(` Platform: ${tenant.platform.name}`);
|
|
117
|
+
if (flags.license)
|
|
118
|
+
this.log(` License: applied`);
|
|
89
119
|
this.log(` Time: ${elapsed}s`);
|
|
90
120
|
}
|
|
91
121
|
}
|
|
@@ -6,6 +6,7 @@ export default class TenantDeployRelease extends BaseCommand {
|
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
+
license: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
release: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -17,9 +17,15 @@ export default class TenantDeployRelease extends BaseCommand {
|
|
|
17
17
|
Deployed release "v1.0" to tenant: My Tenant (my-tenant)
|
|
18
18
|
`,
|
|
19
19
|
`$ xano tenant deploy_release t1234-abcd-xyz1 --release v1.0 -o json`,
|
|
20
|
+
`$ xano tenant deploy_release t1234-abcd-xyz1 --release v1.0 --license ./license.yaml`,
|
|
20
21
|
];
|
|
21
22
|
static flags = {
|
|
22
23
|
...BaseCommand.baseFlags,
|
|
24
|
+
license: Flags.string({
|
|
25
|
+
char: 'l',
|
|
26
|
+
description: 'Path to a license override file to apply after deploy',
|
|
27
|
+
required: false,
|
|
28
|
+
}),
|
|
23
29
|
output: Flags.string({
|
|
24
30
|
char: 'o',
|
|
25
31
|
default: 'summary',
|
|
@@ -77,6 +83,28 @@ Deployed release "v1.0" to tenant: My Tenant (my-tenant)
|
|
|
77
83
|
this.error(`API request failed with status ${response.status}: ${response.statusText}\n${errorText}`);
|
|
78
84
|
}
|
|
79
85
|
const tenant = (await response.json());
|
|
86
|
+
// Apply license override if provided
|
|
87
|
+
if (flags.license) {
|
|
88
|
+
const licensePath = path.resolve(flags.license);
|
|
89
|
+
if (!fs.existsSync(licensePath)) {
|
|
90
|
+
this.error(`License file not found: ${licensePath}`);
|
|
91
|
+
}
|
|
92
|
+
const licenseValue = fs.readFileSync(licensePath, 'utf8');
|
|
93
|
+
const licenseUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/tenant/${tenantName}/license`;
|
|
94
|
+
const licenseResponse = await this.verboseFetch(licenseUrl, {
|
|
95
|
+
body: JSON.stringify({ value: licenseValue }),
|
|
96
|
+
headers: {
|
|
97
|
+
accept: 'application/json',
|
|
98
|
+
Authorization: `Bearer ${profile.access_token}`,
|
|
99
|
+
'Content-Type': 'application/json',
|
|
100
|
+
},
|
|
101
|
+
method: 'POST',
|
|
102
|
+
}, flags.verbose, profile.access_token);
|
|
103
|
+
if (!licenseResponse.ok) {
|
|
104
|
+
const errorText = await licenseResponse.text();
|
|
105
|
+
this.error(`License override failed with status ${licenseResponse.status}: ${licenseResponse.statusText}\n${errorText}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
80
108
|
if (flags.output === 'json') {
|
|
81
109
|
this.log(JSON.stringify(tenant, null, 2));
|
|
82
110
|
}
|
|
@@ -87,6 +115,8 @@ Deployed release "v1.0" to tenant: My Tenant (my-tenant)
|
|
|
87
115
|
this.log(` State: ${tenant.state}`);
|
|
88
116
|
if (tenant.release?.name)
|
|
89
117
|
this.log(` Release: ${tenant.release.name}`);
|
|
118
|
+
if (flags.license)
|
|
119
|
+
this.log(` License: applied`);
|
|
90
120
|
this.log(` Time: ${elapsed}s`);
|
|
91
121
|
}
|
|
92
122
|
}
|