@utiliread/http 1.19.6 → 1.20.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/event-aggregator.d.ts +11 -0
- package/dist/events.d.ts +11 -0
- package/dist/header-names.d.ts +182 -0
- package/dist/helpers.d.ts +5 -0
- package/dist/http-builder.d.ts +61 -0
- package/dist/http-error.d.ts +10 -0
- package/dist/http-response.d.ts +18 -0
- package/dist/http.d.ts +33 -0
- package/dist/http.spec.d.ts +1 -0
- package/dist/index.d.ts +16 -231
- package/dist/index.js +616 -242
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +601 -215
- package/dist/index.mjs.map +1 -1
- package/dist/mapper.d.ts +9 -0
- package/dist/pagination.d.ts +23 -0
- package/dist/{json.d.ts → plugins/json/index.d.ts} +1 -2
- package/dist/plugins/json/index.js +87 -0
- package/dist/plugins/json/index.js.map +1 -0
- package/dist/plugins/json/index.mjs +85 -0
- package/dist/plugins/json/index.mjs.map +1 -0
- package/dist/{jsonpatch.d.ts → plugins/jsonpatch/index.d.ts} +0 -2
- package/dist/plugins/jsonpatch/index.js +21 -0
- package/dist/plugins/jsonpatch/index.js.map +1 -0
- package/dist/plugins/jsonpatch/index.mjs +19 -0
- package/dist/plugins/jsonpatch/index.mjs.map +1 -0
- package/dist/{msgpack.d.ts → plugins/msgpack/index.d.ts} +1 -2
- package/dist/plugins/msgpack/index.js +41 -0
- package/dist/plugins/msgpack/index.js.map +1 -0
- package/dist/plugins/msgpack/index.mjs +39 -0
- package/dist/plugins/msgpack/index.mjs.map +1 -0
- package/dist/problem-details.d.ts +7 -0
- package/dist/query-string.d.ts +6 -0
- package/dist/query-string.spec.d.ts +1 -0
- package/dist/status-codes.d.ts +65 -0
- package/dist/timeout-error.d.ts +3 -0
- package/json.d.ts +1 -1
- package/json.rollup.config.mjs +32 -0
- package/jsonpatch.d.ts +1 -1
- package/jsonpatch.rollup.config.mjs +32 -0
- package/msgpack.d.ts +1 -1
- package/msgpack.rollup.config.mjs +37 -0
- package/package.json +24 -24
- package/rollup.config.mjs +31 -0
- package/src/header-names.ts +273 -0
- package/src/index.ts +2 -1
- package/{plugins/json/src → src/plugins/json}/index.ts +138 -142
- package/{plugins/jsonpatch/src → src/plugins/jsonpatch}/index.ts +36 -36
- package/{plugins/msgpack/src → src/plugins/msgpack}/index.ts +69 -66
- package/src/status-codes.ts +65 -67
- package/tsconfig.json +6 -11
- package/dist/index.d.ts.map +0 -1
- package/dist/json.d.ts.map +0 -1
- package/dist/json.js +0 -93
- package/dist/json.js.map +0 -1
- package/dist/json.mjs +0 -82
- package/dist/json.mjs.map +0 -1
- package/dist/jsonpatch.d.ts.map +0 -1
- package/dist/jsonpatch.js +0 -33
- package/dist/jsonpatch.js.map +0 -1
- package/dist/jsonpatch.mjs +0 -22
- package/dist/jsonpatch.mjs.map +0 -1
- package/dist/msgpack.d.ts.map +0 -1
- package/dist/msgpack.js +0 -50
- package/dist/msgpack.js.map +0 -1
- package/dist/msgpack.mjs +0 -39
- package/dist/msgpack.mjs.map +0 -1
- package/plugins/json/node_modules/@utiliread/http/package.json +0 -4
- package/plugins/json/package.json +0 -15
- package/plugins/json/tsconfig.json +0 -7
- package/plugins/jsonpatch/node_modules/@utiliread/http/package.json +0 -4
- package/plugins/jsonpatch/package.json +0 -16
- package/plugins/jsonpatch/tsconfig.json +0 -7
- package/plugins/msgpack/node_modules/@utiliread/http/package.json +0 -4
- package/plugins/msgpack/package.json +0 -16
- package/plugins/msgpack/tsconfig.json +0 -7
package/tsconfig.json
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
4
|
-
"module": "
|
|
5
|
-
"moduleResolution": "
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
6
|
"declaration": true,
|
|
7
7
|
"sourceMap": true,
|
|
8
8
|
"strict": true,
|
|
9
9
|
"stripInternal": true,
|
|
10
10
|
"rootDir": "src",
|
|
11
|
-
"
|
|
11
|
+
"outDir": "dist",
|
|
12
|
+
"lib": ["ES2020", "DOM"],
|
|
12
13
|
"types": ["mocha"]
|
|
13
|
-
}
|
|
14
|
-
"include": [
|
|
15
|
-
"src/**/*.ts"
|
|
16
|
-
],
|
|
17
|
-
"exclude": [
|
|
18
|
-
"./*.d.ts"
|
|
19
|
-
]
|
|
14
|
+
}
|
|
20
15
|
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AA6BA;IACE,OAAO,IAAI,IAAI,CAAC;CACjB;AC/BD,6BAA6B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;ACHxB,sBAAuB,SAAQ,KAAK;IASzB,UAAU,EAAE,MAAM;IAN3B,IAAI,UAAU,wBAGb;gBAGQ,UAAU,EAAE,MAAM,EACjB,QAAQ,GAAE,YAAY,GAAG,SAAqB;IAUxD,OAAO,CAAC,QAAQ,GAAG,cAAc;CAclC;ACnCD;IAiCqB,WAAW,EAAE,QAAQ;IAhCxC,IAAI,GAAG,WAEN;IAED,IAAI,UAAU,WAEb;IAED,IAAI,OAAO,YAEV;IAED,IAAI,eAAe,YAElB;IAED,IAAI,YAAY,YAEf;IAED,IAAI,aAAa,YAEhB;IAED,IAAI,aAAa,YAEhB;IAED,IAAI,aAAa,YAEhB;gBAEkB,WAAW,EAAE,QAAQ;IAEjC,0BAA0B;CAOlC;AAED,6BAA6B,CAAC,CAAE,SAAQ,YAAY;gBAEhD,WAAW,EAAE,QAAQ,EACb,OAAO,EAAE,CAAC,QAAQ,EAAE,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C;AACpC,mBAAmB,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC;AAC3C,yBAAyB,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;AAElD,kCAAkC,CAAC,EACjC,WAAW,EAAE,cAAc,CAAC,CAAC,EAC7B,SAAS,EAAE,KAAK,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,GACzC,OAAO,CAAC,GAAG,IAAI,CAAC,CAqBlB;AAED,0BAA0B,CAAC,EACzB,WAAW,EAAE,cAAc,CAAC,CAAC,EAC7B,SAAS,EAAE,KAAK,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,GACzC,OAAO,CAAC,CAAC,CAWX","sources":["src/src/event-aggregator.ts","src/src/problem-details.ts","src/src/http-error.ts","src/src/http-response.ts","src/src/timeout-error.ts","src/src/http-builder.ts","src/src/query-string.ts","src/src/http.ts","src/src/pagination.ts","src/src/events.ts","src/src/helpers.ts","src/src/status-codes.ts","src/src/mapper.ts","src/src/index.ts","src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,"export { Http } from \"./http\";\nexport type {\n Page,\n PaginationResult,\n InfinitePage,\n InfinitePaginationResult,\n} from \"./pagination\";\nexport type { ProblemDetails } from \"./problem-details\";\nexport { QueryString } from \"./query-string\";\nexport { HttpResponse, HttpResponseOfT } from \"./http-response\";\nexport { HttpBuilder, HttpBuilderOfT } from \"./http-builder\";\nexport type { Message } from \"./http-builder\";\nexport { HttpError } from \"./http-error\";\nexport { TimeoutError } from \"./timeout-error\";\nexport { events } from \"./events\";\nexport * from \"./helpers\";\nexport type { Fetch } from \"./http\";\nexport type { Subscription } from \"./event-aggregator\";\nexport { statusCodes } from \"./status-codes\";\nexport * from \"./mapper\";\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/json.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAaA,wBAAkB;AAGlB,eAAe,iBAAiB,CAAC;IAC/B,UAAU,WAAW;QACnB,QAAQ,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;QAE7B,UAAU,CAAC,CAAC,EACV,YAAY,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GAC7B,cAAc,CAAC,CAAC,CAAC,CAAC;QACrB,eAAe,CAAC,CAAC,EACf,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,GAC5B,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;QACvB,uBAAuB,CAAC,CAAC,EACvB,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,GAC5B,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;QAChC,0BAA0B,CAAC,CAAC,EAC1B,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,GAC5B,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,kCAAkC,CAAC,CAAC,EAClC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,GAC5B,cAAc,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC;KAChD;IAED,UAAU,cAAc,CAAC,CAAC;QACxB,QAAQ,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;KAC9B;CACF","sources":["plugins/json/src/plugins/json/src/index.ts","plugins/json/src/index.ts"],"sourcesContent":[null,"import {\r\n HttpBuilder,\r\n HttpBuilderOfT,\r\n InfinitePaginationResult,\r\n PaginationResult,\r\n TypeOrMapper,\r\n getMapper,\r\n getNullableMapper,\r\n} from \"@utiliread/http\";\r\nimport { deserialize, serialize } from \"@utiliread/json\";\r\n\r\n// Force declarations to be module augmentations instead of ambient module declarations\r\n// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules\r\nexport default {};\r\n\r\n// https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation\r\ndeclare module \"@utiliread/http\" {\r\n interface HttpBuilder {\r\n withJson(content: any): this;\r\n\r\n expectJson<T>(\r\n typeOrMapper?: TypeOrMapper<T>\r\n ): HttpBuilderOfT<T>;\r\n expectJsonArray<T>(\r\n typeOrMapper: TypeOrMapper<T>\r\n ): HttpBuilderOfT<T[]>;\r\n expectJsonNullableArray<T>(\r\n typeOrMapper: TypeOrMapper<T>\r\n ): HttpBuilderOfT<(T | null)[]>;\r\n expectJsonPaginationResult<T>(\r\n typeOrMapper: TypeOrMapper<T>\r\n ): HttpBuilderOfT<PaginationResult<T>>;\r\n expectJsonInfinitePaginationResult<T>(\r\n typeOrMapper: TypeOrMapper<T>\r\n ): HttpBuilderOfT<InfinitePaginationResult<T>>;\r\n }\r\n\r\n interface HttpBuilderOfT<T> {\r\n withJson(content: any): this;\r\n }\r\n}\r\n\r\nHttpBuilder.prototype.withJson = function (this: HttpBuilder, content: any) {\r\n this.message.content = serialize(content);\r\n this.message.contentType = \"application/json\";\r\n return this;\r\n};\r\n\r\nHttpBuilderOfT.prototype.withJson = function <T>(\r\n this: HttpBuilderOfT<T>,\r\n content: any\r\n) {\r\n this.message.content = serialize(content);\r\n this.message.contentType = \"application/json\";\r\n return this;\r\n};\r\n\r\nHttpBuilder.prototype.expectJson = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper?: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse\r\n .json()\r\n .then((x) => getMapper(deserialize, typeOrMapper)(x));\r\n return promise;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectJsonArray = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse.json().then((x: any[]) => {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n return x.map(itemFactory);\r\n });\r\n return promise;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectJsonNullableArray = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper: TypeOrMapper<T>\r\n): HttpBuilderOfT<(T | null)[]> {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse.json().then((x: any[]) => {\r\n const itemFactory = getNullableMapper(deserialize, typeOrMapper);\r\n return x.map(itemFactory);\r\n });\r\n return promise;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectJsonPaginationResult = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse\r\n .json()\r\n .then((x: PaginationResult<any>) => {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n return {\r\n meta: {\r\n pageCount: x.meta.pageCount,\r\n pageSize: x.meta.pageSize,\r\n totalItems: x.meta.totalItems,\r\n },\r\n data: x.data.map(itemFactory),\r\n };\r\n });\r\n return promise;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectJsonInfinitePaginationResult = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse\r\n .json()\r\n .then((x: InfinitePaginationResult<any>) => {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n return {\r\n meta: {\r\n pageSize: x.meta.pageSize,\r\n continuationToken: x.meta.continuationToken,\r\n },\r\n data: x.data.map(itemFactory),\r\n };\r\n });\r\n return promise;\r\n });\r\n};\r\n"],"names":[],"version":3,"file":"json.d.ts.map"}
|
package/dist/json.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
var $hjeo4$utilireadhttp = require("@utiliread/http");
|
|
2
|
-
var $hjeo4$utilireadjson = require("@utiliread/json");
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function $parcel$defineInteropFlag(a) {
|
|
6
|
-
Object.defineProperty(a, '__esModule', {value: true, configurable: true});
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function $parcel$export(e, n, v, s) {
|
|
10
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
$parcel$defineInteropFlag(module.exports);
|
|
14
|
-
|
|
15
|
-
$parcel$export(module.exports, "default", () => $628f33a00b060acd$export$2e2bcd8739ae039);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var // Force declarations to be module augmentations instead of ambient module declarations
|
|
19
|
-
// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules
|
|
20
|
-
$628f33a00b060acd$export$2e2bcd8739ae039 = {};
|
|
21
|
-
(0, $hjeo4$utilireadhttp.HttpBuilder).prototype.withJson = function(content) {
|
|
22
|
-
this.message.content = (0, $hjeo4$utilireadjson.serialize)(content);
|
|
23
|
-
this.message.contentType = "application/json";
|
|
24
|
-
return this;
|
|
25
|
-
};
|
|
26
|
-
(0, $hjeo4$utilireadhttp.HttpBuilderOfT).prototype.withJson = function(content) {
|
|
27
|
-
this.message.content = (0, $hjeo4$utilireadjson.serialize)(content);
|
|
28
|
-
this.message.contentType = "application/json";
|
|
29
|
-
return this;
|
|
30
|
-
};
|
|
31
|
-
(0, $hjeo4$utilireadhttp.HttpBuilder).prototype.expectJson = function(typeOrMapper) {
|
|
32
|
-
this.message.headers.set("Accept", "application/json");
|
|
33
|
-
return this.useHandler((response)=>{
|
|
34
|
-
const promise = response.rawResponse.json().then((x)=>(0, $hjeo4$utilireadhttp.getMapper)((0, $hjeo4$utilireadjson.deserialize), typeOrMapper)(x));
|
|
35
|
-
return promise;
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
(0, $hjeo4$utilireadhttp.HttpBuilder).prototype.expectJsonArray = function(typeOrMapper) {
|
|
39
|
-
this.message.headers.set("Accept", "application/json");
|
|
40
|
-
return this.useHandler((response)=>{
|
|
41
|
-
const promise = response.rawResponse.json().then((x)=>{
|
|
42
|
-
const itemFactory = (0, $hjeo4$utilireadhttp.getMapper)((0, $hjeo4$utilireadjson.deserialize), typeOrMapper);
|
|
43
|
-
return x.map(itemFactory);
|
|
44
|
-
});
|
|
45
|
-
return promise;
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
(0, $hjeo4$utilireadhttp.HttpBuilder).prototype.expectJsonNullableArray = function(typeOrMapper) {
|
|
49
|
-
this.message.headers.set("Accept", "application/json");
|
|
50
|
-
return this.useHandler((response)=>{
|
|
51
|
-
const promise = response.rawResponse.json().then((x)=>{
|
|
52
|
-
const itemFactory = (0, $hjeo4$utilireadhttp.getNullableMapper)((0, $hjeo4$utilireadjson.deserialize), typeOrMapper);
|
|
53
|
-
return x.map(itemFactory);
|
|
54
|
-
});
|
|
55
|
-
return promise;
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
(0, $hjeo4$utilireadhttp.HttpBuilder).prototype.expectJsonPaginationResult = function(typeOrMapper) {
|
|
59
|
-
this.message.headers.set("Accept", "application/json");
|
|
60
|
-
return this.useHandler((response)=>{
|
|
61
|
-
const promise = response.rawResponse.json().then((x)=>{
|
|
62
|
-
const itemFactory = (0, $hjeo4$utilireadhttp.getMapper)((0, $hjeo4$utilireadjson.deserialize), typeOrMapper);
|
|
63
|
-
return {
|
|
64
|
-
meta: {
|
|
65
|
-
pageCount: x.meta.pageCount,
|
|
66
|
-
pageSize: x.meta.pageSize,
|
|
67
|
-
totalItems: x.meta.totalItems
|
|
68
|
-
},
|
|
69
|
-
data: x.data.map(itemFactory)
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
return promise;
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
(0, $hjeo4$utilireadhttp.HttpBuilder).prototype.expectJsonInfinitePaginationResult = function(typeOrMapper) {
|
|
76
|
-
this.message.headers.set("Accept", "application/json");
|
|
77
|
-
return this.useHandler((response)=>{
|
|
78
|
-
const promise = response.rawResponse.json().then((x)=>{
|
|
79
|
-
const itemFactory = (0, $hjeo4$utilireadhttp.getMapper)((0, $hjeo4$utilireadjson.deserialize), typeOrMapper);
|
|
80
|
-
return {
|
|
81
|
-
meta: {
|
|
82
|
-
pageSize: x.meta.pageSize,
|
|
83
|
-
continuationToken: x.meta.continuationToken
|
|
84
|
-
},
|
|
85
|
-
data: x.data.map(itemFactory)
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
return promise;
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
//# sourceMappingURL=json.js.map
|
package/dist/json.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;IAWA,uFAAuF;AACvF,sFAAsF;AACtF,2CAAe,CAAC;AA6BhB,CAAA,GAAA,gCAAU,EAAE,SAAS,CAAC,QAAQ,GAAG,SAA6B,OAAY;IACxE,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAA,GAAA,8BAAQ,EAAE;IACjC,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG;IAC3B,OAAO,IAAI;AACb;AAEA,CAAA,GAAA,mCAAa,EAAE,SAAS,CAAC,QAAQ,GAAG,SAElC,OAAY;IAEZ,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAA,GAAA,8BAAQ,EAAE;IACjC,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG;IAC3B,OAAO,IAAI;AACb;AAEA,CAAA,GAAA,gCAAU,EAAE,SAAS,CAAC,UAAU,GAAG,SAEjC,YAA8B;IAE9B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU;IACnC,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC;QACtB,MAAM,UAAU,SAAS,WAAW,CACjC,IAAI,GACJ,IAAI,CAAC,CAAC,IAAM,CAAA,GAAA,8BAAQ,EAAE,CAA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gBAC/B;gBACA,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC;YACnB;QACF;QACF,OAAO;IACT;AACF;AAEA,CAAA,GAAA,gCAAU,EAAE,SAAS,CAAC,kCAAkC,GAAG,SAEzD,YAA6B;IAE7B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU;IACnC,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC;QACtB,MAAM,UAAU,SAAS,WAAW,CACjC,IAAI,GACJ,IAAI,CAAC,CAAC;YACL,MAAM,cAAc,CAAA,GAAA,8BAAQ,EAAE,CAAA,GAAA,gCAAU,GAAG;YAC3C,OAAO;gBACL,MAAM;oBACJ,UAAU,EAAE,IAAI,CAAC,QAAQ;oBACzB,mBAAmB,EAAE,IAAI,CAAC,iBAAiB;gBAC7C;gBACA,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC;YACnB;QACF;QACF,OAAO;IACT;AACF","sources":["plugins/json/src/index.ts"],"sourcesContent":["import {\r\n HttpBuilder,\r\n HttpBuilderOfT,\r\n InfinitePaginationResult,\r\n PaginationResult,\r\n TypeOrMapper,\r\n getMapper,\r\n getNullableMapper,\r\n} from \"@utiliread/http\";\r\nimport { deserialize, serialize } from \"@utiliread/json\";\r\n\r\n// Force declarations to be module augmentations instead of ambient module declarations\r\n// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules\r\nexport default {};\r\n\r\n// https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation\r\ndeclare module \"@utiliread/http\" {\r\n interface HttpBuilder {\r\n withJson(content: any): this;\r\n\r\n expectJson<T>(\r\n typeOrMapper?: TypeOrMapper<T>\r\n ): HttpBuilderOfT<T>;\r\n expectJsonArray<T>(\r\n typeOrMapper: TypeOrMapper<T>\r\n ): HttpBuilderOfT<T[]>;\r\n expectJsonNullableArray<T>(\r\n typeOrMapper: TypeOrMapper<T>\r\n ): HttpBuilderOfT<(T | null)[]>;\r\n expectJsonPaginationResult<T>(\r\n typeOrMapper: TypeOrMapper<T>\r\n ): HttpBuilderOfT<PaginationResult<T>>;\r\n expectJsonInfinitePaginationResult<T>(\r\n typeOrMapper: TypeOrMapper<T>\r\n ): HttpBuilderOfT<InfinitePaginationResult<T>>;\r\n }\r\n\r\n interface HttpBuilderOfT<T> {\r\n withJson(content: any): this;\r\n }\r\n}\r\n\r\nHttpBuilder.prototype.withJson = function (this: HttpBuilder, content: any) {\r\n this.message.content = serialize(content);\r\n this.message.contentType = \"application/json\";\r\n return this;\r\n};\r\n\r\nHttpBuilderOfT.prototype.withJson = function <T>(\r\n this: HttpBuilderOfT<T>,\r\n content: any\r\n) {\r\n this.message.content = serialize(content);\r\n this.message.contentType = \"application/json\";\r\n return this;\r\n};\r\n\r\nHttpBuilder.prototype.expectJson = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper?: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse\r\n .json()\r\n .then((x) => getMapper(deserialize, typeOrMapper)(x));\r\n return promise;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectJsonArray = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse.json().then((x: any[]) => {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n return x.map(itemFactory);\r\n });\r\n return promise;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectJsonNullableArray = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper: TypeOrMapper<T>\r\n): HttpBuilderOfT<(T | null)[]> {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse.json().then((x: any[]) => {\r\n const itemFactory = getNullableMapper(deserialize, typeOrMapper);\r\n return x.map(itemFactory);\r\n });\r\n return promise;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectJsonPaginationResult = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse\r\n .json()\r\n .then((x: PaginationResult<any>) => {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n return {\r\n meta: {\r\n pageCount: x.meta.pageCount,\r\n pageSize: x.meta.pageSize,\r\n totalItems: x.meta.totalItems,\r\n },\r\n data: x.data.map(itemFactory),\r\n };\r\n });\r\n return promise;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectJsonInfinitePaginationResult = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse\r\n .json()\r\n .then((x: InfinitePaginationResult<any>) => {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n return {\r\n meta: {\r\n pageSize: x.meta.pageSize,\r\n continuationToken: x.meta.continuationToken,\r\n },\r\n data: x.data.map(itemFactory),\r\n };\r\n });\r\n return promise;\r\n });\r\n};\r\n"],"names":[],"version":3,"file":"json.js.map"}
|
package/dist/json.mjs
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import {HttpBuilder as $017Lt$HttpBuilder, HttpBuilderOfT as $017Lt$HttpBuilderOfT, getMapper as $017Lt$getMapper, getNullableMapper as $017Lt$getNullableMapper} from "@utiliread/http";
|
|
2
|
-
import {serialize as $017Lt$serialize, deserialize as $017Lt$deserialize} from "@utiliread/json";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var // Force declarations to be module augmentations instead of ambient module declarations
|
|
7
|
-
// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules
|
|
8
|
-
$156801c6b6c80d29$export$2e2bcd8739ae039 = {};
|
|
9
|
-
(0, $017Lt$HttpBuilder).prototype.withJson = function(content) {
|
|
10
|
-
this.message.content = (0, $017Lt$serialize)(content);
|
|
11
|
-
this.message.contentType = "application/json";
|
|
12
|
-
return this;
|
|
13
|
-
};
|
|
14
|
-
(0, $017Lt$HttpBuilderOfT).prototype.withJson = function(content) {
|
|
15
|
-
this.message.content = (0, $017Lt$serialize)(content);
|
|
16
|
-
this.message.contentType = "application/json";
|
|
17
|
-
return this;
|
|
18
|
-
};
|
|
19
|
-
(0, $017Lt$HttpBuilder).prototype.expectJson = function(typeOrMapper) {
|
|
20
|
-
this.message.headers.set("Accept", "application/json");
|
|
21
|
-
return this.useHandler((response)=>{
|
|
22
|
-
const promise = response.rawResponse.json().then((x)=>(0, $017Lt$getMapper)((0, $017Lt$deserialize), typeOrMapper)(x));
|
|
23
|
-
return promise;
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
(0, $017Lt$HttpBuilder).prototype.expectJsonArray = function(typeOrMapper) {
|
|
27
|
-
this.message.headers.set("Accept", "application/json");
|
|
28
|
-
return this.useHandler((response)=>{
|
|
29
|
-
const promise = response.rawResponse.json().then((x)=>{
|
|
30
|
-
const itemFactory = (0, $017Lt$getMapper)((0, $017Lt$deserialize), typeOrMapper);
|
|
31
|
-
return x.map(itemFactory);
|
|
32
|
-
});
|
|
33
|
-
return promise;
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
(0, $017Lt$HttpBuilder).prototype.expectJsonNullableArray = function(typeOrMapper) {
|
|
37
|
-
this.message.headers.set("Accept", "application/json");
|
|
38
|
-
return this.useHandler((response)=>{
|
|
39
|
-
const promise = response.rawResponse.json().then((x)=>{
|
|
40
|
-
const itemFactory = (0, $017Lt$getNullableMapper)((0, $017Lt$deserialize), typeOrMapper);
|
|
41
|
-
return x.map(itemFactory);
|
|
42
|
-
});
|
|
43
|
-
return promise;
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
(0, $017Lt$HttpBuilder).prototype.expectJsonPaginationResult = function(typeOrMapper) {
|
|
47
|
-
this.message.headers.set("Accept", "application/json");
|
|
48
|
-
return this.useHandler((response)=>{
|
|
49
|
-
const promise = response.rawResponse.json().then((x)=>{
|
|
50
|
-
const itemFactory = (0, $017Lt$getMapper)((0, $017Lt$deserialize), typeOrMapper);
|
|
51
|
-
return {
|
|
52
|
-
meta: {
|
|
53
|
-
pageCount: x.meta.pageCount,
|
|
54
|
-
pageSize: x.meta.pageSize,
|
|
55
|
-
totalItems: x.meta.totalItems
|
|
56
|
-
},
|
|
57
|
-
data: x.data.map(itemFactory)
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
return promise;
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
(0, $017Lt$HttpBuilder).prototype.expectJsonInfinitePaginationResult = function(typeOrMapper) {
|
|
64
|
-
this.message.headers.set("Accept", "application/json");
|
|
65
|
-
return this.useHandler((response)=>{
|
|
66
|
-
const promise = response.rawResponse.json().then((x)=>{
|
|
67
|
-
const itemFactory = (0, $017Lt$getMapper)((0, $017Lt$deserialize), typeOrMapper);
|
|
68
|
-
return {
|
|
69
|
-
meta: {
|
|
70
|
-
pageSize: x.meta.pageSize,
|
|
71
|
-
continuationToken: x.meta.continuationToken
|
|
72
|
-
},
|
|
73
|
-
data: x.data.map(itemFactory)
|
|
74
|
-
};
|
|
75
|
-
});
|
|
76
|
-
return promise;
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
export {$156801c6b6c80d29$export$2e2bcd8739ae039 as default};
|
|
82
|
-
//# sourceMappingURL=json.mjs.map
|
package/dist/json.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;IAWA,uFAAuF;AACvF,sFAAsF;AACtF,2CAAe,CAAC;AA6BhB,CAAA,GAAA,kBAAU,EAAE,SAAS,CAAC,QAAQ,GAAG,SAA6B,OAAY;IACxE,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAA,GAAA,gBAA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ult,\r\n TypeOrMapper,\r\n getMapper,\r\n getNullableMapper,\r\n} from \"@utiliread/http\";\r\nimport { deserialize, serialize } from \"@utiliread/json\";\r\n\r\n// Force declarations to be module augmentations instead of ambient module declarations\r\n// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules\r\nexport default {};\r\n\r\n// https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation\r\ndeclare module \"@utiliread/http\" {\r\n interface HttpBuilder {\r\n withJson(content: any): this;\r\n\r\n expectJson<T>(\r\n typeOrMapper?: TypeOrMapper<T>\r\n ): HttpBuilderOfT<T>;\r\n expectJsonArray<T>(\r\n typeOrMapper: TypeOrMapper<T>\r\n ): HttpBuilderOfT<T[]>;\r\n expectJsonNullableArray<T>(\r\n typeOrMapper: TypeOrMapper<T>\r\n ): HttpBuilderOfT<(T | null)[]>;\r\n expectJsonPaginationResult<T>(\r\n typeOrMapper: TypeOrMapper<T>\r\n ): HttpBuilderOfT<PaginationResult<T>>;\r\n expectJsonInfinitePaginationResult<T>(\r\n typeOrMapper: TypeOrMapper<T>\r\n ): HttpBuilderOfT<InfinitePaginationResult<T>>;\r\n }\r\n\r\n interface HttpBuilderOfT<T> {\r\n withJson(content: any): this;\r\n }\r\n}\r\n\r\nHttpBuilder.prototype.withJson = function (this: HttpBuilder, content: any) {\r\n this.message.content = serialize(content);\r\n this.message.contentType = \"application/json\";\r\n return this;\r\n};\r\n\r\nHttpBuilderOfT.prototype.withJson = function <T>(\r\n this: HttpBuilderOfT<T>,\r\n content: any\r\n) {\r\n this.message.content = serialize(content);\r\n this.message.contentType = \"application/json\";\r\n return this;\r\n};\r\n\r\nHttpBuilder.prototype.expectJson = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper?: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse\r\n .json()\r\n .then((x) => getMapper(deserialize, typeOrMapper)(x));\r\n return promise;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectJsonArray = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse.json().then((x: any[]) => {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n return x.map(itemFactory);\r\n });\r\n return promise;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectJsonNullableArray = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper: TypeOrMapper<T>\r\n): HttpBuilderOfT<(T | null)[]> {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse.json().then((x: any[]) => {\r\n const itemFactory = getNullableMapper(deserialize, typeOrMapper);\r\n return x.map(itemFactory);\r\n });\r\n return promise;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectJsonPaginationResult = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse\r\n .json()\r\n .then((x: PaginationResult<any>) => {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n return {\r\n meta: {\r\n pageCount: x.meta.pageCount,\r\n pageSize: x.meta.pageSize,\r\n totalItems: x.meta.totalItems,\r\n },\r\n data: x.data.map(itemFactory),\r\n };\r\n });\r\n return promise;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectJsonInfinitePaginationResult = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/json\");\r\n return this.useHandler((response) => {\r\n const promise = response.rawResponse\r\n .json()\r\n .then((x: InfinitePaginationResult<any>) => {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n return {\r\n meta: {\r\n pageSize: x.meta.pageSize,\r\n continuationToken: x.meta.continuationToken,\r\n },\r\n data: x.data.map(itemFactory),\r\n };\r\n });\r\n return promise;\r\n });\r\n};\r\n"],"names":[],"version":3,"file":"json.mjs.map"}
|
package/dist/jsonpatch.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAMA,wBAAkB;AAGlB,eAAe,iBAAiB,CAAC;IAC/B,UAAU,WAAW;QACnB,aAAa,CAAC,UAAU,EAAE,OAAO,sBAAsB,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;KAC7E;IAED,UAAU,cAAc,CAAC,CAAC;QACxB,aAAa,CAAC,UAAU,EAAE,OAAO,sBAAsB,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;KAC7E;CACF","sources":["plugins/jsonpatch/src/plugins/jsonpatch/src/index.ts","plugins/jsonpatch/src/index.ts"],"sourcesContent":[null,"import { HttpBuilder, HttpBuilderOfT } from \"@utiliread/http\";\r\n\r\nimport { serialize } from \"@utiliread/json\";\r\n\r\n// Force declarations to be module augmentations instead of ambient module declarations\r\n// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules\r\nexport default {};\r\n\r\n// https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation\r\ndeclare module \"@utiliread/http\" {\r\n interface HttpBuilder {\r\n withJsonPatch(operations: import(\"@utiliread/jsonpatch\").Operation[]): this;\r\n }\r\n\r\n interface HttpBuilderOfT<T> {\r\n withJsonPatch(operations: import(\"@utiliread/jsonpatch\").Operation[]): this;\r\n }\r\n}\r\n\r\nHttpBuilder.prototype.withJsonPatch = function (\r\n this: HttpBuilder,\r\n operations: import(\"@utiliread/jsonpatch\").Operation[]\r\n) {\r\n this.message.content = serialize(operations);\r\n this.message.contentType = \"application/json-patch+json\";\r\n return this;\r\n};\r\n\r\nHttpBuilderOfT.prototype.withJsonPatch = function <T>(\r\n this: HttpBuilderOfT<T>,\r\n operations: import(\"@utiliread/jsonpatch\").Operation[]\r\n) {\r\n this.message.content = serialize(operations);\r\n this.message.contentType = \"application/json-patch+json\";\r\n return this;\r\n};\r\n"],"names":[],"version":3,"file":"jsonpatch.d.ts.map"}
|
package/dist/jsonpatch.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var $lxUpO$utilireadhttp = require("@utiliread/http");
|
|
2
|
-
var $lxUpO$utilireadjson = require("@utiliread/json");
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function $parcel$defineInteropFlag(a) {
|
|
6
|
-
Object.defineProperty(a, '__esModule', {value: true, configurable: true});
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function $parcel$export(e, n, v, s) {
|
|
10
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
$parcel$defineInteropFlag(module.exports);
|
|
14
|
-
|
|
15
|
-
$parcel$export(module.exports, "default", () => $e95ed02de5c43c10$export$2e2bcd8739ae039);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var // Force declarations to be module augmentations instead of ambient module declarations
|
|
19
|
-
// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules
|
|
20
|
-
$e95ed02de5c43c10$export$2e2bcd8739ae039 = {};
|
|
21
|
-
(0, $lxUpO$utilireadhttp.HttpBuilder).prototype.withJsonPatch = function(operations) {
|
|
22
|
-
this.message.content = (0, $lxUpO$utilireadjson.serialize)(operations);
|
|
23
|
-
this.message.contentType = "application/json-patch+json";
|
|
24
|
-
return this;
|
|
25
|
-
};
|
|
26
|
-
(0, $lxUpO$utilireadhttp.HttpBuilderOfT).prototype.withJsonPatch = function(operations) {
|
|
27
|
-
this.message.content = (0, $lxUpO$utilireadjson.serialize)(operations);
|
|
28
|
-
this.message.contentType = "application/json-patch+json";
|
|
29
|
-
return this;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
//# sourceMappingURL=jsonpatch.js.map
|
package/dist/jsonpatch.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;IAIA,uFAAuF;AACvF,sFAAsF;AACtF,2CAAe,CAAC;AAahB,CAAA,GAAA,gCAAU,EAAE,SAAS,CAAC,aAAa,GAAG,SAEpC,UAAsD;IAEtD,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAA,GAAA,8BAAQ,EAAE;IACjC,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG;IAC3B,OAAO,IAAI;AACb;AAEA,CAAA,GAAA,mCAAa,EAAE,SAAS,CAAC,aAAa,GAAG,SAEvC,UAAsD;IAEtD,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAA,GAAA,8BAAQ,EAAE;IACjC,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG;IAC3B,OAAO,IAAI;AACb","sources":["plugins/jsonpatch/src/index.ts"],"sourcesContent":["import { HttpBuilder, HttpBuilderOfT } from \"@utiliread/http\";\r\n\r\nimport { serialize } from \"@utiliread/json\";\r\n\r\n// Force declarations to be module augmentations instead of ambient module declarations\r\n// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules\r\nexport default {};\r\n\r\n// https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation\r\ndeclare module \"@utiliread/http\" {\r\n interface HttpBuilder {\r\n withJsonPatch(operations: import(\"@utiliread/jsonpatch\").Operation[]): this;\r\n }\r\n\r\n interface HttpBuilderOfT<T> {\r\n withJsonPatch(operations: import(\"@utiliread/jsonpatch\").Operation[]): this;\r\n }\r\n}\r\n\r\nHttpBuilder.prototype.withJsonPatch = function (\r\n this: HttpBuilder,\r\n operations: import(\"@utiliread/jsonpatch\").Operation[]\r\n) {\r\n this.message.content = serialize(operations);\r\n this.message.contentType = \"application/json-patch+json\";\r\n return this;\r\n};\r\n\r\nHttpBuilderOfT.prototype.withJsonPatch = function <T>(\r\n this: HttpBuilderOfT<T>,\r\n operations: import(\"@utiliread/jsonpatch\").Operation[]\r\n) {\r\n this.message.content = serialize(operations);\r\n this.message.contentType = \"application/json-patch+json\";\r\n return this;\r\n};\r\n"],"names":[],"version":3,"file":"jsonpatch.js.map"}
|
package/dist/jsonpatch.mjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {HttpBuilder as $8CiR8$HttpBuilder, HttpBuilderOfT as $8CiR8$HttpBuilderOfT} from "@utiliread/http";
|
|
2
|
-
import {serialize as $8CiR8$serialize} from "@utiliread/json";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var // Force declarations to be module augmentations instead of ambient module declarations
|
|
7
|
-
// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules
|
|
8
|
-
$a9205c2ac5e156ed$export$2e2bcd8739ae039 = {};
|
|
9
|
-
(0, $8CiR8$HttpBuilder).prototype.withJsonPatch = function(operations) {
|
|
10
|
-
this.message.content = (0, $8CiR8$serialize)(operations);
|
|
11
|
-
this.message.contentType = "application/json-patch+json";
|
|
12
|
-
return this;
|
|
13
|
-
};
|
|
14
|
-
(0, $8CiR8$HttpBuilderOfT).prototype.withJsonPatch = function(operations) {
|
|
15
|
-
this.message.content = (0, $8CiR8$serialize)(operations);
|
|
16
|
-
this.message.contentType = "application/json-patch+json";
|
|
17
|
-
return this;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export {$a9205c2ac5e156ed$export$2e2bcd8739ae039 as default};
|
|
22
|
-
//# sourceMappingURL=jsonpatch.mjs.map
|
package/dist/jsonpatch.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;IAIA,uFAAuF;AACvF,sFAAsF;AACtF,2CAAe,CAAC;AAahB,CAAA,GAAA,kBAAU,EAAE,SAAS,CAAC,aAAa,GAAG,SAEpC,UAAsD;IAEtD,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAA,GAAA,gBAAQ,EAAE;IACjC,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG;IAC3B,OAAO,IAAI;AACb;AAEA,CAAA,GAAA,qBAAa,EAAE,SAAS,CAAC,aAAa,GAAG,SAEvC,UAAsD;IAEtD,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAA,GAAA,gBAAQ,EAAE;IACjC,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG;IAC3B,OAAO,IAAI;AACb","sources":["plugins/jsonpatch/src/index.ts"],"sourcesContent":["import { HttpBuilder, HttpBuilderOfT } from \"@utiliread/http\";\r\n\r\nimport { serialize } from \"@utiliread/json\";\r\n\r\n// Force declarations to be module augmentations instead of ambient module declarations\r\n// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules\r\nexport default {};\r\n\r\n// https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation\r\ndeclare module \"@utiliread/http\" {\r\n interface HttpBuilder {\r\n withJsonPatch(operations: import(\"@utiliread/jsonpatch\").Operation[]): this;\r\n }\r\n\r\n interface HttpBuilderOfT<T> {\r\n withJsonPatch(operations: import(\"@utiliread/jsonpatch\").Operation[]): this;\r\n }\r\n}\r\n\r\nHttpBuilder.prototype.withJsonPatch = function (\r\n this: HttpBuilder,\r\n operations: import(\"@utiliread/jsonpatch\").Operation[]\r\n) {\r\n this.message.content = serialize(operations);\r\n this.message.contentType = \"application/json-patch+json\";\r\n return this;\r\n};\r\n\r\nHttpBuilderOfT.prototype.withJsonPatch = function <T>(\r\n this: HttpBuilderOfT<T>,\r\n operations: import(\"@utiliread/jsonpatch\").Operation[]\r\n) {\r\n this.message.content = serialize(operations);\r\n this.message.contentType = \"application/json-patch+json\";\r\n return this;\r\n};\r\n"],"names":[],"version":3,"file":"jsonpatch.mjs.map"}
|
package/dist/msgpack.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";AAOA,wBAAkB;AAGlB,eAAe,iBAAiB,CAAC;IAC/B,UAAU,WAAW;QACnB,iBAAiB,CAAC,CAAC,EACjB,YAAY,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GAC7B,cAAc,CAAC,CAAC,CAAC,CAAC;QACrB,sBAAsB,CAAC,CAAC,EACtB,YAAY,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GAC7B,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;QACvB,sBAAsB,CAAC,CAAC,EACtB,YAAY,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GAC7B,cAAc,CAAC,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;KACrD;CACF","sources":["plugins/msgpack/src/plugins/msgpack/src/index.ts","plugins/msgpack/src/index.ts"],"sourcesContent":[null,"import { HttpBuilder, HttpResponse, TypeOrMapper, getMapper } from \"@utiliread/http\";\r\nimport { decodeArrayStream, decodeAsync } from \"@msgpack/msgpack\";\r\n\r\nimport { deserialize } from \"@utiliread/msgpack\";\r\n\r\n// Force declarations to be module augmentations instead of ambient module declarations\r\n// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules\r\nexport default {};\r\n\r\n// https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation\r\ndeclare module \"@utiliread/http\" {\r\n interface HttpBuilder {\r\n expectMessagePack<T>(\r\n typeOrMapper?: TypeOrMapper<T>\r\n ): HttpBuilderOfT<T>;\r\n expectMessagePackArray<T>(\r\n typeOrMapper?: TypeOrMapper<T>\r\n ): HttpBuilderOfT<T[]>;\r\n streamMessagePackArray<T>(\r\n typeOrMapper?: TypeOrMapper<T>\r\n ): HttpBuilderOfT<AsyncGenerator<T, void, unknown>>;\r\n }\r\n}\r\n\r\nHttpBuilder.prototype.expectMessagePack = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper?: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/x-msgpack\");\r\n return this.useHandler(async (response) => {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n const decoded = await decodeAsync(response.rawResponse.body!);\r\n return itemFactory(decoded);\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectMessagePackArray = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper?: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/x-msgpack\");\r\n return this.useHandler(async (response) => {\r\n const items: T[] = [];\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n for await (const item of decodeArrayStream(response.rawResponse.body!)) {\r\n items.push(itemFactory(item));\r\n }\r\n return items;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.streamMessagePackArray = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper?: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/x-msgpack\");\r\n\r\n async function* handler(response: HttpResponse) {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n for await (const item of decodeArrayStream(response.rawResponse.body!)) {\r\n yield itemFactory(item);\r\n }\r\n }\r\n\r\n return this.useHandler((response) => Promise.resolve(handler(response)));\r\n};\r\n"],"names":[],"version":3,"file":"msgpack.d.ts.map"}
|
package/dist/msgpack.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
var $aEV4B$utilireadhttp = require("@utiliread/http");
|
|
2
|
-
var $aEV4B$msgpackmsgpack = require("@msgpack/msgpack");
|
|
3
|
-
var $aEV4B$utilireadmsgpack = require("@utiliread/msgpack");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function $parcel$defineInteropFlag(a) {
|
|
7
|
-
Object.defineProperty(a, '__esModule', {value: true, configurable: true});
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function $parcel$export(e, n, v, s) {
|
|
11
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
$parcel$defineInteropFlag(module.exports);
|
|
15
|
-
|
|
16
|
-
$parcel$export(module.exports, "default", () => $b458e79d3d55e9fb$export$2e2bcd8739ae039);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var // Force declarations to be module augmentations instead of ambient module declarations
|
|
21
|
-
// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules
|
|
22
|
-
$b458e79d3d55e9fb$export$2e2bcd8739ae039 = {};
|
|
23
|
-
(0, $aEV4B$utilireadhttp.HttpBuilder).prototype.expectMessagePack = function(typeOrMapper) {
|
|
24
|
-
this.message.headers.set("Accept", "application/x-msgpack");
|
|
25
|
-
return this.useHandler(async (response)=>{
|
|
26
|
-
const itemFactory = (0, $aEV4B$utilireadhttp.getMapper)((0, $aEV4B$utilireadmsgpack.deserialize), typeOrMapper);
|
|
27
|
-
const decoded = await (0, $aEV4B$msgpackmsgpack.decodeAsync)(response.rawResponse.body);
|
|
28
|
-
return itemFactory(decoded);
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
(0, $aEV4B$utilireadhttp.HttpBuilder).prototype.expectMessagePackArray = function(typeOrMapper) {
|
|
32
|
-
this.message.headers.set("Accept", "application/x-msgpack");
|
|
33
|
-
return this.useHandler(async (response)=>{
|
|
34
|
-
const items = [];
|
|
35
|
-
const itemFactory = (0, $aEV4B$utilireadhttp.getMapper)((0, $aEV4B$utilireadmsgpack.deserialize), typeOrMapper);
|
|
36
|
-
for await (const item of (0, $aEV4B$msgpackmsgpack.decodeArrayStream)(response.rawResponse.body))items.push(itemFactory(item));
|
|
37
|
-
return items;
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
(0, $aEV4B$utilireadhttp.HttpBuilder).prototype.streamMessagePackArray = function(typeOrMapper) {
|
|
41
|
-
this.message.headers.set("Accept", "application/x-msgpack");
|
|
42
|
-
async function* handler(response) {
|
|
43
|
-
const itemFactory = (0, $aEV4B$utilireadhttp.getMapper)((0, $aEV4B$utilireadmsgpack.deserialize), typeOrMapper);
|
|
44
|
-
for await (const item of (0, $aEV4B$msgpackmsgpack.decodeArrayStream)(response.rawResponse.body))yield itemFactory(item);
|
|
45
|
-
}
|
|
46
|
-
return this.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3C,WAAW,MAAM,QAAQ,CAAA,GAAA,uCAAgB,EAAE,SAAS,WAAW,CAAC,IAAI,EAClE,MAAM,YAAY;IAEtB;IAEA,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,WAAa,QAAQ,OAAO,CAAC,QAAQ;AAC/D","sources":["plugins/msgpack/src/index.ts"],"sourcesContent":["import { HttpBuilder, HttpResponse, TypeOrMapper, getMapper } from \"@utiliread/http\";\r\nimport { decodeArrayStream, decodeAsync } from \"@msgpack/msgpack\";\r\n\r\nimport { deserialize } from \"@utiliread/msgpack\";\r\n\r\n// Force declarations to be module augmentations instead of ambient module declarations\r\n// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules\r\nexport default {};\r\n\r\n// https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation\r\ndeclare module \"@utiliread/http\" {\r\n interface HttpBuilder {\r\n expectMessagePack<T>(\r\n typeOrMapper?: TypeOrMapper<T>\r\n ): HttpBuilderOfT<T>;\r\n expectMessagePackArray<T>(\r\n typeOrMapper?: TypeOrMapper<T>\r\n ): HttpBuilderOfT<T[]>;\r\n streamMessagePackArray<T>(\r\n typeOrMapper?: TypeOrMapper<T>\r\n ): HttpBuilderOfT<AsyncGenerator<T, void, unknown>>;\r\n }\r\n}\r\n\r\nHttpBuilder.prototype.expectMessagePack = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper?: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/x-msgpack\");\r\n return this.useHandler(async (response) => {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n const decoded = await decodeAsync(response.rawResponse.body!);\r\n return itemFactory(decoded);\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectMessagePackArray = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper?: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/x-msgpack\");\r\n return this.useHandler(async (response) => {\r\n const items: T[] = [];\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n for await (const item of decodeArrayStream(response.rawResponse.body!)) {\r\n items.push(itemFactory(item));\r\n }\r\n return items;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.streamMessagePackArray = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper?: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/x-msgpack\");\r\n\r\n async function* handler(response: HttpResponse) {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n for await (const item of decodeArrayStream(response.rawResponse.body!)) {\r\n yield itemFactory(item);\r\n }\r\n }\r\n\r\n return this.useHandler((response) => Promise.resolve(handler(response)));\r\n};\r\n"],"names":[],"version":3,"file":"msgpack.js.map"}
|
package/dist/msgpack.mjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {HttpBuilder as $ce1lZ$HttpBuilder, getMapper as $ce1lZ$getMapper} from "@utiliread/http";
|
|
2
|
-
import {decodeAsync as $ce1lZ$decodeAsync, decodeArrayStream as $ce1lZ$decodeArrayStream} from "@msgpack/msgpack";
|
|
3
|
-
import {deserialize as $ce1lZ$deserialize} from "@utiliread/msgpack";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var // Force declarations to be module augmentations instead of ambient module declarations
|
|
9
|
-
// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules
|
|
10
|
-
$e5d4ffec1a977901$export$2e2bcd8739ae039 = {};
|
|
11
|
-
(0, $ce1lZ$HttpBuilder).prototype.expectMessagePack = function(typeOrMapper) {
|
|
12
|
-
this.message.headers.set("Accept", "application/x-msgpack");
|
|
13
|
-
return this.useHandler(async (response)=>{
|
|
14
|
-
const itemFactory = (0, $ce1lZ$getMapper)((0, $ce1lZ$deserialize), typeOrMapper);
|
|
15
|
-
const decoded = await (0, $ce1lZ$decodeAsync)(response.rawResponse.body);
|
|
16
|
-
return itemFactory(decoded);
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
(0, $ce1lZ$HttpBuilder).prototype.expectMessagePackArray = function(typeOrMapper) {
|
|
20
|
-
this.message.headers.set("Accept", "application/x-msgpack");
|
|
21
|
-
return this.useHandler(async (response)=>{
|
|
22
|
-
const items = [];
|
|
23
|
-
const itemFactory = (0, $ce1lZ$getMapper)((0, $ce1lZ$deserialize), typeOrMapper);
|
|
24
|
-
for await (const item of (0, $ce1lZ$decodeArrayStream)(response.rawResponse.body))items.push(itemFactory(item));
|
|
25
|
-
return items;
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
(0, $ce1lZ$HttpBuilder).prototype.streamMessagePackArray = function(typeOrMapper) {
|
|
29
|
-
this.message.headers.set("Accept", "application/x-msgpack");
|
|
30
|
-
async function* handler(response) {
|
|
31
|
-
const itemFactory = (0, $ce1lZ$getMapper)((0, $ce1lZ$deserialize), typeOrMapper);
|
|
32
|
-
for await (const item of (0, $ce1lZ$decodeArrayStream)(response.rawResponse.body))yield itemFactory(item);
|
|
33
|
-
}
|
|
34
|
-
return this.useHandler((response)=>Promise.resolve(handler(response)));
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export {$e5d4ffec1a977901$export$2e2bcd8739ae039 as default};
|
|
39
|
-
//# sourceMappingURL=msgpack.mjs.map
|
package/dist/msgpack.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;IAKA,uFAAuF;AACvF,sFAAsF;AACtF,2CAAe,CAAC;AAiBhB,CAAA,GAAA,kBAAU,EAAE,SAAS,CAAC,iBAAiB,GAAG,SAExC,YAA8B;IAE9B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU;IACnC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO;QAC5B,MAAM,cAAc,CAAA,GAAA,gBAAQ,EAAE,CAAA,GAAA,kBAAU,GAAG;QAC3C,MAAM,UAAU,MAAM,CAAA,GAAA,kBAAU,EAAE,SAAS,WAAW,CAAC,IAAI;QAC3D,OAAO,YAAY;IACrB;AACF;AAEA,CAAA,GAAA,kBAAU,EAAE,SAAS,CAAC,sBAAsB,GAAG,SAE7C,YAA8B;IAE9B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU;IACnC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO;QAC5B,MAAM,QAAa,EAAE;QACrB,MAAM,cAAc,CAAA,GAAA,gBAAQ,EAAE,CAAA,GAAA,kBAAU,GAAG;QAC3C,WAAW,MAAM,QAAQ,CAAA,GAAA,wBAAgB,EAAE,SAAS,WAAW,CAAC,IAAI,EAClE,MAAM,IAAI,CAAC,YAAY;QAEzB,OAAO;IACT;AACF;AAEA,CAAA,GAAA,kBAAU,EAAE,SAAS,CAAC,sBAAsB,GAAG,SAE7C,YAA8B;IAE9B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU;IAEnC,gBAAgB,QAAQ,QAAsB;QAC5C,MAAM,cAAc,CAAA,GAAA,gBAAQ,EAAE,CAAA,GAAA,kBAAU,GAAG;QAC3C,WAAW,MAAM,QAAQ,CAAA,GAAA,wBAAgB,EAAE,SAAS,WAAW,CAAC,IAAI,EAClE,MAAM,YAAY;IAEtB;IAEA,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,WAAa,QAAQ,OAAO,CAAC,QAAQ;AAC/D","sources":["plugins/msgpack/src/index.ts"],"sourcesContent":["import { HttpBuilder, HttpResponse, TypeOrMapper, getMapper } from \"@utiliread/http\";\r\nimport { decodeArrayStream, decodeAsync } from \"@msgpack/msgpack\";\r\n\r\nimport { deserialize } from \"@utiliread/msgpack\";\r\n\r\n// Force declarations to be module augmentations instead of ambient module declarations\r\n// https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules\r\nexport default {};\r\n\r\n// https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation\r\ndeclare module \"@utiliread/http\" {\r\n interface HttpBuilder {\r\n expectMessagePack<T>(\r\n typeOrMapper?: TypeOrMapper<T>\r\n ): HttpBuilderOfT<T>;\r\n expectMessagePackArray<T>(\r\n typeOrMapper?: TypeOrMapper<T>\r\n ): HttpBuilderOfT<T[]>;\r\n streamMessagePackArray<T>(\r\n typeOrMapper?: TypeOrMapper<T>\r\n ): HttpBuilderOfT<AsyncGenerator<T, void, unknown>>;\r\n }\r\n}\r\n\r\nHttpBuilder.prototype.expectMessagePack = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper?: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/x-msgpack\");\r\n return this.useHandler(async (response) => {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n const decoded = await decodeAsync(response.rawResponse.body!);\r\n return itemFactory(decoded);\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.expectMessagePackArray = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper?: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/x-msgpack\");\r\n return this.useHandler(async (response) => {\r\n const items: T[] = [];\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n for await (const item of decodeArrayStream(response.rawResponse.body!)) {\r\n items.push(itemFactory(item));\r\n }\r\n return items;\r\n });\r\n};\r\n\r\nHttpBuilder.prototype.streamMessagePackArray = function <T>(\r\n this: HttpBuilder,\r\n typeOrMapper?: TypeOrMapper<T>\r\n) {\r\n this.message.headers.set(\"Accept\", \"application/x-msgpack\");\r\n\r\n async function* handler(response: HttpResponse) {\r\n const itemFactory = getMapper(deserialize, typeOrMapper);\r\n for await (const item of decodeArrayStream(response.rawResponse.body!)) {\r\n yield itemFactory(item);\r\n }\r\n }\r\n\r\n return this.useHandler((response) => Promise.resolve(handler(response)));\r\n};\r\n"],"names":[],"version":3,"file":"msgpack.mjs.map"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"source": "src/index.ts",
|
|
3
|
-
"main": "./../../dist/json.js",
|
|
4
|
-
"module": "./../../dist/json.mjs",
|
|
5
|
-
"types": "./../../dist/json.d.ts",
|
|
6
|
-
"alias": {
|
|
7
|
-
"@utiliread/http": false
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@utiliread/http": "file:../../"
|
|
11
|
-
},
|
|
12
|
-
"peerDependencies": {
|
|
13
|
-
"@utiliread/json": "file:../../node_modules/@utiliread/json"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"source": "src/index.ts",
|
|
3
|
-
"main": "./../../dist/jsonpatch.js",
|
|
4
|
-
"module": "./../../dist/jsonpatch.mjs",
|
|
5
|
-
"types": "./../../dist/jsonpatch.d.ts",
|
|
6
|
-
"alias": {
|
|
7
|
-
"@utiliread/http": false
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@utiliread/http": "file:../../"
|
|
11
|
-
},
|
|
12
|
-
"peerDependencies": {
|
|
13
|
-
"@utiliread/json": "file:../../node_modules/@utiliread/json",
|
|
14
|
-
"@utiliread/jsonpatch": "file:../../node_modules/@utiliread/jsonpatch"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"source": "src/index.ts",
|
|
3
|
-
"main": "./../../dist/msgpack.js",
|
|
4
|
-
"module": "./../../dist/msgpack.mjs",
|
|
5
|
-
"types": "./../../dist/msgpack.d.ts",
|
|
6
|
-
"alias": {
|
|
7
|
-
"@utiliread/http": false
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@utiliread/http": "file:../../"
|
|
11
|
-
},
|
|
12
|
-
"peerDependencies": {
|
|
13
|
-
"@msgpack/msgpack": "file:../../node_modules/@msgpack/msgpack",
|
|
14
|
-
"@utiliread/msgpack": "file:../../node_modules/@utiliread/msgpack"
|
|
15
|
-
}
|
|
16
|
-
}
|