@readyfor/api-client-pigeon 0.169.0 → 0.171.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-6MUZHLM5.mjs +42 -0
- package/dist/chunk-7XSND6KI.mjs +100 -0
- package/dist/{chunk-2PGNAMJH.mjs → chunk-BHUMNBFZ.mjs} +1 -1
- package/dist/chunk-GBESGCUB.mjs +19 -0
- package/dist/chunk-V6EPKCC7.mjs +27 -0
- package/dist/{chunk-IOFBDHPP.mjs → chunk-ZHGMUSIW.mjs} +1 -1
- package/dist/components.d.mts +450 -2
- package/dist/components.d.ts +450 -2
- package/dist/components.js +66 -4
- package/dist/components.mjs +21 -1
- package/dist/fetch/campaigns.js +45 -4
- package/dist/fetch/campaigns.mjs +2 -2
- package/dist/fetch/campaignsId.d.mts +47 -0
- package/dist/fetch/campaignsId.d.ts +47 -0
- package/dist/fetch/campaignsId.js +119 -0
- package/dist/fetch/campaignsId.mjs +9 -0
- package/dist/fetch/personalizedMailMagazinesId.d.mts +42 -0
- package/dist/fetch/personalizedMailMagazinesId.d.ts +42 -0
- package/dist/fetch/personalizedMailMagazinesId.js +128 -0
- package/dist/fetch/personalizedMailMagazinesId.mjs +9 -0
- package/dist/hooks/index.d.mts +2 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +95 -8
- package/dist/hooks/index.mjs +14 -4
- package/dist/hooks/useCampaigns.js +55 -8
- package/dist/hooks/useCampaigns.mjs +6 -4
- package/dist/hooks/useCampaignsId.d.mts +38 -0
- package/dist/hooks/useCampaignsId.d.ts +38 -0
- package/dist/hooks/useCampaignsId.js +166 -0
- package/dist/hooks/useCampaignsId.mjs +15 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +98 -4
- package/dist/index.mjs +35 -3
- package/dist/schemaType.d.mts +138 -0
- package/dist/schemaType.d.ts +138 -0
- package/package.json +3 -3
- package/dist/chunk-6US3CWHW.mjs +0 -48
- /package/dist/{chunk-WY7GF7TX.mjs → chunk-RD6VKGWI.mjs} +0 -0
package/dist/fetch/campaigns.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
buildCampaignsPostFetcher,
|
|
4
4
|
getCampaigns,
|
|
5
5
|
postCampaigns
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-ZHGMUSIW.mjs";
|
|
7
|
+
import "../chunk-7XSND6KI.mjs";
|
|
8
8
|
export {
|
|
9
9
|
buildCampaignsGetFetcher,
|
|
10
10
|
buildCampaignsPostFetcher,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { paths } from '../schemaType.mjs';
|
|
2
|
+
import { ForceDig } from '@readyfor/api-client-base';
|
|
3
|
+
|
|
4
|
+
type CampaignsIdGetOperation = paths["/api/campaigns/{id}"]["get"];
|
|
5
|
+
type CampaignsIdGetResponse = CampaignsIdGetOperation["responses"]["200"]["content"]["application/json"];
|
|
6
|
+
declare const buildCampaignsIdGetFetcher: (requestInit?: RequestInit) => (input: RequestInfo, requestInit?: RequestInit) => Promise<{
|
|
7
|
+
campaignDetail: {
|
|
8
|
+
__type: "CurationMailMagazineCampaignDetail";
|
|
9
|
+
id: number;
|
|
10
|
+
} | {
|
|
11
|
+
status: "draft" | "scheduled" | "delivering" | "delivered" | "deliveryFailed";
|
|
12
|
+
__type: "PersonalizedMailMagazineCampaignDetail";
|
|
13
|
+
id: number;
|
|
14
|
+
title: string | null;
|
|
15
|
+
utmCampaign: string | null;
|
|
16
|
+
scheduledDeliveryAt: string | null;
|
|
17
|
+
target: {
|
|
18
|
+
csvFileName: string;
|
|
19
|
+
targetUsersCount: number;
|
|
20
|
+
excludedUsersCount: number;
|
|
21
|
+
} | null;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
type CampaignsIdGetPath = ForceDig<CampaignsIdGetOperation, [
|
|
25
|
+
"parameters",
|
|
26
|
+
"path"
|
|
27
|
+
]>;
|
|
28
|
+
declare const getCampaignsId: (path: CampaignsIdGetPath, requestInit?: RequestInit) => Promise<{
|
|
29
|
+
campaignDetail: {
|
|
30
|
+
__type: "CurationMailMagazineCampaignDetail";
|
|
31
|
+
id: number;
|
|
32
|
+
} | {
|
|
33
|
+
status: "draft" | "scheduled" | "delivering" | "delivered" | "deliveryFailed";
|
|
34
|
+
__type: "PersonalizedMailMagazineCampaignDetail";
|
|
35
|
+
id: number;
|
|
36
|
+
title: string | null;
|
|
37
|
+
utmCampaign: string | null;
|
|
38
|
+
scheduledDeliveryAt: string | null;
|
|
39
|
+
target: {
|
|
40
|
+
csvFileName: string;
|
|
41
|
+
targetUsersCount: number;
|
|
42
|
+
excludedUsersCount: number;
|
|
43
|
+
} | null;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
|
|
47
|
+
export { type CampaignsIdGetPath, type CampaignsIdGetResponse, buildCampaignsIdGetFetcher, getCampaignsId };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { paths } from '../schemaType.js';
|
|
2
|
+
import { ForceDig } from '@readyfor/api-client-base';
|
|
3
|
+
|
|
4
|
+
type CampaignsIdGetOperation = paths["/api/campaigns/{id}"]["get"];
|
|
5
|
+
type CampaignsIdGetResponse = CampaignsIdGetOperation["responses"]["200"]["content"]["application/json"];
|
|
6
|
+
declare const buildCampaignsIdGetFetcher: (requestInit?: RequestInit) => (input: RequestInfo, requestInit?: RequestInit) => Promise<{
|
|
7
|
+
campaignDetail: {
|
|
8
|
+
__type: "CurationMailMagazineCampaignDetail";
|
|
9
|
+
id: number;
|
|
10
|
+
} | {
|
|
11
|
+
status: "draft" | "scheduled" | "delivering" | "delivered" | "deliveryFailed";
|
|
12
|
+
__type: "PersonalizedMailMagazineCampaignDetail";
|
|
13
|
+
id: number;
|
|
14
|
+
title: string | null;
|
|
15
|
+
utmCampaign: string | null;
|
|
16
|
+
scheduledDeliveryAt: string | null;
|
|
17
|
+
target: {
|
|
18
|
+
csvFileName: string;
|
|
19
|
+
targetUsersCount: number;
|
|
20
|
+
excludedUsersCount: number;
|
|
21
|
+
} | null;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
type CampaignsIdGetPath = ForceDig<CampaignsIdGetOperation, [
|
|
25
|
+
"parameters",
|
|
26
|
+
"path"
|
|
27
|
+
]>;
|
|
28
|
+
declare const getCampaignsId: (path: CampaignsIdGetPath, requestInit?: RequestInit) => Promise<{
|
|
29
|
+
campaignDetail: {
|
|
30
|
+
__type: "CurationMailMagazineCampaignDetail";
|
|
31
|
+
id: number;
|
|
32
|
+
} | {
|
|
33
|
+
status: "draft" | "scheduled" | "delivering" | "delivered" | "deliveryFailed";
|
|
34
|
+
__type: "PersonalizedMailMagazineCampaignDetail";
|
|
35
|
+
id: number;
|
|
36
|
+
title: string | null;
|
|
37
|
+
utmCampaign: string | null;
|
|
38
|
+
scheduledDeliveryAt: string | null;
|
|
39
|
+
target: {
|
|
40
|
+
csvFileName: string;
|
|
41
|
+
targetUsersCount: number;
|
|
42
|
+
excludedUsersCount: number;
|
|
43
|
+
} | null;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
|
|
47
|
+
export { type CampaignsIdGetPath, type CampaignsIdGetResponse, buildCampaignsIdGetFetcher, getCampaignsId };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/fetch/campaignsId.ts
|
|
21
|
+
var campaignsId_exports = {};
|
|
22
|
+
__export(campaignsId_exports, {
|
|
23
|
+
buildCampaignsIdGetFetcher: () => buildCampaignsIdGetFetcher,
|
|
24
|
+
getCampaignsId: () => getCampaignsId
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(campaignsId_exports);
|
|
27
|
+
var import_api_client_base = require("@readyfor/api-client-base");
|
|
28
|
+
|
|
29
|
+
// src/components.ts
|
|
30
|
+
var import_zod = require("zod");
|
|
31
|
+
var PersonalizedMailMagazineTargetCsvRecord = import_zod.z.object({
|
|
32
|
+
userId: import_zod.z.number(),
|
|
33
|
+
projectId: import_zod.z.number(),
|
|
34
|
+
slotNumber: import_zod.z.number()
|
|
35
|
+
});
|
|
36
|
+
var PersonalizedMailMagazineCampaignDetailTarget = import_zod.z.object({
|
|
37
|
+
csvFileName: import_zod.z.string(),
|
|
38
|
+
targetUsersCount: import_zod.z.number(),
|
|
39
|
+
excludedUsersCount: import_zod.z.number()
|
|
40
|
+
});
|
|
41
|
+
var CampaignStatus = import_zod.z.union([
|
|
42
|
+
import_zod.z.literal("draft"),
|
|
43
|
+
import_zod.z.literal("scheduled"),
|
|
44
|
+
import_zod.z.literal("delivering"),
|
|
45
|
+
import_zod.z.literal("delivered"),
|
|
46
|
+
import_zod.z.literal("deliveryFailed")
|
|
47
|
+
]);
|
|
48
|
+
var PersonalizedMailMagazineTargetCsv = import_zod.z.object({
|
|
49
|
+
fileName: import_zod.z.string(),
|
|
50
|
+
records: import_zod.z.array(PersonalizedMailMagazineTargetCsvRecord)
|
|
51
|
+
});
|
|
52
|
+
var CurationMailMagazineCampaignDetail = import_zod.z.object({
|
|
53
|
+
__type: import_zod.z.literal("CurationMailMagazineCampaignDetail"),
|
|
54
|
+
id: import_zod.z.number()
|
|
55
|
+
});
|
|
56
|
+
var PersonalizedMailMagazineCampaignDetail = import_zod.z.object({
|
|
57
|
+
__type: import_zod.z.literal("PersonalizedMailMagazineCampaignDetail"),
|
|
58
|
+
id: import_zod.z.number(),
|
|
59
|
+
status: CampaignStatus,
|
|
60
|
+
title: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
61
|
+
utmCampaign: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
62
|
+
scheduledDeliveryAt: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
63
|
+
target: import_zod.z.union([PersonalizedMailMagazineCampaignDetailTarget, import_zod.z.null()])
|
|
64
|
+
});
|
|
65
|
+
var CampaignKind = import_zod.z.union([
|
|
66
|
+
import_zod.z.literal("curationMailMagazine"),
|
|
67
|
+
import_zod.z.literal("personalizedMailMagazine")
|
|
68
|
+
]);
|
|
69
|
+
var PersonalizedMailMagazineFormData = import_zod.z.object({
|
|
70
|
+
title: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
71
|
+
utmCampaign: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
72
|
+
scheduledDeliveryAt: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
73
|
+
targetCsv: import_zod.z.union([PersonalizedMailMagazineTargetCsv, import_zod.z.null()])
|
|
74
|
+
});
|
|
75
|
+
var CampaignDetail = import_zod.z.union([
|
|
76
|
+
PersonalizedMailMagazineCampaignDetail,
|
|
77
|
+
CurationMailMagazineCampaignDetail
|
|
78
|
+
]);
|
|
79
|
+
var Pagination = import_zod.z.object({
|
|
80
|
+
totalPages: import_zod.z.number(),
|
|
81
|
+
totalCount: import_zod.z.number(),
|
|
82
|
+
currentPerPage: import_zod.z.number(),
|
|
83
|
+
currentPage: import_zod.z.number(),
|
|
84
|
+
prevPage: import_zod.z.union([import_zod.z.number(), import_zod.z.null()]),
|
|
85
|
+
nextPage: import_zod.z.union([import_zod.z.number(), import_zod.z.null()]),
|
|
86
|
+
isFirstPage: import_zod.z.boolean(),
|
|
87
|
+
isLastPage: import_zod.z.boolean()
|
|
88
|
+
});
|
|
89
|
+
var Campaign = import_zod.z.object({
|
|
90
|
+
id: import_zod.z.number(),
|
|
91
|
+
title: import_zod.z.optional(import_zod.z.union([import_zod.z.string(), import_zod.z.null()])),
|
|
92
|
+
status: CampaignStatus,
|
|
93
|
+
kind: CampaignKind,
|
|
94
|
+
deliveryAt: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
95
|
+
lastEditorName: import_zod.z.string(),
|
|
96
|
+
lastEditedAt: import_zod.z.string()
|
|
97
|
+
});
|
|
98
|
+
var PatchPersonalizedMailMagazinesPersonalizedMailMagazineIdRequestBody = import_zod.z.object({ formData: PersonalizedMailMagazineFormData });
|
|
99
|
+
var GetCampaignsCampaignIdResponse = import_zod.z.object({
|
|
100
|
+
campaignDetail: CampaignDetail
|
|
101
|
+
});
|
|
102
|
+
var PostCampaignsRequestBody = import_zod.z.object({ kind: CampaignKind });
|
|
103
|
+
var PostCampaignsResponse = import_zod.z.object({ id: import_zod.z.number() });
|
|
104
|
+
var GetCampaignsResponse = import_zod.z.object({
|
|
105
|
+
campaigns: import_zod.z.array(Campaign),
|
|
106
|
+
pagination: Pagination
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// src/fetch/campaignsId.ts
|
|
110
|
+
var buildCampaignsIdGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(GetCampaignsCampaignIdResponse, { ...requestInit });
|
|
111
|
+
var getCampaignsId = (path, requestInit) => buildCampaignsIdGetFetcher()(
|
|
112
|
+
(0, import_api_client_base.__internal__requestUrl)("/api/campaigns/{id}", path),
|
|
113
|
+
{ ...requestInit, method: "GET" }
|
|
114
|
+
);
|
|
115
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
116
|
+
0 && (module.exports = {
|
|
117
|
+
buildCampaignsIdGetFetcher,
|
|
118
|
+
getCampaignsId
|
|
119
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { paths } from '../schemaType.mjs';
|
|
2
|
+
import { ForceDig } from '@readyfor/api-client-base';
|
|
3
|
+
|
|
4
|
+
type PersonalizedMailMagazinesIdPatchOperation = paths["/api/personalized_mail_magazines/{id}"]["patch"];
|
|
5
|
+
type PersonalizedMailMagazinesIdPatchResponse = PersonalizedMailMagazinesIdPatchOperation["responses"]["200"]["content"]["application/json"];
|
|
6
|
+
declare const buildPersonalizedMailMagazinesIdPatchFetcher: (requestInit?: RequestInit) => (input: RequestInfo, requestInit?: RequestInit) => Promise<{
|
|
7
|
+
status: "draft" | "scheduled" | "delivering" | "delivered" | "deliveryFailed";
|
|
8
|
+
__type: "PersonalizedMailMagazineCampaignDetail";
|
|
9
|
+
id: number;
|
|
10
|
+
title: string | null;
|
|
11
|
+
utmCampaign: string | null;
|
|
12
|
+
scheduledDeliveryAt: string | null;
|
|
13
|
+
target: {
|
|
14
|
+
csvFileName: string;
|
|
15
|
+
targetUsersCount: number;
|
|
16
|
+
excludedUsersCount: number;
|
|
17
|
+
} | null;
|
|
18
|
+
}>;
|
|
19
|
+
type PersonalizedMailMagazinesIdPatchPath = ForceDig<PersonalizedMailMagazinesIdPatchOperation, [
|
|
20
|
+
"parameters",
|
|
21
|
+
"path"
|
|
22
|
+
]>;
|
|
23
|
+
type PersonalizedMailMagazinesIdPatchRequestBody = ForceDig<PersonalizedMailMagazinesIdPatchOperation, [
|
|
24
|
+
"requestBody",
|
|
25
|
+
"content",
|
|
26
|
+
"application/json"
|
|
27
|
+
]>;
|
|
28
|
+
declare const patchPersonalizedMailMagazinesId: (path: PersonalizedMailMagazinesIdPatchPath, requestBody: PersonalizedMailMagazinesIdPatchRequestBody, requestInit?: RequestInit) => Promise<{
|
|
29
|
+
status: "draft" | "scheduled" | "delivering" | "delivered" | "deliveryFailed";
|
|
30
|
+
__type: "PersonalizedMailMagazineCampaignDetail";
|
|
31
|
+
id: number;
|
|
32
|
+
title: string | null;
|
|
33
|
+
utmCampaign: string | null;
|
|
34
|
+
scheduledDeliveryAt: string | null;
|
|
35
|
+
target: {
|
|
36
|
+
csvFileName: string;
|
|
37
|
+
targetUsersCount: number;
|
|
38
|
+
excludedUsersCount: number;
|
|
39
|
+
} | null;
|
|
40
|
+
}>;
|
|
41
|
+
|
|
42
|
+
export { type PersonalizedMailMagazinesIdPatchPath, type PersonalizedMailMagazinesIdPatchRequestBody, type PersonalizedMailMagazinesIdPatchResponse, buildPersonalizedMailMagazinesIdPatchFetcher, patchPersonalizedMailMagazinesId };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { paths } from '../schemaType.js';
|
|
2
|
+
import { ForceDig } from '@readyfor/api-client-base';
|
|
3
|
+
|
|
4
|
+
type PersonalizedMailMagazinesIdPatchOperation = paths["/api/personalized_mail_magazines/{id}"]["patch"];
|
|
5
|
+
type PersonalizedMailMagazinesIdPatchResponse = PersonalizedMailMagazinesIdPatchOperation["responses"]["200"]["content"]["application/json"];
|
|
6
|
+
declare const buildPersonalizedMailMagazinesIdPatchFetcher: (requestInit?: RequestInit) => (input: RequestInfo, requestInit?: RequestInit) => Promise<{
|
|
7
|
+
status: "draft" | "scheduled" | "delivering" | "delivered" | "deliveryFailed";
|
|
8
|
+
__type: "PersonalizedMailMagazineCampaignDetail";
|
|
9
|
+
id: number;
|
|
10
|
+
title: string | null;
|
|
11
|
+
utmCampaign: string | null;
|
|
12
|
+
scheduledDeliveryAt: string | null;
|
|
13
|
+
target: {
|
|
14
|
+
csvFileName: string;
|
|
15
|
+
targetUsersCount: number;
|
|
16
|
+
excludedUsersCount: number;
|
|
17
|
+
} | null;
|
|
18
|
+
}>;
|
|
19
|
+
type PersonalizedMailMagazinesIdPatchPath = ForceDig<PersonalizedMailMagazinesIdPatchOperation, [
|
|
20
|
+
"parameters",
|
|
21
|
+
"path"
|
|
22
|
+
]>;
|
|
23
|
+
type PersonalizedMailMagazinesIdPatchRequestBody = ForceDig<PersonalizedMailMagazinesIdPatchOperation, [
|
|
24
|
+
"requestBody",
|
|
25
|
+
"content",
|
|
26
|
+
"application/json"
|
|
27
|
+
]>;
|
|
28
|
+
declare const patchPersonalizedMailMagazinesId: (path: PersonalizedMailMagazinesIdPatchPath, requestBody: PersonalizedMailMagazinesIdPatchRequestBody, requestInit?: RequestInit) => Promise<{
|
|
29
|
+
status: "draft" | "scheduled" | "delivering" | "delivered" | "deliveryFailed";
|
|
30
|
+
__type: "PersonalizedMailMagazineCampaignDetail";
|
|
31
|
+
id: number;
|
|
32
|
+
title: string | null;
|
|
33
|
+
utmCampaign: string | null;
|
|
34
|
+
scheduledDeliveryAt: string | null;
|
|
35
|
+
target: {
|
|
36
|
+
csvFileName: string;
|
|
37
|
+
targetUsersCount: number;
|
|
38
|
+
excludedUsersCount: number;
|
|
39
|
+
} | null;
|
|
40
|
+
}>;
|
|
41
|
+
|
|
42
|
+
export { type PersonalizedMailMagazinesIdPatchPath, type PersonalizedMailMagazinesIdPatchRequestBody, type PersonalizedMailMagazinesIdPatchResponse, buildPersonalizedMailMagazinesIdPatchFetcher, patchPersonalizedMailMagazinesId };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/fetch/personalizedMailMagazinesId.ts
|
|
21
|
+
var personalizedMailMagazinesId_exports = {};
|
|
22
|
+
__export(personalizedMailMagazinesId_exports, {
|
|
23
|
+
buildPersonalizedMailMagazinesIdPatchFetcher: () => buildPersonalizedMailMagazinesIdPatchFetcher,
|
|
24
|
+
patchPersonalizedMailMagazinesId: () => patchPersonalizedMailMagazinesId
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(personalizedMailMagazinesId_exports);
|
|
27
|
+
var import_api_client_base = require("@readyfor/api-client-base");
|
|
28
|
+
|
|
29
|
+
// src/components.ts
|
|
30
|
+
var import_zod = require("zod");
|
|
31
|
+
var PersonalizedMailMagazineTargetCsvRecord = import_zod.z.object({
|
|
32
|
+
userId: import_zod.z.number(),
|
|
33
|
+
projectId: import_zod.z.number(),
|
|
34
|
+
slotNumber: import_zod.z.number()
|
|
35
|
+
});
|
|
36
|
+
var PersonalizedMailMagazineCampaignDetailTarget = import_zod.z.object({
|
|
37
|
+
csvFileName: import_zod.z.string(),
|
|
38
|
+
targetUsersCount: import_zod.z.number(),
|
|
39
|
+
excludedUsersCount: import_zod.z.number()
|
|
40
|
+
});
|
|
41
|
+
var CampaignStatus = import_zod.z.union([
|
|
42
|
+
import_zod.z.literal("draft"),
|
|
43
|
+
import_zod.z.literal("scheduled"),
|
|
44
|
+
import_zod.z.literal("delivering"),
|
|
45
|
+
import_zod.z.literal("delivered"),
|
|
46
|
+
import_zod.z.literal("deliveryFailed")
|
|
47
|
+
]);
|
|
48
|
+
var PersonalizedMailMagazineTargetCsv = import_zod.z.object({
|
|
49
|
+
fileName: import_zod.z.string(),
|
|
50
|
+
records: import_zod.z.array(PersonalizedMailMagazineTargetCsvRecord)
|
|
51
|
+
});
|
|
52
|
+
var CurationMailMagazineCampaignDetail = import_zod.z.object({
|
|
53
|
+
__type: import_zod.z.literal("CurationMailMagazineCampaignDetail"),
|
|
54
|
+
id: import_zod.z.number()
|
|
55
|
+
});
|
|
56
|
+
var PersonalizedMailMagazineCampaignDetail = import_zod.z.object({
|
|
57
|
+
__type: import_zod.z.literal("PersonalizedMailMagazineCampaignDetail"),
|
|
58
|
+
id: import_zod.z.number(),
|
|
59
|
+
status: CampaignStatus,
|
|
60
|
+
title: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
61
|
+
utmCampaign: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
62
|
+
scheduledDeliveryAt: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
63
|
+
target: import_zod.z.union([PersonalizedMailMagazineCampaignDetailTarget, import_zod.z.null()])
|
|
64
|
+
});
|
|
65
|
+
var CampaignKind = import_zod.z.union([
|
|
66
|
+
import_zod.z.literal("curationMailMagazine"),
|
|
67
|
+
import_zod.z.literal("personalizedMailMagazine")
|
|
68
|
+
]);
|
|
69
|
+
var PersonalizedMailMagazineFormData = import_zod.z.object({
|
|
70
|
+
title: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
71
|
+
utmCampaign: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
72
|
+
scheduledDeliveryAt: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
73
|
+
targetCsv: import_zod.z.union([PersonalizedMailMagazineTargetCsv, import_zod.z.null()])
|
|
74
|
+
});
|
|
75
|
+
var CampaignDetail = import_zod.z.union([
|
|
76
|
+
PersonalizedMailMagazineCampaignDetail,
|
|
77
|
+
CurationMailMagazineCampaignDetail
|
|
78
|
+
]);
|
|
79
|
+
var Pagination = import_zod.z.object({
|
|
80
|
+
totalPages: import_zod.z.number(),
|
|
81
|
+
totalCount: import_zod.z.number(),
|
|
82
|
+
currentPerPage: import_zod.z.number(),
|
|
83
|
+
currentPage: import_zod.z.number(),
|
|
84
|
+
prevPage: import_zod.z.union([import_zod.z.number(), import_zod.z.null()]),
|
|
85
|
+
nextPage: import_zod.z.union([import_zod.z.number(), import_zod.z.null()]),
|
|
86
|
+
isFirstPage: import_zod.z.boolean(),
|
|
87
|
+
isLastPage: import_zod.z.boolean()
|
|
88
|
+
});
|
|
89
|
+
var Campaign = import_zod.z.object({
|
|
90
|
+
id: import_zod.z.number(),
|
|
91
|
+
title: import_zod.z.optional(import_zod.z.union([import_zod.z.string(), import_zod.z.null()])),
|
|
92
|
+
status: CampaignStatus,
|
|
93
|
+
kind: CampaignKind,
|
|
94
|
+
deliveryAt: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
95
|
+
lastEditorName: import_zod.z.string(),
|
|
96
|
+
lastEditedAt: import_zod.z.string()
|
|
97
|
+
});
|
|
98
|
+
var PatchPersonalizedMailMagazinesPersonalizedMailMagazineIdRequestBody = import_zod.z.object({ formData: PersonalizedMailMagazineFormData });
|
|
99
|
+
var PatchPersonalizedMailMagazinesPersonalizedMailMagazineIdResponse = PersonalizedMailMagazineCampaignDetail;
|
|
100
|
+
var GetCampaignsCampaignIdResponse = import_zod.z.object({
|
|
101
|
+
campaignDetail: CampaignDetail
|
|
102
|
+
});
|
|
103
|
+
var PostCampaignsRequestBody = import_zod.z.object({ kind: CampaignKind });
|
|
104
|
+
var PostCampaignsResponse = import_zod.z.object({ id: import_zod.z.number() });
|
|
105
|
+
var GetCampaignsResponse = import_zod.z.object({
|
|
106
|
+
campaigns: import_zod.z.array(Campaign),
|
|
107
|
+
pagination: Pagination
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// src/fetch/personalizedMailMagazinesId.ts
|
|
111
|
+
var buildPersonalizedMailMagazinesIdPatchFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(
|
|
112
|
+
PatchPersonalizedMailMagazinesPersonalizedMailMagazineIdResponse,
|
|
113
|
+
{ ...requestInit }
|
|
114
|
+
);
|
|
115
|
+
var patchPersonalizedMailMagazinesId = (path, requestBody, requestInit) => buildPersonalizedMailMagazinesIdPatchFetcher()(
|
|
116
|
+
(0, import_api_client_base.__internal__requestUrl)("/api/personalized_mail_magazines/{id}", path),
|
|
117
|
+
{
|
|
118
|
+
...requestInit,
|
|
119
|
+
method: "PATCH",
|
|
120
|
+
headers: { ...requestInit?.headers, "Content-Type": "application/json" },
|
|
121
|
+
body: JSON.stringify(requestBody)
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
125
|
+
0 && (module.exports = {
|
|
126
|
+
buildPersonalizedMailMagazinesIdPatchFetcher,
|
|
127
|
+
patchPersonalizedMailMagazinesId
|
|
128
|
+
});
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { useCampaigns, useCampaignsImmutable, useCampaignsInfinite } from './useCampaigns.mjs';
|
|
2
|
+
export { useCampaignsId, useCampaignsIdImmutable, useCampaignsIdInfinite } from './useCampaignsId.mjs';
|
|
2
3
|
import 'swr/infinite';
|
|
3
4
|
import 'swr';
|
|
4
5
|
import '../schemaType.mjs';
|
|
5
6
|
import '@readyfor/api-client-base/react';
|
|
6
7
|
import '../fetch/campaigns.mjs';
|
|
7
8
|
import '@readyfor/api-client-base';
|
|
9
|
+
import '../fetch/campaignsId.mjs';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { useCampaigns, useCampaignsImmutable, useCampaignsInfinite } from './useCampaigns.js';
|
|
2
|
+
export { useCampaignsId, useCampaignsIdImmutable, useCampaignsIdInfinite } from './useCampaignsId.js';
|
|
2
3
|
import 'swr/infinite';
|
|
3
4
|
import 'swr';
|
|
4
5
|
import '../schemaType.js';
|
|
5
6
|
import '@readyfor/api-client-base/react';
|
|
6
7
|
import '../fetch/campaigns.js';
|
|
7
8
|
import '@readyfor/api-client-base';
|
|
9
|
+
import '../fetch/campaignsId.js';
|
package/dist/hooks/index.js
CHANGED
|
@@ -31,6 +31,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var hooks_exports = {};
|
|
32
32
|
__export(hooks_exports, {
|
|
33
33
|
useCampaigns: () => useCampaigns,
|
|
34
|
+
useCampaignsId: () => useCampaignsId,
|
|
35
|
+
useCampaignsIdImmutable: () => useCampaignsIdImmutable,
|
|
36
|
+
useCampaignsIdInfinite: () => useCampaignsIdInfinite,
|
|
34
37
|
useCampaignsImmutable: () => useCampaignsImmutable,
|
|
35
38
|
useCampaignsInfinite: () => useCampaignsInfinite
|
|
36
39
|
});
|
|
@@ -40,15 +43,21 @@ module.exports = __toCommonJS(hooks_exports);
|
|
|
40
43
|
var import_immutable = __toESM(require("swr/immutable"));
|
|
41
44
|
var import_infinite = __toESM(require("swr/infinite"));
|
|
42
45
|
var import_swr = __toESM(require("swr"));
|
|
43
|
-
var
|
|
46
|
+
var import_api_client_base4 = require("@readyfor/api-client-base");
|
|
44
47
|
var import_react = require("@readyfor/api-client-base/react");
|
|
45
48
|
|
|
46
49
|
// src/components.ts
|
|
47
50
|
var import_zod = require("zod");
|
|
48
|
-
var
|
|
49
|
-
import_zod.z.
|
|
50
|
-
import_zod.z.
|
|
51
|
-
|
|
51
|
+
var PersonalizedMailMagazineTargetCsvRecord = import_zod.z.object({
|
|
52
|
+
userId: import_zod.z.number(),
|
|
53
|
+
projectId: import_zod.z.number(),
|
|
54
|
+
slotNumber: import_zod.z.number()
|
|
55
|
+
});
|
|
56
|
+
var PersonalizedMailMagazineCampaignDetailTarget = import_zod.z.object({
|
|
57
|
+
csvFileName: import_zod.z.string(),
|
|
58
|
+
targetUsersCount: import_zod.z.number(),
|
|
59
|
+
excludedUsersCount: import_zod.z.number()
|
|
60
|
+
});
|
|
52
61
|
var CampaignStatus = import_zod.z.union([
|
|
53
62
|
import_zod.z.literal("draft"),
|
|
54
63
|
import_zod.z.literal("scheduled"),
|
|
@@ -56,6 +65,37 @@ var CampaignStatus = import_zod.z.union([
|
|
|
56
65
|
import_zod.z.literal("delivered"),
|
|
57
66
|
import_zod.z.literal("deliveryFailed")
|
|
58
67
|
]);
|
|
68
|
+
var PersonalizedMailMagazineTargetCsv = import_zod.z.object({
|
|
69
|
+
fileName: import_zod.z.string(),
|
|
70
|
+
records: import_zod.z.array(PersonalizedMailMagazineTargetCsvRecord)
|
|
71
|
+
});
|
|
72
|
+
var CurationMailMagazineCampaignDetail = import_zod.z.object({
|
|
73
|
+
__type: import_zod.z.literal("CurationMailMagazineCampaignDetail"),
|
|
74
|
+
id: import_zod.z.number()
|
|
75
|
+
});
|
|
76
|
+
var PersonalizedMailMagazineCampaignDetail = import_zod.z.object({
|
|
77
|
+
__type: import_zod.z.literal("PersonalizedMailMagazineCampaignDetail"),
|
|
78
|
+
id: import_zod.z.number(),
|
|
79
|
+
status: CampaignStatus,
|
|
80
|
+
title: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
81
|
+
utmCampaign: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
82
|
+
scheduledDeliveryAt: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
83
|
+
target: import_zod.z.union([PersonalizedMailMagazineCampaignDetailTarget, import_zod.z.null()])
|
|
84
|
+
});
|
|
85
|
+
var CampaignKind = import_zod.z.union([
|
|
86
|
+
import_zod.z.literal("curationMailMagazine"),
|
|
87
|
+
import_zod.z.literal("personalizedMailMagazine")
|
|
88
|
+
]);
|
|
89
|
+
var PersonalizedMailMagazineFormData = import_zod.z.object({
|
|
90
|
+
title: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
91
|
+
utmCampaign: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
92
|
+
scheduledDeliveryAt: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
93
|
+
targetCsv: import_zod.z.union([PersonalizedMailMagazineTargetCsv, import_zod.z.null()])
|
|
94
|
+
});
|
|
95
|
+
var CampaignDetail = import_zod.z.union([
|
|
96
|
+
PersonalizedMailMagazineCampaignDetail,
|
|
97
|
+
CurationMailMagazineCampaignDetail
|
|
98
|
+
]);
|
|
59
99
|
var Pagination = import_zod.z.object({
|
|
60
100
|
totalPages: import_zod.z.number(),
|
|
61
101
|
totalCount: import_zod.z.number(),
|
|
@@ -75,6 +115,10 @@ var Campaign = import_zod.z.object({
|
|
|
75
115
|
lastEditorName: import_zod.z.string(),
|
|
76
116
|
lastEditedAt: import_zod.z.string()
|
|
77
117
|
});
|
|
118
|
+
var PatchPersonalizedMailMagazinesPersonalizedMailMagazineIdRequestBody = import_zod.z.object({ formData: PersonalizedMailMagazineFormData });
|
|
119
|
+
var GetCampaignsCampaignIdResponse = import_zod.z.object({
|
|
120
|
+
campaignDetail: CampaignDetail
|
|
121
|
+
});
|
|
78
122
|
var PostCampaignsRequestBody = import_zod.z.object({ kind: CampaignKind });
|
|
79
123
|
var PostCampaignsResponse = import_zod.z.object({ id: import_zod.z.number() });
|
|
80
124
|
var GetCampaignsResponse = import_zod.z.object({
|
|
@@ -86,10 +130,17 @@ var GetCampaignsResponse = import_zod.z.object({
|
|
|
86
130
|
var import_api_client_base = require("@readyfor/api-client-base");
|
|
87
131
|
var buildCampaignsGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(GetCampaignsResponse, { ...requestInit });
|
|
88
132
|
|
|
133
|
+
// src/fetch/campaignsId.ts
|
|
134
|
+
var import_api_client_base2 = require("@readyfor/api-client-base");
|
|
135
|
+
var buildCampaignsIdGetFetcher = (requestInit) => (0, import_api_client_base2.createJsonFetcher)(GetCampaignsCampaignIdResponse, { ...requestInit });
|
|
136
|
+
|
|
137
|
+
// src/fetch/personalizedMailMagazinesId.ts
|
|
138
|
+
var import_api_client_base3 = require("@readyfor/api-client-base");
|
|
139
|
+
|
|
89
140
|
// src/hooks/useCampaigns.ts
|
|
90
141
|
var campaignsGetFetcher = buildCampaignsGetFetcher();
|
|
91
142
|
var useCampaigns = (query, swrConfig) => {
|
|
92
|
-
const key = (0,
|
|
143
|
+
const key = (0, import_api_client_base4.__internal__requestUrl)("/api/campaigns", {}, query);
|
|
93
144
|
const requestInit = (0, import_react.useRequestInit)();
|
|
94
145
|
const result = (0, import_swr.default)(
|
|
95
146
|
swrConfig?.shouldNotFetch ? null : key,
|
|
@@ -99,7 +150,7 @@ var useCampaigns = (query, swrConfig) => {
|
|
|
99
150
|
return { key, ...result };
|
|
100
151
|
};
|
|
101
152
|
var useCampaignsImmutable = (query, swrConfig) => {
|
|
102
|
-
const key = (0,
|
|
153
|
+
const key = (0, import_api_client_base4.__internal__requestUrl)("/api/campaigns", {}, query);
|
|
103
154
|
const requestInit = (0, import_react.useRequestInit)();
|
|
104
155
|
const result = (0, import_immutable.default)(
|
|
105
156
|
swrConfig?.shouldNotFetch ? null : key,
|
|
@@ -109,13 +160,49 @@ var useCampaignsImmutable = (query, swrConfig) => {
|
|
|
109
160
|
return { key, ...result };
|
|
110
161
|
};
|
|
111
162
|
var useCampaignsInfinite = (getKey, swrConfig) => (0, import_infinite.default)(
|
|
112
|
-
getKey((query) => (0,
|
|
163
|
+
getKey((query) => (0, import_api_client_base4.__internal__requestUrl)({}, query)),
|
|
113
164
|
campaignsGetFetcher,
|
|
114
165
|
swrConfig
|
|
115
166
|
);
|
|
167
|
+
|
|
168
|
+
// src/hooks/useCampaignsId.ts
|
|
169
|
+
var import_immutable2 = __toESM(require("swr/immutable"));
|
|
170
|
+
var import_infinite2 = __toESM(require("swr/infinite"));
|
|
171
|
+
var import_swr2 = __toESM(require("swr"));
|
|
172
|
+
var import_api_client_base5 = require("@readyfor/api-client-base");
|
|
173
|
+
var import_react2 = require("@readyfor/api-client-base/react");
|
|
174
|
+
var campaignsIdGetFetcher = buildCampaignsIdGetFetcher();
|
|
175
|
+
var useCampaignsId = (path, swrConfig) => {
|
|
176
|
+
const key = (0, import_api_client_base5.__internal__requestUrl)("/api/campaigns/{id}", path);
|
|
177
|
+
const requestInit = (0, import_react2.useRequestInit)();
|
|
178
|
+
const result = (0, import_swr2.default)(
|
|
179
|
+
swrConfig?.shouldNotFetch ? null : key,
|
|
180
|
+
buildCampaignsIdGetFetcher(requestInit),
|
|
181
|
+
swrConfig
|
|
182
|
+
);
|
|
183
|
+
return { key, ...result };
|
|
184
|
+
};
|
|
185
|
+
var useCampaignsIdImmutable = (path, swrConfig) => {
|
|
186
|
+
const key = (0, import_api_client_base5.__internal__requestUrl)("/api/campaigns/{id}", path);
|
|
187
|
+
const requestInit = (0, import_react2.useRequestInit)();
|
|
188
|
+
const result = (0, import_immutable2.default)(
|
|
189
|
+
swrConfig?.shouldNotFetch ? null : key,
|
|
190
|
+
buildCampaignsIdGetFetcher(requestInit),
|
|
191
|
+
swrConfig
|
|
192
|
+
);
|
|
193
|
+
return { key, ...result };
|
|
194
|
+
};
|
|
195
|
+
var useCampaignsIdInfinite = (getKey, swrConfig) => (0, import_infinite2.default)(
|
|
196
|
+
getKey((path) => (0, import_api_client_base5.__internal__requestUrl)(path)),
|
|
197
|
+
campaignsIdGetFetcher,
|
|
198
|
+
swrConfig
|
|
199
|
+
);
|
|
116
200
|
// Annotate the CommonJS export names for ESM import in node:
|
|
117
201
|
0 && (module.exports = {
|
|
118
202
|
useCampaigns,
|
|
203
|
+
useCampaignsId,
|
|
204
|
+
useCampaignsIdImmutable,
|
|
205
|
+
useCampaignsIdInfinite,
|
|
119
206
|
useCampaignsImmutable,
|
|
120
207
|
useCampaignsInfinite
|
|
121
208
|
});
|