graze-client 0.7.2 → 0.7.3

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.
@@ -61,6 +61,158 @@ declare const GrazeClient_base: Effect.Service.Class<GrazeClient, "GrazeClient",
61
61
  };
62
62
  }[];
63
63
  }, unknown, never>;
64
+ stickyposts: {
65
+ readonly create: <WithResponse extends boolean = false>(request: {
66
+ readonly payload: {
67
+ readonly algo_id: number;
68
+ readonly is_active: boolean;
69
+ readonly sticky_type: "pinned" | "rotating";
70
+ readonly post_url: string;
71
+ readonly stopping_criteria?: {
72
+ readonly expiration_time?: number | undefined;
73
+ } | undefined;
74
+ };
75
+ readonly withResponse?: WithResponse;
76
+ }) => Effect.Effect<WithResponse extends true ? [{
77
+ readonly message: string;
78
+ }, import("@effect/platform/HttpClientResponse").HttpClientResponse] : {
79
+ readonly message: string;
80
+ }, unknown, never>;
81
+ readonly get: <WithResponse extends boolean = false>(request: {
82
+ readonly path: {
83
+ readonly feedId: number;
84
+ };
85
+ readonly withResponse?: WithResponse;
86
+ }) => Effect.Effect<WithResponse extends true ? [{
87
+ readonly sticky_posts: readonly {
88
+ readonly id: number;
89
+ readonly created_at: string;
90
+ readonly updated_at: string;
91
+ readonly post: {
92
+ readonly embed: any;
93
+ readonly labels: any;
94
+ readonly $type: string;
95
+ readonly viewer: any;
96
+ readonly cid: string;
97
+ readonly uri: string;
98
+ readonly author: {
99
+ readonly labels: readonly any[];
100
+ readonly did: string;
101
+ readonly $type: string;
102
+ readonly avatar: string;
103
+ readonly handle: string;
104
+ readonly viewer: any;
105
+ readonly createdAt: string;
106
+ readonly associated: any;
107
+ readonly displayName: string;
108
+ };
109
+ readonly record: {
110
+ readonly text: string;
111
+ readonly reply: any;
112
+ readonly embed: any;
113
+ readonly labels: any;
114
+ readonly $type: string;
115
+ readonly createdAt: string;
116
+ readonly tags: any;
117
+ readonly langs: readonly string[];
118
+ readonly facets: readonly any[];
119
+ readonly entities: any;
120
+ };
121
+ readonly indexedAt: string;
122
+ readonly likeCount: number;
123
+ readonly quoteCount: number;
124
+ readonly replyCount: number;
125
+ readonly threadgate: unknown;
126
+ readonly repostCount: number;
127
+ };
128
+ readonly uri: string;
129
+ readonly author: string;
130
+ readonly is_active: boolean;
131
+ readonly sticky_type: "pinned" | "rotating";
132
+ readonly stopping_criteria?: {
133
+ readonly expiration_time?: number | undefined;
134
+ } | undefined;
135
+ readonly hidden: boolean;
136
+ }[];
137
+ }, import("@effect/platform/HttpClientResponse").HttpClientResponse] : {
138
+ readonly sticky_posts: readonly {
139
+ readonly id: number;
140
+ readonly created_at: string;
141
+ readonly updated_at: string;
142
+ readonly post: {
143
+ readonly embed: any;
144
+ readonly labels: any;
145
+ readonly $type: string;
146
+ readonly viewer: any;
147
+ readonly cid: string;
148
+ readonly uri: string;
149
+ readonly author: {
150
+ readonly labels: readonly any[];
151
+ readonly did: string;
152
+ readonly $type: string;
153
+ readonly avatar: string;
154
+ readonly handle: string;
155
+ readonly viewer: any;
156
+ readonly createdAt: string;
157
+ readonly associated: any;
158
+ readonly displayName: string;
159
+ };
160
+ readonly record: {
161
+ readonly text: string;
162
+ readonly reply: any;
163
+ readonly embed: any;
164
+ readonly labels: any;
165
+ readonly $type: string;
166
+ readonly createdAt: string;
167
+ readonly tags: any;
168
+ readonly langs: readonly string[];
169
+ readonly facets: readonly any[];
170
+ readonly entities: any;
171
+ };
172
+ readonly indexedAt: string;
173
+ readonly likeCount: number;
174
+ readonly quoteCount: number;
175
+ readonly replyCount: number;
176
+ readonly threadgate: unknown;
177
+ readonly repostCount: number;
178
+ };
179
+ readonly uri: string;
180
+ readonly author: string;
181
+ readonly is_active: boolean;
182
+ readonly sticky_type: "pinned" | "rotating";
183
+ readonly stopping_criteria?: {
184
+ readonly expiration_time?: number | undefined;
185
+ } | undefined;
186
+ readonly hidden: boolean;
187
+ }[];
188
+ }, unknown, never>;
189
+ readonly update: <WithResponse extends boolean = false>(request: {
190
+ readonly path: {
191
+ readonly feedId: number;
192
+ readonly stickyPostId: number;
193
+ };
194
+ readonly urlParams: {
195
+ readonly is_active: boolean;
196
+ readonly sticky_type: "pinned" | "rotating";
197
+ };
198
+ readonly withResponse?: WithResponse;
199
+ }) => Effect.Effect<WithResponse extends true ? [{
200
+ readonly message: string;
201
+ }, import("@effect/platform/HttpClientResponse").HttpClientResponse] : {
202
+ readonly message: string;
203
+ }, unknown, never>;
204
+ readonly delete: <WithResponse extends boolean = false>(request: {
205
+ readonly path: {
206
+ readonly feedId: number;
207
+ readonly stickyPostId: number;
208
+ };
209
+ readonly withResponse?: WithResponse;
210
+ }) => Effect.Effect<WithResponse extends true ? [{
211
+ readonly message: string;
212
+ }, import("@effect/platform/HttpClientResponse").HttpClientResponse] : {
213
+ readonly message: string;
214
+ }, unknown, never>;
215
+ };
64
216
  getFeed: <WithResponse extends boolean = false>(request: {
65
217
  readonly path: {
66
218
  readonly feedId: number;
@@ -141,156 +293,6 @@ declare const GrazeClient_base: Effect.Service.Class<GrazeClient, "GrazeClient",
141
293
  };
142
294
  readonly withResponse?: WithResponse;
143
295
  }) => Effect.Effect<WithResponse extends true ? [unknown, import("@effect/platform/HttpClientResponse").HttpClientResponse] : unknown, unknown, never>;
