@dropthis/cli 0.35.0 → 0.37.0
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 +6 -4
- package/dist/cli.cjs +352 -105
- package/dist/cli.cjs.map +1 -1
- package/node_modules/@dropthis/node/dist/edge.cjs +34 -1
- package/node_modules/@dropthis/node/dist/edge.cjs.map +1 -1
- package/node_modules/@dropthis/node/dist/edge.d.cts +1 -1
- package/node_modules/@dropthis/node/dist/edge.d.ts +1 -1
- package/node_modules/@dropthis/node/dist/edge.mjs +34 -1
- package/node_modules/@dropthis/node/dist/edge.mjs.map +1 -1
- package/node_modules/@dropthis/node/dist/index.cjs +34 -1
- package/node_modules/@dropthis/node/dist/index.cjs.map +1 -1
- package/node_modules/@dropthis/node/dist/index.d.cts +2 -2
- package/node_modules/@dropthis/node/dist/index.d.ts +2 -2
- package/node_modules/@dropthis/node/dist/index.mjs +34 -1
- package/node_modules/@dropthis/node/dist/index.mjs.map +1 -1
- package/node_modules/@dropthis/node/dist/{workspaces-Cq705UM6.d.cts → workspaces-CfwVerjp.d.cts} +45 -5
- package/node_modules/@dropthis/node/dist/{workspaces-Cq705UM6.d.ts → workspaces-CfwVerjp.d.ts} +45 -5
- package/node_modules/@dropthis/node/package.json +1 -1
- package/package.json +2 -2
|
@@ -825,6 +825,26 @@ var DeploymentsResource = class {
|
|
|
825
825
|
`/drops/${encodeURIComponent(dropId)}/deployments/${encodeURIComponent(deploymentId)}`
|
|
826
826
|
);
|
|
827
827
|
}
|
|
828
|
+
/**
|
|
829
|
+
* Roll a drop back to a prior deployment's content (Pro+ version-history feature). Mints a
|
|
830
|
+
* NEW deployment whose content is copied from `deploymentId` and makes it current — the drop's
|
|
831
|
+
* URL and settings are unchanged. Restoring the deployment that is already current is a 200
|
|
832
|
+
* no-op. Below Pro returns `feature_not_in_plan` (carrying `upgradeUrl`). Returns the updated
|
|
833
|
+
* parent drop (with its `url` and bumped `revision`). Pass `idempotencyKey` to make a retry
|
|
834
|
+
* safe. POST /drops/{id}/deployments/{deploymentId}/restore.
|
|
835
|
+
*/
|
|
836
|
+
restore(dropId, deploymentId, options = {}) {
|
|
837
|
+
const requestOptions = {};
|
|
838
|
+
if (options.idempotencyKey)
|
|
839
|
+
requestOptions.idempotencyKey = options.idempotencyKey;
|
|
840
|
+
if (options.ifRevision !== void 0)
|
|
841
|
+
requestOptions.ifRevision = options.ifRevision;
|
|
842
|
+
return this.transport.request(
|
|
843
|
+
"POST",
|
|
844
|
+
`/drops/${encodeURIComponent(dropId)}/deployments/${encodeURIComponent(deploymentId)}/restore`,
|
|
845
|
+
requestOptions
|
|
846
|
+
);
|
|
847
|
+
}
|
|
828
848
|
};
|
|
829
849
|
|
|
830
850
|
// src/resources/domains.ts
|
|
@@ -1021,6 +1041,19 @@ var DropsResource = class {
|
|
|
1021
1041
|
`/drops/${encodeURIComponent(dropId)}`
|
|
1022
1042
|
);
|
|
1023
1043
|
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Approximate view analytics for one drop, by its `drop_…` id. Gated by the `analytics`
|
|
1046
|
+
* capability: Free returns `feature_not_in_plan` (needs Keep); Keep (`view_count`) returns
|
|
1047
|
+
* `views`/`truncated` with breakdowns null; Pro+ (`full`) also returns `byCountry`/
|
|
1048
|
+
* `byReferer`/`daily`. Counts are best-effort (captured fire-and-forget at the edge) — an
|
|
1049
|
+
* approximate signal, not exact human visits. GET /drops/{id}/analytics.
|
|
1050
|
+
*/
|
|
1051
|
+
analytics(dropId) {
|
|
1052
|
+
return this.transport.request(
|
|
1053
|
+
"GET",
|
|
1054
|
+
`/drops/${encodeURIComponent(dropId)}/analytics`
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1024
1057
|
/**
|
|
1025
1058
|
* Resolve a public locator (a drop URL, a custom-domain URL, or a bare vanity/shared
|
|
1026
1059
|
* slug) back to the drop — the way to recover a lost `drop_…` id. Sends the raw target
|
|
@@ -1302,7 +1335,7 @@ function toSnakeCase(value) {
|
|
|
1302
1335
|
|
|
1303
1336
|
// src/transport.ts
|
|
1304
1337
|
var DEFAULT_BASE_URL = "https://api.dropthis.app";
|
|
1305
|
-
var SDK_VERSION = true ? "0.
|
|
1338
|
+
var SDK_VERSION = true ? "0.33.0" : "0.0.0-dev";
|
|
1306
1339
|
var Transport = class {
|
|
1307
1340
|
apiKey;
|
|
1308
1341
|
baseUrl;
|