1.2.6 • Published 3 years ago

zodios-api-shorthand v1.2.6

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Why?

This library is a helper to shorten the Zodios API definition, so instead of writing:

makeApi([
  {
    method: "get",
    name: "getTransactions",
    path: "/v1/transactions",
    parameters: [
      {
        type: "Query",
        name: "limit",
        schema: z.number(),
      },
      {
        type: "Query",
        name: "offset",
        schema: z.number(),
      },
    ],
    response: z.string(),
  },
]);

You can write:

api({
  "GET transactions": {
    path: "/v1/transactions",
    queries: {
      limit: z.number(),
      offset: z.number(),
    },
    response: z.string(),
  },
});

Instructions

Check out src/index.test.ts about usage

1.2.0

3 years ago

1.1.0

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.0.0

3 years ago