144
- createStickyPost: <WithResponse extends boolean = false>(request: {
145
- readonly payload: {
146
- readonly algo_id: number;
147
- readonly is_active: boolean;
148
- readonly sticky_type: "pinned" | "rotating";
149
- readonly post_url: string;
150
- readonly stopping_criteria?: {
151
- readonly expiration_time: number;
152
- } | undefined;
153
- };
154
- readonly withResponse?: WithResponse;
155
- }) => Effect.Effect<WithResponse extends true ? [{
156
- readonly message: string;
157
- }, import("@effect/platform/HttpClientResponse").HttpClientResponse] : {
158
- readonly message: string;
159
- }, unknown, never>;
160
- getStickyPosts: <WithResponse extends boolean = false>(request: {
161
- readonly path: {
162
- readonly feedId: number;
163
- };
164
- readonly withResponse?: WithResponse;
165
- }) => Effect.Effect<WithResponse extends true ? [{
166
- readonly sticky_posts: readonly {
167
- readonly id: number;
168
- readonly created_at: string;
169
- readonly updated_at: string;
170
- readonly post: {
171
- readonly embed: any;
172
- readonly labels: any;
173
- readonly $type: string;
174
- readonly viewer: any;
175
- readonly cid: string;
176
- readonly uri: string;
177
- readonly author: {
178
- readonly labels: readonly any[];
179
- readonly did: string;
180
- readonly $type: string;
181
- readonly avatar: string;
182
- readonly handle: string;
183
- readonly viewer: any;
184
- readonly createdAt: string;
185
- readonly associated: any;
186
- readonly displayName: string;
187
- };
188
- readonly record: {
189
- readonly text: string;
190
- readonly reply: any;
191
- readonly embed: any;
192
- readonly labels: any;
193
- readonly $type: string;
194
- readonly createdAt: string;
195
- readonly tags: any;
196
- readonly langs: readonly string[];
197
- readonly facets: readonly any[];
198
- readonly entities: any;
199
- };
200
- readonly indexedAt: string;
201
- readonly likeCount: number;
202
- readonly quoteCount: number;
203
- readonly replyCount: number;
204
- readonly threadgate: unknown;
205
- readonly repostCount: number;
206
- };
207
- readonly uri: string;
208
- readonly author: string;
209
- readonly is_active: boolean;
210
- readonly sticky_type: "pinned" | "rotating";
211
- readonly stopping_criteria?: {
212
- readonly expiration_time: number;
213
- } | undefined;
214
- readonly hidden: boolean;
215
- }[];
216
- }, import("@effect/platform/HttpClientResponse").HttpClientResponse] : {
217
- readonly sticky_posts: readonly {
218
- readonly id: number;
219
- readonly created_at: string;
220
- readonly updated_at: string;
221
- readonly post: {
222
- readonly embed: any;
223
- readonly labels: any;
224
- readonly $type: string;
225
- readonly viewer: any;
226
- readonly cid: string;
227
- readonly uri: string;
228
- readonly author: {
229
- readonly labels: readonly any[];
230
- readonly did: string;
231
- readonly $type: string;
232
- readonly avatar: string;
233
- readonly handle: string;
234
- readonly viewer: any;
235
- readonly createdAt: string;
236
- readonly associated: any;
237
- readonly displayName: string;
238
- };
239
- readonly record: {
240
- readonly text: string;
241
- readonly reply: any;
242
- readonly embed: any;
243
- readonly labels: any;
244
- readonly $type: string;
245
- readonly createdAt: string;
246
- readonly tags: any;
247
- readonly langs: readonly string[];
248
- readonly facets: readonly any[];
249
- readonly entities: any;
250
- };
251
- readonly indexedAt: string;
252
- readonly likeCount: number;
253
- readonly quoteCount: number;
254
- readonly replyCount: number;
255
- readonly threadgate: unknown;
256
- readonly repostCount: number;
257
- };
258
- readonly uri: string;
259
- readonly author: string;
260
- readonly is_active: boolean;
261
- readonly sticky_type: "pinned" | "rotating";
262
- readonly stopping_criteria?: {
263
- readonly expiration_time: number;
264
- } | undefined;
265
- readonly hidden: boolean;
266
- }[];
267
- }, unknown, never>;
268
- updateStickyPost: <WithResponse extends boolean = false>(request: {
269
- readonly path: {
270
- readonly feedId: number;
271
- readonly stickyPostId: number;
272
- };
273
- readonly urlParams: {
274
- readonly is_active: boolean;
275
- readonly sticky_type: "pinned" | "rotating";
276
- };
277
- readonly withResponse?: WithResponse;
278
- }) => Effect.Effect<WithResponse extends true ? [{
279
- readonly message: string;
280
- }, import("@effect/platform/HttpClientResponse").HttpClientResponse] : {
281
- readonly message: string;
282
- }, unknown, never>;
283
- deleteStickyPost: <WithResponse extends boolean = false>(request: {
284
- readonly path: {
285
- readonly feedId: number;
286
- readonly stickyPostId: number;
287
- };
288
- readonly withResponse?: WithResponse;
289
- }) => Effect.Effect<WithResponse extends true ? [{
290
- readonly message: string;
291
- }, import("@effect/platform/HttpClientResponse").HttpClientResponse] : {
292
- readonly message: string;
293
- }, unknown, never>;
294
296
  }, import("effect/ConfigError").ConfigError, HttpClient.HttpClient>;
