graze-client 0.8.1 → 0.9.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/build/dts/GrazeClient.d.ts +368 -242
- package/build/dts/GrazeClient.d.ts.map +1 -1
- package/build/dts/builder.d.ts +2 -2
- package/build/dts/builder.d.ts.map +1 -1
- package/build/dts/common.d.ts +2 -3
- package/build/dts/common.d.ts.map +1 -1
- package/build/dts/index.d.ts +12 -12
- package/build/dts/index.d.ts.map +1 -1
- package/build/dts/schema/Post.d.ts +52 -52
- package/build/dts/schema/Post.d.ts.map +1 -1
- package/build/dts/schema/StickyPosts.d.ts +55 -56
- package/build/dts/schema/StickyPosts.d.ts.map +1 -1
- package/build/dts/schema/UpdateAlgorithmPayload.d.ts +137 -137
- package/build/dts/schema/UpdateAlgorithmPayload.d.ts.map +1 -1
- package/build/dts/schema/index.d.ts.map +1 -1
- package/build/dts/schema/shared.d.ts +126 -126
- package/build/dts/schema/shared.d.ts.map +1 -1
- package/build/dts/stickyposts.d.ts +80 -78
- package/build/dts/stickyposts.d.ts.map +1 -1
- package/build/esm/GrazeClient.js +47 -31
- package/build/esm/GrazeClient.js.map +1 -1
- package/build/esm/builder.js +20 -20
- package/build/esm/builder.js.map +1 -1
- package/build/esm/common.js +4 -3
- package/build/esm/common.js.map +1 -1
- package/build/esm/index.js +11 -8
- package/build/esm/index.js.map +1 -1
- package/build/esm/schema/Post.js +9 -9
- package/build/esm/schema/Post.js.map +1 -1
- package/build/esm/schema/StickyPosts.js +8 -9
- package/build/esm/schema/StickyPosts.js.map +1 -1
- package/build/esm/schema/UpdateAlgorithmPayload.js +130 -53
- package/build/esm/schema/UpdateAlgorithmPayload.js.map +1 -1
- package/build/esm/schema/index.js.map +1 -1
- package/build/esm/schema/shared.js +14 -14
- package/build/esm/schema/shared.js.map +1 -1
- package/build/esm/stickyposts.js +28 -13
- package/build/esm/stickyposts.js.map +1 -1
- package/package.json +21 -23
- package/src/GrazeClient.ts +83 -76
- package/src/builder.ts +78 -74
- package/src/common.ts +5 -10
- package/src/index.ts +61 -52
- package/src/schema/Post.ts +16 -16
- package/src/schema/StickyPosts.ts +22 -26
- package/src/schema/UpdateAlgorithmPayload.ts +153 -145
- package/src/schema/index.ts +2 -2
- package/src/schema/shared.ts +32 -32
- package/src/stickyposts.ts +48 -27
package/src/stickyposts.ts
CHANGED
|
@@ -1,43 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { FeedIdParam } from "./common.js"
|
|
1
|
+
import { Schema, SchemaTransformation } from "effect";
|
|
2
|
+
import { FeedIdParam } from "./common.js";
|
|
4
3
|
import {
|
|
5
4
|
CreateStickyPostBody,
|
|
6
5
|
GetStickyPostsBody,
|
|
7
6
|
StickyPostIdParam,
|
|
8
7
|
StickyPostSuccess,
|
|
9
|
-
StickyType
|
|
10
|
-
} from "./schema/StickyPosts.js"
|
|
8
|
+
StickyType,
|
|
9
|
+
} from "./schema/StickyPosts.js";
|
|
10
|
+
import * as HttpApiEndpoint from "effect/unstable/httpapi/HttpApiEndpoint";
|
|
11
|
+
import * as HttpApiGroup from "effect/unstable/httpapi/HttpApiGroup";
|
|
12
|
+
|
|
13
|
+
// v4 dropped `Schema.BooleanFromString`; decode the query strings "true"/"false".
|
|
14
|
+
const BooleanFromString = Schema.Literals(["true", "false"]).pipe(
|
|
15
|
+
Schema.decodeTo(
|
|
16
|
+
Schema.Boolean,
|
|
17
|
+
SchemaTransformation.transform({
|
|
18
|
+
decode: (s) => s === "true",
|
|
19
|
+
encode: (b) => (b ? "true" : "false"),
|
|
20
|
+
}),
|
|
21
|
+
),
|
|
22
|
+
);
|
|
11
23
|
|
|
12
24
|
export const StickyPostsApiGroup = HttpApiGroup.make("stickyposts")
|
|
13
25
|
.add(
|
|
14
|
-
HttpApiEndpoint.post("create"
|
|
15
|
-
|
|
16
|
-
|
|
26
|
+
HttpApiEndpoint.post("create", "/app/api/v1/feed-management/sticky-posts", {
|
|
27
|
+
payload: CreateStickyPostBody,
|
|
28
|
+
success: StickyPostSuccess,
|
|
29
|
+
}),
|
|
17
30
|
)
|
|
18
31
|
.add(
|
|
19
32
|
HttpApiEndpoint.get(
|
|
20
|
-
"get"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
33
|
+
"get",
|
|
34
|
+
"/app/api/v1/feed-management/sticky-posts/:feedId",
|
|
35
|
+
{
|
|
36
|
+
params: { feedId: FeedIdParam },
|
|
37
|
+
success: GetStickyPostsBody,
|
|
38
|
+
},
|
|
39
|
+
),
|
|
24
40
|
)
|
|
25
41
|
.add(
|
|
26
42
|
HttpApiEndpoint.put(
|
|
27
|
-
"update"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
"update",
|
|
44
|
+
"/app/api/v1/feed-management/sticky-posts/:feedId/:stickyPostId",
|
|
45
|
+
{
|
|
46
|
+
params: { feedId: FeedIdParam, stickyPostId: StickyPostIdParam },
|
|
47
|
+
query: Schema.Struct({
|
|
48
|
+
is_active: BooleanFromString,
|
|
49
|
+
sticky_type: StickyType,
|
|
50
|
+
}),
|
|
51
|
+
success: StickyPostSuccess,
|
|
52
|
+
},
|
|
53
|
+
),
|
|
36
54
|
)
|
|
37
55
|
.add(
|
|
38
|
-
HttpApiEndpoint.
|
|
39
|
-
"delete"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
HttpApiEndpoint.make("DELETE")(
|
|
57
|
+
"delete",
|
|
58
|
+
"/app/api/v1/feed-management/sticky-posts/:feedId/:stickyPostId",
|
|
59
|
+
{
|
|
60
|
+
params: { feedId: FeedIdParam, stickyPostId: StickyPostIdParam },
|
|
61
|
+
success: StickyPostSuccess,
|
|
62
|
+
},
|
|
63
|
+
),
|
|
64
|
+
);
|