@knapsack/types 4.109.0 → 4.110.1

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.
@@ -4,6 +4,7 @@ import type { GeneralDiscovery } from './discovery';
4
4
  import type { KsTemplateSpec } from './app-client-data/patterns';
5
5
  import type { RendererDiscovery, RendererId, TemplateInfo } from './renderers';
6
6
  import type { Role } from './user-roles';
7
+ import type { PackageJson } from './type-utils';
7
8
  /**
8
9
  * Route on our App API that checks if the user is authenticated and returns their role
9
10
  * Make sure to add KS Site ID header {@link import('@knapsack/core').ksHttpHeaders} to recieve correct role
@@ -69,4 +70,45 @@ export type AppApiProductsSiteInspect = ApiRoute<{
69
70
  };
70
71
  output: ProductsSiteInspectResponse;
71
72
  }>;
73
+ /**
74
+ * Body of `GET /internal/orgs/:productsOrganizationId/sites/:siteId/pkg-info`
75
+ * on the App API: the `package.json` of one package as the site's deployed
76
+ * App Client resolves it (its `/api/v2/pkg-info`), cut down to the fields
77
+ * that identify a version and its entry points, with `exports` passed
78
+ * through as-is. Nothing else in the `package.json` leaves the site. A field the `package.json` lacks is absent,
79
+ * never `null`; `types` falls back to `typings`. Every variant is a 200.
80
+ */
81
+ export type ProductsSitePkgInfoResponse = {
82
+ type: 'success';
83
+ pkgJson: {
84
+ name: string;
85
+ version: string;
86
+ exports?: PackageJson['exports'];
87
+ main?: string;
88
+ module?: string;
89
+ types?: string;
90
+ peerDependencies?: Record<string, string>;
91
+ };
92
+ }
93
+ /** The site's App Client cannot resolve the package. */
94
+ | {
95
+ type: 'pkg.notFound';
96
+ }
97
+ /**
98
+ * The App Client failed to read the package some other way. `message` is
99
+ * a fixed text naming the package; the client's own error goes to the log.
100
+ */
101
+ | {
102
+ type: 'error.unknown';
103
+ message: string;
104
+ };
105
+ export type AppApiProductsSitePkgInfo = ApiRoute<{
106
+ path: '/internal/orgs/:productsOrganizationId/sites/:siteId/pkg-info';
107
+ method: 'GET';
108
+ /** A bare package name or `@scope/name`: no sub-path, no file path. */
109
+ input: {
110
+ pkgName: string;
111
+ };
112
+ output: ProductsSitePkgInfoResponse;
113
+ }>;
72
114
  //# sourceMappingURL=app-api-routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-api-routes.d.ts","sourceRoot":"","sources":["../src/app-api-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,IAAI,EAAE,2BAA2B,CAAC;IAClC,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE;QACN,IAAI,EAAE,IAAI,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,EAAE,OAAO,CAAC;KACxB,CAAC;CACH,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,EAAE,qBAAqB,CAAC;IAC/B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,qBAAqB,EAAE;SACpB,aAAa,IAAI,UAAU,CAAC,CAAC,EAAE,iBAAiB,CAAC,aAAa,CAAC;KACjE,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IAChD,IAAI,EAAE,+DAA+D,CAAC;IACtE,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,4BAA4B,CAAC;CACtC,CAAC,CAAC;AAEH;;;;;G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AE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;QACjC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC3C,CAAC;CACH;AACH,wDAAwD;GACtD;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE;AAC1B;;;GAGG;GACD;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAC/C,IAAI,EAAE,+DAA+D,CAAC;IACtE,MAAM,EAAE,KAAK,CAAC;IACd,uEAAuE;IACvE,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3B,MAAM,EAAE,2BAA2B,CAAC;CACrC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@knapsack/types",
3
3
  "description": "",
4
- "version": "4.109.0",
4
+ "version": "4.110.1",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "sideEffects": false,
34
34
  "dependencies": {
35
- "@knapsack/file-utils": "4.109.0",
36
- "@knapsack/utils": "4.109.0",
35
+ "@knapsack/file-utils": "4.110.1",
36
+ "@knapsack/utils": "4.110.1",
37
37
  "color-string": "^1.9.1",
38
38
  "immer": "^10.2.0",
39
39
  "superstruct": "^0.16.7",
@@ -41,8 +41,8 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@apidevtools/json-schema-ref-parser": "^11.9.3",
44
- "@knapsack/file-utils": "4.109.0",
45
- "@knapsack/typescript-config-starter": "4.109.0",
44
+ "@knapsack/file-utils": "4.110.1",
45
+ "@knapsack/typescript-config-starter": "4.110.1",
46
46
  "@tiptap/core": "^3.24.0",
47
47
  "@types/color-string": "^1.5.5",
48
48
  "@types/fs-extra": "^11.0.4",