295
297
  readonly dependencies: readonly [import("effect/Layer").Layer<HttpClient.HttpClient, never, never>];
296
298
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"GrazeClient.d.ts","sourceRoot":"","sources":["../../src/GrazeClient.ts"],"names":[],"mappings":"AAOA,OAAO,EAOL,UAAU,EAEX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAgB,MAAM,EAAoB,MAAM,QAAQ,CAAC;AAEhE,OAAO,KAAK,IAAI,MAAM,oCAAoC,CAAC;;;gCAyH1B,IAAI,CAAC,Q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ED,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"}
@@ -0,0 +1,5 @@
1
+ import { HttpApiSchema } from "@effect/platform";
2
+ import { Schema } from "effect";
3
+ export declare const UserIdParam: HttpApiSchema.Param<"userId", typeof Schema.NumberFromString>;
4
+ export declare const FeedIdParam: HttpApiSchema.Param<"feedId", typeof Schema.NumberFromString>;
5
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,WAAW,+DAGvB,CAAC;AACF,eAAO,MAAM,WAAW,+DAGvB,CAAC"}
@@ -3,7 +3,7 @@ import { HttpApiSchema } from "@effect/platform";
3
3
  export declare const StickyPostIdParam: HttpApiSchema.Param<"stickyPostId", typeof S.NumberFromString>;
