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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GrazeClient.d.ts","sourceRoot":"","sources":["../../src/GrazeClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAQ,MAAM,EAAE,KAAK,EAAY,MAAM,EAAE,MAAM,QAAQ,CAAC;AAUhF,OAAO,KAAK,IAAI,MAAM,oCAAoC,CAAC;AAI3D,OAAO,KAAK,aAAa,MAAM,
|
|
1
|
+
{"version":3,"file":"GrazeClient.d.ts","sourceRoot":"","sources":["../../src/GrazeClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAQ,MAAM,EAAE,KAAK,EAAY,MAAM,EAAE,MAAM,QAAQ,CAAC;AAUhF,OAAO,KAAK,IAAI,MAAM,oCAAoC,CAAC;AAI3D,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,eAAe,MAAM,iCAAiC,CAAC;AAGnE,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAoErD,QAAA,MAAM,SAAS;4BAiBkB,IAAI,CAAC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAc5C,CAAC;;4BAd8B,IAAI,CAAC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgB9C,qBAAa,WAAY,SAAQ,gBAGf;IAChB,MAAM,CAAC,QAAQ,CAAC,KAAK,sDAEnB;CACH;AAED,8EAA8E;AAC9E,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,SAAS,CAAC,CAAC;;;;AAElE,qBAAa,UAAW,SAAQ,gBAA+B;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;CAAG"}
|
package/build/dts/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import {
|
|
3
|
-
type
|
|
2
|
+
import { GrazeClient } from "./GrazeClient.js";
|
|
3
|
+
type GrazePromiseApi = Effect.Success<typeof setup>;
|
|
4
4
|
export declare class GrazeService {
|
|
5
|
-
getFeed:
|
|
6
|
-
getFeeds:
|
|
7
|
-
hidePost:
|
|
8
|
-
unhidePost:
|
|
9
|
-
updateAlgorithm:
|
|
10
|
-
publishAlgorithm:
|
|
5
|
+
getFeed: GrazePromiseApi["getFeed"];
|
|
6
|
+
getFeeds: GrazePromiseApi["getFeeds"];
|
|
7
|
+
hidePost: GrazePromiseApi["hidePost"];
|
|
8
|
+
unhidePost: GrazePromiseApi["unhidePost"];
|
|
9
|
+
updateAlgorithm: GrazePromiseApi["updateAlgorithm"];
|
|
10
|
+
publishAlgorithm: GrazePromiseApi["publishAlgorithm"];
|
|
11
11
|
stickyposts: {
|
|
12
|
-
get:
|
|
13
|
-
create:
|
|
14
|
-
delete:
|
|
15
|
-
update:
|
|
12
|
+
get: GrazePromiseApi["getStickyPosts"];
|
|
13
|
+
create: GrazePromiseApi["createStickyPost"];
|
|
14
|
+
delete: GrazePromiseApi["deleteStickyPost"];
|
|
15
|
+
update: GrazePromiseApi["updateStickyPost"];
|
|
16
16
|
};
|
|
17
17
|
constructor({ apiUrl, cookie, userId, }: {
|
|
18
18
|
apiUrl: string;
|
|
@@ -20,6 +20,277 @@ export declare class GrazeService {
|
|
|
20
20
|
userId: number;
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
+
declare const setup: Effect.Effect<{
|
|
24
|
+
getFeed: (request: {
|
|
25
|
+
readonly params: {
|
|
26
|
+
readonly feedId: number;
|
|
27
|
+
};
|
|
28
|
+
readonly responseMode?: "decoded-only";
|
|
29
|
+
readonly sseOptions?: import("effect/encoding/Sse").DecodeOptions | undefined;
|
|
30
|
+
}) => Promise<{
|
|
31
|
+
readonly draft_algorithm_manifest: unknown;
|
|
32
|
+
readonly algorithm_manifest: unknown;
|
|
33
|
+
readonly stats: unknown;
|
|
34
|
+
readonly latest_error: unknown;
|
|
35
|
+
readonly latest_compute_cycle: unknown;
|
|
36
|
+
readonly subscriber_lists: unknown;
|
|
37
|
+
readonly algorithm_uri: string;
|
|
38
|
+
readonly algorithm_manifest_id: number | null;
|
|
39
|
+
readonly draft_algorithm_manifest_id: number;
|
|
40
|
+
readonly record_name: string;
|
|
41
|
+
readonly display_name: string;
|
|
42
|
+
readonly description: string;
|
|
43
|
+
readonly feed_did: string;
|
|
44
|
+
readonly avatar_url: string | null;
|
|
45
|
+
readonly cpm_cents: number | null;
|
|
46
|
+
readonly deleted: boolean;
|
|
47
|
+
readonly active: boolean;
|
|
48
|
+
readonly public: boolean;
|
|
49
|
+
readonly monetization_available: boolean;
|
|
50
|
+
readonly status: string | null;
|
|
51
|
+
readonly unique_operator_ids: readonly number[];
|
|
52
|
+
readonly user_id: number;
|
|
53
|
+
readonly id: number;
|
|
54
|
+
readonly created_at: Date;
|
|
55
|
+
readonly updated_at: Date;
|
|
56
|
+
readonly deleted_at: Date | null;
|
|
57
|
+
}>;
|
|
58
|
+
getFeeds: () => Promise<{
|
|
59
|
+
readonly page: number;
|
|
60
|
+
readonly page_size: number;
|
|
61
|
+
readonly total_items: number;
|
|
62
|
+
readonly total_pages: number;
|
|
63
|
+
readonly user_algos: readonly {
|
|
64
|
+
readonly stats: {
|
|
65
|
+
readonly page_renders: number;
|
|
66
|
+
readonly unique_users: number;
|
|
67
|
+
readonly post_renders: number;
|
|
68
|
+
};
|
|
69
|
+
readonly algorithm_uri: string;
|
|
70
|
+
readonly algorithm_manifest_id: number | null;
|
|
71
|
+
readonly draft_algorithm_manifest_id: number;
|
|
72
|
+
readonly record_name: string;
|
|
73
|
+
readonly display_name: string;
|
|
74
|
+
readonly description: string;
|
|
75
|
+
readonly feed_did: string;
|
|
76
|
+
readonly avatar_url: string | null;
|
|
77
|
+
readonly cpm_cents: number | null;
|
|
78
|
+
readonly deleted: boolean;
|
|
79
|
+
readonly active: boolean;
|
|
80
|
+
readonly public: boolean;
|
|
81
|
+
readonly monetization_available: boolean;
|
|
82
|
+
readonly status: string | null;
|
|
83
|
+
readonly unique_operator_ids: readonly number[];
|
|
84
|
+
readonly user_id: number;
|
|
85
|
+
readonly id: number;
|
|
86
|
+
readonly created_at: Date;
|
|
87
|
+
readonly updated_at: Date;
|
|
88
|
+
readonly deleted_at: Date | null;
|
|
89
|
+
}[];
|
|
90
|
+
}>;
|
|
91
|
+
hidePost: (request: {
|
|
92
|
+
readonly payload: {
|
|
93
|
+
readonly algo_id: number;
|
|
94
|
+
readonly at_uri: string;
|
|
95
|
+
};
|
|
96
|
+
readonly responseMode?: "decoded-only";
|
|
97
|
+
readonly sseOptions?: import("effect/encoding/Sse").DecodeOptions | undefined;
|
|
98
|
+
}) => Promise<unknown>;
|
|
99
|
+
unhidePost: (request: {
|
|
100
|
+
readonly payload: {
|
|
101
|
+
readonly algo_id: number;
|
|
102
|
+
readonly at_uri: string;
|
|
103
|
+
};
|
|
104
|
+
readonly responseMode?: "decoded-only";
|
|
105
|
+
readonly sseOptions?: import("effect/encoding/Sse").DecodeOptions | undefined;
|
|
106
|
+
}) => Promise<unknown>;
|
|
107
|
+
updateAlgorithm: (data: {
|
|
108
|
+
readonly record_name: string;
|
|
109
|
+
readonly display_name: string;
|
|
110
|
+
readonly user_id: number;
|
|
111
|
+
readonly id: number;
|
|
112
|
+
readonly algorithm_manifest: {
|
|
113
|
+
readonly filter: Readonly<{
|
|
114
|
+
and: ReadonlyArray<import("./schema/UpdateAlgorithmPayload.js").Filter>;
|
|
115
|
+
}> | Readonly<{
|
|
116
|
+
or: ReadonlyArray<import("./schema/UpdateAlgorithmPayload.js").Filter>;
|
|
117
|
+
}> | Readonly<{
|
|
118
|
+
list_member: readonly [import("./schema/UpdateAlgorithmPayload.js").ListUri, "in" | "not_in"];
|
|
119
|
+
}> | Readonly<{
|
|
120
|
+
attribute_compare: readonly [import("./schema/UpdateAlgorithmPayload.js").AttributeName, import("./schema/UpdateAlgorithmPayload.js").AttributeComparison, import("./schema/UpdateAlgorithmPayload.js").AttributeValue];
|
|
121
|
+
}> | Readonly<{
|
|
122
|
+
regex_matches: readonly [import("./schema/UpdateAlgorithmPayload.js").AttributeName, string, boolean];
|
|
123
|
+
}> | Readonly<{
|
|
124
|
+
regex_negation_matches: readonly [import("./schema/UpdateAlgorithmPayload.js").AttributeName, string, boolean];
|
|
125
|
+
}> | Readonly<{
|
|
126
|
+
regex_any: readonly [import("./schema/UpdateAlgorithmPayload.js").AttributeName, ReadonlyArray<string>, boolean, boolean];
|
|
127
|
+
}> | Readonly<{
|
|
128
|
+
regex_none: readonly [import("./schema/UpdateAlgorithmPayload.js").AttributeName, ReadonlyArray<string>, boolean, boolean];
|
|
129
|
+
}> | Readonly<{
|
|
130
|
+
content_moderation: readonly ["OK", ">=", number];
|
|
131
|
+
}> | Readonly<{
|
|
132
|
+
entity_excludes: readonly ["labels", readonly ["porn", "sexual", "nudity"]];
|
|
133
|
+
}> | Readonly<{
|
|
134
|
+
embed_type: readonly ["==" | "!=", "video" | "image" | "link" | "post" | "gif" | "image_group"];
|
|
135
|
+
}> | Readonly<{
|
|
136
|
+
social_graph: readonly [string, "in" | "not_in", "follows" | "followers"];
|
|
137
|
+
}> | Readonly<{
|
|
138
|
+
post_type: readonly ["in" | "not_in", ReadonlyArray<import("./schema/UpdateAlgorithmPayload.js").PostType>];
|
|
139
|
+
}>;
|
|
140
|
+
readonly sort_settings?: {
|
|
141
|
+
readonly time_window: number;
|
|
142
|
+
readonly decay_penalty: number;
|
|
143
|
+
readonly like_count_multiplier: number;
|
|
144
|
+
readonly reply_count_multiplier: number;
|
|
145
|
+
readonly repost_count_multiplier: number;
|
|
146
|
+
readonly reader_like_count_multiplier: number;
|
|
147
|
+
readonly reader_reply_count_multiplier: number;
|
|
148
|
+
readonly reader_repost_count_multiplier: number;
|
|
149
|
+
} | undefined;
|
|
150
|
+
};
|
|
151
|
+
readonly order: "new" | "trending" | "blend" | "hackernews" | "old";
|
|
152
|
+
readonly description?: string | undefined;
|
|
153
|
+
readonly file?: unknown;
|
|
154
|
+
readonly metadata?: {
|
|
155
|
+
readonly document?: unknown;
|
|
156
|
+
readonly schema?: {
|
|
157
|
+
readonly schemaVersion: 2;
|
|
158
|
+
readonly sequences: {
|
|
159
|
+
readonly [x: string]: number;
|
|
160
|
+
};
|
|
161
|
+
} | undefined;
|
|
162
|
+
readonly session?: unknown;
|
|
163
|
+
} | undefined;
|
|
164
|
+
}) => Promise<{
|
|
165
|
+
readonly message: string;
|
|
166
|
+
readonly algorithm: {
|
|
167
|
+
readonly algorithm_uri: string;
|
|
168
|
+
readonly algorithm_manifest_id: number | null;
|
|
169
|
+
readonly draft_algorithm_manifest_id: number;
|
|
170
|
+
readonly record_name: string;
|
|
171
|
+
readonly display_name: string;
|
|
172
|
+
readonly description: string;
|
|
173
|
+
readonly feed_did: string;
|
|
174
|
+
readonly avatar_url: string | null;
|
|
175
|
+
readonly cpm_cents: number | null;
|
|
176
|
+
readonly deleted: boolean;
|
|
177
|
+
readonly active: boolean;
|
|
178
|
+
readonly public: boolean;
|
|
179
|
+
readonly monetization_available: boolean;
|
|
180
|
+
readonly status: string | null;
|
|
181
|
+
readonly unique_operator_ids: readonly number[];
|
|
182
|
+
readonly user_id: number;
|
|
183
|
+
readonly id: number;
|
|
184
|
+
readonly created_at: Date;
|
|
185
|
+
readonly updated_at: Date;
|
|
186
|
+
readonly deleted_at: Date | null;
|
|
187
|
+
};
|
|
188
|
+
}>;
|
|
189
|
+
publishAlgorithm: (request: {
|
|
190
|
+
readonly params: {
|
|
191
|
+
readonly feedId: number;
|
|
192
|
+
};
|
|
193
|
+
readonly responseMode?: "decoded-only";
|
|
194
|
+
readonly sseOptions?: import("effect/encoding/Sse").DecodeOptions | undefined;
|
|
195
|
+
}) => Promise<unknown>;
|
|
196
|
+
getStickyPosts: (request: {
|
|
197
|
+
readonly params: {
|
|
198
|
+
readonly feedId: number;
|
|
199
|
+
};
|
|
200
|
+
readonly responseMode?: "decoded-only";
|
|
201
|
+
readonly sseOptions?: import("effect/encoding/Sse").DecodeOptions | undefined;
|
|
202
|
+
}) => Promise<{
|
|
203
|
+
readonly sticky_posts: readonly {
|
|
204
|
+
readonly id: number;
|
|
205
|
+
readonly created_at: string;
|
|
206
|
+
readonly updated_at: string;
|
|
207
|
+
readonly post: {
|
|
208
|
+
readonly cid: string;
|
|
209
|
+
readonly uri: string;
|
|
210
|
+
readonly $type: string;
|
|
211
|
+
readonly embed: any;
|
|
212
|
+
readonly author: {
|
|
213
|
+
readonly did: string;
|
|
214
|
+
readonly $type: string;
|
|
215
|
+
readonly avatar: string;
|
|
216
|
+
readonly handle: string;
|
|
217
|
+
readonly labels: readonly any[];
|
|
218
|
+
readonly viewer: any;
|
|
219
|
+
readonly createdAt: string;
|
|
220
|
+
readonly associated: any;
|
|
221
|
+
readonly displayName: string;
|
|
222
|
+
};
|
|
223
|
+
readonly labels: any;
|
|
224
|
+
readonly record: {
|
|
225
|
+
readonly tags: any;
|
|
226
|
+
readonly text: string;
|
|
227
|
+
readonly $type: string;
|
|
228
|
+
readonly embed: any;
|
|
229
|
+
readonly langs: readonly string[] | null;
|
|
230
|
+
readonly reply: any;
|
|
231
|
+
readonly facets: readonly any[] | null;
|
|
232
|
+
readonly labels: any;
|
|
233
|
+
readonly entities: any;
|
|
234
|
+
readonly createdAt: string;
|
|
235
|
+
};
|
|
236
|
+
readonly viewer: any;
|
|
237
|
+
readonly indexedAt: string;
|
|
238
|
+
readonly likeCount: number;
|
|
239
|
+
readonly quoteCount: number;
|
|
240
|
+
readonly replyCount: number;
|
|
241
|
+
readonly threadgate: unknown;
|
|
242
|
+
readonly repostCount: number;
|
|
243
|
+
};
|
|
244
|
+
readonly uri: string;
|
|
245
|
+
readonly author: string;
|
|
246
|
+
readonly is_active: boolean;
|
|
247
|
+
readonly sticky_type: "pinned" | "rotating";
|
|
248
|
+
readonly hidden: boolean;
|
|
249
|
+
readonly stopping_criteria?: {
|
|
250
|
+
readonly expiration_time?: number | undefined;
|
|
251
|
+
} | undefined;
|
|
252
|
+
}[];
|
|
253
|
+
}>;
|
|
254
|
+
createStickyPost: (request: {
|
|
255
|
+
readonly payload: {
|
|
256
|
+
readonly algo_id: number;
|
|
257
|
+
readonly is_active: boolean;
|
|
258
|
+
readonly sticky_type: "pinned" | "rotating";
|
|
259
|
+
readonly post_url: string;
|
|
260
|
+
readonly stopping_criteria?: {
|
|
261
|
+
readonly expiration_time?: number | undefined;
|
|
262
|
+
} | undefined;
|
|
263
|
+
};
|
|
264
|
+
readonly responseMode?: "decoded-only";
|
|
265
|
+
readonly sseOptions?: import("effect/encoding/Sse").DecodeOptions | undefined;
|
|
266
|
+
}) => Promise<{
|
|
267
|
+
readonly message: string;
|
|
268
|
+
}>;
|
|
269
|
+
deleteStickyPost: (request: {
|
|
270
|
+
readonly params: {
|
|
271
|
+
readonly feedId: number;
|
|
272
|
+
readonly stickyPostId: number;
|
|
273
|
+
};
|
|
274
|
+
readonly responseMode?: "decoded-only";
|
|
275
|
+
readonly sseOptions?: import("effect/encoding/Sse").DecodeOptions | undefined;
|
|
276
|
+
}) => Promise<{
|
|
277
|
+
readonly message: string;
|
|
278
|
+
}>;
|
|
279
|
+
updateStickyPost: (request: {
|
|
280
|
+
readonly params: {
|
|
281
|
+
readonly feedId: number;
|
|
282
|
+
readonly stickyPostId: number;
|
|
283
|
+
};
|
|
284
|
+
readonly query: {
|
|
285
|
+
readonly is_active: boolean;
|
|
286
|
+
readonly sticky_type: "pinned" | "rotating";
|
|
287
|
+
};
|
|
288
|
+
readonly responseMode?: "decoded-only";
|
|
289
|
+
readonly sseOptions?: import("effect/encoding/Sse").DecodeOptions | undefined;
|
|
290
|
+
}) => Promise<{
|
|
291
|
+
readonly message: string;
|
|
292
|
+
}>;
|
|
293
|
+
}, never, GrazeClient>;
|
|
23
294
|
export { Algo, F } from "./builder.js";
|
|
24
295
|
export * from "./schema/index.js";
|
|
25
296
|
//# sourceMappingURL=index.d.ts.map
|
package/build/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA4CT,CAAC;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import * as HttpApiEndpoint from "effect/
|
|
3
|
-
import * as HttpApiGroup from "effect/
|
|
4
|
-
export declare const StickyPostsApiGroup: HttpApiGroup.HttpApiGroup<"stickyposts", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", "/app/api/v1/feed-management/sticky-posts",
|
|
2
|
+
import * as HttpApiEndpoint from "effect/http-api/HttpApiEndpoint";
|
|
3
|
+
import * as HttpApiGroup from "effect/http-api/HttpApiGroup";
|
|
4
|
+
export declare const StickyPostsApiGroup: HttpApiGroup.HttpApiGroup<"stickyposts", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", "/app/api/v1/feed-management/sticky-posts", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
5
5
|
readonly is_active: Schema.Boolean;
|
|
6
6
|
readonly sticky_type: Schema.Literals<readonly ["pinned", "rotating"]>;
|
|
7
7
|
readonly algo_id: Schema.Number;
|
|
@@ -9,11 +9,11 @@ export declare const StickyPostsApiGroup: HttpApiGroup.HttpApiGroup<"stickyposts
|
|
|
9
9
|
readonly stopping_criteria: Schema.optional<Schema.Struct<{
|
|
10
10
|
readonly expiration_time: Schema.optional<Schema.Number>;
|
|
11
11
|
}>>;
|
|
12
|
-
}>>,
|
|
12
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
13
13
|
readonly message: Schema.String;
|
|
14
|
-
}>>,
|
|
14
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"get", "GET", "/app/api/v1/feed-management/sticky-posts/:feedId", Schema.toCodecStringTree<Schema.Struct<{
|
|
15
15
|
feedId: Schema.NumberFromString;
|
|
16
|
-
}>>,
|
|
16
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
17
17
|
readonly sticky_posts: Schema.$Array<Schema.Struct<{
|
|
18
18
|
readonly stopping_criteria: Schema.optional<Schema.Struct<{
|
|
19
19
|
readonly expiration_time: Schema.optional<Schema.Number>;
|
|
@@ -64,18 +64,18 @@ export declare const StickyPostsApiGroup: HttpApiGroup.HttpApiGroup<"stickyposts
|
|
|
64
64
|
readonly sticky_type: Schema.Literals<readonly ["pinned", "rotating"]>;
|
|
65
65
|
readonly id: Schema.Number;
|
|
66
66
|
}>>;
|
|
67
|
-
}>>,
|
|
67
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"update", "PUT", "/app/api/v1/feed-management/sticky-posts/:feedId/:stickyPostId", Schema.toCodecStringTree<Schema.Struct<{
|
|
68
68
|
feedId: Schema.NumberFromString;
|
|
69
69
|
stickyPostId: Schema.NumberFromString;
|
|
70
|
-
}>>,
|
|
70
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
71
71
|
readonly is_active: Schema.decodeTo<Schema.Boolean, Schema.Literals<readonly ["true", "false"]>, never, never>;
|
|
72
72
|
readonly sticky_type: Schema.Literals<readonly ["pinned", "rotating"]>;
|
|
73
|
-
}>>,
|
|
73
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
74
74
|
readonly message: Schema.String;
|
|
75
|
-
}>>,
|
|
75
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"delete", "DELETE", "/app/api/v1/feed-management/sticky-posts/:feedId/:stickyPostId", Schema.toCodecStringTree<Schema.Struct<{
|
|
76
76
|
feedId: Schema.NumberFromString;
|
|
77
77
|
stickyPostId: Schema.NumberFromString;
|
|
78
|
-
}>>,
|
|
78
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
79
79
|
readonly message: Schema.String;
|
|
80
|
-
}>>,
|
|
80
|
+
}>>, never, never, never>, false>;
|
|
81
81
|
//# sourceMappingURL=stickyposts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stickyposts.d.ts","sourceRoot":"","sources":["../../src/stickyposts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAwB,MAAM,QAAQ,CAAC;AAStD,OAAO,KAAK,eAAe,MAAM,
|
|
1
|
+
{"version":3,"file":"stickyposts.d.ts","sourceRoot":"","sources":["../../src/stickyposts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAwB,MAAM,QAAQ,CAAC;AAStD,OAAO,KAAK,eAAe,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,YAAY,MAAM,8BAA8B,CAAC;AAa7D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAwC7B,CAAC"}
|
package/build/esm/GrazeClient.js
CHANGED
|
@@ -3,14 +3,14 @@ import { AlgoUpdateResponse, GetAlgoResponse, GetAlgorithmsResponse, HidePostBod
|
|
|
3
3
|
import { FeedIdParam, UserIdParam } from "./common.js";
|
|
4
4
|
import * as Form from "./schema/UpdateAlgorithmPayload.js";
|
|
5
5
|
import { StickyPostsApiGroup } from "./stickyposts.js";
|
|
6
|
-
import * as FetchHttpClient from "effect/
|
|
7
|
-
import * as HttpApi from "effect/
|
|
8
|
-
import * as HttpApiClient from "effect/
|
|
9
|
-
import * as HttpApiEndpoint from "effect/
|
|
10
|
-
import * as HttpApiGroup from "effect/
|
|
11
|
-
import * as HttpApiSchema from "effect/
|
|
12
|
-
import * as HttpClient from "effect/
|
|
13
|
-
import * as HttpClientRequest from "effect/
|
|
6
|
+
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
7
|
+
import * as HttpApi from "effect/http-api/HttpApi";
|
|
8
|
+
import * as HttpApiClient from "effect/http-api/HttpApiClient";
|
|
9
|
+
import * as HttpApiEndpoint from "effect/http-api/HttpApiEndpoint";
|
|
10
|
+
import * as HttpApiGroup from "effect/http-api/HttpApiGroup";
|
|
11
|
+
import * as HttpApiSchema from "effect/http-api/HttpApiSchema";
|
|
12
|
+
import * as HttpClient from "effect/http/HttpClient";
|
|
13
|
+
import * as HttpClientRequest from "effect/http/HttpClientRequest";
|
|
14
14
|
function isStringOrBlob(val) {
|
|
15
15
|
return typeof val === "string" || val instanceof Blob;
|
|
16
16
|
}
|
|
@@ -61,8 +61,8 @@ class GrazeApiDef extends HttpApi.make("grazeApi")
|
|
|
61
61
|
.add(StickyPostsApiGroup) {
|
|
62
62
|
}
|
|
63
63
|
const grazeLive = Effect.gen(function* () {
|
|
64
|
-
const baseUrl = yield* Config.
|
|
65
|
-
const cookie = yield* Config.
|
|
64
|
+
const baseUrl = yield* Config.URL("GRAZE_API_URL");
|
|
65
|
+
const cookie = yield* Config.Redacted("GRAZE_COOKIE");
|
|
66
66
|
const client = yield* HttpApiClient.make(GrazeApiDef, {
|
|
67
67
|
baseUrl: baseUrl.toString(),
|
|
68
68
|
transformClient: (client) => client.pipe(HttpClient.filterStatusOk, HttpClient.mapRequest(HttpClientRequest.setHeaders({
|
|
@@ -73,7 +73,7 @@ const grazeLive = Effect.gen(function* () {
|
|
|
73
73
|
const formData = yield* encodeForm(data);
|
|
74
74
|
return yield* client.updateAlgorithm({ payload: formData });
|
|
75
75
|
});
|
|
76
|
-
const userId = yield* Config.
|
|
76
|
+
const userId = yield* Config.Int("GRAZE_USER_ID");
|
|
77
77
|
const getFeeds = () => client.getFeeds({ query: { user_id: userId } });
|
|
78
78
|
return {
|
|
79
79
|
...client,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GrazeClient.js","sourceRoot":"","sources":["../../src/GrazeClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,cAAc,GACf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,IAAI,MAAM,oCAAoC,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,eAAe,MAAM,
|
|
1
|
+
{"version":3,"file":"GrazeClient.js","sourceRoot":"","sources":["../../src/GrazeClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,cAAc,GACf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,IAAI,MAAM,oCAAoC,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,eAAe,MAAM,iCAAiC,CAAC;AACnE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YAAY,CAK3D;CAAG"}
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI/C,MAAM,OAAO,YAAY;IACvB,OAAO,CAA6B;IACpC,QAAQ,CAA8B;IACtC,QAAQ,CAA8B;IACtC,UAAU,CAAgC;IAC1C,eAAe,CAAqC;IACpD,gBAAgB,CAAsC;IACtD,WAAW,CAKT;IAEF,YAAY,EACV,MAAM,EACN,MAAM,EACN,MAAM,GAKP;QACC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC;YACrB,CAAC,eAAe,EAAE,MAAM,CAAC;YACzB,CAAC,cAAc,EAAE,MAAM,CAAC;YACxB,CAAC,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;SACrC,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YAC5C,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YACzC,OAAO,MAAM,CAAC,OAAO,CACnB,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAClE,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC7C,MAAM,IAAI,GA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QACL,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,UAAU;QACV,eAAe;QACf,gBAAgB;QAChB,cAAc;QACd,gBAAgB;QAChB,gBAAgB;QAChB,gBAAgB;KACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC"}
|
package/build/esm/stickyposts.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Schema, SchemaTransformation } from "effect";
|
|
2
2
|
import { FeedIdParam } from "./common.js";
|
|
3
3
|
import { CreateStickyPostBody, GetStickyPostsBody, StickyPostIdParam, StickyPostSuccess, StickyType, } from "./schema/StickyPosts.js";
|
|
4
|
-
import * as HttpApiEndpoint from "effect/
|
|
5
|
-
import * as HttpApiGroup from "effect/
|
|
4
|
+
import * as HttpApiEndpoint from "effect/http-api/HttpApiEndpoint";
|
|
5
|
+
import * as HttpApiGroup from "effect/http-api/HttpApiGroup";
|
|
6
6
|
// v4 dropped `Schema.BooleanFromString`; decode the query strings "true"/"false".
|
|
7
7
|
const BooleanFromString = Schema.Literals(["true", "false"]).pipe(Schema.decodeTo(Schema.Boolean, SchemaTransformation.transform({
|
|
8
8
|
decode: (s) => s === "true",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stickyposts.js","sourceRoot":"","sources":["../../src/stickyposts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,E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H;KACA,GAAG,CACF,eAAe,CAAC,GAAG,CACjB,KAAK,EACL,kDAAkD,EAClD;IACE,MAAM,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE;IAC/B,OAAO,EAAE,kBAAkB;CAC5B,CACF,CACF;KACA,GAAG,CACF,eAAe,CAAC,GAAG,CACjB,QAAQ,EACR,gEAAgE,EAChE;IACE,MAAM,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE;IAChE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;QACnB,SAAS,EAAE,iBAAiB;QAC5B,WAAW,EAAE,UAAU;KACxB,CAAC;IACF,OAAO,EAAE,iBAAiB;CAC3B,CACF,CACF;KACA,GAAG,CACF,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAC5B,QAAQ,EACR,gEAAgE,EAChE;IACE,MAAM,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE;IAChE,OAAO,EAAE,iBAAiB;CAC3B,CACF,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graze-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A Typescript Graze API client.",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"effect": "^4.0.0
|
|
53
|
+
"effect": "^4.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@babel/cli": "^7.24.8",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"@changesets/cli": "^2.27.8",
|
|
63
63
|
"@effect/build-utils": "^0.8.9",
|
|
64
64
|
"@effect/eslint-plugin": "^0.3.2",
|
|
65
|
-
"@effect/language-service": "^0.
|
|
66
|
-
"@effect/vitest": "4.0.
|
|
65
|
+
"@effect/language-service": "^0.87.5",
|
|
66
|
+
"@effect/vitest": "4.0.5",
|
|
67
67
|
"@eslint/compat": "1.1.1",
|
|
68
68
|
"@eslint/eslintrc": "3.1.0",
|
|
69
69
|
"@eslint/js": "9.10.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"eslint-plugin-sort-destructure-keys": "^2.0.0",
|
|
80
80
|
"tsx": "^4.17.0",
|
|
81
81
|
"typescript": "^5.6.2",
|
|
82
|
-
"vitest": "^
|
|
83
|
-
"effect": "4.0.
|
|
82
|
+
"vitest": "^4.1.11",
|
|
83
|
+
"effect": "4.0.5"
|
|
84
84
|
}
|
|
85
85
|
}
|
package/src/GrazeClient.ts
CHANGED
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
import { FeedIdParam, UserIdParam } from "./common.js";
|
|
11
11
|
import * as Form from "./schema/UpdateAlgorithmPayload.js";
|
|
12
12
|
import { StickyPostsApiGroup } from "./stickyposts.js";
|
|
13
|
-
import * as FetchHttpClient from "effect/
|
|
14
|
-
import * as HttpApi from "effect/
|
|
15
|
-
import * as HttpApiClient from "effect/
|
|
16
|
-
import * as HttpApiEndpoint from "effect/
|
|
17
|
-
import * as HttpApiGroup from "effect/
|
|
18
|
-
import * as HttpApiSchema from "effect/
|
|
19
|
-
import * as HttpClient from "effect/
|
|
20
|
-
import * as HttpClientRequest from "effect/
|
|
13
|
+
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
14
|
+
import * as HttpApi from "effect/http-api/HttpApi";
|
|
15
|
+
import * as HttpApiClient from "effect/http-api/HttpApiClient";
|
|
16
|
+
import * as HttpApiEndpoint from "effect/http-api/HttpApiEndpoint";
|
|
17
|
+
import * as HttpApiGroup from "effect/http-api/HttpApiGroup";
|
|
18
|
+
import * as HttpApiSchema from "effect/http-api/HttpApiSchema";
|
|
19
|
+
import * as HttpClient from "effect/http/HttpClient";
|
|
20
|
+
import * as HttpClientRequest from "effect/http/HttpClientRequest";
|
|
21
21
|
|
|
22
22
|
function isStringOrBlob(val: unknown): val is string | Blob {
|
|
23
23
|
return typeof val === "string" || val instanceof Blob;
|
|
@@ -85,8 +85,8 @@ class GrazeApiDef extends HttpApi.make("grazeApi")
|
|
|
85
85
|
.add(StickyPostsApiGroup) {}
|
|
86
86
|
|
|
87
87
|
const grazeLive = Effect.gen(function* () {
|
|
88
|
-
const baseUrl = yield* Config.
|
|
89
|
-
const cookie = yield* Config.
|
|
88
|
+
const baseUrl = yield* Config.URL("GRAZE_API_URL");
|
|
89
|
+
const cookie = yield* Config.Redacted("GRAZE_COOKIE");
|
|
90
90
|
|
|
91
91
|
const client = yield* HttpApiClient.make(GrazeApiDef, {
|
|
92
92
|
baseUrl: baseUrl.toString(),
|
|
@@ -107,7 +107,7 @@ const grazeLive = Effect.gen(function* () {
|
|
|
107
107
|
return yield* client.updateAlgorithm({ payload: formData });
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
-
const userId = yield* Config.
|
|
110
|
+
const userId = yield* Config.Int("GRAZE_USER_ID");
|
|
111
111
|
const getFeeds = () => client.getFeeds({ query: { user_id: userId } });
|
|
112
112
|
|
|
113
113
|
return {
|