@skyramp/skyramp 1.3.22 → 1.3.24
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/package.json +1 -1
- package/src/classes/ResponseV2.d.ts +7 -0
- package/src/classes/ResponseV2.js +22 -0
- package/src/workspace.d.ts +1 -1
- package/src/workspace.js +1 -1
package/package.json
CHANGED
|
@@ -22,4 +22,11 @@ export declare class ResponseV2 {
|
|
|
22
22
|
*/
|
|
23
23
|
constructor(options?: ResponseV2Options);
|
|
24
24
|
toYaml(): string;
|
|
25
|
+
toJson(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Prints the response status in a formatted way with color coding.
|
|
28
|
+
* Uses the C library function PrintResponseV2Status for output.
|
|
29
|
+
* @param expectedStatusCode - The expected HTTP status code as a string (supports wildcards like "2xx", "20x")
|
|
30
|
+
*/
|
|
31
|
+
print(expectedStatusCode: string): void;
|
|
25
32
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
const yaml = require('js-yaml');
|
|
2
|
+
const lib = require('../lib');
|
|
3
|
+
|
|
4
|
+
// C library function binding for PrintResponseV2Status
|
|
5
|
+
const printResponseV2Status = lib.func('PrintResponseV2Status', 'void', ['str', 'str']);
|
|
2
6
|
|
|
3
7
|
/**
|
|
4
8
|
* Represents a REST response.
|
|
@@ -95,6 +99,24 @@ class ResponseV2 {
|
|
|
95
99
|
}, {});
|
|
96
100
|
return JSON.stringify(jsonObject, null, 2);
|
|
97
101
|
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Prints the response status in a formatted way with color coding.
|
|
105
|
+
* Uses the C library function PrintResponseV2Status for output.
|
|
106
|
+
*
|
|
107
|
+
* @param {string} expectedStatusCode - The expected HTTP status code as a string (supports wildcards like "2xx", "20x")
|
|
108
|
+
*/
|
|
109
|
+
print(expectedStatusCode) {
|
|
110
|
+
if (!expectedStatusCode || typeof expectedStatusCode !== 'string') {
|
|
111
|
+
throw new Error('Expected status code must be a non-empty string');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Convert ResponseV2 to JSON
|
|
115
|
+
const responseJson = this.toJson();
|
|
116
|
+
|
|
117
|
+
// Call the C library function
|
|
118
|
+
printResponseV2Status(responseJson, expectedStatusCode);
|
|
119
|
+
}
|
|
98
120
|
}
|
|
99
121
|
|
|
100
122
|
|
package/src/workspace.d.ts
CHANGED
package/src/workspace.js
CHANGED
|
@@ -41,7 +41,7 @@ const serviceSchema = z.object({
|
|
|
41
41
|
.optional(),
|
|
42
42
|
runtimeDetails: z
|
|
43
43
|
.object({
|
|
44
|
-
serverStartCommand: z.string(),
|
|
44
|
+
serverStartCommand: z.string().optional(),
|
|
45
45
|
runtime: z.enum(['local', 'docker', 'k8s']),
|
|
46
46
|
dockerNetwork: z.string().optional(),
|
|
47
47
|
k8sNamespace: z.string().optional(),
|