4
4
  export type StickyPostIdParam = typeof StickyPostIdParam.Type;
5
5
  export declare const StoppingCriteria: S.Struct<{
6
- expiration_time: typeof S.Number;
6
+ expiration_time: S.optional<typeof S.Number>;
7
7
  }>;
8
8
  export type StoppingCriteria = typeof StoppingCriteria.Type;
9
9
  export declare const StickyType: S.Literal<["pinned", "rotating"]>;
@@ -14,14 +14,14 @@ export declare const CreateStickyPostBody: S.Struct<{
14
14
  algo_id: typeof S.Number;
15
15
  post_url: typeof S.String;
16
16
  stopping_criteria: S.optional<S.Struct<{
17
- expiration_time: typeof S.Number;
17
+ expiration_time: S.optional<typeof S.Number>;
18
18
  }>>;
19
19
  }>;
20
20
  export type CreateStickyPostBody = typeof CreateStickyPostBody.Type;
21
21
  export declare const GetStickyPostsBody: S.Struct<{
22
22
  sticky_posts: S.Array$<S.Struct<{
23
23
  stopping_criteria: S.optional<S.Struct<{
24
- expiration_time: typeof S.Number;
24
+ expiration_time: S.optional<typeof S.Number>;
25
25
  }>>;
26
26
  hidden: typeof S.Boolean;
27
27
  uri: typeof S.String;
@@ -0,0 +1,79 @@
1
+ import { HttpApiGroup, HttpApiEndpoint } from "@effect/platform";
2
+ export declare const StickyPostsApiGroup: HttpApiGroup.HttpApiGroup<"stickyposts", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
3
+ readonly algo_id: number;
4
+ readonly is_active: boolean;
5
+ readonly sticky_type: "pinned" | "rotating";
6
+ readonly post_url: string;
7
+ readonly stopping_criteria?: {
8
+ readonly expiration_time?: number | undefined;
9
+ } | undefined;
10
+ }, never, {
11
+ readonly message: string;
12
+ }, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"get", "GET", {
13
+ readonly feedId: number;
14
+ }, never, never, never, {
15
+ readonly sticky_posts: readonly {
16
+ readonly id: number;
17
+ readonly created_at: string;
18
+ readonly updated_at: string;
19
+ readonly post: {
20
+ readonly embed: any;
21
+ readonly labels: any;
22
+ readonly $type: string;
23
+ readonly viewer: any;
24
+ readonly cid: string;
25
+ readonly uri: string;
26
+ readonly author: {
27
+ readonly labels: readonly any[];
28
+ readonly did: string;
29
+ readonly $type: string;
30
+ readonly avatar: string;
31
+ readonly handle: string;
32
+ readonly viewer: any;
33
+ readonly createdAt: string;
34
+ readonly associated: any;
35
+ readonly displayName: string;
36
+ };
37
+ readonly record: {
38
+ readonly text: string;
39
+ readonly reply: any;
40
+ readonly embed: any;
41
+ readonly labels: any;
42
+ readonly $type: string;
43
+ readonly createdAt: string;
44
+ readonly tags: any;
45
+ readonly langs: readonly string[];
46
+ readonly facets: readonly any[];
47
+ readonly entities: any;
48
+ };
49
+ readonly indexedAt: string;
50
+ readonly likeCount: number;
51
+ readonly quoteCount: number;
52
+ readonly replyCount: number;
53
+ readonly threadgate: unknown;
54
+ readonly repostCount: number;
55
+ };
56
+ readonly uri: string;
57
+ readonly author: string;
58
+ readonly is_active: boolean;
59
+ readonly sticky_type: "pinned" | "rotating";
60
+ readonly stopping_criteria?: {
61
+ readonly expiration_time?: number | undefined;
62
+ } | undefined;
63
+ readonly hidden: boolean;
64
+ }[];
65
+ }, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"update", "PUT", {
66
+ readonly feedId: number;
67
+ readonly stickyPostId: number;
68
+ }, {
69
+ readonly is_active: boolean;
70
+ readonly sticky_type: "pinned" | "rotating";
71
+ }, never, never, {
72
+ readonly message: string;
73
+ }, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"delete", "DELETE", {
74
+ readonly feedId: number;
75
+ readonly stickyPostId: number;
76
+ }, never, never, never, {
77
+ readonly message: string;
78
+ }, never, never, never>, never, never, false>;
79
+ //# sourceMappingURL=stickyposts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stickyposts.d.ts","sourceRoot":"","sources":["../../src/stickyposts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAWjE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CA+B7B,CAAC"}
@@ -2,7 +2,8 @@ import { AlgoUpdateResponse, GetAlgoResponse, GetAlgorithmsResponse, HidePostBod
2
2
  import { FetchHttpClient, HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup, HttpApiSchema, HttpClient, HttpClientRequest, } from "@effect/platform";
3
3
  import { Config, Data, Effect, Redacted, Schema } from "effect";
4
4
  import * as Form from "./schema/UpdateAlgorithmPayload.js";
5
- import { CreateStickyPostBody, GetStickyPostsBody, StickyPostIdParam, StickyPostSuccess, StickyType, } from "./schema/StickyPosts.js";
5
+ import { FeedIdParam, UserIdParam } from "./common.js";
6
+ import { StickyPostsApiGroup } from "./stickyposts.js";
6
7
  function isStringOrBlob(val) {
7
8
  return typeof val === "string" || val instanceof Blob;
8
9
  }
@@ -19,8 +20,6 @@ const encodeForm = (obj) => Effect.gen(function* () {
19
20
  }
20
21
  return formData;
21
22
  });
22
- const UserIdParam = HttpApiSchema.param("userId", Schema.NumberFromString);
23
- const FeedIdParam = HttpApiSchema.param("feedId", Schema.NumberFromString);
24
23
  const GrazeApiGroup = HttpApiGroup.make("graze", { topLevel: true })
25
24
  .add(HttpApiEndpoint.get("getFeeds") `/app/my_feeds`
26
25
  .addSuccess(GetAlgorithmsResponse)
@@ -37,20 +36,10 @@ const GrazeApiGroup = HttpApiGroup.make("graze", { topLevel: true })
37
36
  .addSuccess(Schema.Unknown))
38
37
  .add(HttpApiEndpoint.post("unhidePost") `/app/unhide_post`
39
38
  .setPayload(UnhidePostBody)
40
- .addSuccess(Schema.Unknown))
41
- .add(HttpApiEndpoint.post("createStickyPost") `/app/api/v1/feed-management/sticky-posts`
42
- .setPayload(CreateStickyPostBody)
43
- .addSuccess(StickyPostSuccess))
44
- .add(HttpApiEndpoint.get("getStickyPosts") `/app/api/v1/feed-management/sticky-posts/${FeedIdParam}`.addSuccess(GetStickyPostsBody))
45
- .add(HttpApiEndpoint.put("updateStickyPost") `/app/api/v1/feed-management/sticky-posts/${FeedIdParam}/${StickyPostIdParam}`
46
- .setUrlParams(Schema.Struct({
47
- is_active: Schema.BooleanFromString,
48
- sticky_type: StickyType,
49
- }))
50
- .addSuccess(StickyPostSuccess))
51
- .add(HttpApiEndpoint.del("deleteStickyPost") `/app/api/v1/feed-management/sticky-posts/${FeedIdParam}/${StickyPostIdParam}`.addSuccess(StickyPostSuccess));
39
+ .addSuccess(Schema.Unknown));
52
40
  class GrazeApiDef extends HttpApi.make("grazeApi")
