@plasmicpkgs/fetch 0.0.3 → 0.0.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/index.d.ts +20 -0
- package/dist/index.esm.js +130 -8
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +128 -8
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,24 @@ declare function fetch_2(url: string, method: HTTPMethod, headers: Record<string
|
|
|
9
9
|
}>;
|
|
10
10
|
export { fetch_2 as fetch }
|
|
11
11
|
|
|
12
|
+
export declare interface FetchProps {
|
|
13
|
+
url?: string;
|
|
14
|
+
method?: string;
|
|
15
|
+
body?: string | object;
|
|
16
|
+
headers?: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare function graphqlFetch(url: string, method: HTTPMethod, headers: Record<string, string>, query?: {
|
|
20
|
+
query?: string;
|
|
21
|
+
variables?: object;
|
|
22
|
+
}, varOverrides?: Record<string, any>): Promise<{
|
|
23
|
+
statusCode: number;
|
|
24
|
+
headers: {
|
|
25
|
+
[k: string]: string;
|
|
26
|
+
};
|
|
27
|
+
response: any;
|
|
28
|
+
}>;
|
|
29
|
+
|
|
12
30
|
declare type HTTPMethod = "GET" | "POST" | "PUT" | "DELETE";
|
|
13
31
|
|
|
14
32
|
declare type Registerable = {
|
|
@@ -17,4 +35,6 @@ declare type Registerable = {
|
|
|
17
35
|
|
|
18
36
|
export declare function registerFetch(loader?: Registerable): void;
|
|
19
37
|
|
|
38
|
+
export declare function registerGraphqlFetch(loader?: Registerable): void;
|
|
39
|
+
|
|
20
40
|
export { }
|
package/dist/index.esm.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1
20
|
var __async = (__this, __arguments, generator) => {
|
|
2
21
|
return new Promise((resolve, reject) => {
|
|
3
22
|
var fulfilled = (value) => {
|
|
@@ -21,6 +40,14 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21
40
|
|
|
22
41
|
// src/index.ts
|
|
23
42
|
import registerFunction from "@plasmicapp/host/registerFunction";
|
|
43
|
+
var CustomError = class extends Error {
|
|
44
|
+
constructor(message, info, status) {
|
|
45
|
+
super(message);
|
|
46
|
+
this.name = "CustomError";
|
|
47
|
+
this.info = info;
|
|
48
|
+
this.status = status;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
24
51
|
function base64StringToBuffer(bstr) {
|
|
25
52
|
try {
|
|
26
53
|
bstr = atob(bstr);
|
|
@@ -51,22 +78,45 @@ function maybeParseJSON(json) {
|
|
|
51
78
|
return json;
|
|
52
79
|
}
|
|
53
80
|
}
|
|
54
|
-
function
|
|
55
|
-
return __async(this,
|
|
81
|
+
function performFetch(_0) {
|
|
82
|
+
return __async(this, arguments, function* ({ url, method, body, headers }) {
|
|
83
|
+
if (!url) {
|
|
84
|
+
throw new Error("Please specify a URL to fetch");
|
|
85
|
+
}
|
|
86
|
+
if (!headers) {
|
|
87
|
+
headers = {};
|
|
88
|
+
}
|
|
89
|
+
const headerNamesLowercase = new Set(
|
|
90
|
+
Object.keys(headers).map((headerName) => headerName.toLowerCase())
|
|
91
|
+
);
|
|
92
|
+
if (!headerNamesLowercase.has("accept")) {
|
|
93
|
+
headers["Accept"] = "application/json";
|
|
94
|
+
}
|
|
95
|
+
if (body && !headerNamesLowercase.has("content-type")) {
|
|
96
|
+
headers["Content-Type"] = "application/json";
|
|
97
|
+
}
|
|
56
98
|
const response = yield fetch(url, {
|
|
57
99
|
method,
|
|
58
100
|
headers,
|
|
59
101
|
body: bodyToFetchBody(body)
|
|
60
102
|
});
|
|
61
|
-
const
|
|
62
|
-
const
|
|
103
|
+
const text = yield response.text();
|
|
104
|
+
const maybeJson = maybeParseJSON(text);
|
|
105
|
+
if (!response.ok) {
|
|
106
|
+
throw new CustomError(response.statusText, maybeJson, response.status);
|
|
107
|
+
}
|
|
63
108
|
return {
|
|
64
|
-
statusCode,
|
|
109
|
+
statusCode: response.status,
|
|
65
110
|
headers: Object.fromEntries(response.headers.entries()),
|
|
66
|
-
response:
|
|
111
|
+
response: maybeJson
|
|
67
112
|
};
|
|
68
113
|
});
|
|
69
114
|
}
|
|
115
|
+
function wrappedFetch(url, method, headers, body) {
|
|
116
|
+
return __async(this, null, function* () {
|
|
117
|
+
return yield performFetch({ url, method, headers, body });
|
|
118
|
+
});
|
|
119
|
+
}
|
|
70
120
|
var registerFetchParams = {
|
|
71
121
|
name: "fetch",
|
|
72
122
|
importPath: "@plasmicpkgs/fetch",
|
|
@@ -77,7 +127,8 @@ var registerFetchParams = {
|
|
|
77
127
|
},
|
|
78
128
|
{
|
|
79
129
|
name: "method",
|
|
80
|
-
type: "
|
|
130
|
+
type: "choice",
|
|
131
|
+
options: ["GET", "POST", "PUT", "DELETE"]
|
|
81
132
|
},
|
|
82
133
|
{
|
|
83
134
|
name: "headers",
|
|
@@ -96,8 +147,79 @@ function registerFetch(loader) {
|
|
|
96
147
|
registerFunction(wrappedFetch, registerFetchParams);
|
|
97
148
|
}
|
|
98
149
|
}
|
|
150
|
+
function graphqlFetch(url, method, headers, query, varOverrides) {
|
|
151
|
+
return __async(this, null, function* () {
|
|
152
|
+
var _a;
|
|
153
|
+
let fetchProps;
|
|
154
|
+
method = method != null ? method : "POST";
|
|
155
|
+
if (method === "GET") {
|
|
156
|
+
const urlWithQueryParams = new URL(url != null ? url : "");
|
|
157
|
+
urlWithQueryParams.searchParams.set("query", (_a = query == null ? void 0 : query.query) != null ? _a : "{}");
|
|
158
|
+
urlWithQueryParams.searchParams.set(
|
|
159
|
+
"variables",
|
|
160
|
+
JSON.stringify(__spreadValues(__spreadValues({}, query == null ? void 0 : query.variables), varOverrides))
|
|
161
|
+
);
|
|
162
|
+
fetchProps = {
|
|
163
|
+
url: urlWithQueryParams.toString(),
|
|
164
|
+
method,
|
|
165
|
+
headers
|
|
166
|
+
};
|
|
167
|
+
} else {
|
|
168
|
+
fetchProps = {
|
|
169
|
+
body: __spreadProps(__spreadValues({}, query), { variables: __spreadValues(__spreadValues({}, query == null ? void 0 : query.variables), varOverrides) }),
|
|
170
|
+
url,
|
|
171
|
+
method,
|
|
172
|
+
headers
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
return performFetch(fetchProps);
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
var registerGraphqlFetchParams = {
|
|
179
|
+
name: "graphqlFetch",
|
|
180
|
+
importPath: "@plasmicpkgs/fetch",
|
|
181
|
+
params: [
|
|
182
|
+
{
|
|
183
|
+
name: "url",
|
|
184
|
+
type: "string"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "method",
|
|
188
|
+
type: "choice",
|
|
189
|
+
options: ["GET", "POST", "PUT", "DELETE"]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: "headers",
|
|
193
|
+
type: "object"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "query",
|
|
197
|
+
type: "code",
|
|
198
|
+
lang: "graphql",
|
|
199
|
+
headers: (props) => props.headers,
|
|
200
|
+
endpoint: (props) => {
|
|
201
|
+
var _a;
|
|
202
|
+
return (_a = props.url) != null ? _a : "";
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "varOverrides",
|
|
207
|
+
type: "object"
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
// TODO: remove as any when "code" type is available
|
|
211
|
+
};
|
|
212
|
+
function registerGraphqlFetch(loader) {
|
|
213
|
+
if (loader) {
|
|
214
|
+
loader.registerFunction(graphqlFetch, registerGraphqlFetchParams);
|
|
215
|
+
} else {
|
|
216
|
+
registerFunction(graphqlFetch, registerGraphqlFetchParams);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
99
219
|
export {
|
|
100
220
|
wrappedFetch as fetch,
|
|
101
|
-
|
|
221
|
+
graphqlFetch,
|
|
222
|
+
registerFetch,
|
|
223
|
+
registerGraphqlFetch
|
|
102
224
|
};
|
|
103
225
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import registerFunction, {\n CustomFunctionMeta,\n} from \"@plasmicapp/host/registerFunction\";\n\ntype Registerable = {\n registerFunction: typeof registerFunction;\n};\n\n// Some functions were extracted from platform/wab/src/wab/server/data-sources/http-fetcher.ts\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import registerFunction, {\n CustomFunctionMeta,\n} from \"@plasmicapp/host/registerFunction\";\n\ntype Registerable = {\n registerFunction: typeof registerFunction;\n};\n\nclass CustomError extends Error {\n info: Record<string, any>;\n status: number;\n constructor(message: string, info: Record<string, string>, status: number) {\n super(message);\n this.name = \"CustomError\";\n this.info = info;\n this.status = status;\n }\n}\n\n// Some functions were extracted from platform/wab/src/wab/server/data-sources/http-fetcher.ts\ntype HTTPMethod = \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n\nfunction base64StringToBuffer(bstr: string) {\n try {\n bstr = atob(bstr);\n } catch (e) {\n throw new Error(\"Invalid base64 for binary type\");\n }\n const uint8Array = new Uint8Array(bstr.length);\n for (let i = 0; i < bstr.length; i++) {\n uint8Array[i] = bstr.charCodeAt(i);\n }\n return uint8Array.buffer;\n}\n\nfunction bodyToFetchBody(body?: string | object) {\n if (body == null) {\n return undefined;\n } else if (typeof body === \"object\") {\n return JSON.stringify(body);\n } else if (body.startsWith(\"@binary\")) {\n return base64StringToBuffer(body.slice(\"@binary\".length));\n } else {\n return body;\n }\n}\n\nfunction maybeParseJSON(json: string) {\n try {\n return JSON.parse(json);\n } catch (e) {\n return json;\n }\n}\n\nexport interface FetchProps {\n url?: string;\n method?: string;\n body?: string | object;\n headers?: Record<string, string>;\n}\n\nasync function performFetch({ url, method, body, headers }: FetchProps) {\n if (!url) {\n throw new Error(\"Please specify a URL to fetch\");\n }\n\n // Add default headers unless specified\n if (!headers) {\n headers = {};\n }\n const headerNamesLowercase = new Set(\n Object.keys(headers).map((headerName) => headerName.toLowerCase())\n );\n if (!headerNamesLowercase.has(\"accept\")) {\n headers[\"Accept\"] = \"application/json\";\n }\n if (body && !headerNamesLowercase.has(\"content-type\")) {\n headers[\"Content-Type\"] = \"application/json\";\n }\n\n const response = await fetch(url, {\n method,\n headers,\n body: bodyToFetchBody(body),\n });\n\n const text = await response.text();\n const maybeJson = maybeParseJSON(text);\n\n // @see https://swr.vercel.app/docs/error-handling\n // If the status code is not in the range 200-299,\n // we still try to parse and throw it.\n if (!response.ok) {\n throw new CustomError(response.statusText, maybeJson, response.status);\n }\n\n return {\n statusCode: response.status,\n headers: Object.fromEntries(response.headers.entries()),\n response: maybeJson,\n };\n}\n\nasync function wrappedFetch(\n url: string,\n method: HTTPMethod,\n headers: Record<string, string>,\n body?: string | object\n) {\n return await performFetch({ url, method, headers, body });\n}\n\nexport { wrappedFetch as fetch };\n\nconst registerFetchParams: CustomFunctionMeta<typeof wrappedFetch> = {\n name: \"fetch\",\n importPath: \"@plasmicpkgs/fetch\",\n params: [\n {\n name: \"url\",\n type: \"string\",\n },\n {\n name: \"method\",\n type: \"choice\",\n options: [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\n },\n {\n name: \"headers\",\n type: \"object\",\n },\n {\n name: \"body\",\n type: \"object\",\n },\n ],\n};\n\nexport function registerFetch(loader?: Registerable) {\n if (loader) {\n loader.registerFunction(wrappedFetch, registerFetchParams);\n } else {\n registerFunction(wrappedFetch, registerFetchParams);\n }\n}\n\nexport async function graphqlFetch(\n url: string,\n method: HTTPMethod,\n headers: Record<string, string>,\n query?: { query?: string; variables?: object },\n varOverrides?: Record<string, any>\n) {\n let fetchProps: FetchProps;\n method = method ?? \"POST\";\n\n if (method === \"GET\") {\n // https://graphql.org/learn/serving-over-http/#get-request-and-parameters\n const urlWithQueryParams = new URL(url ?? \"\");\n urlWithQueryParams.searchParams.set(\"query\", query?.query ?? \"{}\");\n urlWithQueryParams.searchParams.set(\n \"variables\",\n JSON.stringify({ ...query?.variables, ...varOverrides })\n );\n fetchProps = {\n url: urlWithQueryParams.toString(),\n method,\n headers,\n };\n } else {\n fetchProps = {\n body: { ...query, variables: { ...query?.variables, ...varOverrides } },\n url,\n method,\n headers,\n };\n }\n\n return performFetch(fetchProps);\n}\n\nconst registerGraphqlFetchParams: CustomFunctionMeta<typeof graphqlFetch> = {\n name: \"graphqlFetch\",\n importPath: \"@plasmicpkgs/fetch\",\n params: [\n {\n name: \"url\",\n type: \"string\",\n },\n {\n name: \"method\",\n type: \"choice\",\n options: [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\n },\n {\n name: \"headers\",\n type: \"object\",\n },\n {\n name: \"query\",\n type: \"code\",\n lang: \"graphql\",\n headers: (props: any) => props.headers,\n endpoint: (props: any) => props.url ?? \"\",\n },\n {\n name: \"varOverrides\",\n type: \"object\",\n },\n ],\n // TODO: remove as any when \"code\" type is available\n} as any;\n\nexport function registerGraphqlFetch(loader?: Registerable) {\n if (loader) {\n loader.registerFunction(graphqlFetch, registerGraphqlFetchParams);\n } else {\n registerFunction(graphqlFetch, registerGraphqlFetchParams);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,sBAEA;AAMP,IAAM,cAAN,cAA0B,MAAM;AAAA,EAG9B,YAAY,SAAiB,MAA8B,QAAgB;AACzE,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,SAAS;AAAA,EAChB;AACF;AAKA,SAAS,qBAAqB,MAAc;AAC1C,MAAI;AACF,WAAO,KAAK,IAAI;AAAA,EAClB,SAAS,GAAP;AACA,UAAM,IAAI,MAAM,gCAAgC;AAAA,EAClD;AACA,QAAM,aAAa,IAAI,WAAW,KAAK,MAAM;AAC7C,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,eAAW,CAAC,IAAI,KAAK,WAAW,CAAC;AAAA,EACnC;AACA,SAAO,WAAW;AACpB;AAEA,SAAS,gBAAgB,MAAwB;AAC/C,MAAI,QAAQ,MAAM;AAChB,WAAO;AAAA,EACT,WAAW,OAAO,SAAS,UAAU;AACnC,WAAO,KAAK,UAAU,IAAI;AAAA,EAC5B,WAAW,KAAK,WAAW,SAAS,GAAG;AACrC,WAAO,qBAAqB,KAAK,MAAM,UAAU,MAAM,CAAC;AAAA,EAC1D,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAEA,SAAS,eAAe,MAAc;AACpC,MAAI;AACF,WAAO,KAAK,MAAM,IAAI;AAAA,EACxB,SAAS,GAAP;AACA,WAAO;AAAA,EACT;AACF;AASA,SAAe,aAAa,IAA4C;AAAA,6CAA5C,EAAE,K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UAAU,CAAC,UAAY;AA5M7B;AA4MgC,2BAAM,QAAN,YAAa;AAAA;AAAA,IACzC;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,EACF;AAAA;AAEF;AAEO,SAAS,qBAAqB,QAAuB;AAC1D,MAAI,QAAQ;AACV,WAAO,iBAAiB,cAAc,0BAA0B;AAAA,EAClE,OAAO;AACL,qBAAiB,cAAc,0BAA0B;AAAA,EAC3D;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
9
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
10
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
8
25
|
var __export = (target, all) => {
|
|
9
26
|
for (var name in all)
|
|
10
27
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -51,10 +68,20 @@ var __async = (__this, __arguments, generator) => {
|
|
|
51
68
|
var src_exports = {};
|
|
52
69
|
__export(src_exports, {
|
|
53
70
|
fetch: () => wrappedFetch,
|
|
54
|
-
|
|
71
|
+
graphqlFetch: () => graphqlFetch,
|
|
72
|
+
registerFetch: () => registerFetch,
|
|
73
|
+
registerGraphqlFetch: () => registerGraphqlFetch
|
|
55
74
|
});
|
|
56
75
|
module.exports = __toCommonJS(src_exports);
|
|
57
76
|
var import_registerFunction = __toESM(require("@plasmicapp/host/registerFunction"));
|
|
77
|
+
var CustomError = class extends Error {
|
|
78
|
+
constructor(message, info, status) {
|
|
79
|
+
super(message);
|
|
80
|
+
this.name = "CustomError";
|
|
81
|
+
this.info = info;
|
|
82
|
+
this.status = status;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
58
85
|
function base64StringToBuffer(bstr) {
|
|
59
86
|
try {
|
|
60
87
|
bstr = atob(bstr);
|
|
@@ -85,22 +112,45 @@ function maybeParseJSON(json) {
|
|
|
85
112
|
return json;
|
|
86
113
|
}
|
|
87
114
|
}
|
|
88
|
-
function
|
|
89
|
-
return __async(this,
|
|
115
|
+
function performFetch(_0) {
|
|
116
|
+
return __async(this, arguments, function* ({ url, method, body, headers }) {
|
|
117
|
+
if (!url) {
|
|
118
|
+
throw new Error("Please specify a URL to fetch");
|
|
119
|
+
}
|
|
120
|
+
if (!headers) {
|
|
121
|
+
headers = {};
|
|
122
|
+
}
|
|
123
|
+
const headerNamesLowercase = new Set(
|
|
124
|
+
Object.keys(headers).map((headerName) => headerName.toLowerCase())
|
|
125
|
+
);
|
|
126
|
+
if (!headerNamesLowercase.has("accept")) {
|
|
127
|
+
headers["Accept"] = "application/json";
|
|
128
|
+
}
|
|
129
|
+
if (body && !headerNamesLowercase.has("content-type")) {
|
|
130
|
+
headers["Content-Type"] = "application/json";
|
|
131
|
+
}
|
|
90
132
|
const response = yield fetch(url, {
|
|
91
133
|
method,
|
|
92
134
|
headers,
|
|
93
135
|
body: bodyToFetchBody(body)
|
|
94
136
|
});
|
|
95
|
-
const
|
|
96
|
-
const
|
|
137
|
+
const text = yield response.text();
|
|
138
|
+
const maybeJson = maybeParseJSON(text);
|
|
139
|
+
if (!response.ok) {
|
|
140
|
+
throw new CustomError(response.statusText, maybeJson, response.status);
|
|
141
|
+
}
|
|
97
142
|
return {
|
|
98
|
-
statusCode,
|
|
143
|
+
statusCode: response.status,
|
|
99
144
|
headers: Object.fromEntries(response.headers.entries()),
|
|
100
|
-
response:
|
|
145
|
+
response: maybeJson
|
|
101
146
|
};
|
|
102
147
|
});
|
|
103
148
|
}
|
|
149
|
+
function wrappedFetch(url, method, headers, body) {
|
|
150
|
+
return __async(this, null, function* () {
|
|
151
|
+
return yield performFetch({ url, method, headers, body });
|
|
152
|
+
});
|
|
153
|
+
}
|
|
104
154
|
var registerFetchParams = {
|
|
105
155
|
name: "fetch",
|
|
106
156
|
importPath: "@plasmicpkgs/fetch",
|
|
@@ -111,7 +161,8 @@ var registerFetchParams = {
|
|
|
111
161
|
},
|
|
112
162
|
{
|
|
113
163
|
name: "method",
|
|
114
|
-
type: "
|
|
164
|
+
type: "choice",
|
|
165
|
+
options: ["GET", "POST", "PUT", "DELETE"]
|
|
115
166
|
},
|
|
116
167
|
{
|
|
117
168
|
name: "headers",
|
|
@@ -130,4 +181,73 @@ function registerFetch(loader) {
|
|
|
130
181
|
(0, import_registerFunction.default)(wrappedFetch, registerFetchParams);
|
|
131
182
|
}
|
|
132
183
|
}
|
|
184
|
+
function graphqlFetch(url, method, headers, query, varOverrides) {
|
|
185
|
+
return __async(this, null, function* () {
|
|
186
|
+
var _a;
|
|
187
|
+
let fetchProps;
|
|
188
|
+
method = method != null ? method : "POST";
|
|
189
|
+
if (method === "GET") {
|
|
190
|
+
const urlWithQueryParams = new URL(url != null ? url : "");
|
|
191
|
+
urlWithQueryParams.searchParams.set("query", (_a = query == null ? void 0 : query.query) != null ? _a : "{}");
|
|
192
|
+
urlWithQueryParams.searchParams.set(
|
|
193
|
+
"variables",
|
|
194
|
+
JSON.stringify(__spreadValues(__spreadValues({}, query == null ? void 0 : query.variables), varOverrides))
|
|
195
|
+
);
|
|
196
|
+
fetchProps = {
|
|
197
|
+
url: urlWithQueryParams.toString(),
|
|
198
|
+
method,
|
|
199
|
+
headers
|
|
200
|
+
};
|
|
201
|
+
} else {
|
|
202
|
+
fetchProps = {
|
|
203
|
+
body: __spreadProps(__spreadValues({}, query), { variables: __spreadValues(__spreadValues({}, query == null ? void 0 : query.variables), varOverrides) }),
|
|
204
|
+
url,
|
|
205
|
+
method,
|
|
206
|
+
headers
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
return performFetch(fetchProps);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
var registerGraphqlFetchParams = {
|
|
213
|
+
name: "graphqlFetch",
|
|
214
|
+
importPath: "@plasmicpkgs/fetch",
|
|
215
|
+
params: [
|
|
216
|
+
{
|
|
217
|
+
name: "url",
|
|
218
|
+
type: "string"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: "method",
|
|
222
|
+
type: "choice",
|
|
223
|
+
options: ["GET", "POST", "PUT", "DELETE"]
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: "headers",
|
|
227
|
+
type: "object"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: "query",
|
|
231
|
+
type: "code",
|
|
232
|
+
lang: "graphql",
|
|
233
|
+
headers: (props) => props.headers,
|
|
234
|
+
endpoint: (props) => {
|
|
235
|
+
var _a;
|
|
236
|
+
return (_a = props.url) != null ? _a : "";
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: "varOverrides",
|
|
241
|
+
type: "object"
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
// TODO: remove as any when "code" type is available
|
|
245
|
+
};
|
|
246
|
+
function registerGraphqlFetch(loader) {
|
|
247
|
+
if (loader) {
|
|
248
|
+
loader.registerFunction(graphqlFetch, registerGraphqlFetchParams);
|
|
249
|
+
} else {
|
|
250
|
+
(0, import_registerFunction.default)(graphqlFetch, registerGraphqlFetchParams);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
133
253
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import registerFunction, {\n CustomFunctionMeta,\n} from \"@plasmicapp/host/registerFunction\";\n\ntype Registerable = {\n registerFunction: typeof registerFunction;\n};\n\n// Some functions were extracted from platform/wab/src/wab/server/data-sources/http-fetcher.ts\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import registerFunction, {\n CustomFunctionMeta,\n} from \"@plasmicapp/host/registerFunction\";\n\ntype Registerable = {\n registerFunction: typeof registerFunction;\n};\n\nclass CustomError extends Error {\n info: Record<string, any>;\n status: number;\n constructor(message: string, info: Record<string, string>, status: number) {\n super(message);\n this.name = \"CustomError\";\n this.info = info;\n this.status = status;\n }\n}\n\n// Some functions were extracted from platform/wab/src/wab/server/data-sources/http-fetcher.ts\ntype HTTPMethod = \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n\nfunction base64StringToBuffer(bstr: string) {\n try {\n bstr = atob(bstr);\n } catch (e) {\n throw new Error(\"Invalid base64 for binary type\");\n }\n const uint8Array = new Uint8Array(bstr.length);\n for (let i = 0; i < bstr.length; i++) {\n uint8Array[i] = bstr.charCodeAt(i);\n }\n return uint8Array.buffer;\n}\n\nfunction bodyToFetchBody(body?: string | object) {\n if (body == null) {\n return undefined;\n } else if (typeof body === \"object\") {\n return JSON.stringify(body);\n } else if (body.startsWith(\"@binary\")) {\n return base64StringToBuffer(body.slice(\"@binary\".length));\n } else {\n return body;\n }\n}\n\nfunction maybeParseJSON(json: string) {\n try {\n return JSON.parse(json);\n } catch (e) {\n return json;\n }\n}\n\nexport interface FetchProps {\n url?: string;\n method?: string;\n body?: string | object;\n headers?: Record<string, string>;\n}\n\nasync function performFetch({ url, method, body, headers }: FetchProps) {\n if (!url) {\n throw new Error(\"Please specify a URL to fetch\");\n }\n\n // Add default headers unless specified\n if (!headers) {\n headers = {};\n }\n const headerNamesLowercase = new Set(\n Object.keys(headers).map((headerName) => headerName.toLowerCase())\n );\n if (!headerNamesLowercase.has(\"accept\")) {\n headers[\"Accept\"] = \"application/json\";\n }\n if (body && !headerNamesLowercase.has(\"content-type\")) {\n headers[\"Content-Type\"] = \"application/json\";\n }\n\n const response = await fetch(url, {\n method,\n headers,\n body: bodyToFetchBody(body),\n });\n\n const text = await response.text();\n const maybeJson = maybeParseJSON(text);\n\n // @see https://swr.vercel.app/docs/error-handling\n // If the status code is not in the range 200-299,\n // we still try to parse and throw it.\n if (!response.ok) {\n throw new CustomError(response.statusText, maybeJson, response.status);\n }\n\n return {\n statusCode: response.status,\n headers: Object.fromEntries(response.headers.entries()),\n response: maybeJson,\n };\n}\n\nasync function wrappedFetch(\n url: string,\n method: HTTPMethod,\n headers: Record<string, string>,\n body?: string | object\n) {\n return await performFetch({ url, method, headers, body });\n}\n\nexport { wrappedFetch as fetch };\n\nconst registerFetchParams: CustomFunctionMeta<typeof wrappedFetch> = {\n name: \"fetch\",\n importPath: \"@plasmicpkgs/fetch\",\n params: [\n {\n name: \"url\",\n type: \"string\",\n },\n {\n name: \"method\",\n type: \"choice\",\n options: [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\n },\n {\n name: \"headers\",\n type: \"object\",\n },\n {\n name: \"body\",\n type: \"object\",\n },\n ],\n};\n\nexport function registerFetch(loader?: Registerable) {\n if (loader) {\n loader.registerFunction(wrappedFetch, registerFetchParams);\n } else {\n registerFunction(wrappedFetch, registerFetchParams);\n }\n}\n\nexport async function graphqlFetch(\n url: string,\n method: HTTPMethod,\n headers: Record<string, string>,\n query?: { query?: string; variables?: object },\n varOverrides?: Record<string, any>\n) {\n let fetchProps: FetchProps;\n method = method ?? \"POST\";\n\n if (method === \"GET\") {\n // https://graphql.org/learn/serving-over-http/#get-request-and-parameters\n const urlWithQueryParams = new URL(url ?? \"\");\n urlWithQueryParams.searchParams.set(\"query\", query?.query ?? \"{}\");\n urlWithQueryParams.searchParams.set(\n \"variables\",\n JSON.stringify({ ...query?.variables, ...varOverrides })\n );\n fetchProps = {\n url: urlWithQueryParams.toString(),\n method,\n headers,\n };\n } else {\n fetchProps = {\n body: { ...query, variables: { ...query?.variables, ...varOverrides } },\n url,\n method,\n headers,\n };\n }\n\n return performFetch(fetchProps);\n}\n\nconst registerGraphqlFetchParams: CustomFunctionMeta<typeof graphqlFetch> = {\n name: \"graphqlFetch\",\n importPath: \"@plasmicpkgs/fetch\",\n params: [\n {\n name: \"url\",\n type: \"string\",\n },\n {\n name: \"method\",\n type: \"choice\",\n options: [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\n },\n {\n name: \"headers\",\n type: \"object\",\n },\n {\n name: \"query\",\n type: \"code\",\n lang: \"graphql\",\n headers: (props: any) => props.headers,\n endpoint: (props: any) => props.url ?? \"\",\n },\n {\n name: \"varOverrides\",\n type: \"object\",\n },\n ],\n // TODO: remove as any when \"code\" type is available\n} as any;\n\nexport function registerGraphqlFetch(loader?: Registerable) {\n if (loader) {\n loader.registerFunction(graphqlFetch, registerGraphqlFetchParams);\n } else {\n registerFunction(graphqlFetch, registerGraphqlFetchParams);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAEO;AAMP,IAAM,cAAN,cAA0B,MAAM;AAAA,EAG9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+1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/fetch",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Plasmic registration call for fetch function",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "e25172b4452e1a8405c93cfc7fd54e531ecab146"
|
|
36
36
|
}
|