@readyfor/api-client-pigeon 0.163.0 → 0.164.0-pr923.5bcb86f
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-BZW5HHND.mjs +42 -0
- package/dist/chunk-L4D5MI7T.mjs +44 -0
- package/dist/chunk-MAHZKOWV.mjs +19 -0
- package/dist/components.d.mts +148 -5
- package/dist/components.d.ts +148 -5
- package/dist/components.js +44 -3
- package/dist/components.mjs +11 -3
- package/dist/fetch/campaigns.d.mts +53 -0
- package/dist/fetch/campaigns.d.ts +53 -0
- package/dist/fetch/campaigns.js +76 -0
- package/dist/fetch/campaigns.mjs +9 -0
- package/dist/hooks/index.d.mts +4 -3
- package/dist/hooks/index.d.ts +4 -3
- package/dist/hooks/index.js +54 -21
- package/dist/hooks/index.mjs +9 -9
- package/dist/hooks/useCampaigns.d.mts +43 -0
- package/dist/hooks/useCampaigns.d.ts +43 -0
- package/dist/hooks/{useV1Example.js → useCampaigns.js} +57 -24
- package/dist/hooks/useCampaigns.mjs +13 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +54 -13
- package/dist/index.mjs +16 -8
- package/dist/schemaType.d.mts +115 -10
- package/dist/schemaType.d.ts +115 -10
- package/package.json +9 -10
- package/dist/chunk-77MRBHHK.mjs +0 -7
- package/dist/chunk-HJ4QTN4K.mjs +0 -42
- package/dist/chunk-R5STKOXL.mjs +0 -19
- package/dist/fetch/v1Example.d.mts +0 -12
- package/dist/fetch/v1Example.d.ts +0 -12
- package/dist/fetch/v1Example.js +0 -43
- package/dist/fetch/v1Example.mjs +0 -9
- package/dist/hooks/useV1Example.d.mts +0 -37
- package/dist/hooks/useV1Example.d.ts +0 -37
- package/dist/hooks/useV1Example.mjs +0 -13
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { useCampaigns, useCampaignsImmutable, useCampaignsInfinite } from './useCampaigns.mjs';
|
|
2
2
|
import 'swr/infinite';
|
|
3
3
|
import 'swr';
|
|
4
|
-
import '@readyfor/api-client-base/react';
|
|
5
|
-
import '../fetch/v1Example.mjs';
|
|
6
4
|
import '../schemaType.mjs';
|
|
5
|
+
import '@readyfor/api-client-base/react';
|
|
6
|
+
import '../fetch/campaigns.mjs';
|
|
7
|
+
import '@readyfor/api-client-base';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { useCampaigns, useCampaignsImmutable, useCampaignsInfinite } from './useCampaigns.js';
|
|
2
2
|
import 'swr/infinite';
|
|
3
3
|
import 'swr';
|
|
4
|
-
import '@readyfor/api-client-base/react';
|
|
5
|
-
import '../fetch/v1Example.js';
|
|
6
4
|
import '../schemaType.js';
|
|
5
|
+
import '@readyfor/api-client-base/react';
|
|
6
|
+
import '../fetch/campaigns.js';
|
|
7
|
+
import '@readyfor/api-client-base';
|
package/dist/hooks/index.js
CHANGED
|
@@ -30,13 +30,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/hooks/index.ts
|
|
31
31
|
var hooks_exports = {};
|
|
32
32
|
__export(hooks_exports, {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
useCampaigns: () => useCampaigns,
|
|
34
|
+
useCampaignsImmutable: () => useCampaignsImmutable,
|
|
35
|
+
useCampaignsInfinite: () => useCampaignsInfinite
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(hooks_exports);
|
|
38
38
|
|
|
39
|
-
// src/hooks/
|
|
39
|
+
// src/hooks/useCampaigns.ts
|
|
40
40
|
var import_immutable = __toESM(require("swr/immutable"));
|
|
41
41
|
var import_infinite = __toESM(require("swr/infinite"));
|
|
42
42
|
var import_swr = __toESM(require("swr"));
|
|
@@ -45,42 +45,75 @@ var import_react = require("@readyfor/api-client-base/react");
|
|
|
45
45
|
|
|
46
46
|
// src/components.ts
|
|
47
47
|
var import_zod = require("zod");
|
|
48
|
-
var
|
|
48
|
+
var CampaignType = import_zod.z.union([
|
|
49
|
+
import_zod.z.literal("curationMailMagazine"),
|
|
50
|
+
import_zod.z.literal("personalizedMailMagazine")
|
|
51
|
+
]);
|
|
52
|
+
var CampaignStatus = import_zod.z.union([
|
|
53
|
+
import_zod.z.literal("draft"),
|
|
54
|
+
import_zod.z.literal("scheduled"),
|
|
55
|
+
import_zod.z.literal("delivering"),
|
|
56
|
+
import_zod.z.literal("delivered"),
|
|
57
|
+
import_zod.z.literal("deliveryFailed")
|
|
58
|
+
]);
|
|
59
|
+
var Pagination = import_zod.z.object({
|
|
60
|
+
totalPages: import_zod.z.number(),
|
|
61
|
+
totalCount: import_zod.z.number(),
|
|
62
|
+
currentPerPage: import_zod.z.number(),
|
|
63
|
+
currentPage: import_zod.z.number(),
|
|
64
|
+
prevPage: import_zod.z.union([import_zod.z.number(), import_zod.z.null()]),
|
|
65
|
+
nextPage: import_zod.z.union([import_zod.z.number(), import_zod.z.null()]),
|
|
66
|
+
isFirstPage: import_zod.z.boolean(),
|
|
67
|
+
isLastPage: import_zod.z.boolean()
|
|
68
|
+
});
|
|
69
|
+
var Campaign = import_zod.z.object({
|
|
70
|
+
id: import_zod.z.number(),
|
|
71
|
+
title: import_zod.z.optional(import_zod.z.union([import_zod.z.string(), import_zod.z.null()])),
|
|
72
|
+
status: CampaignStatus,
|
|
73
|
+
type: CampaignType,
|
|
74
|
+
deliveryAt: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
75
|
+
lastEditorName: import_zod.z.string(),
|
|
76
|
+
lastEditedAt: import_zod.z.string()
|
|
77
|
+
});
|
|
78
|
+
var GetCampaigns = import_zod.z.object({
|
|
79
|
+
campaigns: import_zod.z.array(Campaign),
|
|
80
|
+
pagination: Pagination
|
|
81
|
+
});
|
|
49
82
|
|
|
50
|
-
// src/fetch/
|
|
83
|
+
// src/fetch/campaigns.ts
|
|
51
84
|
var import_api_client_base = require("@readyfor/api-client-base");
|
|
52
|
-
var
|
|
85
|
+
var buildCampaignsGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(GetCampaigns, { ...requestInit });
|
|
53
86
|
|
|
54
|
-
// src/hooks/
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
const key = (0, import_api_client_base2.__internal__requestUrl)("/api/
|
|
87
|
+
// src/hooks/useCampaigns.ts
|
|
88
|
+
var campaignsGetFetcher = buildCampaignsGetFetcher();
|
|
89
|
+
var useCampaigns = (query, swrConfig) => {
|
|
90
|
+
const key = (0, import_api_client_base2.__internal__requestUrl)("/api/campaigns", {}, query);
|
|
58
91
|
const requestInit = (0, import_react.useRequestInit)();
|
|
59
92
|
const result = (0, import_swr.default)(
|
|
60
93
|
swrConfig?.shouldNotFetch ? null : key,
|
|
61
|
-
|
|
94
|
+
buildCampaignsGetFetcher(requestInit),
|
|
62
95
|
swrConfig
|
|
63
96
|
);
|
|
64
97
|
return { key, ...result };
|
|
65
98
|
};
|
|
66
|
-
var
|
|
67
|
-
const key = (0, import_api_client_base2.__internal__requestUrl)("/api/
|
|
99
|
+
var useCampaignsImmutable = (query, swrConfig) => {
|
|
100
|
+
const key = (0, import_api_client_base2.__internal__requestUrl)("/api/campaigns", {}, query);
|
|
68
101
|
const requestInit = (0, import_react.useRequestInit)();
|
|
69
102
|
const result = (0, import_immutable.default)(
|
|
70
103
|
swrConfig?.shouldNotFetch ? null : key,
|
|
71
|
-
|
|
104
|
+
buildCampaignsGetFetcher(requestInit),
|
|
72
105
|
swrConfig
|
|
73
106
|
);
|
|
74
107
|
return { key, ...result };
|
|
75
108
|
};
|
|
76
|
-
var
|
|
77
|
-
getKey(() => (0, import_api_client_base2.__internal__requestUrl)()),
|
|
78
|
-
|
|
109
|
+
var useCampaignsInfinite = (getKey, swrConfig) => (0, import_infinite.default)(
|
|
110
|
+
getKey((query) => (0, import_api_client_base2.__internal__requestUrl)({}, query)),
|
|
111
|
+
campaignsGetFetcher,
|
|
79
112
|
swrConfig
|
|
80
113
|
);
|
|
81
114
|
// Annotate the CommonJS export names for ESM import in node:
|
|
82
115
|
0 && (module.exports = {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
116
|
+
useCampaigns,
|
|
117
|
+
useCampaignsImmutable,
|
|
118
|
+
useCampaignsInfinite
|
|
86
119
|
});
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "../chunk-
|
|
2
|
+
useCampaigns,
|
|
3
|
+
useCampaignsImmutable,
|
|
4
|
+
useCampaignsInfinite
|
|
5
|
+
} from "../chunk-BZW5HHND.mjs";
|
|
6
6
|
import "../chunk-WY7GF7TX.mjs";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-MAHZKOWV.mjs";
|
|
8
|
+
import "../chunk-L4D5MI7T.mjs";
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
useCampaigns,
|
|
11
|
+
useCampaignsImmutable,
|
|
12
|
+
useCampaignsInfinite
|
|
13
13
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { components } from '../schemaType.mjs';
|
|
6
|
+
import { Configuration } from '@readyfor/api-client-base/react';
|
|
7
|
+
import { CampaignsGetQuery, CampaignsGetResponse } from '../fetch/campaigns.mjs';
|
|
8
|
+
import '@readyfor/api-client-base';
|
|
9
|
+
|
|
10
|
+
declare const useCampaigns: (query: CampaignsGetQuery, swrConfig?: Configuration<CampaignsGetResponse>) => {
|
|
11
|
+
data: {
|
|
12
|
+
campaigns: components["schemas"]["Campaign"][];
|
|
13
|
+
pagination: components["schemas"]["Pagination"];
|
|
14
|
+
} | undefined;
|
|
15
|
+
error: any;
|
|
16
|
+
mutate: swr.KeyedMutator<{
|
|
17
|
+
campaigns: components["schemas"]["Campaign"][];
|
|
18
|
+
pagination: components["schemas"]["Pagination"];
|
|
19
|
+
}>;
|
|
20
|
+
isValidating: boolean;
|
|
21
|
+
isLoading: boolean;
|
|
22
|
+
key: string;
|
|
23
|
+
};
|
|
24
|
+
declare const useCampaignsImmutable: (query: CampaignsGetQuery, swrConfig?: Configuration<CampaignsGetResponse>) => {
|
|
25
|
+
data: {
|
|
26
|
+
campaigns: components["schemas"]["Campaign"][];
|
|
27
|
+
pagination: components["schemas"]["Pagination"];
|
|
28
|
+
} | undefined;
|
|
29
|
+
error: any;
|
|
30
|
+
mutate: swr.KeyedMutator<{
|
|
31
|
+
campaigns: components["schemas"]["Campaign"][];
|
|
32
|
+
pagination: components["schemas"]["Pagination"];
|
|
33
|
+
}>;
|
|
34
|
+
isValidating: boolean;
|
|
35
|
+
isLoading: boolean;
|
|
36
|
+
key: string;
|
|
37
|
+
};
|
|
38
|
+
declare const useCampaignsInfinite: <Args extends Arguments>(getKey: (keyBuilder: (query: CampaignsGetQuery) => string) => SWRInfiniteKeyLoader<CampaignsGetResponse, Args>, swrConfig?: SWRInfiniteConfiguration<CampaignsGetResponse>) => swr_infinite.SWRInfiniteResponse<{
|
|
39
|
+
campaigns: components["schemas"]["Campaign"][];
|
|
40
|
+
pagination: components["schemas"]["Pagination"];
|
|
41
|
+
}, any>;
|
|
42
|
+
|
|
43
|
+
export { useCampaigns, useCampaignsImmutable, useCampaignsInfinite };
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { components } from '../schemaType.js';
|
|
6
|
+
import { Configuration } from '@readyfor/api-client-base/react';
|
|
7
|
+
import { CampaignsGetQuery, CampaignsGetResponse } from '../fetch/campaigns.js';
|
|
8
|
+
import '@readyfor/api-client-base';
|
|
9
|
+
|
|
10
|
+
declare const useCampaigns: (query: CampaignsGetQuery, swrConfig?: Configuration<CampaignsGetResponse>) => {
|
|
11
|
+
data: {
|
|
12
|
+
campaigns: components["schemas"]["Campaign"][];
|
|
13
|
+
pagination: components["schemas"]["Pagination"];
|
|
14
|
+
} | undefined;
|
|
15
|
+
error: any;
|
|
16
|
+
mutate: swr.KeyedMutator<{
|
|
17
|
+
campaigns: components["schemas"]["Campaign"][];
|
|
18
|
+
pagination: components["schemas"]["Pagination"];
|
|
19
|
+
}>;
|
|
20
|
+
isValidating: boolean;
|
|
21
|
+
isLoading: boolean;
|
|
22
|
+
key: string;
|
|
23
|
+
};
|
|
24
|
+
declare const useCampaignsImmutable: (query: CampaignsGetQuery, swrConfig?: Configuration<CampaignsGetResponse>) => {
|
|
25
|
+
data: {
|
|
26
|
+
campaigns: components["schemas"]["Campaign"][];
|
|
27
|
+
pagination: components["schemas"]["Pagination"];
|
|
28
|
+
} | undefined;
|
|
29
|
+
error: any;
|
|
30
|
+
mutate: swr.KeyedMutator<{
|
|
31
|
+
campaigns: components["schemas"]["Campaign"][];
|
|
32
|
+
pagination: components["schemas"]["Pagination"];
|
|
33
|
+
}>;
|
|
34
|
+
isValidating: boolean;
|
|
35
|
+
isLoading: boolean;
|
|
36
|
+
key: string;
|
|
37
|
+
};
|
|
38
|
+
declare const useCampaignsInfinite: <Args extends Arguments>(getKey: (keyBuilder: (query: CampaignsGetQuery) => string) => SWRInfiniteKeyLoader<CampaignsGetResponse, Args>, swrConfig?: SWRInfiniteConfiguration<CampaignsGetResponse>) => swr_infinite.SWRInfiniteResponse<{
|
|
39
|
+
campaigns: components["schemas"]["Campaign"][];
|
|
40
|
+
pagination: components["schemas"]["Pagination"];
|
|
41
|
+
}, any>;
|
|
42
|
+
|
|
43
|
+
export { useCampaigns, useCampaignsImmutable, useCampaignsInfinite };
|
|
@@ -27,14 +27,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
|
-
// src/hooks/
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
// src/hooks/useCampaigns.ts
|
|
31
|
+
var useCampaigns_exports = {};
|
|
32
|
+
__export(useCampaigns_exports, {
|
|
33
|
+
useCampaigns: () => useCampaigns,
|
|
34
|
+
useCampaignsImmutable: () => useCampaignsImmutable,
|
|
35
|
+
useCampaignsInfinite: () => useCampaignsInfinite
|
|
36
36
|
});
|
|
37
|
-
module.exports = __toCommonJS(
|
|
37
|
+
module.exports = __toCommonJS(useCampaigns_exports);
|
|
38
38
|
var import_immutable = __toESM(require("swr/immutable"));
|
|
39
39
|
var import_infinite = __toESM(require("swr/infinite"));
|
|
40
40
|
var import_swr = __toESM(require("swr"));
|
|
@@ -43,42 +43,75 @@ var import_react = require("@readyfor/api-client-base/react");
|
|
|
43
43
|
|
|
44
44
|
// src/components.ts
|
|
45
45
|
var import_zod = require("zod");
|
|
46
|
-
var
|
|
46
|
+
var CampaignType = import_zod.z.union([
|
|
47
|
+
import_zod.z.literal("curationMailMagazine"),
|
|
48
|
+
import_zod.z.literal("personalizedMailMagazine")
|
|
49
|
+
]);
|
|
50
|
+
var CampaignStatus = import_zod.z.union([
|
|
51
|
+
import_zod.z.literal("draft"),
|
|
52
|
+
import_zod.z.literal("scheduled"),
|
|
53
|
+
import_zod.z.literal("delivering"),
|
|
54
|
+
import_zod.z.literal("delivered"),
|
|
55
|
+
import_zod.z.literal("deliveryFailed")
|
|
56
|
+
]);
|
|
57
|
+
var Pagination = import_zod.z.object({
|
|
58
|
+
totalPages: import_zod.z.number(),
|
|
59
|
+
totalCount: import_zod.z.number(),
|
|
60
|
+
currentPerPage: import_zod.z.number(),
|
|
61
|
+
currentPage: import_zod.z.number(),
|
|
62
|
+
prevPage: import_zod.z.union([import_zod.z.number(), import_zod.z.null()]),
|
|
63
|
+
nextPage: import_zod.z.union([import_zod.z.number(), import_zod.z.null()]),
|
|
64
|
+
isFirstPage: import_zod.z.boolean(),
|
|
65
|
+
isLastPage: import_zod.z.boolean()
|
|
66
|
+
});
|
|
67
|
+
var Campaign = import_zod.z.object({
|
|
68
|
+
id: import_zod.z.number(),
|
|
69
|
+
title: import_zod.z.optional(import_zod.z.union([import_zod.z.string(), import_zod.z.null()])),
|
|
70
|
+
status: CampaignStatus,
|
|
71
|
+
type: CampaignType,
|
|
72
|
+
deliveryAt: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
73
|
+
lastEditorName: import_zod.z.string(),
|
|
74
|
+
lastEditedAt: import_zod.z.string()
|
|
75
|
+
});
|
|
76
|
+
var GetCampaigns = import_zod.z.object({
|
|
77
|
+
campaigns: import_zod.z.array(Campaign),
|
|
78
|
+
pagination: Pagination
|
|
79
|
+
});
|
|
47
80
|
|
|
48
|
-
// src/fetch/
|
|
81
|
+
// src/fetch/campaigns.ts
|
|
49
82
|
var import_api_client_base = require("@readyfor/api-client-base");
|
|
50
|
-
var
|
|
83
|
+
var buildCampaignsGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(GetCampaigns, { ...requestInit });
|
|
51
84
|
|
|
52
|
-
// src/hooks/
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
const key = (0, import_api_client_base2.__internal__requestUrl)("/api/
|
|
85
|
+
// src/hooks/useCampaigns.ts
|
|
86
|
+
var campaignsGetFetcher = buildCampaignsGetFetcher();
|
|
87
|
+
var useCampaigns = (query, swrConfig) => {
|
|
88
|
+
const key = (0, import_api_client_base2.__internal__requestUrl)("/api/campaigns", {}, query);
|
|
56
89
|
const requestInit = (0, import_react.useRequestInit)();
|
|
57
90
|
const result = (0, import_swr.default)(
|
|
58
91
|
swrConfig?.shouldNotFetch ? null : key,
|
|
59
|
-
|
|
92
|
+
buildCampaignsGetFetcher(requestInit),
|
|
60
93
|
swrConfig
|
|
61
94
|
);
|
|
62
95
|
return { key, ...result };
|
|
63
96
|
};
|
|
64
|
-
var
|
|
65
|
-
const key = (0, import_api_client_base2.__internal__requestUrl)("/api/
|
|
97
|
+
var useCampaignsImmutable = (query, swrConfig) => {
|
|
98
|
+
const key = (0, import_api_client_base2.__internal__requestUrl)("/api/campaigns", {}, query);
|
|
66
99
|
const requestInit = (0, import_react.useRequestInit)();
|
|
67
100
|
const result = (0, import_immutable.default)(
|
|
68
101
|
swrConfig?.shouldNotFetch ? null : key,
|
|
69
|
-
|
|
102
|
+
buildCampaignsGetFetcher(requestInit),
|
|
70
103
|
swrConfig
|
|
71
104
|
);
|
|
72
105
|
return { key, ...result };
|
|
73
106
|
};
|
|
74
|
-
var
|
|
75
|
-
getKey(() => (0, import_api_client_base2.__internal__requestUrl)()),
|
|
76
|
-
|
|
107
|
+
var useCampaignsInfinite = (getKey, swrConfig) => (0, import_infinite.default)(
|
|
108
|
+
getKey((query) => (0, import_api_client_base2.__internal__requestUrl)({}, query)),
|
|
109
|
+
campaignsGetFetcher,
|
|
77
110
|
swrConfig
|
|
78
111
|
);
|
|
79
112
|
// Annotate the CommonJS export names for ESM import in node:
|
|
80
113
|
0 && (module.exports = {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
114
|
+
useCampaigns,
|
|
115
|
+
useCampaignsImmutable,
|
|
116
|
+
useCampaignsInfinite
|
|
84
117
|
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCampaigns,
|
|
3
|
+
useCampaignsImmutable,
|
|
4
|
+
useCampaignsInfinite
|
|
5
|
+
} from "../chunk-BZW5HHND.mjs";
|
|
6
|
+
import "../chunk-WY7GF7TX.mjs";
|
|
7
|
+
import "../chunk-MAHZKOWV.mjs";
|
|
8
|
+
import "../chunk-L4D5MI7T.mjs";
|
|
9
|
+
export {
|
|
10
|
+
useCampaigns,
|
|
11
|
+
useCampaignsImmutable,
|
|
12
|
+
useCampaignsInfinite
|
|
13
|
+
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { $defs, components, external, operations, paths, webhooks } from './schemaType.mjs';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { Campaign, CampaignStatus, CampaignType, GetCampaigns, Pagination } from './components.mjs';
|
|
3
|
+
export { CampaignsGetQuery, CampaignsGetResponse, buildCampaignsGetFetcher, getCampaigns } from './fetch/campaigns.mjs';
|
|
4
4
|
import 'zod';
|
|
5
|
+
import '@readyfor/api-client-base';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { $defs, components, external, operations, paths, webhooks } from './schemaType.js';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { Campaign, CampaignStatus, CampaignType, GetCampaigns, Pagination } from './components.js';
|
|
3
|
+
export { CampaignsGetQuery, CampaignsGetResponse, buildCampaignsGetFetcher, getCampaigns } from './fetch/campaigns.js';
|
|
4
4
|
import 'zod';
|
|
5
|
+
import '@readyfor/api-client-base';
|
package/dist/index.js
CHANGED
|
@@ -20,26 +20,67 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
Campaign: () => Campaign,
|
|
24
|
+
CampaignStatus: () => CampaignStatus,
|
|
25
|
+
CampaignType: () => CampaignType,
|
|
26
|
+
GetCampaigns: () => GetCampaigns,
|
|
27
|
+
Pagination: () => Pagination,
|
|
28
|
+
buildCampaignsGetFetcher: () => buildCampaignsGetFetcher,
|
|
29
|
+
getCampaigns: () => getCampaigns
|
|
26
30
|
});
|
|
27
31
|
module.exports = __toCommonJS(src_exports);
|
|
28
32
|
|
|
29
33
|
// src/components.ts
|
|
30
34
|
var import_zod = require("zod");
|
|
31
|
-
var
|
|
35
|
+
var CampaignType = import_zod.z.union([
|
|
36
|
+
import_zod.z.literal("curationMailMagazine"),
|
|
37
|
+
import_zod.z.literal("personalizedMailMagazine")
|
|
38
|
+
]);
|
|
39
|
+
var CampaignStatus = import_zod.z.union([
|
|
40
|
+
import_zod.z.literal("draft"),
|
|
41
|
+
import_zod.z.literal("scheduled"),
|
|
42
|
+
import_zod.z.literal("delivering"),
|
|
43
|
+
import_zod.z.literal("delivered"),
|
|
44
|
+
import_zod.z.literal("deliveryFailed")
|
|
45
|
+
]);
|
|
46
|
+
var Pagination = import_zod.z.object({
|
|
47
|
+
totalPages: import_zod.z.number(),
|
|
48
|
+
totalCount: import_zod.z.number(),
|
|
49
|
+
currentPerPage: import_zod.z.number(),
|
|
50
|
+
currentPage: import_zod.z.number(),
|
|
51
|
+
prevPage: import_zod.z.union([import_zod.z.number(), import_zod.z.null()]),
|
|
52
|
+
nextPage: import_zod.z.union([import_zod.z.number(), import_zod.z.null()]),
|
|
53
|
+
isFirstPage: import_zod.z.boolean(),
|
|
54
|
+
isLastPage: import_zod.z.boolean()
|
|
55
|
+
});
|
|
56
|
+
var Campaign = import_zod.z.object({
|
|
57
|
+
id: import_zod.z.number(),
|
|
58
|
+
title: import_zod.z.optional(import_zod.z.union([import_zod.z.string(), import_zod.z.null()])),
|
|
59
|
+
status: CampaignStatus,
|
|
60
|
+
type: CampaignType,
|
|
61
|
+
deliveryAt: import_zod.z.union([import_zod.z.string(), import_zod.z.null()]),
|
|
62
|
+
lastEditorName: import_zod.z.string(),
|
|
63
|
+
lastEditedAt: import_zod.z.string()
|
|
64
|
+
});
|
|
65
|
+
var GetCampaigns = import_zod.z.object({
|
|
66
|
+
campaigns: import_zod.z.array(Campaign),
|
|
67
|
+
pagination: Pagination
|
|
68
|
+
});
|
|
32
69
|
|
|
33
|
-
// src/fetch/
|
|
70
|
+
// src/fetch/campaigns.ts
|
|
34
71
|
var import_api_client_base = require("@readyfor/api-client-base");
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
method: "GET"
|
|
39
|
-
|
|
72
|
+
var buildCampaignsGetFetcher = (requestInit) => (0, import_api_client_base.createJsonFetcher)(GetCampaigns, { ...requestInit });
|
|
73
|
+
var getCampaigns = (query, requestInit) => buildCampaignsGetFetcher()(
|
|
74
|
+
(0, import_api_client_base.__internal__requestUrl)("/api/campaigns", {}, query),
|
|
75
|
+
{ ...requestInit, method: "GET" }
|
|
76
|
+
);
|
|
40
77
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
78
|
0 && (module.exports = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
79
|
+
Campaign,
|
|
80
|
+
CampaignStatus,
|
|
81
|
+
CampaignType,
|
|
82
|
+
GetCampaigns,
|
|
83
|
+
Pagination,
|
|
84
|
+
buildCampaignsGetFetcher,
|
|
85
|
+
getCampaigns
|
|
45
86
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import "./chunk-WY7GF7TX.mjs";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "./chunk-
|
|
3
|
+
buildCampaignsGetFetcher,
|
|
4
|
+
getCampaigns
|
|
5
|
+
} from "./chunk-MAHZKOWV.mjs";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
Campaign,
|
|
8
|
+
CampaignStatus,
|
|
9
|
+
CampaignType,
|
|
10
|
+
GetCampaigns,
|
|
11
|
+
Pagination
|
|
12
|
+
} from "./chunk-L4D5MI7T.mjs";
|
|
9
13
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
Campaign,
|
|
15
|
+
CampaignStatus,
|
|
16
|
+
CampaignType,
|
|
17
|
+
GetCampaigns,
|
|
18
|
+
Pagination,
|
|
19
|
+
buildCampaignsGetFetcher,
|
|
20
|
+
getCampaigns
|
|
13
21
|
};
|