@logbrew/sdk 0.1.11 → 0.1.13
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 +2 -2
- package/issue-stack.cjs +2 -6
- package/package.json +1 -1
- package/release-artifacts-build.cjs +3 -8
- package/release-artifacts-upload.js +3 -8
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ export default {
|
|
|
39
39
|
projectId: "550e8400-e29b-41d4-a716-446655440000",
|
|
40
40
|
minifiedPathPrefix: "https://cdn.example/assets",
|
|
41
41
|
upload: {
|
|
42
|
-
endpoint: "https://api.logbrew.
|
|
42
|
+
endpoint: "https://api.logbrew.co/api/release-artifacts",
|
|
43
43
|
allowHostedUpload: true,
|
|
44
44
|
maxRetries: 2
|
|
45
45
|
}
|
|
@@ -95,7 +95,7 @@ export LOGBREW_RELEASE_ARTIFACT_AUTH="<release-artifact-auth>"
|
|
|
95
95
|
npx logbrew-release-artifacts upload-js \
|
|
96
96
|
--build-dir dist \
|
|
97
97
|
--manifest logbrew-release-artifacts.json \
|
|
98
|
-
--endpoint https://api.logbrew.
|
|
98
|
+
--endpoint https://api.logbrew.co/api/release-artifacts \
|
|
99
99
|
--token-env LOGBREW_RELEASE_ARTIFACT_AUTH \
|
|
100
100
|
--allow-hosted
|
|
101
101
|
```
|
package/issue-stack.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const MAX_ISSUE_STACK_FRAMES = 32;
|
|
|
4
4
|
const MAX_ISSUE_STACK_FUNCTION_LENGTH = 256;
|
|
5
5
|
const MAX_ISSUE_STACK_MODULE_LENGTH = 512;
|
|
6
6
|
const SAFE_DEBUG_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;
|
|
7
|
-
const LOCAL_ABSOLUTE_PATH_PATTERN =
|
|
7
|
+
const LOCAL_ABSOLUTE_PATH_PATTERN = /(?:^|\s)(?:\/(?:Users|home|private|tmp|var|Volumes)\/|[A-Za-z]:[\\/])/u;
|
|
8
8
|
|
|
9
9
|
function buildIssueStackHelpers({ SdkError }) {
|
|
10
10
|
function javascriptStackEvidence(stack, debugIdMap) {
|
|
@@ -27,10 +27,6 @@ function buildIssueStackHelpers({ SdkError }) {
|
|
|
27
27
|
return { frames, truncated };
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
function javascriptStackFrames(stack, debugIdMap) {
|
|
31
|
-
return javascriptStackEvidence(stack, debugIdMap).frames;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
30
|
function validateIssueStackFrames(stackFrames) {
|
|
35
31
|
if (stackFrames === undefined) {
|
|
36
32
|
return undefined;
|
|
@@ -90,7 +86,7 @@ function buildIssueStackHelpers({ SdkError }) {
|
|
|
90
86
|
});
|
|
91
87
|
}
|
|
92
88
|
|
|
93
|
-
return { javascriptStackEvidence,
|
|
89
|
+
return { javascriptStackEvidence, validateIssueStackFrames };
|
|
94
90
|
}
|
|
95
91
|
|
|
96
92
|
function parseJavaScriptStackFrame(rawLine) {
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const { spawnSync } = require("node:child_process");
|
|
4
4
|
const net = require("node:net");
|
|
5
5
|
|
|
6
|
+
const HOSTED_UPLOAD_ENDPOINT = "https://api.logbrew.co/api/release-artifacts";
|
|
6
7
|
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;
|
|
7
8
|
const UPLOAD_OPTION_NAMES = new Set([
|
|
8
9
|
"allowHostedUpload",
|
|
@@ -116,14 +117,8 @@ function normalizeReleaseArtifactUploadOptions(upload, { integration, projectId
|
|
|
116
117
|
if (hosted && !allowHostedUpload) {
|
|
117
118
|
throw new Error(`LogBrew ${integration} release-artifact hosted upload requires allowHostedUpload`);
|
|
118
119
|
}
|
|
119
|
-
if (hosted &&
|
|
120
|
-
throw new Error(`LogBrew ${integration} hosted release-artifact
|
|
121
|
-
}
|
|
122
|
-
if (hosted && (parsedEndpoint.username || parsedEndpoint.password)) {
|
|
123
|
-
throw new Error(`LogBrew ${integration} hosted release-artifact upload endpoint must not include embedded auth values`);
|
|
124
|
-
}
|
|
125
|
-
if (hosted && (parsedEndpoint.search || parsedEndpoint.hash)) {
|
|
126
|
-
throw new Error(`LogBrew ${integration} hosted release-artifact upload endpoint must not include query strings or fragments`);
|
|
120
|
+
if (hosted && endpoint !== HOSTED_UPLOAD_ENDPOINT) {
|
|
121
|
+
throw new Error(`LogBrew ${integration} hosted release-artifact uploads must use ${HOSTED_UPLOAD_ENDPOINT}`);
|
|
127
122
|
}
|
|
128
123
|
if (hosted && !projectId) {
|
|
129
124
|
throw new Error(`LogBrew ${integration} release-artifact hosted upload requires projectId`);
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
} from "./release-artifacts-common.js";
|
|
19
19
|
|
|
20
20
|
const DEFAULT_UPLOAD_TOKEN_ENV = "LOGBREW_RELEASE_ARTIFACT_TOKEN";
|
|
21
|
+
const HOSTED_UPLOAD_ENDPOINT = "https://api.logbrew.co/api/release-artifacts";
|
|
21
22
|
const NON_RETRYABLE_UPLOAD_STATUSES = new Set([400, 401, 403, 413]);
|
|
22
23
|
const RETRYABLE_UPLOAD_STATUSES = new Set([408, 429]);
|
|
23
24
|
const SCRIPT_VERSION = "0.1.0";
|
|
@@ -125,14 +126,8 @@ function requireUploadEndpoint(endpoint, allowHosted) {
|
|
|
125
126
|
if (!allowHosted) {
|
|
126
127
|
throw new Error("release artifact hosted upload requires explicit --allow-hosted; use loopback endpoints for local proof");
|
|
127
128
|
}
|
|
128
|
-
if (
|
|
129
|
-
throw new Error(
|
|
130
|
-
}
|
|
131
|
-
if (parsed.username || parsed.password) {
|
|
132
|
-
throw new Error("hosted release artifact upload endpoints must not include embedded auth values");
|
|
133
|
-
}
|
|
134
|
-
if (parsed.search || parsed.hash) {
|
|
135
|
-
throw new Error("hosted release artifact upload endpoints must not include query strings or fragments");
|
|
129
|
+
if (endpoint !== HOSTED_UPLOAD_ENDPOINT) {
|
|
130
|
+
throw new Error(`hosted release artifact uploads must use ${HOSTED_UPLOAD_ENDPOINT}`);
|
|
136
131
|
}
|
|
137
132
|
return parsed;
|
|
138
133
|
}
|