@mistweaverco/kulala-core 0.1.5 → 0.18.0
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/cli.js +232 -0
- package/dist/index.d.ts +2 -33
- package/dist/index.js +236 -14763
- package/dist/lib/downloader/index.d.ts +15 -0
- package/dist/lib/kulala-core/index.d.ts +17 -0
- package/dist/lib/kulala-core/types.d.ts +142 -0
- package/package.json +15 -22
- package/LICENSE +0 -21
- package/README.md +0 -84
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -58
- package/dist/lib/auth/oauth2/acquisition.d.ts +0 -39
- package/dist/lib/auth/oauth2/acquisition.d.ts.map +0 -1
- package/dist/lib/auth/oauth2/browser-flow.d.ts +0 -62
- package/dist/lib/auth/oauth2/browser-flow.d.ts.map +0 -1
- package/dist/lib/auth/oauth2/config.d.ts +0 -17
- package/dist/lib/auth/oauth2/config.d.ts.map +0 -1
- package/dist/lib/auth/oauth2/continuation.d.ts +0 -10
- package/dist/lib/auth/oauth2/continuation.d.ts.map +0 -1
- package/dist/lib/auth/oauth2/manager.d.ts +0 -21
- package/dist/lib/auth/oauth2/manager.d.ts.map +0 -1
- package/dist/lib/auth/oauth2/prompt-error.d.ts +0 -10
- package/dist/lib/auth/oauth2/prompt-error.d.ts.map +0 -1
- package/dist/lib/auth/oauth2/prompt-helper.d.ts +0 -16
- package/dist/lib/auth/oauth2/prompt-helper.d.ts.map +0 -1
- package/dist/lib/auth/oauth2/types.d.ts +0 -60
- package/dist/lib/auth/oauth2/types.d.ts.map +0 -1
- package/dist/lib/helpers/index.d.ts +0 -2
- package/dist/lib/helpers/index.d.ts.map +0 -1
- package/dist/lib/parser/at-variables.d.ts +0 -17
- package/dist/lib/parser/at-variables.d.ts.map +0 -1
- package/dist/lib/parser/body.d.ts +0 -5
- package/dist/lib/parser/body.d.ts.map +0 -1
- package/dist/lib/parser/comment.d.ts +0 -3
- package/dist/lib/parser/comment.d.ts.map +0 -1
- package/dist/lib/parser/directive.d.ts +0 -15
- package/dist/lib/parser/directive.d.ts.map +0 -1
- package/dist/lib/parser/header.d.ts +0 -4
- package/dist/lib/parser/header.d.ts.map +0 -1
- package/dist/lib/parser/index.d.ts +0 -6
- package/dist/lib/parser/index.d.ts.map +0 -1
- package/dist/lib/parser/lib/helpers/index.d.ts +0 -10
- package/dist/lib/parser/lib/helpers/index.d.ts.map +0 -1
- package/dist/lib/parser/operator.d.ts +0 -4
- package/dist/lib/parser/operator.d.ts.map +0 -1
- package/dist/lib/parser/parser.d.ts +0 -3
- package/dist/lib/parser/parser.d.ts.map +0 -1
- package/dist/lib/parser/request.d.ts +0 -10
- package/dist/lib/parser/request.d.ts.map +0 -1
- package/dist/lib/parser/script.d.ts +0 -8
- package/dist/lib/parser/script.d.ts.map +0 -1
- package/dist/lib/parser/types/block.d.ts +0 -31
- package/dist/lib/parser/types/block.d.ts.map +0 -1
- package/dist/lib/parser/types/body.d.ts +0 -41
- package/dist/lib/parser/types/body.d.ts.map +0 -1
- package/dist/lib/parser/types/comment.d.ts +0 -6
- package/dist/lib/parser/types/comment.d.ts.map +0 -1
- package/dist/lib/parser/types/directive.d.ts +0 -13
- package/dist/lib/parser/types/directive.d.ts.map +0 -1
- package/dist/lib/parser/types/document.d.ts +0 -17
- package/dist/lib/parser/types/document.d.ts.map +0 -1
- package/dist/lib/parser/types/error.d.ts +0 -7
- package/dist/lib/parser/types/error.d.ts.map +0 -1
- package/dist/lib/parser/types/header.d.ts +0 -5
- package/dist/lib/parser/types/header.d.ts.map +0 -1
- package/dist/lib/parser/types/index.d.ts +0 -4
- package/dist/lib/parser/types/index.d.ts.map +0 -1
- package/dist/lib/parser/types/operator.d.ts +0 -10
- package/dist/lib/parser/types/operator.d.ts.map +0 -1
- package/dist/lib/parser/types/parser.d.ts +0 -6
- package/dist/lib/parser/types/parser.d.ts.map +0 -1
- package/dist/lib/parser/types/request.d.ts +0 -44
- package/dist/lib/parser/types/request.d.ts.map +0 -1
- package/dist/lib/parser/types/script.d.ts +0 -13
- package/dist/lib/parser/types/script.d.ts.map +0 -1
- package/dist/lib/parser/types/session.d.ts +0 -27
- package/dist/lib/parser/types/session.d.ts.map +0 -1
- package/dist/lib/parser/types/stdinparsed.d.ts +0 -31
- package/dist/lib/parser/types/stdinparsed.d.ts.map +0 -1
- package/dist/lib/parser/types/variable.d.ts +0 -4
- package/dist/lib/parser/types/variable.d.ts.map +0 -1
- package/dist/lib/persistence/cookie-store.d.ts +0 -13
- package/dist/lib/persistence/cookie-store.d.ts.map +0 -1
- package/dist/lib/persistence/data-dir.d.ts +0 -12
- package/dist/lib/persistence/data-dir.d.ts.map +0 -1
- package/dist/lib/persistence/db.d.ts +0 -44
- package/dist/lib/persistence/db.d.ts.map +0 -1
- package/dist/lib/persistence/document-store.d.ts +0 -15
- package/dist/lib/persistence/document-store.d.ts.map +0 -1
- package/dist/lib/persistence/encrypted-store.d.ts +0 -17
- package/dist/lib/persistence/encrypted-store.d.ts.map +0 -1
- package/dist/lib/persistence/history-store.d.ts +0 -26
- package/dist/lib/persistence/history-store.d.ts.map +0 -1
- package/dist/lib/persistence/index.d.ts +0 -26
- package/dist/lib/persistence/index.d.ts.map +0 -1
- package/dist/lib/persistence/keychain.d.ts +0 -24
- package/dist/lib/persistence/keychain.d.ts.map +0 -1
- package/dist/lib/persistence/prompt-store.d.ts +0 -31
- package/dist/lib/persistence/prompt-store.d.ts.map +0 -1
- package/dist/lib/persistence/replay-store.d.ts +0 -19
- package/dist/lib/persistence/replay-store.d.ts.map +0 -1
- package/dist/lib/persistence/variable-store.d.ts +0 -34
- package/dist/lib/persistence/variable-store.d.ts.map +0 -1
- package/dist/lib/runner/block.d.ts +0 -7
- package/dist/lib/runner/block.d.ts.map +0 -1
- package/dist/lib/runner/body.d.ts +0 -30
- package/dist/lib/runner/body.d.ts.map +0 -1
- package/dist/lib/runner/curl-transport.d.ts +0 -3
- package/dist/lib/runner/curl-transport.d.ts.map +0 -1
- package/dist/lib/runner/doRequest.d.ts +0 -5
- package/dist/lib/runner/doRequest.d.ts.map +0 -1
- package/dist/lib/runner/embedded-curl.d.ts +0 -2
- package/dist/lib/runner/embedded-curl.d.ts.map +0 -1
- package/dist/lib/runner/headers.d.ts +0 -14
- package/dist/lib/runner/headers.d.ts.map +0 -1
- package/dist/lib/runner/http-client.d.ts +0 -61
- package/dist/lib/runner/http-client.d.ts.map +0 -1
- package/dist/lib/runner/http-transport.d.ts +0 -5
- package/dist/lib/runner/http-transport.d.ts.map +0 -1
- package/dist/lib/runner/index.d.ts +0 -10
- package/dist/lib/runner/index.d.ts.map +0 -1
- package/dist/lib/runner/scripts.d.ts +0 -14
- package/dist/lib/runner/scripts.d.ts.map +0 -1
- package/dist/lib/runner/types.d.ts +0 -91
- package/dist/lib/runner/types.d.ts.map +0 -1
- package/dist/lib/variables/env-files.d.ts +0 -17
- package/dist/lib/variables/env-files.d.ts.map +0 -1
- package/dist/lib/variables/flatten-json.d.ts +0 -7
- package/dist/lib/variables/flatten-json.d.ts.map +0 -1
- package/dist/lib/variables/index.d.ts +0 -22
- package/dist/lib/variables/index.d.ts.map +0 -1
- package/dist/lib/variables/kuba.d.ts +0 -15
- package/dist/lib/variables/kuba.d.ts.map +0 -1
- package/dist/lib/variables/magic.d.ts +0 -7
- package/dist/lib/variables/magic.d.ts.map +0 -1
- package/dist/lib/variables/request-vars.d.ts +0 -25
- package/dist/lib/variables/request-vars.d.ts.map +0 -1
- package/dist/lib/variables/resolve.d.ts +0 -16
- package/dist/lib/variables/resolve.d.ts.map +0 -1
- package/dist/lib/variables/stable-id.d.ts +0 -6
- package/dist/lib/variables/stable-id.d.ts.map +0 -1
- package/dist/lib/variables/substitute.d.ts +0 -28
- package/dist/lib/variables/substitute.d.ts.map +0 -1
- package/scripts/ensure-vendored-curl.ts +0 -223
- package/scripts/generate-vendored-curl.ts +0 -108
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare function getBinPath(): string;
|
|
2
|
+
export declare function installBackend(): Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* Best-effort install for lifecycle scripts (postinstall/prepare).
|
|
5
|
+
* Never throws; logs a warning when download fails so first-use fallback can run.
|
|
6
|
+
*/
|
|
7
|
+
export declare function tryInstallBackend(): Promise<void>;
|
|
8
|
+
export declare function ensureInstalled(): Promise<string>;
|
|
9
|
+
export declare const downloader: {
|
|
10
|
+
ensureInstalled: typeof ensureInstalled;
|
|
11
|
+
getBinPath: typeof getBinPath;
|
|
12
|
+
installBackend: typeof installBackend;
|
|
13
|
+
tryInstallBackend: typeof tryInstallBackend;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { KulalaDocument, KulalaFormatInput, KulalaHttpFormatResult, KulalaParseInput, KulalaResponseWrapper, KulalaRunInput } from "./types";
|
|
2
|
+
export type { KulalaDocument, KulalaFormatInput, KulalaHttpFormatResult, KulalaParseInput, KulalaRequestErrorResponse, KulalaRequestSuccessResponse, KulalaResponseItem, KulalaResponseWrapper, KulalaRunInput, RunLimit, } from "./types";
|
|
3
|
+
export type InvokeOptions = {
|
|
4
|
+
cwd?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function parseDocument(input: KulalaParseInput, options?: InvokeOptions): Promise<KulalaDocument>;
|
|
7
|
+
export declare function formatDocument(input: KulalaFormatInput, options?: InvokeOptions): Promise<KulalaHttpFormatResult>;
|
|
8
|
+
export declare function runDocument(input: KulalaRunInput, options?: InvokeOptions): Promise<{
|
|
9
|
+
doc: KulalaDocument;
|
|
10
|
+
response: KulalaResponseWrapper;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const kulalaCore: {
|
|
13
|
+
parse: typeof parseDocument;
|
|
14
|
+
validate: typeof parseDocument;
|
|
15
|
+
format: typeof formatDocument;
|
|
16
|
+
run: typeof runDocument;
|
|
17
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
export type KulalaResponseBody = {
|
|
2
|
+
type: "text";
|
|
3
|
+
content: string;
|
|
4
|
+
mediaType?: string;
|
|
5
|
+
} | {
|
|
6
|
+
type: "json";
|
|
7
|
+
content: Record<string, unknown>;
|
|
8
|
+
formatted?: string;
|
|
9
|
+
};
|
|
10
|
+
export type KulalaScriptConsoleLine = {
|
|
11
|
+
level: "log" | "error" | "warn" | "info" | "debug";
|
|
12
|
+
message: string;
|
|
13
|
+
origin: {
|
|
14
|
+
type: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
line?: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type KulalaRequestSuccessResponse = {
|
|
20
|
+
success: true;
|
|
21
|
+
blockName?: string;
|
|
22
|
+
status: number;
|
|
23
|
+
headers: Record<string, string>;
|
|
24
|
+
url: string;
|
|
25
|
+
request?: {
|
|
26
|
+
method: string;
|
|
27
|
+
url: string;
|
|
28
|
+
headers?: Record<string, string>;
|
|
29
|
+
body?: string;
|
|
30
|
+
};
|
|
31
|
+
timings: {
|
|
32
|
+
dns: number;
|
|
33
|
+
tcp: number;
|
|
34
|
+
tls: number;
|
|
35
|
+
request: number;
|
|
36
|
+
redirect: number;
|
|
37
|
+
firstByte: number;
|
|
38
|
+
startTransfer: number;
|
|
39
|
+
total: number;
|
|
40
|
+
};
|
|
41
|
+
body: KulalaResponseBody;
|
|
42
|
+
filteredBody?: KulalaResponseBody;
|
|
43
|
+
scriptConsole?: KulalaScriptConsoleLine[];
|
|
44
|
+
};
|
|
45
|
+
export type KulalaRequestErrorResponse = {
|
|
46
|
+
success: false;
|
|
47
|
+
blockName?: string;
|
|
48
|
+
error: string;
|
|
49
|
+
scriptConsole?: KulalaScriptConsoleLine[];
|
|
50
|
+
httpCompleted?: boolean;
|
|
51
|
+
status?: number;
|
|
52
|
+
headers?: Record<string, string>;
|
|
53
|
+
url?: string;
|
|
54
|
+
request?: {
|
|
55
|
+
method: string;
|
|
56
|
+
url: string;
|
|
57
|
+
headers?: Record<string, string>;
|
|
58
|
+
body?: string;
|
|
59
|
+
};
|
|
60
|
+
body?: KulalaResponseBody;
|
|
61
|
+
};
|
|
62
|
+
export type KulalaPromptResponse = {
|
|
63
|
+
success: false;
|
|
64
|
+
prompt: true;
|
|
65
|
+
promptId: string;
|
|
66
|
+
promptType: string;
|
|
67
|
+
message: string;
|
|
68
|
+
inputs: Array<{
|
|
69
|
+
id: string;
|
|
70
|
+
label: string;
|
|
71
|
+
type: "text" | "password" | "url";
|
|
72
|
+
required?: boolean;
|
|
73
|
+
}>;
|
|
74
|
+
};
|
|
75
|
+
export type KulalaSkippedResponse = {
|
|
76
|
+
success: true;
|
|
77
|
+
skipped: true;
|
|
78
|
+
blockName?: string;
|
|
79
|
+
scriptConsole?: KulalaScriptConsoleLine[];
|
|
80
|
+
};
|
|
81
|
+
export type KulalaWebSocketPlanResponse = {
|
|
82
|
+
success: true;
|
|
83
|
+
protocol: "websocket";
|
|
84
|
+
url: string;
|
|
85
|
+
initialMessage?: string;
|
|
86
|
+
};
|
|
87
|
+
export type KulalaResponseItem = KulalaRequestSuccessResponse | KulalaRequestErrorResponse | KulalaPromptResponse | KulalaSkippedResponse | KulalaWebSocketPlanResponse;
|
|
88
|
+
export type KulalaResponseWrapper = {
|
|
89
|
+
type: "responses";
|
|
90
|
+
data: KulalaResponseItem[];
|
|
91
|
+
} | {
|
|
92
|
+
type: "error";
|
|
93
|
+
data: KulalaRequestErrorResponse[];
|
|
94
|
+
};
|
|
95
|
+
export type RunLimit = {
|
|
96
|
+
filter: "name";
|
|
97
|
+
name: string;
|
|
98
|
+
} | {
|
|
99
|
+
filter: "cursorPosition";
|
|
100
|
+
line: number;
|
|
101
|
+
column: number;
|
|
102
|
+
};
|
|
103
|
+
export type KulalaDocument = {
|
|
104
|
+
hasErrors: boolean;
|
|
105
|
+
blocks: Array<{
|
|
106
|
+
name: string;
|
|
107
|
+
errors?: Array<{
|
|
108
|
+
message: string;
|
|
109
|
+
lineNumber?: number;
|
|
110
|
+
}>;
|
|
111
|
+
}>;
|
|
112
|
+
[key: string]: unknown;
|
|
113
|
+
};
|
|
114
|
+
export type KulalaHttpFormatResult = {
|
|
115
|
+
content: string;
|
|
116
|
+
changed: boolean;
|
|
117
|
+
};
|
|
118
|
+
export type KulalaRunInput = {
|
|
119
|
+
content: string;
|
|
120
|
+
filepath?: string;
|
|
121
|
+
env?: string;
|
|
122
|
+
limit?: RunLimit[];
|
|
123
|
+
haltOnError?: boolean;
|
|
124
|
+
};
|
|
125
|
+
export type KulalaParseInput = {
|
|
126
|
+
content: string;
|
|
127
|
+
filepath?: string;
|
|
128
|
+
};
|
|
129
|
+
export type KulalaFormatInput = {
|
|
130
|
+
content: string;
|
|
131
|
+
filepath?: string;
|
|
132
|
+
formatBody?: boolean;
|
|
133
|
+
bodyFormat?: {
|
|
134
|
+
indent?: number;
|
|
135
|
+
line_width?: number;
|
|
136
|
+
expand_tabs?: boolean;
|
|
137
|
+
};
|
|
138
|
+
defaults?: {
|
|
139
|
+
http_method?: string;
|
|
140
|
+
http_version?: string | false;
|
|
141
|
+
};
|
|
142
|
+
};
|
package/package.json
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mistweaverco/kulala-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"private": false,
|
|
6
5
|
"license": "MIT",
|
|
7
6
|
"repository": {
|
|
8
7
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/mistweaverco/kulala-core.git"
|
|
8
|
+
"url": "git+https://github.com/mistweaverco/kulala-core.git",
|
|
9
|
+
"directory": "packages/core-npm-wrapper"
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://github.com/mistweaverco/kulala-core#readme",
|
|
12
12
|
"bugs": {
|
|
13
13
|
"url": "https://github.com/mistweaverco/kulala-core/issues"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
|
-
"
|
|
16
|
+
"node": ">=20"
|
|
17
|
+
},
|
|
18
|
+
"bin": {
|
|
19
|
+
"kulala-core": "dist/cli.js"
|
|
17
20
|
},
|
|
18
21
|
"main": "./dist/index.js",
|
|
19
|
-
"module": "./dist/index.js",
|
|
20
22
|
"types": "./dist/index.d.ts",
|
|
21
23
|
"exports": {
|
|
22
24
|
".": {
|
|
@@ -25,25 +27,16 @@
|
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
29
|
"files": [
|
|
28
|
-
"dist",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
30
|
+
"dist/cli.js",
|
|
31
|
+
"dist/index.js",
|
|
32
|
+
"dist/index.d.ts",
|
|
33
|
+
"dist/install-backend.js",
|
|
34
|
+
"dist/lib"
|
|
32
35
|
],
|
|
33
36
|
"scripts": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"postinstall": "bun run ./scripts/ensure-vendored-curl.ts",
|
|
38
|
-
"build": "bun run build:js && bun run build:types",
|
|
39
|
-
"build:js": "bun build src/index.ts --outdir dist --format esm --target bun --sourcemap --define __KULALA_EMBED_CURL__=false",
|
|
40
|
-
"build:types": "tsc -p tsconfig.build.json",
|
|
41
|
-
"prepack": "cp ./../../README.md . && cp ./../../LICENSE . && bun run build"
|
|
42
|
-
},
|
|
43
|
-
"pkg": {
|
|
44
|
-
"assets": [
|
|
45
|
-
"../../vendor/curl/**/*"
|
|
46
|
-
]
|
|
37
|
+
"build": "bun run scripts/build.ts",
|
|
38
|
+
"prepare": "bun run scripts/build.ts || true",
|
|
39
|
+
"postinstall": "node dist/install-backend.js || true"
|
|
47
40
|
},
|
|
48
41
|
"publishConfig": {
|
|
49
42
|
"access": "public"
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025+ mistweaverco
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
# Kulala Core
|
|
6
|
-
|
|
7
|
-
[](https://github.com/mistweaverco/kulala-core/graphs/contributors)
|
|
8
|
-
[](https://github.com/mistweaverco/kulala-core/releases/latest)
|
|
9
|
-
[](https://github.com/orgs/mistweaverco/projects/3/views/1?filterQuery=repo%3Amistweaverco%2Fkulala-core)
|
|
10
|
-
[](https://discord.gg/QyVQmfY4Rt)
|
|
11
|
-
|
|
12
|
-
<p></p>
|
|
13
|
-
|
|
14
|
-
Kulala is swahili for "rest" or "relax."
|
|
15
|
-
|
|
16
|
-
A straightforwarded, powerful, and extendable HTTP client library.
|
|
17
|
-
It powers the [Kulala toolchain](https://getkulala.net),
|
|
18
|
-
and can be used as a standalone library.
|
|
19
|
-
|
|
20
|
-
<p></p>
|
|
21
|
-
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
## Overview
|
|
25
|
-
|
|
26
|
-
A RESTful API is a web service architecture that adheres to
|
|
27
|
-
specific constraints:
|
|
28
|
-
|
|
29
|
-
- statelessness,
|
|
30
|
-
- uniform interface,
|
|
31
|
-
- client-server separation
|
|
32
|
-
|
|
33
|
-
Typically using HTTP methods like `GET`, `POST`, `PUT`, and `DELETE`.
|
|
34
|
-
It uses standard web protocols to enable interoperability
|
|
35
|
-
between distributed systems.
|
|
36
|
-
|
|
37
|
-
## Features
|
|
38
|
-
|
|
39
|
-
### Request types
|
|
40
|
-
|
|
41
|
-
- HTTP RESTful (1.0, 1.1, 2, 3)
|
|
42
|
-
- GraphQL (queries, mutations)
|
|
43
|
-
|
|
44
|
-
### Variables
|
|
45
|
-
|
|
46
|
-
- Host Environment
|
|
47
|
-
- Document variables
|
|
48
|
-
- Request scoped variables
|
|
49
|
-
- `http-client.env` files
|
|
50
|
-
- Built-in support for [kuba](https://kuba.mwco.app)
|
|
51
|
-
|
|
52
|
-
### Scripting
|
|
53
|
-
|
|
54
|
-
Supports JavaScript, Lua, and TypeScript for:
|
|
55
|
-
|
|
56
|
-
- Pre-request
|
|
57
|
-
- Post-request
|
|
58
|
-
- Conditional
|
|
59
|
-
- Inline
|
|
60
|
-
- External
|
|
61
|
-
|
|
62
|
-
### Authentication
|
|
63
|
-
|
|
64
|
-
- Basic
|
|
65
|
-
- Bearer
|
|
66
|
-
- OAuth 2.0
|
|
67
|
-
|
|
68
|
-
### Automation and testing
|
|
69
|
-
|
|
70
|
-
Assertions, automated testing and reporting
|
|
71
|
-
is compatible with the IntelliJ HTTP Client:
|
|
72
|
-
|
|
73
|
-
## Usage
|
|
74
|
-
|
|
75
|
-
See the [examples][examples]
|
|
76
|
-
directory for usage examples.
|
|
77
|
-
|
|
78
|
-
### Vendored curl
|
|
79
|
-
|
|
80
|
-
- **`npm install` / `bun install`**: the `@mistweaverco/kulala-core` package runs `postinstall`, which downloads a pinned static curl for the **installing machine’s** OS and architecture into the user cache (or you can set `KULALA_CURL_PATH` to your own binary).
|
|
81
|
-
- **Published library** (`dist/`): the npm build sets `__KULALA_EMBED_CURL__=false`, so the tarball does **not** embed curl from the machine that ran `npm publish`.
|
|
82
|
-
- **`bun build --compile`** (your app or the examples): run `packages/core/scripts/generate-vendored-curl.ts` (optionally with `--target=bun-…` for cross-compiles), then compile with `--define __KULALA_EMBED_CURL__=true` so the correct curl is embedded for that build. For cross-compilation you must have the matching curl available under the cache path or under `vendor/curl/<platform>-<arch>/` in this repo.
|
|
83
|
-
|
|
84
|
-
[examples]: https://github.com/mistweaverco/kulala-core/tree/main/examples
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAExE,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EACV,0BAA0B,EAC1B,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AASzD,eAAO,MAAM,UAAU;;;;;4BAPK;QAC1B,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,KAAG,OAAO,CAAC,cAAc,CAAC;+BAHC;QAC1B,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,KAAG,OAAO,CAAC,cAAc,CAAC;0BASN;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,yBAAyB,EAAE,CAAC;KACrC,KAAG,OAAO,CAAC;QAAE,GAAG,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,qBAAqB,CAAA;KAAE,CAAC;CAwB7D,CAAC"}
|