MCPcopy Create free account
hub / github.com/effect-app/libs / UsersApi

Class UsersApi

repos/effect/packages/platform-node/test/HttpApi.test.ts:1590–1650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1588).prefix("/groups") {}
1589
1590class UsersApi extends HttpApiGroup.make("users")
1591 .add(
1592 HttpApiEndpoint.get("findById", "/:id", {
1593 params: {
1594 id: Schema.Finite
1595 },
1596 success: User,
1597 error: UserError
1598 }),
1599 HttpApiEndpoint.post("create", "/", {
1600 payload: Schema.Struct(Struct.omit(User.fields, ["id", "createdAt"])),
1601 query: {
1602 id: Schema.Finite
1603 },
1604 success: User,
1605 error: [UserError, UserError]
1606 }),
1607 HttpApiEndpoint.get("list", "/", {
1608 headers: {
1609 page: Schema.Finite.pipe(
1610 Schema.optionalKey,
1611 Schema.decode({
1612 decode: SchemaGetter.withDefault(Effect.succeed(1)),
1613 encode: SchemaGetter.passthrough()
1614 })
1615 )
1616 },
1617 query: {
1618 query: Schema.optional(Schema.String).annotate({ description: "search query" })
1619 },
1620 success: Schema.Array(User),
1621 error: NoStatusError
1622 })
1623 .annotate(OpenApi.Deprecated, true)
1624 .annotate(OpenApi.Summary, "test summary")
1625 .annotateMerge(OpenApi.annotations({ identifier: "listUsers" })),
1626 HttpApiEndpoint.post("upload", "/upload/:0?", {
1627 params: {
1628 0: Schema.optional(Schema.String)
1629 },
1630 payload: Schema.Struct({
1631 file: Multipart.SingleFileSchema
1632 }).pipe(HttpApiSchema.asMultipart()),
1633 success: Schema.Struct({
1634 contentType: Schema.String,
1635 length: Schema.Int
1636 })
1637 }),
1638 HttpApiEndpoint.post("uploadStream", `/uploadstream`, {
1639 payload: Schema.Struct({
1640 file: Multipart.SingleFileSchema
1641 }).pipe(HttpApiSchema.asMultipartStream()),
1642 success: Schema.Struct({
1643 contentType: Schema.String,
1644 length: Schema.Int
1645 })
1646 })
1647 )

Callers

nothing calls this directly

Calls 9

annotateMergeMethod · 0.65
middlewareMethod · 0.65
addMethod · 0.65
makeMethod · 0.65
getMethod · 0.65
omitMethod · 0.65
annotateMethod · 0.65
pipeMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…