@shopware/api-gen 0.0.3 → 0.0.4

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.
Files changed (3) hide show
  1. package/README.md +2 -2
  2. package/dist/cli.mjs +41 -26
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -12,8 +12,8 @@ Documentation specific for this package: [api-gen](https://frontends.shopware.co
12
12
 
13
13
  Full changelog for stable version is available [here](https://github.com/shopware/frontends/blob/main/packages/api-gen/CHANGELOG.md)
14
14
 
15
- ### Latest changes: 0.0.3
15
+ ### Latest changes: 0.0.4
16
16
 
17
17
  ### Patch Changes
18
18
 
19
- - [#292](https://github.com/shopware/frontends/pull/292) [`b68ca7f`](https://github.com/shopware/frontends/commit/b68ca7fbd51d22f4be84a228ca107972e07bfa32) Thanks [@patzick](https://github.com/patzick)! - fixed cli building, prettier is not inlined into bundle
19
+ - [#295](https://github.com/shopware/frontends/pull/295) [`23a0a53`](https://github.com/shopware/frontends/commit/23a0a532410990c0075ea7fff622949ccdecfd49) Thanks [@patzick](https://github.com/patzick)! - bump dependencies
package/dist/cli.mjs CHANGED
@@ -528,8 +528,11 @@ const patches = {
528
528
  */
529
529
  name: "ContextTokenResponse",
530
530
  patch: (schema) => {
531
- var _a;
532
- (_a = schema.components.schemas)["ContextTokenResponse"] ?? (_a["ContextTokenResponse"] = {
531
+ var _a, _b, _c, _d, _e, _f, _g, _h;
532
+ schema.components ?? (schema.components = {});
533
+ (_a = schema.components).schemas ?? (_a.schemas = {});
534
+ schema.paths ?? (schema.paths = {});
535
+ (_b = schema.components.schemas)["ContextTokenResponse"] ?? (_b["ContextTokenResponse"] = {
533
536
  type: "object",
534
537
  properties: {
535
538
  contextToken: {
@@ -538,36 +541,48 @@ const patches = {
538
541
  }
539
542
  }
540
543
  });
541
- schema.paths["/context"].patch.responses["200"] = {
542
- description: "Returns the context token. Use that as your `sw-context-token` header for subsequent requests. Redirect if getRedirectUrl is set.",
543
- content: {
544
- "application/json": {
545
- schema: {
546
- $ref: "#/components/schemas/ContextTokenResponse"
544
+ (_c = schema.paths["/context"]).patch ?? (_c.patch = {});
545
+ if ("responses" in schema.paths["/context"].patch) {
546
+ (_d = schema.paths["/context"].patch).responses ?? (_d.responses = {});
547
+ schema.paths["/context"].patch.responses["200"] = {
548
+ description: "Returns the context token. Use that as your `sw-context-token` header for subsequent requests. Redirect if getRedirectUrl is set.",
549
+ content: {
550
+ "application/json": {
551
+ schema: {
552
+ $ref: "#/components/schemas/ContextTokenResponse"
553
+ }
547
554
  }
548
555
  }
549
- }
550
- };
551
- schema.paths["/account/login"].post.responses["200"] = {
552
- description: "A successful login returns a context token which is associated with the logged in user. Use that as your `sw-context-token` header for subsequent requests.",
553
- content: {
554
- "application/json": {
555
- schema: {
556
- $ref: "#/components/schemas/ContextTokenResponse"
556
+ };
557
+ }
558
+ (_e = schema.paths["/account/login"]).post ?? (_e.post = {});
559
+ if ("responses" in schema.paths["/account/login"].post) {
560
+ (_f = schema.paths["/account/login"].post).responses ?? (_f.responses = {});
561
+ schema.paths["/account/login"].post.responses["200"] = {
562
+ description: "A successful login returns a context token which is associated with the logged in user. Use that as your `sw-context-token` header for subsequent requests.",
563
+ content: {
564
+ "application/json": {
565
+ schema: {
566
+ $ref: "#/components/schemas/ContextTokenResponse"
567
+ }
557
568
  }
558
569
  }
559
- }
560
- };
561
- schema.paths["/account/logout"].post.responses["200"] = {
562
- description: "A successful logout returns a context token for the anonymous user. Use that as your `sw-context-token` header for subsequent requests.",
563
- content: {
564
- "application/json": {
565
- schema: {
566
- $ref: "#/components/schemas/ContextTokenResponse"
570
+ };
571
+ }
572
+ (_g = schema.paths["/account/logout"]).post ?? (_g.post = {});
573
+ if ("responses" in schema.paths["/account/logout"].post) {
574
+ (_h = schema.paths["/account/logout"].post).responses ?? (_h.responses = {});
575
+ schema.paths["/account/logout"].post.responses["200"] = {
576
+ description: "A successful logout returns a context token for the anonymous user. Use that as your `sw-context-token` header for subsequent requests.",
577
+ content: {
578
+ "application/json": {
579
+ schema: {
580
+ $ref: "#/components/schemas/ContextTokenResponse"
581
+ }
567
582
  }
568
583
  }
569
- }
570
- };
584
+ };
585
+ }
571
586
  return schema;
572
587
  }
573
588
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopware/api-gen",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Shopware CLI for API client generation.",
5
5
  "author": "Shopware",
6
6
  "repository": {
@@ -25,26 +25,26 @@
25
25
  "api-gen": "bin/api-gen.mjs"
26
26
  },
27
27
  "devDependencies": {
28
- "@types/prettier": "^2.7.2",
28
+ "@types/prettier": "^2.7.3",
29
29
  "@types/yargs": "^17.0.24",
30
30
  "@vitest/coverage-c8": "^0.32.2",
31
31
  "picocolors": "^1.0.0",
32
32
  "vitest": "^0.32.2",
33
- "eslint-config-shopware": "0.0.2",
33
+ "eslint-config-shopware": "0.0.3",
34
34
  "tsconfig": "0.0.0"
35
35
  },
36
36
  "dependencies": {
37
- "ofetch": "^1.0.1",
37
+ "ofetch": "^1.1.1",
38
38
  "openapi-typescript": "^6.2.8",
39
39
  "prettier": "^2.8.8",
40
- "semver": "^7.3.8",
40
+ "semver": "^7.5.3",
41
41
  "yargs": "^17.7.2"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "unbuild",
45
45
  "cli": "esno ./src/cli.ts",
46
46
  "dev": "export NODE_ENV=development && unbuild --stub",
47
- "lint": "eslint src/**/*.ts* --fix --max-warnings=0",
47
+ "lint": "eslint src/**/*.ts* --fix --max-warnings=0 && pnpm run typecheck",
48
48
  "typecheck": "tsc --noEmit",
49
49
  "test": "vitest run",
50
50
  "test:bench": "vitest bench",