create-cloudflare 0.0.0-7310add1 → 0.0.0-765ebc1c

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/dist/cli.js CHANGED
@@ -57864,7 +57864,7 @@ var Yargs = YargsFactory(esm_default);
57864
57864
  var yargs_default = Yargs;
57865
57865
 
57866
57866
  // package.json
57867
- var version = "0.0.0-7310add1";
57867
+ var version = "0.0.0-765ebc1c";
57868
57868
  var devDependencies = {
57869
57869
  "@babel/parser": "^7.21.3",
57870
57870
  "@babel/types": "^7.21.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "0.0.0-7310add1",
3
+ "version": "0.0.0-765ebc1c",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -17,8 +17,8 @@ The sample plugin allows ChatGPT users to search for repositories using GitHub's
17
17
  ## Usage
18
18
 
19
19
  1. You can configure the `.well-known/ai-plugin.json` route in `index.ts`.
20
- 2. You can set up any new routes and the associated OpenAPI schema by defining new routes. See `search.ts` for an example.
21
- 3. For more information read the [itty-router-openapi official documentation](https://cloudflare.github.io/itty-router-openapi/).
20
+ 2. Update the OpenAPI schema in `openapi.ts`.
21
+ 3. You can set up any new routes and the associated OpenAPI schema by defining new routes. See `search.ts` for an example.
22
22
 
23
23
  ## Deploying to OpenAI's API
24
24
 
@@ -7,7 +7,7 @@
7
7
  "start": "wrangler dev"
8
8
  },
9
9
  "dependencies": {
10
- "@cloudflare/itty-router-openapi": "^1.0.1"
10
+ "@cloudflare/itty-router-openapi": "^0.1.2"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@cloudflare/workers-types": "^4.20230404.0",
@@ -1,4 +1,9 @@
1
- import { OpenAPIRoute, Query } from "@cloudflare/itty-router-openapi";
1
+ import {
2
+ ApiException,
3
+ OpenAPIRoute,
4
+ Query,
5
+ ValidationError,
6
+ } from "@cloudflare/itty-router-openapi";
2
7
 
3
8
  export class GetSearch extends OpenAPIRoute {
4
9
  static schema = {
@@ -12,7 +17,6 @@ export class GetSearch extends OpenAPIRoute {
12
17
  },
13
18
  responses: {
14
19
  "200": {
15
- description: "Successfully response",
16
20
  schema: {
17
21
  repos: [
18
22
  {
@@ -29,7 +33,7 @@ export class GetSearch extends OpenAPIRoute {
29
33
  };
30
34
 
31
35
  async handle(request: Request, env, ctx, data: Record<string, any>) {
32
- const url = `https://api.github.com/search/repositories?q=${data.query.q}`;
36
+ const url = `https://api.github.com/search/repositories?q=${data.q}`;
33
37
 
34
38
  const resp = await fetch(url, {
35
39
  headers: {