graze-client 0.9.0 → 0.11.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 +317 -363
- package/build/dts/GrazeClient.d.ts.map +1 -1
- package/build/dts/index.d.ts +283 -12
- package/build/dts/index.d.ts.map +1 -1
- package/build/dts/schema/index.d.ts +1 -0
- package/build/dts/schema/index.d.ts.map +1 -1
- package/build/dts/stickyposts.d.ts +12 -12
- package/build/dts/stickyposts.d.ts.map +1 -1
- package/build/esm/GrazeClient.js +11 -11
- package/build/esm/GrazeClient.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/schema/index.js +1 -0
- package/build/esm/schema/index.js.map +1 -1
- package/build/esm/stickyposts.js +2 -2
- package/build/esm/stickyposts.js.map +1 -1
- package/package.json +6 -6
- package/src/GrazeClient.ts +11 -11
- package/src/index.ts +28 -28
- package/src/schema/index.ts +1 -0
- package/src/stickyposts.ts +2 -2
package/src/index.ts
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import { ConfigProvider, Effect } from "effect";
|
|
2
|
-
import { GrazeClient
|
|
2
|
+
import { GrazeClient } from "./GrazeClient.js";
|
|
3
3
|
|
|
4
|
-
type
|
|
5
|
-
...args: Array<any>
|
|
6
|
-
) => Effect.Effect<infer A, infer _E, never>
|
|
7
|
-
? (...args: Parameters<T>) => Promise<A>
|
|
8
|
-
: never;
|
|
4
|
+
type GrazePromiseApi = Effect.Success<typeof setup>;
|
|
9
5
|
|
|
10
6
|
export class GrazeService {
|
|
11
|
-
getFeed:
|
|
12
|
-
getFeeds:
|
|
13
|
-
hidePost:
|
|
14
|
-
unhidePost:
|
|
15
|
-
updateAlgorithm:
|
|
16
|
-
publishAlgorithm:
|
|
7
|
+
getFeed: GrazePromiseApi["getFeed"];
|
|
8
|
+
getFeeds: GrazePromiseApi["getFeeds"];
|
|
9
|
+
hidePost: GrazePromiseApi["hidePost"];
|
|
10
|
+
unhidePost: GrazePromiseApi["unhidePost"];
|
|
11
|
+
updateAlgorithm: GrazePromiseApi["updateAlgorithm"];
|
|
12
|
+
publishAlgorithm: GrazePromiseApi["publishAlgorithm"];
|
|
17
13
|
stickyposts: {
|
|
18
|
-
get:
|
|
19
|
-
create:
|
|
20
|
-
delete:
|
|
21
|
-
update:
|
|
14
|
+
get: GrazePromiseApi["getStickyPosts"];
|
|
15
|
+
create: GrazePromiseApi["createStickyPost"];
|
|
16
|
+
delete: GrazePromiseApi["deleteStickyPost"];
|
|
17
|
+
update: GrazePromiseApi["updateStickyPost"];
|
|
22
18
|
};
|
|
23
19
|
|
|
24
20
|
constructor({
|
|
@@ -64,30 +60,34 @@ export class GrazeService {
|
|
|
64
60
|
|
|
65
61
|
const setup = Effect.gen(function* () {
|
|
66
62
|
const client = yield* GrazeClient;
|
|
67
|
-
const getFeed = (
|
|
68
|
-
client.getFeed
|
|
63
|
+
const getFeed = (
|
|
64
|
+
...args: Parameters<typeof client.getFeed<"decoded-only">>
|
|
65
|
+
) => client.getFeed(...args).pipe(Effect.runPromise);
|
|
69
66
|
const getFeeds = (...args: Parameters<typeof client.getFeeds>) =>
|
|
70
67
|
client.getFeeds(...args).pipe(Effect.runPromise);
|
|
71
|
-
const hidePost = (
|
|
72
|
-
client.hidePost
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
const hidePost = (
|
|
69
|
+
...args: Parameters<typeof client.hidePost<"decoded-only">>
|
|
70
|
+
) => client.hidePost(...args).pipe(Effect.runPromise);
|
|
71
|
+
const unhidePost = (
|
|
72
|
+
...args: Parameters<typeof client.unhidePost<"decoded-only">>
|
|
73
|
+
) => client.unhidePost(...args).pipe(Effect.runPromise);
|
|
75
74
|
const updateAlgorithm = (
|
|
76
75
|
...args: Parameters<typeof client.updateAlgorithm>
|
|
77
76
|
) => client.updateAlgorithm(...args).pipe(Effect.runPromise);
|
|
78
77
|
const publishAlgorithm = (
|
|
79
|
-
...args: Parameters<typeof client.publishAlgorithm
|
|
78
|
+
...args: Parameters<typeof client.publishAlgorithm<"decoded-only">>
|
|
80
79
|
) => client.publishAlgorithm(...args).pipe(Effect.runPromise);
|
|
81
|
-
const getStickyPosts = (
|
|
82
|
-
client.stickyposts.get
|
|
80
|
+
const getStickyPosts = (
|
|
81
|
+
...args: Parameters<typeof client.stickyposts.get<"decoded-only">>
|
|
82
|
+
) => client.stickyposts.get(...args).pipe(Effect.runPromise);
|
|
83
83
|
const createStickyPost = (
|
|
84
|
-
...args: Parameters<typeof client.stickyposts.create
|
|
84
|
+
...args: Parameters<typeof client.stickyposts.create<"decoded-only">>
|
|
85
85
|
) => client.stickyposts.create(...args).pipe(Effect.runPromise);
|
|
86
86
|
const deleteStickyPost = (
|
|
87
|
-
...args: Parameters<typeof client.stickyposts.delete
|
|
87
|
+
...args: Parameters<typeof client.stickyposts.delete<"decoded-only">>
|
|
88
88
|
) => client.stickyposts.delete(...args).pipe(Effect.runPromise);
|
|
89
89
|
const updateStickyPost = (
|
|
90
|
-
...args: Parameters<typeof client.stickyposts.update
|
|
90
|
+
...args: Parameters<typeof client.stickyposts.update<"decoded-only">>
|
|
91
91
|
) => client.stickyposts.update(...args).pipe(Effect.runPromise);
|
|
92
92
|
|
|
93
93
|
return {
|
package/src/schema/index.ts
CHANGED
package/src/stickyposts.ts
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
StickyPostSuccess,
|
|
8
8
|
StickyType,
|
|
9
9
|
} from "./schema/StickyPosts.js";
|
|
10
|
-
import * as HttpApiEndpoint from "effect/
|
|
11
|
-
import * as HttpApiGroup from "effect/
|
|
10
|
+
import * as HttpApiEndpoint from "effect/http-api/HttpApiEndpoint";
|
|
11
|
+
import * as HttpApiGroup from "effect/http-api/HttpApiGroup";
|
|
12
12
|
|
|
13
13
|
// v4 dropped `Schema.BooleanFromString`; decode the query strings "true"/"false".
|
|
14
14
|
const BooleanFromString = Schema.Literals(["true", "false"]).pipe(
|