@readyfor/api-client-pigeon 0.0.1-pr903.f6e652b → 0.0.1-pr904.4f555c8
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/chunk-DX53K7VW.mjs +39 -0
- package/dist/chunk-WY7GF7TX.mjs +0 -0
- package/dist/hooks/index.d.mts +6 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +83 -0
- package/dist/hooks/index.mjs +13 -0
- package/dist/hooks/useV1Example.d.mts +37 -0
- package/dist/hooks/useV1Example.d.ts +37 -0
- package/dist/hooks/useV1Example.js +81 -0
- package/dist/hooks/useV1Example.mjs +13 -0
- package/dist/index.mjs +1 -0
- package/package.json +8 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildV1ExampleGetFetcher
|
|
3
|
+
} from "./chunk-BPM425IG.mjs";
|
|
4
|
+
|
|
5
|
+
// src/hooks/useV1Example.ts
|
|
6
|
+
import useSWRImmutable from "swr/immutable";
|
|
7
|
+
import useSWRInfinite from "swr/infinite";
|
|
8
|
+
import useSWR from "swr";
|
|
9
|
+
import { __internal__requestUrl } from "@readyfor/api-client-base";
|
|
10
|
+
var v1ExampleGetFetcher = buildV1ExampleGetFetcher();
|
|
11
|
+
var useV1Example = (swrConfig) => {
|
|
12
|
+
const key = __internal__requestUrl("/api/v1/example");
|
|
13
|
+
const result = useSWR(
|
|
14
|
+
swrConfig?.shouldNotFetch ? null : key,
|
|
15
|
+
v1ExampleGetFetcher,
|
|
16
|
+
swrConfig
|
|
17
|
+
);
|
|
18
|
+
return { key, ...result };
|
|
19
|
+
};
|
|
20
|
+
var useV1ExampleImmutable = (swrConfig) => {
|
|
21
|
+
const key = __internal__requestUrl("/api/v1/example");
|
|
22
|
+
const result = useSWRImmutable(
|
|
23
|
+
swrConfig?.shouldNotFetch ? null : key,
|
|
24
|
+
v1ExampleGetFetcher,
|
|
25
|
+
swrConfig
|
|
26
|
+
);
|
|
27
|
+
return { key, ...result };
|
|
28
|
+
};
|
|
29
|
+
var useV1ExampleInfinite = (getKey, swrConfig) => useSWRInfinite(
|
|
30
|
+
getKey(() => __internal__requestUrl()),
|
|
31
|
+
v1ExampleGetFetcher,
|
|
32
|
+
swrConfig
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
useV1Example,
|
|
37
|
+
useV1ExampleImmutable,
|
|
38
|
+
useV1ExampleInfinite
|
|
39
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/hooks/index.ts
|
|
31
|
+
var hooks_exports = {};
|
|
32
|
+
__export(hooks_exports, {
|
|
33
|
+
useV1Example: () => useV1Example,
|
|
34
|
+
useV1ExampleImmutable: () => useV1ExampleImmutable,
|
|
35
|
+
useV1ExampleInfinite: () => useV1ExampleInfinite
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(hooks_exports);
|
|
38
|
+
|
|
39
|
+
// src/hooks/useV1Example.ts
|
|
40
|
+
var import_immutable = __toESM(require("swr/immutable"));
|
|
41
|
+
var import_infinite = __toESM(require("swr/infinite"));
|
|
42
|
+
var import_swr = __toESM(require("swr"));
|
|
43
|
+
var import_api_client_base2 = require("@readyfor/api-client-base");
|
|
44
|
+
|
|
45
|
+
// src/components.ts
|
|
46
|
+
var import_zod = require("zod");
|
|
47
|
+
var ExampleModel = import_zod.z.object({ value: import_zod.z.string() });
|
|
48
|
+
|
|
49
|
+
// src/fetch/v1Example.ts
|
|
50
|
+
var import_api_client_base = require("@readyfor/api-client-base");
|
|
51
|
+
var buildV1ExampleGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(ExampleModel, { ...requestInit });
|
|
52
|
+
|
|
53
|
+
// src/hooks/useV1Example.ts
|
|
54
|
+
var v1ExampleGetFetcher = buildV1ExampleGetFetcher();
|
|
55
|
+
var useV1Example = (swrConfig) => {
|
|
56
|
+
const key = (0, import_api_client_base2.__internal__requestUrl)("/api/v1/example");
|
|
57
|
+
const result = (0, import_swr.default)(
|
|
58
|
+
swrConfig?.shouldNotFetch ? null : key,
|
|
59
|
+
v1ExampleGetFetcher,
|
|
60
|
+
swrConfig
|
|
61
|
+
);
|
|
62
|
+
return { key, ...result };
|
|
63
|
+
};
|
|
64
|
+
var useV1ExampleImmutable = (swrConfig) => {
|
|
65
|
+
const key = (0, import_api_client_base2.__internal__requestUrl)("/api/v1/example");
|
|
66
|
+
const result = (0, import_immutable.default)(
|
|
67
|
+
swrConfig?.shouldNotFetch ? null : key,
|
|
68
|
+
v1ExampleGetFetcher,
|
|
69
|
+
swrConfig
|
|
70
|
+
);
|
|
71
|
+
return { key, ...result };
|
|
72
|
+
};
|
|
73
|
+
var useV1ExampleInfinite = (getKey, swrConfig) => (0, import_infinite.default)(
|
|
74
|
+
getKey(() => (0, import_api_client_base2.__internal__requestUrl)()),
|
|
75
|
+
v1ExampleGetFetcher,
|
|
76
|
+
swrConfig
|
|
77
|
+
);
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
useV1Example,
|
|
81
|
+
useV1ExampleImmutable,
|
|
82
|
+
useV1ExampleInfinite
|
|
83
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useV1Example,
|
|
3
|
+
useV1ExampleImmutable,
|
|
4
|
+
useV1ExampleInfinite
|
|
5
|
+
} from "../chunk-DX53K7VW.mjs";
|
|
6
|
+
import "../chunk-WY7GF7TX.mjs";
|
|
7
|
+
import "../chunk-BPM425IG.mjs";
|
|
8
|
+
import "../chunk-77MRBHHK.mjs";
|
|
9
|
+
export {
|
|
10
|
+
useV1Example,
|
|
11
|
+
useV1ExampleImmutable,
|
|
12
|
+
useV1ExampleInfinite
|
|
13
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as swr_infinite from 'swr/infinite';
|
|
2
|
+
import { SWRInfiniteKeyLoader, SWRInfiniteConfiguration } from 'swr/infinite';
|
|
3
|
+
import * as swr from 'swr';
|
|
4
|
+
import { Arguments } from 'swr';
|
|
5
|
+
import { Configuration } from '@readyfor/api-client-base/react';
|
|
6
|
+
import { V1ExampleGetResponse } from '../fetch/v1Example.mjs';
|
|
7
|
+
import '../schemaType.mjs';
|
|
8
|
+
|
|
9
|
+
declare const useV1Example: (swrConfig: Configuration<V1ExampleGetResponse>) => {
|
|
10
|
+
data: {
|
|
11
|
+
value: string;
|
|
12
|
+
} | undefined;
|
|
13
|
+
error: any;
|
|
14
|
+
mutate: swr.KeyedMutator<{
|
|
15
|
+
value: string;
|
|
16
|
+
}>;
|
|
17
|
+
isValidating: boolean;
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
key: string;
|
|
20
|
+
};
|
|
21
|
+
declare const useV1ExampleImmutable: (swrConfig: Configuration<V1ExampleGetResponse>) => {
|
|
22
|
+
data: {
|
|
23
|
+
value: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
error: any;
|
|
26
|
+
mutate: swr.KeyedMutator<{
|
|
27
|
+
value: string;
|
|
28
|
+
}>;
|
|
29
|
+
isValidating: boolean;
|
|
30
|
+
isLoading: boolean;
|
|
31
|
+
key: string;
|
|
32
|
+
};
|
|
33
|
+
declare const useV1ExampleInfinite: <Args extends Arguments>(getKey: (keyBuilder: () => string) => SWRInfiniteKeyLoader<V1ExampleGetResponse, Args>, swrConfig?: SWRInfiniteConfiguration<V1ExampleGetResponse>) => swr_infinite.SWRInfiniteResponse<{
|
|
34
|
+
value: string;
|
|
35
|
+
}, any>;
|
|
36
|
+
|
|
37
|
+
export { useV1Example, useV1ExampleImmutable, useV1ExampleInfinite };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as swr_infinite from 'swr/infinite';
|
|
2
|
+
import { SWRInfiniteKeyLoader, SWRInfiniteConfiguration } from 'swr/infinite';
|
|
3
|
+
import * as swr from 'swr';
|
|
4
|
+
import { Arguments } from 'swr';
|
|
5
|
+
import { Configuration } from '@readyfor/api-client-base/react';
|
|
6
|
+
import { V1ExampleGetResponse } from '../fetch/v1Example.js';
|
|
7
|
+
import '../schemaType.js';
|
|
8
|
+
|
|
9
|
+
declare const useV1Example: (swrConfig: Configuration<V1ExampleGetResponse>) => {
|
|
10
|
+
data: {
|
|
11
|
+
value: string;
|
|
12
|
+
} | undefined;
|
|
13
|
+
error: any;
|
|
14
|
+
mutate: swr.KeyedMutator<{
|
|
15
|
+
value: string;
|
|
16
|
+
}>;
|
|
17
|
+
isValidating: boolean;
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
key: string;
|
|
20
|
+
};
|
|
21
|
+
declare const useV1ExampleImmutable: (swrConfig: Configuration<V1ExampleGetResponse>) => {
|
|
22
|
+
data: {
|
|
23
|
+
value: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
error: any;
|
|
26
|
+
mutate: swr.KeyedMutator<{
|
|
27
|
+
value: string;
|
|
28
|
+
}>;
|
|
29
|
+
isValidating: boolean;
|
|
30
|
+
isLoading: boolean;
|
|
31
|
+
key: string;
|
|
32
|
+
};
|
|
33
|
+
declare const useV1ExampleInfinite: <Args extends Arguments>(getKey: (keyBuilder: () => string) => SWRInfiniteKeyLoader<V1ExampleGetResponse, Args>, swrConfig?: SWRInfiniteConfiguration<V1ExampleGetResponse>) => swr_infinite.SWRInfiniteResponse<{
|
|
34
|
+
value: string;
|
|
35
|
+
}, any>;
|
|
36
|
+
|
|
37
|
+
export { useV1Example, useV1ExampleImmutable, useV1ExampleInfinite };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/hooks/useV1Example.ts
|
|
31
|
+
var useV1Example_exports = {};
|
|
32
|
+
__export(useV1Example_exports, {
|
|
33
|
+
useV1Example: () => useV1Example,
|
|
34
|
+
useV1ExampleImmutable: () => useV1ExampleImmutable,
|
|
35
|
+
useV1ExampleInfinite: () => useV1ExampleInfinite
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(useV1Example_exports);
|
|
38
|
+
var import_immutable = __toESM(require("swr/immutable"));
|
|
39
|
+
var import_infinite = __toESM(require("swr/infinite"));
|
|
40
|
+
var import_swr = __toESM(require("swr"));
|
|
41
|
+
var import_api_client_base2 = require("@readyfor/api-client-base");
|
|
42
|
+
|
|
43
|
+
// src/components.ts
|
|
44
|
+
var import_zod = require("zod");
|
|
45
|
+
var ExampleModel = import_zod.z.object({ value: import_zod.z.string() });
|
|
46
|
+
|
|
47
|
+
// src/fetch/v1Example.ts
|
|
48
|
+
var import_api_client_base = require("@readyfor/api-client-base");
|
|
49
|
+
var buildV1ExampleGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(ExampleModel, { ...requestInit });
|
|
50
|
+
|
|
51
|
+
// src/hooks/useV1Example.ts
|
|
52
|
+
var v1ExampleGetFetcher = buildV1ExampleGetFetcher();
|
|
53
|
+
var useV1Example = (swrConfig) => {
|
|
54
|
+
const key = (0, import_api_client_base2.__internal__requestUrl)("/api/v1/example");
|
|
55
|
+
const result = (0, import_swr.default)(
|
|
56
|
+
swrConfig?.shouldNotFetch ? null : key,
|
|
57
|
+
v1ExampleGetFetcher,
|
|
58
|
+
swrConfig
|
|
59
|
+
);
|
|
60
|
+
return { key, ...result };
|
|
61
|
+
};
|
|
62
|
+
var useV1ExampleImmutable = (swrConfig) => {
|
|
63
|
+
const key = (0, import_api_client_base2.__internal__requestUrl)("/api/v1/example");
|
|
64
|
+
const result = (0, import_immutable.default)(
|
|
65
|
+
swrConfig?.shouldNotFetch ? null : key,
|
|
66
|
+
v1ExampleGetFetcher,
|
|
67
|
+
swrConfig
|
|
68
|
+
);
|
|
69
|
+
return { key, ...result };
|
|
70
|
+
};
|
|
71
|
+
var useV1ExampleInfinite = (getKey, swrConfig) => (0, import_infinite.default)(
|
|
72
|
+
getKey(() => (0, import_api_client_base2.__internal__requestUrl)()),
|
|
73
|
+
v1ExampleGetFetcher,
|
|
74
|
+
swrConfig
|
|
75
|
+
);
|
|
76
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
+
0 && (module.exports = {
|
|
78
|
+
useV1Example,
|
|
79
|
+
useV1ExampleImmutable,
|
|
80
|
+
useV1ExampleInfinite
|
|
81
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useV1Example,
|
|
3
|
+
useV1ExampleImmutable,
|
|
4
|
+
useV1ExampleInfinite
|
|
5
|
+
} from "../chunk-DX53K7VW.mjs";
|
|
6
|
+
import "../chunk-WY7GF7TX.mjs";
|
|
7
|
+
import "../chunk-BPM425IG.mjs";
|
|
8
|
+
import "../chunk-77MRBHHK.mjs";
|
|
9
|
+
export {
|
|
10
|
+
useV1Example,
|
|
11
|
+
useV1ExampleImmutable,
|
|
12
|
+
useV1ExampleInfinite
|
|
13
|
+
};
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@readyfor/api-client-pigeon",
|
|
3
|
-
"version": "0.0.1-
|
|
3
|
+
"version": "0.0.1-pr904.4f555c8",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
14
|
"import": "./dist/index.mjs",
|
|
15
15
|
"require": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./hooks": {
|
|
18
|
+
"types": "./dist/hooks/index.d.ts",
|
|
19
|
+
"import": "./dist/hooks/index.mjs",
|
|
20
|
+
"require": "./dist/hooks/index.js"
|
|
16
21
|
}
|
|
17
22
|
},
|
|
18
23
|
"devDependencies": {
|
|
@@ -24,7 +29,7 @@
|
|
|
24
29
|
"swr": "^2.2.5",
|
|
25
30
|
"use-sync-external-store": "^1.2.2",
|
|
26
31
|
"zod": "^3.23.8",
|
|
27
|
-
"@readyfor/api-client-base": "0.0.1-
|
|
32
|
+
"@readyfor/api-client-base": "0.0.1-pr904.4f555c8"
|
|
28
33
|
},
|
|
29
34
|
"peerDependencies": {
|
|
30
35
|
"qs": "^6",
|
|
@@ -32,7 +37,7 @@
|
|
|
32
37
|
"swr": "^2",
|
|
33
38
|
"use-sync-external-store": "1.2.2",
|
|
34
39
|
"zod": "^3",
|
|
35
|
-
"@readyfor/api-client-base": "0.0.1-
|
|
40
|
+
"@readyfor/api-client-base": "0.0.1-pr904.4f555c8"
|
|
36
41
|
},
|
|
37
42
|
"peerDependenciesMeta": {
|
|
38
43
|
"react": {
|