@readyfor/api-client-pigeon 0.166.0 → 0.168.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-W3XGHP3T.mjs → chunk-2PGNAMJH.mjs} +1 -1
- package/dist/{chunk-NPGTR3T2.mjs → chunk-6US3CWHW.mjs} +6 -2
- package/dist/chunk-IOFBDHPP.mjs +29 -0
- package/dist/components.d.mts +16 -2
- package/dist/components.d.ts +16 -2
- package/dist/components.js +11 -5
- package/dist/components.mjs +9 -5
- package/dist/fetch/campaigns.d.mts +14 -1
- package/dist/fetch/campaigns.d.ts +14 -1
- package/dist/fetch/campaigns.js +17 -4
- package/dist/fetch/campaigns.mjs +8 -4
- package/dist/hooks/index.js +4 -2
- package/dist/hooks/index.mjs +3 -3
- package/dist/hooks/useCampaigns.js +4 -2
- package/dist/hooks/useCampaigns.mjs +3 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +23 -6
- package/dist/index.mjs +15 -7
- package/dist/schemaType.d.mts +39 -3
- package/dist/schemaType.d.ts +39 -3
- package/package.json +3 -3
- package/dist/chunk-IP4VOBPR.mjs +0 -19
|
@@ -30,7 +30,9 @@ var Campaign = z.object({
|
|
|
30
30
|
lastEditorName: z.string(),
|
|
31
31
|
lastEditedAt: z.string()
|
|
32
32
|
});
|
|
33
|
-
var
|
|
33
|
+
var PostCampaignsRequestBody = z.object({ kind: CampaignKind });
|
|
34
|
+
var PostCampaignsResponse = z.object({ id: z.number() });
|
|
35
|
+
var GetCampaignsResponse = z.object({
|
|
34
36
|
campaigns: z.array(Campaign),
|
|
35
37
|
pagination: Pagination
|
|
36
38
|
});
|
|
@@ -40,5 +42,7 @@ export {
|
|
|
40
42
|
CampaignStatus,
|
|
41
43
|
Pagination,
|
|
42
44
|
Campaign,
|
|
43
|
-
|
|
45
|
+
PostCampaignsRequestBody,
|
|
46
|
+
PostCampaignsResponse,
|
|
47
|
+
GetCampaignsResponse
|
|
44
48
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GetCampaignsResponse,
|
|
3
|
+
PostCampaignsResponse
|
|
4
|
+
} from "./chunk-6US3CWHW.mjs";
|
|
5
|
+
|
|
6
|
+
// src/fetch/campaigns.ts
|
|
7
|
+
import {
|
|
8
|
+
createJsonFetcher,
|
|
9
|
+
__internal__requestUrl
|
|
10
|
+
} from "@readyfor/api-client-base";
|
|
11
|
+
var buildCampaignsGetFetcher = (requestInit) => createJsonFetcher(GetCampaignsResponse, { ...requestInit });
|
|
12
|
+
var getCampaigns = (query, requestInit) => buildCampaignsGetFetcher()(
|
|
13
|
+
__internal__requestUrl("/api/campaigns", {}, query),
|
|
14
|
+
{ ...requestInit, method: "GET" }
|
|
15
|
+
);
|
|
16
|
+
var buildCampaignsPostFetcher = (requestInit) => createJsonFetcher(PostCampaignsResponse, { ...requestInit });
|
|
17
|
+
var postCampaigns = (requestBody, requestInit) => buildCampaignsPostFetcher()(__internal__requestUrl("/api/campaigns"), {
|
|
18
|
+
...requestInit,
|
|
19
|
+
method: "POST",
|
|
20
|
+
headers: { ...requestInit?.headers, "Content-Type": "application/json" },
|
|
21
|
+
body: JSON.stringify(requestBody)
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
buildCampaignsGetFetcher,
|
|
26
|
+
getCampaigns,
|
|
27
|
+
buildCampaignsPostFetcher,
|
|
28
|
+
postCampaigns
|
|
29
|
+
};
|
package/dist/components.d.mts
CHANGED
|
@@ -55,7 +55,21 @@ declare const Campaign: z.ZodObject<{
|
|
|
55
55
|
lastEditedAt: string;
|
|
56
56
|
title?: string | null | undefined;
|
|
57
57
|
}>;
|
|
58
|
-
declare const
|
|
58
|
+
declare const PostCampaignsRequestBody: z.ZodObject<{
|
|
59
|
+
kind: z.ZodUnion<[z.ZodLiteral<"curationMailMagazine">, z.ZodLiteral<"personalizedMailMagazine">]>;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
kind: "curationMailMagazine" | "personalizedMailMagazine";
|
|
62
|
+
}, {
|
|
63
|
+
kind: "curationMailMagazine" | "personalizedMailMagazine";
|
|
64
|
+
}>;
|
|
65
|
+
declare const PostCampaignsResponse: z.ZodObject<{
|
|
66
|
+
id: z.ZodNumber;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
id: number;
|
|
69
|
+
}, {
|
|
70
|
+
id: number;
|
|
71
|
+
}>;
|
|
72
|
+
declare const GetCampaignsResponse: z.ZodObject<{
|
|
59
73
|
campaigns: z.ZodArray<z.ZodObject<{
|
|
60
74
|
id: z.ZodNumber;
|
|
61
75
|
title: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
@@ -151,4 +165,4 @@ declare const GetCampaigns: z.ZodObject<{
|
|
|
151
165
|
};
|
|
152
166
|
}>;
|
|
153
167
|
|
|
154
|
-
export { Campaign, CampaignKind, CampaignStatus,
|
|
168
|
+
export { Campaign, CampaignKind, CampaignStatus, GetCampaignsResponse, Pagination, PostCampaignsRequestBody, PostCampaignsResponse };
|
package/dist/components.d.ts
CHANGED
|
@@ -55,7 +55,21 @@ declare const Campaign: z.ZodObject<{
|
|
|
55
55
|
lastEditedAt: string;
|
|
56
56
|
title?: string | null | undefined;
|
|
57
57
|
}>;
|
|
58
|
-
declare const
|
|
58
|
+
declare const PostCampaignsRequestBody: z.ZodObject<{
|
|
59
|
+
kind: z.ZodUnion<[z.ZodLiteral<"curationMailMagazine">, z.ZodLiteral<"personalizedMailMagazine">]>;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
kind: "curationMailMagazine" | "personalizedMailMagazine";
|
|
62
|
+
}, {
|
|
63
|
+
kind: "curationMailMagazine" | "personalizedMailMagazine";
|
|
64
|
+
}>;
|
|
65
|
+
declare const PostCampaignsResponse: z.ZodObject<{
|
|
66
|
+
id: z.ZodNumber;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
id: number;
|
|
69
|
+
}, {
|
|
70
|
+
id: number;
|
|
71
|
+
}>;
|
|
72
|
+
declare const GetCampaignsResponse: z.ZodObject<{
|
|
59
73
|
campaigns: z.ZodArray<z.ZodObject<{
|
|
60
74
|
id: z.ZodNumber;
|
|
61
75
|
title: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
@@ -151,4 +165,4 @@ declare const GetCampaigns: z.ZodObject<{
|
|
|
151
165
|
};
|
|
152
166
|
}>;
|
|
153
167
|
|
|
154
|
-
export { Campaign, CampaignKind, CampaignStatus,
|
|
168
|
+
export { Campaign, CampaignKind, CampaignStatus, GetCampaignsResponse, Pagination, PostCampaignsRequestBody, PostCampaignsResponse };
|
package/dist/components.js
CHANGED
|
@@ -23,8 +23,10 @@ __export(components_exports, {
|
|
|
23
23
|
Campaign: () => Campaign,
|
|
24
24
|
CampaignKind: () => CampaignKind,
|
|
25
25
|
CampaignStatus: () => CampaignStatus,
|
|
26
|
-
|
|
27
|
-
Pagination: () => Pagination
|
|
26
|
+
GetCampaignsResponse: () => GetCampaignsResponse,
|
|
27
|
+
Pagination: () => Pagination,
|
|
28
|
+
PostCampaignsRequestBody: () => PostCampaignsRequestBody,
|
|
29
|
+
PostCampaignsResponse: () => PostCampaignsResponse
|
|
28
30
|
});
|
|
29
31
|
module.exports = __toCommonJS(components_exports);
|
|
30
32
|
var import_zod = require("zod");
|
|
@@ -58,7 +60,9 @@ var Campaign = import_zod.z.object({
|
|
|
58
60
|
lastEditorName: import_zod.z.string(),
|
|
59
61
|
lastEditedAt: import_zod.z.string()
|
|
60
62
|
});
|
|
61
|
-
var
|
|
63
|
+
var PostCampaignsRequestBody = import_zod.z.object({ kind: CampaignKind });
|
|
64
|
+
var PostCampaignsResponse = import_zod.z.object({ id: import_zod.z.number() });
|
|
65
|
+
var GetCampaignsResponse = import_zod.z.object({
|
|
62
66
|
campaigns: import_zod.z.array(Campaign),
|
|
63
67
|
pagination: Pagination
|
|
64
68
|
});
|
|
@@ -67,6 +71,8 @@ var GetCampaigns = import_zod.z.object({
|
|
|
67
71
|
Campaign,
|
|
68
72
|
CampaignKind,
|
|
69
73
|
CampaignStatus,
|
|
70
|
-
|
|
71
|
-
Pagination
|
|
74
|
+
GetCampaignsResponse,
|
|
75
|
+
Pagination,
|
|
76
|
+
PostCampaignsRequestBody,
|
|
77
|
+
PostCampaignsResponse
|
|
72
78
|
});
|
package/dist/components.mjs
CHANGED
|
@@ -2,13 +2,17 @@ import {
|
|
|
2
2
|
Campaign,
|
|
3
3
|
CampaignKind,
|
|
4
4
|
CampaignStatus,
|
|
5
|
-
|
|
6
|
-
Pagination
|
|
7
|
-
|
|
5
|
+
GetCampaignsResponse,
|
|
6
|
+
Pagination,
|
|
7
|
+
PostCampaignsRequestBody,
|
|
8
|
+
PostCampaignsResponse
|
|
9
|
+
} from "./chunk-6US3CWHW.mjs";
|
|
8
10
|
export {
|
|
9
11
|
Campaign,
|
|
10
12
|
CampaignKind,
|
|
11
13
|
CampaignStatus,
|
|
12
|
-
|
|
13
|
-
Pagination
|
|
14
|
+
GetCampaignsResponse,
|
|
15
|
+
Pagination,
|
|
16
|
+
PostCampaignsRequestBody,
|
|
17
|
+
PostCampaignsResponse
|
|
14
18
|
};
|
|
@@ -49,5 +49,18 @@ declare const getCampaigns: (query: CampaignsGetQuery, requestInit?: RequestInit
|
|
|
49
49
|
isLastPage: boolean;
|
|
50
50
|
};
|
|
51
51
|
}>;
|
|
52
|
+
type CampaignsPostOperation = paths["/api/campaigns"]["post"];
|
|
53
|
+
type CampaignsPostResponse = CampaignsPostOperation["responses"]["201"]["content"]["application/json"];
|
|
54
|
+
declare const buildCampaignsPostFetcher: (requestInit?: RequestInit) => (input: RequestInfo, requestInit?: RequestInit) => Promise<{
|
|
55
|
+
id: number;
|
|
56
|
+
}>;
|
|
57
|
+
type CampaignsPostRequestBody = ForceDig<CampaignsPostOperation, [
|
|
58
|
+
"requestBody",
|
|
59
|
+
"content",
|
|
60
|
+
"application/json"
|
|
61
|
+
]>;
|
|
62
|
+
declare const postCampaigns: (requestBody: CampaignsPostRequestBody, requestInit?: RequestInit) => Promise<{
|
|
63
|
+
id: number;
|
|
64
|
+
}>;
|
|
52
65
|
|
|
53
|
-
export { type CampaignsGetQuery, type CampaignsGetResponse, buildCampaignsGetFetcher, getCampaigns };
|
|
66
|
+
export { type CampaignsGetQuery, type CampaignsGetResponse, type CampaignsPostRequestBody, type CampaignsPostResponse, buildCampaignsGetFetcher, buildCampaignsPostFetcher, getCampaigns, postCampaigns };
|
|
@@ -49,5 +49,18 @@ declare const getCampaigns: (query: CampaignsGetQuery, requestInit?: RequestInit
|
|
|
49
49
|
isLastPage: boolean;
|
|
50
50
|
};
|
|
51
51
|
}>;
|
|
52
|
+
type CampaignsPostOperation = paths["/api/campaigns"]["post"];
|
|
53
|
+
type CampaignsPostResponse = CampaignsPostOperation["responses"]["201"]["content"]["application/json"];
|
|
54
|
+
declare const buildCampaignsPostFetcher: (requestInit?: RequestInit) => (input: RequestInfo, requestInit?: RequestInit) => Promise<{
|
|
55
|
+
id: number;
|
|
56
|
+
}>;
|
|
57
|
+
type CampaignsPostRequestBody = ForceDig<CampaignsPostOperation, [
|
|
58
|
+
"requestBody",
|
|
59
|
+
"content",
|
|
60
|
+
"application/json"
|
|
61
|
+
]>;
|
|
62
|
+
declare const postCampaigns: (requestBody: CampaignsPostRequestBody, requestInit?: RequestInit) => Promise<{
|
|
63
|
+
id: number;
|
|
64
|
+
}>;
|
|
52
65
|
|
|
53
|
-
export { type CampaignsGetQuery, type CampaignsGetResponse, buildCampaignsGetFetcher, getCampaigns };
|
|
66
|
+
export { type CampaignsGetQuery, type CampaignsGetResponse, type CampaignsPostRequestBody, type CampaignsPostResponse, buildCampaignsGetFetcher, buildCampaignsPostFetcher, getCampaigns, postCampaigns };
|
package/dist/fetch/campaigns.js
CHANGED
|
@@ -21,7 +21,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var campaigns_exports = {};
|
|
22
22
|
__export(campaigns_exports, {
|
|
23
23
|
buildCampaignsGetFetcher: () => buildCampaignsGetFetcher,
|
|
24
|
-
|
|
24
|
+
buildCampaignsPostFetcher: () => buildCampaignsPostFetcher,
|
|
25
|
+
getCampaigns: () => getCampaigns,
|
|
26
|
+
postCampaigns: () => postCampaigns
|
|
25
27
|
});
|
|
26
28
|
module.exports = __toCommonJS(campaigns_exports);
|
|
27
29
|
var import_api_client_base = require("@readyfor/api-client-base");
|
|
@@ -58,19 +60,30 @@ var Campaign = import_zod.z.object({
|
|
|
58
60
|
lastEditorName: import_zod.z.string(),
|
|
59
61
|
lastEditedAt: import_zod.z.string()
|
|
60
62
|
});
|
|
61
|
-
var
|
|
63
|
+
var PostCampaignsRequestBody = import_zod.z.object({ kind: CampaignKind });
|
|
64
|
+
var PostCampaignsResponse = import_zod.z.object({ id: import_zod.z.number() });
|
|
65
|
+
var GetCampaignsResponse = import_zod.z.object({
|
|
62
66
|
campaigns: import_zod.z.array(Campaign),
|
|
63
67
|
pagination: Pagination
|
|
64
68
|
});
|
|
65
69
|
|
|
66
70
|
// src/fetch/campaigns.ts
|
|
67
|
-
var buildCampaignsGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(
|
|
71
|
+
var buildCampaignsGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(GetCampaignsResponse, { ...requestInit });
|
|
68
72
|
var getCampaigns = (query, requestInit) => buildCampaignsGetFetcher()(
|
|
69
73
|
(0, import_api_client_base.__internal__requestUrl)("/api/campaigns", {}, query),
|
|
70
74
|
{ ...requestInit, method: "GET" }
|
|
71
75
|
);
|
|
76
|
+
var buildCampaignsPostFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(PostCampaignsResponse, { ...requestInit });
|
|
77
|
+
var postCampaigns = (requestBody, requestInit) => buildCampaignsPostFetcher()((0, import_api_client_base.__internal__requestUrl)("/api/campaigns"), {
|
|
78
|
+
...requestInit,
|
|
79
|
+
method: "POST",
|
|
80
|
+
headers: { ...requestInit?.headers, "Content-Type": "application/json" },
|
|
81
|
+
body: JSON.stringify(requestBody)
|
|
82
|
+
});
|
|
72
83
|
// Annotate the CommonJS export names for ESM import in node:
|
|
73
84
|
0 && (module.exports = {
|
|
74
85
|
buildCampaignsGetFetcher,
|
|
75
|
-
|
|
86
|
+
buildCampaignsPostFetcher,
|
|
87
|
+
getCampaigns,
|
|
88
|
+
postCampaigns
|
|
76
89
|
});
|
package/dist/fetch/campaigns.mjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildCampaignsGetFetcher,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
buildCampaignsPostFetcher,
|
|
4
|
+
getCampaigns,
|
|
5
|
+
postCampaigns
|
|
6
|
+
} from "../chunk-IOFBDHPP.mjs";
|
|
7
|
+
import "../chunk-6US3CWHW.mjs";
|
|
6
8
|
export {
|
|
7
9
|
buildCampaignsGetFetcher,
|
|
8
|
-
|
|
10
|
+
buildCampaignsPostFetcher,
|
|
11
|
+
getCampaigns,
|
|
12
|
+
postCampaigns
|
|
9
13
|
};
|
package/dist/hooks/index.js
CHANGED
|
@@ -75,14 +75,16 @@ var Campaign = import_zod.z.object({
|
|
|
75
75
|
lastEditorName: import_zod.z.string(),
|
|
76
76
|
lastEditedAt: import_zod.z.string()
|
|
77
77
|
});
|
|
78
|
-
var
|
|
78
|
+
var PostCampaignsRequestBody = import_zod.z.object({ kind: CampaignKind });
|
|
79
|
+
var PostCampaignsResponse = import_zod.z.object({ id: import_zod.z.number() });
|
|
80
|
+
var GetCampaignsResponse = import_zod.z.object({
|
|
79
81
|
campaigns: import_zod.z.array(Campaign),
|
|
80
82
|
pagination: Pagination
|
|
81
83
|
});
|
|
82
84
|
|
|
83
85
|
// src/fetch/campaigns.ts
|
|
84
86
|
var import_api_client_base = require("@readyfor/api-client-base");
|
|
85
|
-
var buildCampaignsGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(
|
|
87
|
+
var buildCampaignsGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(GetCampaignsResponse, { ...requestInit });
|
|
86
88
|
|
|
87
89
|
// src/hooks/useCampaigns.ts
|
|
88
90
|
var campaignsGetFetcher = buildCampaignsGetFetcher();
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
useCampaigns,
|
|
3
3
|
useCampaignsImmutable,
|
|
4
4
|
useCampaignsInfinite
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-2PGNAMJH.mjs";
|
|
6
6
|
import "../chunk-WY7GF7TX.mjs";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-IOFBDHPP.mjs";
|
|
8
|
+
import "../chunk-6US3CWHW.mjs";
|
|
9
9
|
export {
|
|
10
10
|
useCampaigns,
|
|
11
11
|
useCampaignsImmutable,
|
|
@@ -73,14 +73,16 @@ var Campaign = import_zod.z.object({
|
|
|
73
73
|
lastEditorName: import_zod.z.string(),
|
|
74
74
|
lastEditedAt: import_zod.z.string()
|
|
75
75
|
});
|
|
76
|
-
var
|
|
76
|
+
var PostCampaignsRequestBody = import_zod.z.object({ kind: CampaignKind });
|
|
77
|
+
var PostCampaignsResponse = import_zod.z.object({ id: import_zod.z.number() });
|
|
78
|
+
var GetCampaignsResponse = import_zod.z.object({
|
|
77
79
|
campaigns: import_zod.z.array(Campaign),
|
|
78
80
|
pagination: Pagination
|
|
79
81
|
});
|
|
80
82
|
|
|
81
83
|
// src/fetch/campaigns.ts
|
|
82
84
|
var import_api_client_base = require("@readyfor/api-client-base");
|
|
83
|
-
var buildCampaignsGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(
|
|
85
|
+
var buildCampaignsGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(GetCampaignsResponse, { ...requestInit });
|
|
84
86
|
|
|
85
87
|
// src/hooks/useCampaigns.ts
|
|
86
88
|
var campaignsGetFetcher = buildCampaignsGetFetcher();
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
useCampaigns,
|
|
3
3
|
useCampaignsImmutable,
|
|
4
4
|
useCampaignsInfinite
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-2PGNAMJH.mjs";
|
|
6
6
|
import "../chunk-WY7GF7TX.mjs";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-IOFBDHPP.mjs";
|
|
8
|
+
import "../chunk-6US3CWHW.mjs";
|
|
9
9
|
export {
|
|
10
10
|
useCampaigns,
|
|
11
11
|
useCampaignsImmutable,
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { $defs, components, external, operations, paths, webhooks } from './schemaType.mjs';
|
|
2
|
-
export { Campaign, CampaignKind, CampaignStatus,
|
|
3
|
-
export { CampaignsGetQuery, CampaignsGetResponse, buildCampaignsGetFetcher, getCampaigns } from './fetch/campaigns.mjs';
|
|
2
|
+
export { Campaign, CampaignKind, CampaignStatus, GetCampaignsResponse, Pagination, PostCampaignsRequestBody, PostCampaignsResponse } from './components.mjs';
|
|
3
|
+
export { CampaignsGetQuery, CampaignsGetResponse, CampaignsPostRequestBody, CampaignsPostResponse, buildCampaignsGetFetcher, buildCampaignsPostFetcher, getCampaigns, postCampaigns } from './fetch/campaigns.mjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@readyfor/api-client-base';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { $defs, components, external, operations, paths, webhooks } from './schemaType.js';
|
|
2
|
-
export { Campaign, CampaignKind, CampaignStatus,
|
|
3
|
-
export { CampaignsGetQuery, CampaignsGetResponse, buildCampaignsGetFetcher, getCampaigns } from './fetch/campaigns.js';
|
|
2
|
+
export { Campaign, CampaignKind, CampaignStatus, GetCampaignsResponse, Pagination, PostCampaignsRequestBody, PostCampaignsResponse } from './components.js';
|
|
3
|
+
export { CampaignsGetQuery, CampaignsGetResponse, CampaignsPostRequestBody, CampaignsPostResponse, buildCampaignsGetFetcher, buildCampaignsPostFetcher, getCampaigns, postCampaigns } from './fetch/campaigns.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@readyfor/api-client-base';
|
package/dist/index.js
CHANGED
|
@@ -23,10 +23,14 @@ __export(src_exports, {
|
|
|
23
23
|
Campaign: () => Campaign,
|
|
24
24
|
CampaignKind: () => CampaignKind,
|
|
25
25
|
CampaignStatus: () => CampaignStatus,
|
|
26
|
-
|
|
26
|
+
GetCampaignsResponse: () => GetCampaignsResponse,
|
|
27
27
|
Pagination: () => Pagination,
|
|
28
|
+
PostCampaignsRequestBody: () => PostCampaignsRequestBody,
|
|
29
|
+
PostCampaignsResponse: () => PostCampaignsResponse,
|
|
28
30
|
buildCampaignsGetFetcher: () => buildCampaignsGetFetcher,
|
|
29
|
-
|
|
31
|
+
buildCampaignsPostFetcher: () => buildCampaignsPostFetcher,
|
|
32
|
+
getCampaigns: () => getCampaigns,
|
|
33
|
+
postCampaigns: () => postCampaigns
|
|
30
34
|
});
|
|
31
35
|
module.exports = __toCommonJS(src_exports);
|
|
32
36
|
|
|
@@ -62,25 +66,38 @@ var Campaign = import_zod.z.object({
|
|
|
62
66
|
lastEditorName: import_zod.z.string(),
|
|
63
67
|
lastEditedAt: import_zod.z.string()
|
|
64
68
|
});
|
|
65
|
-
var
|
|
69
|
+
var PostCampaignsRequestBody = import_zod.z.object({ kind: CampaignKind });
|
|
70
|
+
var PostCampaignsResponse = import_zod.z.object({ id: import_zod.z.number() });
|
|
71
|
+
var GetCampaignsResponse = import_zod.z.object({
|
|
66
72
|
campaigns: import_zod.z.array(Campaign),
|
|
67
73
|
pagination: Pagination
|
|
68
74
|
});
|
|
69
75
|
|
|
70
76
|
// src/fetch/campaigns.ts
|
|
71
77
|
var import_api_client_base = require("@readyfor/api-client-base");
|
|
72
|
-
var buildCampaignsGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(
|
|
78
|
+
var buildCampaignsGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(GetCampaignsResponse, { ...requestInit });
|
|
73
79
|
var getCampaigns = (query, requestInit) => buildCampaignsGetFetcher()(
|
|
74
80
|
(0, import_api_client_base.__internal__requestUrl)("/api/campaigns", {}, query),
|
|
75
81
|
{ ...requestInit, method: "GET" }
|
|
76
82
|
);
|
|
83
|
+
var buildCampaignsPostFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(PostCampaignsResponse, { ...requestInit });
|
|
84
|
+
var postCampaigns = (requestBody, requestInit) => buildCampaignsPostFetcher()((0, import_api_client_base.__internal__requestUrl)("/api/campaigns"), {
|
|
85
|
+
...requestInit,
|
|
86
|
+
method: "POST",
|
|
87
|
+
headers: { ...requestInit?.headers, "Content-Type": "application/json" },
|
|
88
|
+
body: JSON.stringify(requestBody)
|
|
89
|
+
});
|
|
77
90
|
// Annotate the CommonJS export names for ESM import in node:
|
|
78
91
|
0 && (module.exports = {
|
|
79
92
|
Campaign,
|
|
80
93
|
CampaignKind,
|
|
81
94
|
CampaignStatus,
|
|
82
|
-
|
|
95
|
+
GetCampaignsResponse,
|
|
83
96
|
Pagination,
|
|
97
|
+
PostCampaignsRequestBody,
|
|
98
|
+
PostCampaignsResponse,
|
|
84
99
|
buildCampaignsGetFetcher,
|
|
85
|
-
|
|
100
|
+
buildCampaignsPostFetcher,
|
|
101
|
+
getCampaigns,
|
|
102
|
+
postCampaigns
|
|
86
103
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import "./chunk-WY7GF7TX.mjs";
|
|
2
2
|
import {
|
|
3
3
|
buildCampaignsGetFetcher,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
buildCampaignsPostFetcher,
|
|
5
|
+
getCampaigns,
|
|
6
|
+
postCampaigns
|
|
7
|
+
} from "./chunk-IOFBDHPP.mjs";
|
|
6
8
|
import {
|
|
7
9
|
Campaign,
|
|
8
10
|
CampaignKind,
|
|
9
11
|
CampaignStatus,
|
|
10
|
-
|
|
11
|
-
Pagination
|
|
12
|
-
|
|
12
|
+
GetCampaignsResponse,
|
|
13
|
+
Pagination,
|
|
14
|
+
PostCampaignsRequestBody,
|
|
15
|
+
PostCampaignsResponse
|
|
16
|
+
} from "./chunk-6US3CWHW.mjs";
|
|
13
17
|
export {
|
|
14
18
|
Campaign,
|
|
15
19
|
CampaignKind,
|
|
16
20
|
CampaignStatus,
|
|
17
|
-
|
|
21
|
+
GetCampaignsResponse,
|
|
18
22
|
Pagination,
|
|
23
|
+
PostCampaignsRequestBody,
|
|
24
|
+
PostCampaignsResponse,
|
|
19
25
|
buildCampaignsGetFetcher,
|
|
20
|
-
|
|
26
|
+
buildCampaignsPostFetcher,
|
|
27
|
+
getCampaigns,
|
|
28
|
+
postCampaigns
|
|
21
29
|
};
|
package/dist/schemaType.d.mts
CHANGED
|
@@ -6,13 +6,15 @@ interface paths {
|
|
|
6
6
|
"/api/campaigns": {
|
|
7
7
|
/** キャンペーン一覧を取得する */
|
|
8
8
|
get: operations["GetCampaigns"];
|
|
9
|
+
/** キャンペーンを作成する */
|
|
10
|
+
post: operations["PostCampaigns"];
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
13
|
type webhooks = Record<string, never>;
|
|
12
14
|
interface components {
|
|
13
15
|
schemas: {
|
|
14
16
|
/**
|
|
15
|
-
*
|
|
17
|
+
* GetCampaignsResponse
|
|
16
18
|
* @example {
|
|
17
19
|
* "pagination": {
|
|
18
20
|
* "nextPage": 7,
|
|
@@ -46,7 +48,7 @@ interface components {
|
|
|
46
48
|
* ]
|
|
47
49
|
* }
|
|
48
50
|
*/
|
|
49
|
-
|
|
51
|
+
GetCampaignsResponse: {
|
|
50
52
|
campaigns: components["schemas"]["Campaign"][];
|
|
51
53
|
pagination: components["schemas"]["Pagination"];
|
|
52
54
|
};
|
|
@@ -73,6 +75,24 @@ interface components {
|
|
|
73
75
|
/** Format: date-time */
|
|
74
76
|
lastEditedAt: string;
|
|
75
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* PostCampaignsResponse
|
|
80
|
+
* @example {
|
|
81
|
+
* "id": 0
|
|
82
|
+
* }
|
|
83
|
+
*/
|
|
84
|
+
PostCampaignsResponse: {
|
|
85
|
+
id: number;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* PostCampaignsRequestBody
|
|
89
|
+
* @example {
|
|
90
|
+
* "kind": "curationMailMagazine"
|
|
91
|
+
* }
|
|
92
|
+
*/
|
|
93
|
+
PostCampaignsRequestBody: {
|
|
94
|
+
kind: components["schemas"]["CampaignKind"];
|
|
95
|
+
};
|
|
76
96
|
/**
|
|
77
97
|
* CampaignStatus
|
|
78
98
|
* @enum {string}
|
|
@@ -141,7 +161,23 @@ interface operations {
|
|
|
141
161
|
/** @description OK */
|
|
142
162
|
200: {
|
|
143
163
|
content: {
|
|
144
|
-
"application/json": components["schemas"]["
|
|
164
|
+
"application/json": components["schemas"]["GetCampaignsResponse"];
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
/** キャンペーンを作成する */
|
|
170
|
+
PostCampaigns: {
|
|
171
|
+
requestBody: {
|
|
172
|
+
content: {
|
|
173
|
+
"application/json": components["schemas"]["PostCampaignsRequestBody"];
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
responses: {
|
|
177
|
+
/** @description Created */
|
|
178
|
+
201: {
|
|
179
|
+
content: {
|
|
180
|
+
"application/json": components["schemas"]["PostCampaignsResponse"];
|
|
145
181
|
};
|
|
146
182
|
};
|
|
147
183
|
};
|
package/dist/schemaType.d.ts
CHANGED
|
@@ -6,13 +6,15 @@ interface paths {
|
|
|
6
6
|
"/api/campaigns": {
|
|
7
7
|
/** キャンペーン一覧を取得する */
|
|
8
8
|
get: operations["GetCampaigns"];
|
|
9
|
+
/** キャンペーンを作成する */
|
|
10
|
+
post: operations["PostCampaigns"];
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
13
|
type webhooks = Record<string, never>;
|
|
12
14
|
interface components {
|
|
13
15
|
schemas: {
|
|
14
16
|
/**
|
|
15
|
-
*
|
|
17
|
+
* GetCampaignsResponse
|
|
16
18
|
* @example {
|
|
17
19
|
* "pagination": {
|
|
18
20
|
* "nextPage": 7,
|
|
@@ -46,7 +48,7 @@ interface components {
|
|
|
46
48
|
* ]
|
|
47
49
|
* }
|
|
48
50
|
*/
|
|
49
|
-
|
|
51
|
+
GetCampaignsResponse: {
|
|
50
52
|
campaigns: components["schemas"]["Campaign"][];
|
|
51
53
|
pagination: components["schemas"]["Pagination"];
|
|
52
54
|
};
|
|
@@ -73,6 +75,24 @@ interface components {
|
|
|
73
75
|
/** Format: date-time */
|
|
74
76
|
lastEditedAt: string;
|
|
75
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* PostCampaignsResponse
|
|
80
|
+
* @example {
|
|
81
|
+
* "id": 0
|
|
82
|
+
* }
|
|
83
|
+
*/
|
|
84
|
+
PostCampaignsResponse: {
|
|
85
|
+
id: number;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* PostCampaignsRequestBody
|
|
89
|
+
* @example {
|
|
90
|
+
* "kind": "curationMailMagazine"
|
|
91
|
+
* }
|
|
92
|
+
*/
|
|
93
|
+
PostCampaignsRequestBody: {
|
|
94
|
+
kind: components["schemas"]["CampaignKind"];
|
|
95
|
+
};
|
|
76
96
|
/**
|
|
77
97
|
* CampaignStatus
|
|
78
98
|
* @enum {string}
|
|
@@ -141,7 +161,23 @@ interface operations {
|
|
|
141
161
|
/** @description OK */
|
|
142
162
|
200: {
|
|
143
163
|
content: {
|
|
144
|
-
"application/json": components["schemas"]["
|
|
164
|
+
"application/json": components["schemas"]["GetCampaignsResponse"];
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
/** キャンペーンを作成する */
|
|
170
|
+
PostCampaigns: {
|
|
171
|
+
requestBody: {
|
|
172
|
+
content: {
|
|
173
|
+
"application/json": components["schemas"]["PostCampaignsRequestBody"];
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
responses: {
|
|
177
|
+
/** @description Created */
|
|
178
|
+
201: {
|
|
179
|
+
content: {
|
|
180
|
+
"application/json": components["schemas"]["PostCampaignsResponse"];
|
|
145
181
|
};
|
|
146
182
|
};
|
|
147
183
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@readyfor/api-client-pigeon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.168.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"build": "tsup"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@readyfor/api-client-base": "0.
|
|
27
|
+
"@readyfor/api-client-base": "0.168.0",
|
|
28
28
|
"@types/qs": "6.9.17",
|
|
29
29
|
"@types/react": "^18.3.12",
|
|
30
30
|
"@types/use-sync-external-store": "0.0.6",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"src"
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "17053a524c9494a3b90788f0be5b5b121f5667a3"
|
|
69
69
|
}
|
package/dist/chunk-IP4VOBPR.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GetCampaigns
|
|
3
|
-
} from "./chunk-NPGTR3T2.mjs";
|
|
4
|
-
|
|
5
|
-
// src/fetch/campaigns.ts
|
|
6
|
-
import {
|
|
7
|
-
createJsonFetcher,
|
|
8
|
-
__internal__requestUrl
|
|
9
|
-
} from "@readyfor/api-client-base";
|
|
10
|
-
var buildCampaignsGetFetcher = (requestInit) => createJsonFetcher(GetCampaigns, { ...requestInit });
|
|
11
|
-
var getCampaigns = (query, requestInit) => buildCampaignsGetFetcher()(
|
|
12
|
-
__internal__requestUrl("/api/campaigns", {}, query),
|
|
13
|
-
{ ...requestInit, method: "GET" }
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
buildCampaignsGetFetcher,
|
|
18
|
-
getCampaigns
|
|
19
|
-
};
|