53
41
  .add(GrazeApiGroup)
42
+ .add(StickyPostsApiGroup)
54
43
  .addError(Schema.Unknown) {
55
44
  }
56
45
  const grazeLive = Effect.gen(function* () {
@@ -1 +1 @@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0 +1,5 @@
1
+ import { HttpApiSchema } from "@effect/platform";
2
+ import { Schema } from "effect";
3
+ export const UserIdParam = HttpApiSchema.param("userId", Schema.NumberFromString);
4
+ export const FeedIdParam = HttpApiSchema.param("feedId", Schema.NumberFromString);
5
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,KAAK,CAC5C,QAAQ,EACR,MAAM,CAAC,gBAAgB,CACxB,CAAC;AACF,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,KAAK,CAC5C,QAAQ,EACR,MAAM,CAAC,gBAAgB,CACxB,CAAC"}
@@ -3,7 +3,7 @@ import { Post } from "./Post.js";
3
3
  import { HttpApiSchema } from "@effect/platform";
4
4
  export const StickyPostIdParam = HttpApiSchema.param("stickyPostId", S.NumberFromString);
5
5
  export const StoppingCriteria = S.Struct({
6
- expiration_time: S.Number,
6
+ expiration_time: S.Number.pipe(S.optional),
7
7
  });
8
8
  export const StickyType = S.Literal("pinned", "rotating");
9
9
  const StickyPostBase = S.Struct({
@@ -1 +1 @@
1
- {"version":3,"file":"StickyPosts.js","sourceRoot":"","sources":["../../../src/schema/StickyPosts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC,KAAK,CAClD,cAAc,EACd,CAAC,CAAC,gBAAgB,CACnB,CAAC;AAGF,MAAM,CAAC,MAAM,gBAAgB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C,OAAO;QACjB,GAAG,EAAE,CAAC,CAAC,MAAM;QACb,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,UAAU,EAAE,CAAC,CAAC,MAAM;QACpB,UAAU,EAAE,CAAC,CAAC,MAAM;KACrB,CAAC,CACH;CACF,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,OAAO,EAAE,CAAC,CAAC,MAAM;CAClB,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { HttpApiGroup, HttpApiEndpoint } from "@effect/platform";
2
+ import { Schema } from "effect";
3
+ import { CreateStickyPostBody, GetStickyPostsBody, StickyPostIdParam, StickyPostSuccess, StickyType, } from "./schema/StickyPosts.js";
4
+ import { FeedIdParam } from "./common.js";
5
+ export const StickyPostsApiGroup = HttpApiGroup.make("stickyposts")
6
+ .add(HttpApiEndpoint.post("create") `/app/api/v1/feed-management/sticky-posts`
7
+ .setPayload(CreateStickyPostBody)
8
+ .addSuccess(StickyPostSuccess))
9
+ .add(HttpApiEndpoint.get("get") `/app/api/v1/feed-management/sticky-posts/${FeedIdParam}`.addSuccess(GetStickyPostsBody))
10
+ .add(HttpApiEndpoint.put("update") `/app/api/v1/feed-management/sticky-posts/${FeedIdParam}/${StickyPostIdParam}`
11
+ .setUrlParams(Schema.Struct({
12
+ is_active: Schema.BooleanFromString,
13
+ sticky_type: StickyType,
14
+ }))
15
+ .addSuccess(StickyPostSuccess))
16
+ .add(HttpApiEndpoint.del("delete") `/app/api/v1/feed-management/sticky-posts/${FeedIdParam}/${StickyPostIdParam}`.addSuccess(StickyPostSuccess));
17
+ //# sourceMappingURL=stickyposts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stickyposts.js","sourceRoot":"","sources":["../../src/stickyposts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,GACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC;KAChE,GAAG,CACF,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA,0CAA0C;KACrE,UAAU,CAAC,oBAAoB,CAAC;KAChC,UAAU,CAAC,iBAAiB,CAAC,CACjC;KACA,GAAG,CACF,eAAe,CAAC,GAAG,CACjB,KAAK,CACN,CAAA,4CAA4C,WAAW,EAAE,CAAC,UAAU,CACnE,kBAAkB,CACnB,CACF;KACA,GAAG,CACF,eAAe,CAAC,GAAG,CACjB,QAAQ,CACT,CAAA,4CAA4C,WAAW,IAAI,iBAAiB,EAAE;KAC5E,YAAY,CACX,MAAM,CAAC,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC,iBAAiB;IACnC,WAAW,EAAE,UAAU;CACxB,CAAC,CACH;KACA,UAAU,CAAC,iBAAiB,CAAC,CACjC;KACA,GAAG,CACF,eAAe,CAAC,GAAG,CACjB,QAAQ,CACT,CAAA,4CAA4C,WAAW,IAAI,iBAAiB,EAAE,CAAC,UAAU,CACxF,iBAAiB,CAClB,CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graze-client",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "A Typescript Graze API client.",
@@ -18,13 +18,8 @@ import {
18
18
  import { Config, Data, Effect, Redacted, Schema } from "effect";
19
19
 
20
20
  import * as Form from "./schema/UpdateAlgorithmPayload.js";
21
- import {
22
- CreateStickyPostBody,
23
- GetStickyPostsBody,
24
- StickyPostIdParam,
25
- StickyPostSuccess,
26
- StickyType,
27
- } from "./schema/StickyPosts.js";
21
+ import { FeedIdParam, UserIdParam } from "./common.js";
22
+ import { StickyPostsApiGroup } from "./stickyposts.js";
28
23
 
29
24
  function isStringOrBlob(val: unknown): val is string | Blob {
30
25
  return typeof val === "string" || val instanceof Blob;
@@ -45,9 +40,6 @@ const encodeForm = (obj: Form.FullForm) =>
45
40
  return formData;
46
41
  });
47
42
 
48
- const UserIdParam = HttpApiSchema.param("userId", Schema.NumberFromString);
49
- const FeedIdParam = HttpApiSchema.param("feedId", Schema.NumberFromString);
50
-
51
43
  const GrazeApiGroup = HttpApiGroup.make("graze", { topLevel: true })
52
44
  .add(
53
45
  HttpApiEndpoint.get("getFeeds")`/app/my_feeds`
@@ -82,43 +74,11 @@ const GrazeApiGroup = HttpApiGroup.make("graze", { topLevel: true })
82
74
  HttpApiEndpoint.post("unhidePost")`/app/unhide_post`
83
75
  .setPayload(UnhidePostBody)
84
76
  .addSuccess(Schema.Unknown)
85
- )
86
- .add(
87
- HttpApiEndpoint.post(
88
- "createStickyPost"
89
- )`/app/api/v1/feed-management/sticky-posts`
90
- .setPayload(CreateStickyPostBody)
91
- .addSuccess(StickyPostSuccess)
92
- )
93
- .add(
94
- HttpApiEndpoint.get(
95
- "getStickyPosts"
96
- )`/app/api/v1/feed-management/sticky-posts/${FeedIdParam}`.addSuccess(
97
- GetStickyPostsBody
98
- )
99
- )
100
- .add(
101
- HttpApiEndpoint.put(
102
- "updateStickyPost"
103
- )`/app/api/v1/feed-management/sticky-posts/${FeedIdParam}/${StickyPostIdParam}`
104
- .setUrlParams(
105
- Schema.Struct({
106
- is_active: Schema.BooleanFromString,
107
- sticky_type: StickyType,
108
- })
109
- )
110
- .addSuccess(StickyPostSuccess)
111
- )
112
- .add(
113
- HttpApiEndpoint.del(
114
- "deleteStickyPost"
115
- )`/app/api/v1/feed-management/sticky-posts/${FeedIdParam}/${StickyPostIdParam}`.addSuccess(
116
- StickyPostSuccess
117
- )
118
77
  );
119
78
 
120
79
  class GrazeApiDef extends HttpApi.make("grazeApi")
121
80
  .add(GrazeApiGroup)
81
+ .add(StickyPostsApiGroup)
122
82
  .addError(Schema.Unknown) {}
123
83
 
124
84
  const grazeLive = Effect.gen(function* () {
package/src/common.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { HttpApiSchema } from "@effect/platform";
2
+ import { Schema } from "effect";
3
+
4
+ export const UserIdParam = HttpApiSchema.param(
5
+ "userId",
6
+ Schema.NumberFromString
7
+ );
8
+ export const FeedIdParam = HttpApiSchema.param(
9
+ "feedId",
10
+ Schema.NumberFromString
11
+ );
@@ -9,7 +9,7 @@ export const StickyPostIdParam = HttpApiSchema.param(
9
9
  export type StickyPostIdParam = typeof StickyPostIdParam.Type;
10
10
 
11
11
  export const StoppingCriteria = S.Struct({
12
- expiration_time: S.Number,
12
+ expiration_time: S.Number.pipe(S.optional),
13
13
  });
14
14
  export type StoppingCriteria = typeof StoppingCriteria.Type;
15
15
 
@@ -0,0 +1,43 @@
1
+ import { HttpApiGroup, HttpApiEndpoint } from "@effect/platform";
2
+ import { Schema } from "effect";
3
+ import {
4
+ CreateStickyPostBody,
5
+ GetStickyPostsBody,
6
+ StickyPostIdParam,
7
+ StickyPostSuccess,
8
+ StickyType,
9
+ } from "./schema/StickyPosts.js";
10
+ import { FeedIdParam } from "./common.js";
11
+
12
+ export const StickyPostsApiGroup = HttpApiGroup.make("stickyposts")
13
+ .add(
14
+ HttpApiEndpoint.post("create")`/app/api/v1/feed-management/sticky-posts`
15
+ .setPayload(CreateStickyPostBody)
16
+ .addSuccess(StickyPostSuccess)
17
+ )
18
+ .add(
19
+ HttpApiEndpoint.get(
20
+ "get"
21
+ )`/app/api/v1/feed-management/sticky-posts/${FeedIdParam}`.addSuccess(
22
+ GetStickyPostsBody
23
+ )
24
+ )
25
+ .add(
26
+ HttpApiEndpoint.put(
27
+ "update"
28
+ )`/app/api/v1/feed-management/sticky-posts/${FeedIdParam}/${StickyPostIdParam}`
29
+ .setUrlParams(
30
+ Schema.Struct({
31
+ is_active: Schema.BooleanFromString,
32
+ sticky_type: StickyType,
33
+ })
34
+ )
35
+ .addSuccess(StickyPostSuccess)
36
+ )
37
+ .add(
38
+ HttpApiEndpoint.del(
39
+ "delete"
40
+ )`/app/api/v1/feed-management/sticky-posts/${FeedIdParam}/${StickyPostIdParam}`.addSuccess(
41
+ StickyPostSuccess
42
+ )
43
+ );