@crombolo/api-management 0.33.1 → 0.35.2
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/README.md +14 -0
- package/package.json +5 -5
- package/src/handlers/package.ts +4 -1
- package/src/ports-packages.ts +5 -2
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @crombolo/api-management
|
|
2
|
+
|
|
3
|
+
**Internal to crombolo.** This package is published because
|
|
4
|
+
[`@crombolo/crombolo`](https://www.npmjs.com/package/@crombolo/crombolo)
|
|
5
|
+
depends on it, and its exports can change in any release, a patch included.
|
|
6
|
+
|
|
7
|
+
Import from `@crombolo/crombolo` instead:
|
|
8
|
+
|
|
9
|
+
- `@crombolo/crombolo` for a site: its config, its boot and its views.
|
|
10
|
+
- `@crombolo/crombolo/bundle` for a server bundle's author.
|
|
11
|
+
- `@crombolo/crombolo/host` for whoever runs sites.
|
|
12
|
+
|
|
13
|
+
Those three entry points carry the compatibility promise in
|
|
14
|
+
[`docs/api.md`](https://github.com/kineco-au/crombolo-cms/blob/main/docs/api.md).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crombolo/api-management",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Umbraco-compatible Management API handlers for crombolo.",
|
|
3
|
+
"version": "0.35.2",
|
|
4
|
+
"description": "Internal to crombolo, with no compatibility promise: use @crombolo/crombolo. Umbraco-compatible Management API handlers for crombolo.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Crombolo",
|
|
7
7
|
"homepage": "https://github.com/kineco-au/crombolo-cms#readme",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@crombolo/content": "0.
|
|
32
|
-
"@crombolo/contracts": "0.
|
|
33
|
-
"@crombolo/core": "0.
|
|
31
|
+
"@crombolo/content": "0.35.2",
|
|
32
|
+
"@crombolo/contracts": "0.35.2",
|
|
33
|
+
"@crombolo/core": "0.35.2"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/handlers/package.ts
CHANGED
|
@@ -161,7 +161,10 @@ export function registerPackageHandlers(router: ManagementApiRouter, port: Packa
|
|
|
161
161
|
})
|
|
162
162
|
|
|
163
163
|
router.handle('GetPackageCreatedByIdDownload', async (ctx) => {
|
|
164
|
-
|
|
164
|
+
// Without media unless asked, as every command that writes a bundle (story 195).
|
|
165
|
+
const built = await port.build(ctx.params.id as string, {
|
|
166
|
+
withMedia: ctx.url.searchParams.get('withMedia') === 'true',
|
|
167
|
+
})
|
|
165
168
|
if (!built) return packageNotFound()
|
|
166
169
|
return new Response(built.bytes, {
|
|
167
170
|
headers: {
|
package/src/ports-packages.ts
CHANGED
|
@@ -54,6 +54,9 @@ export interface PackagePort {
|
|
|
54
54
|
create(input: PackageDefinitionInput, id: string | undefined): Promise<PackageWriteResult>
|
|
55
55
|
update(id: string, input: PackageDefinitionInput): Promise<PackageWriteResult>
|
|
56
56
|
remove(id: string): Promise<'deleted' | 'notFound'>
|
|
57
|
-
/**
|
|
58
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Serializes and packs the definition now; undefined when it is gone. Media
|
|
59
|
+
* files are carried only when asked for (story 195).
|
|
60
|
+
*/
|
|
61
|
+
build(id: string, options?: { withMedia?: boolean }): Promise<BuiltPackage | undefined>
|
|
59
62
|
}
|