@driggsby/deploy 0.3.2 → 0.3.3
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/client.d.ts +4 -0
- package/dist/client.js +19 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -51,3 +51,7 @@ export declare function uploadBlob(api: DeployApi, sha256: string, bytes: Uint8A
|
|
|
51
51
|
export declare function finalizeVersion(api: DeployApi, versionId: string, live: boolean): Promise<FinalizedVersion | BlobsMissing>;
|
|
52
52
|
export declare function listVersions(api: DeployApi, slug: string): Promise<VersionList>;
|
|
53
53
|
export declare function setLiveVersion(api: DeployApi, slug: string, versionNumber: number): Promise<FinalizedVersion>;
|
|
54
|
+
export interface DeletedApp {
|
|
55
|
+
appName: string;
|
|
56
|
+
}
|
|
57
|
+
export declare function deleteApp(api: DeployApi, slug: string): Promise<DeletedApp>;
|
package/dist/client.js
CHANGED
|
@@ -154,6 +154,25 @@ export async function setLiveVersion(api, slug, versionNumber) {
|
|
|
154
154
|
});
|
|
155
155
|
return parseFinalized(parsed);
|
|
156
156
|
}
|
|
157
|
+
// Permanently removes the app and every deployed version. There is no
|
|
158
|
+
// undo on the server side, so callers own the "are you sure" step — and
|
|
159
|
+
// once the server answers success, NOTHING about the response body may
|
|
160
|
+
// turn the completed delete into an error: a 204, an empty body, or a
|
|
161
|
+
// missing display field all fall back to the slug the caller asked to
|
|
162
|
+
// delete. This is deliberately looser than every other endpoint here,
|
|
163
|
+
// because those parse state the caller acts on next; this one only
|
|
164
|
+
// decorates a fact that is already irreversible.
|
|
165
|
+
export async function deleteApp(api, slug) {
|
|
166
|
+
const response = await rawRequest(api, "DELETE", `/deploy/apps/${encodeURIComponent(slug)}`, {});
|
|
167
|
+
if (response.status !== 200 && response.status !== 204) {
|
|
168
|
+
throw apiErrorFrom(response, await parseJsonBody(response));
|
|
169
|
+
}
|
|
170
|
+
const parsed = await parseJsonBody(response);
|
|
171
|
+
const name = typeof parsed === "object" && parsed !== null
|
|
172
|
+
? parsed.deleted_app_name
|
|
173
|
+
: undefined;
|
|
174
|
+
return { appName: typeof name === "string" && name !== "" ? name : slug };
|
|
175
|
+
}
|
|
157
176
|
async function requestJson(api, method, path, options) {
|
|
158
177
|
const response = await rawRequest(api, method, path, options);
|
|
159
178
|
return expectStatus(response, options.expectedStatus ?? 200);
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { PUBLIC_BASE_URL, consoleUrlOnOrigin, isLoopbackBaseUrl, resolveBaseUrl
|
|
|
3
3
|
export { MAX_FILE_BYTES, MAX_FILE_COUNT, MAX_PATH_LENGTH, MAX_TOTAL_BYTES, slugProblem, } from "./limits.ts";
|
|
4
4
|
export { type ProjectConfig, readProjectConfig, writeAssignedSlug } from "./project-config.ts";
|
|
5
5
|
export { type CollectedDeploy, type DeployFile, collectDeployFiles, formatBytes, } from "./manifest.ts";
|
|
6
|
-
export { type BlobsMissing, type CreatedApp, type CreatedVersion, type DeployApi, type FinalizedVersion, type ManifestFile, type VersionList, type VersionSummary, createApp, createVersion, finalizeVersion, listVersions, setLiveVersion, uploadBlob, } from "./client.ts";
|
|
6
|
+
export { type BlobsMissing, type CreatedApp, type CreatedVersion, type DeletedApp, type DeployApi, type FinalizedVersion, type ManifestFile, type VersionList, type VersionSummary, createApp, createVersion, deleteApp, finalizeVersion, listVersions, setLiveVersion, uploadBlob, } from "./client.ts";
|
|
7
7
|
export { type DeployOptions, type DeployOutcome, type ProjectDeployOptions, type ProjectDeployResult, deployCollectedFiles, deployProjectFiles, } from "./deploy.ts";
|
|
8
8
|
export { type LiveAddresses, MAX_LIVE_ADDRESS_CHARS, hasLiveAddress, liveAddresses, liveAddressLines, } from "./live-addresses.ts";
|
|
9
9
|
export { capForTerminal, quotedForTerminal, sanitizeForTerminal, wrapProse, } from "./terminal-text.ts";
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ export { PUBLIC_BASE_URL, consoleUrlOnOrigin, isLoopbackBaseUrl, resolveBaseUrl
|
|
|
9
9
|
export { MAX_FILE_BYTES, MAX_FILE_COUNT, MAX_PATH_LENGTH, MAX_TOTAL_BYTES, slugProblem, } from "./limits.js";
|
|
10
10
|
export { readProjectConfig, writeAssignedSlug } from "./project-config.js";
|
|
11
11
|
export { collectDeployFiles, formatBytes, } from "./manifest.js";
|
|
12
|
-
export { createApp, createVersion, finalizeVersion, listVersions, setLiveVersion, uploadBlob, } from "./client.js";
|
|
12
|
+
export { createApp, createVersion, deleteApp, finalizeVersion, listVersions, setLiveVersion, uploadBlob, } from "./client.js";
|
|
13
13
|
export { deployCollectedFiles, deployProjectFiles, } from "./deploy.js";
|
|
14
14
|
// The addresses a deploy or rollback prints, shared by this package's bin
|
|
15
15
|
// and the driggsby CLI so both say the same thing.
|