@logbrew/sdk 0.1.2 → 0.1.4

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.
@@ -0,0 +1,175 @@
1
+ const SUPPORT_TICKET_SOURCES = new Set(["cli", "sdk", "website", "docs", "mobile"]);
2
+ const SUPPORT_TICKET_CATEGORIES = new Set([
3
+ "sdk_install_failure",
4
+ "ingest_failure",
5
+ "auth_failure",
6
+ "project_setup",
7
+ "dashboard_issue",
8
+ "docs_confusion",
9
+ "cli_issue",
10
+ "mobile_issue",
11
+ "billing_question",
12
+ "other"
13
+ ]);
14
+ const SUPPORT_DIAGNOSTICS_MAX_DEPTH = 5;
15
+ const SUPPORT_DIAGNOSTICS_MAX_ARRAY_LENGTH = 20;
16
+ const SUPPORT_DIAGNOSTICS_MAX_STRING_LENGTH = 500;
17
+
18
+ function buildCreateSupportTicketDraft({ SdkError, requireAllowedValue, requireNonEmpty, requireTraceId }) {
19
+ return function createSupportTicketDraft(input) {
20
+ if (!input || Array.isArray(input) || typeof input !== "object") {
21
+ throw new SdkError("validation_error", "support ticket draft input must be an object");
22
+ }
23
+
24
+ requireAllowedValue("support ticket source", input.source, SUPPORT_TICKET_SOURCES);
25
+ requireAllowedValue("support ticket category", input.category, SUPPORT_TICKET_CATEGORIES);
26
+ const draft = {
27
+ source: input.source,
28
+ category: input.category,
29
+ title: requiredSupportString(requireNonEmpty, "support ticket title", input.title),
30
+ description: requiredSupportString(requireNonEmpty, "support ticket description", input.description)
31
+ };
32
+
33
+ addOptionalSupportString(draft, "project_id", "support ticket projectId", input.projectId, requireNonEmpty);
34
+ addOptionalSupportString(draft, "environment", "support ticket environment", input.environment, requireNonEmpty);
35
+ addOptionalSupportString(draft, "runtime", "support ticket runtime", input.runtime, requireNonEmpty);
36
+ addOptionalSupportString(draft, "framework", "support ticket framework", input.framework, requireNonEmpty);
37
+ addOptionalSupportString(draft, "sdk_package", "support ticket sdkPackage", input.sdkPackage, requireNonEmpty);
38
+ addOptionalSupportString(draft, "sdk_version", "support ticket sdkVersion", input.sdkVersion, requireNonEmpty);
39
+ addOptionalSupportString(draft, "release", "support ticket release", input.release, requireNonEmpty);
40
+ if (input.traceId !== undefined) {
41
+ requireTraceId(input.traceId);
42
+ draft.trace_id = input.traceId.toLowerCase();
43
+ }
44
+ addOptionalSupportString(draft, "event_id", "support ticket eventId", input.eventId, requireNonEmpty);
45
+ if (input.diagnostics !== undefined) {
46
+ draft.diagnostics = sanitizeSupportDiagnostics(input.diagnostics, SdkError);
47
+ }
48
+
49
+ return draft;
50
+ };
51
+ }
52
+
53
+ function requiredSupportString(requireNonEmpty, label, value) {
54
+ requireNonEmpty(label, value);
55
+ return value.trim();
56
+ }
57
+
58
+ function addOptionalSupportString(target, key, label, value, requireNonEmpty) {
59
+ if (value === undefined) {
60
+ return;
61
+ }
62
+ target[key] = requiredSupportString(requireNonEmpty, label, value);
63
+ }
64
+
65
+ function sanitizeSupportDiagnostics(diagnostics, SdkError) {
66
+ if (!diagnostics || Array.isArray(diagnostics) || typeof diagnostics !== "object") {
67
+ throw new SdkError("validation_error", "support ticket diagnostics must be an object");
68
+ }
69
+ return sanitizeSupportDiagnosticValue(diagnostics, 0, "");
70
+ }
71
+
72
+ function sanitizeSupportDiagnosticValue(value, depth, key) {
73
+ if (isSensitiveSupportKey(key)) {
74
+ return "[redacted]";
75
+ }
76
+ if (value instanceof Error) {
77
+ return { name: value.name || "Error" };
78
+ }
79
+ if (value === null || typeof value === "number" && Number.isFinite(value) || typeof value === "boolean") {
80
+ return value;
81
+ }
82
+ if (typeof value === "string") {
83
+ return sanitizeSupportDiagnosticString(value);
84
+ }
85
+ if (Array.isArray(value)) {
86
+ if (depth >= SUPPORT_DIAGNOSTICS_MAX_DEPTH) {
87
+ return "[max-depth]";
88
+ }
89
+ return value
90
+ .slice(0, SUPPORT_DIAGNOSTICS_MAX_ARRAY_LENGTH)
91
+ .map((item) => sanitizeSupportDiagnosticValue(item, depth + 1, ""));
92
+ }
93
+ if (value && typeof value === "object") {
94
+ if (depth >= SUPPORT_DIAGNOSTICS_MAX_DEPTH) {
95
+ return "[max-depth]";
96
+ }
97
+ const safe = {};
98
+ for (const [childKey, childValue] of Object.entries(value)) {
99
+ const sanitized = sanitizeSupportDiagnosticValue(childValue, depth + 1, childKey);
100
+ if (sanitized !== undefined) {
101
+ safe[childKey] = sanitized;
102
+ }
103
+ }
104
+ return safe;
105
+ }
106
+ return undefined;
107
+ }
108
+
109
+ function isSensitiveSupportKey(key) {
110
+ if (typeof key !== "string" || key === "") {
111
+ return false;
112
+ }
113
+ const normalized = key.replace(/[^a-z0-9]/giu, "").toLowerCase();
114
+ return [
115
+ "apikey",
116
+ "auth",
117
+ "authorization",
118
+ "authtoken",
119
+ "bearer",
120
+ "clientsecret",
121
+ "connectionstring",
122
+ "cookie",
123
+ "credential",
124
+ "dsn",
125
+ "email",
126
+ "password",
127
+ "passwd",
128
+ "privatekey",
129
+ "refreshtoken",
130
+ "secret",
131
+ "session",
132
+ "setcookie",
133
+ "token"
134
+ ].some((needle) => normalized.includes(needle));
135
+ }
136
+
137
+ function sanitizeSupportDiagnosticString(value) {
138
+ const trimmed = value.trim();
139
+ if (trimmed === "") {
140
+ return "";
141
+ }
142
+ if (isSensitiveSupportString(trimmed)) {
143
+ return "[redacted]";
144
+ }
145
+ const pathRedacted = redactLocalPath(trimmed);
146
+ const urlRedacted = redactUrl(pathRedacted);
147
+ return urlRedacted.length > SUPPORT_DIAGNOSTICS_MAX_STRING_LENGTH
148
+ ? `${urlRedacted.slice(0, SUPPORT_DIAGNOSTICS_MAX_STRING_LENGTH)}...`
149
+ : urlRedacted;
150
+ }
151
+
152
+ function isSensitiveSupportString(value) {
153
+ return /(?:authorization|api[_-]?key|token|secret|password|passwd|cookie)\s*[:=]/iu.test(value)
154
+ || /\bBearer\s+[A-Za-z0-9._~+/-]+=*/iu.test(value)
155
+ || /\blbw_(?:ingest|client|api)_[A-Za-z0-9._-]+/iu.test(value)
156
+ || /\b(?:github_pat|ghp|gho|npm|pypi|sk_live|sk_test|xox[baprs]|AKIA)[A-Za-z0-9._-]+/u.test(value);
157
+ }
158
+
159
+ function redactLocalPath(value) {
160
+ if (/^(?:\/Users\/|\/home\/|\/var\/folders\/|[A-Za-z]:\\)/u.test(value)) {
161
+ return "[redacted-path]";
162
+ }
163
+ return value;
164
+ }
165
+
166
+ function redactUrl(value) {
167
+ try {
168
+ const url = new URL(value);
169
+ return `[redacted-url]${url.pathname || "/"}`;
170
+ } catch {
171
+ return value.split(/[?#]/u)[0];
172
+ }
173
+ }
174
+
175
+ module.exports = { buildCreateSupportTicketDraft };
@@ -0,0 +1,217 @@
1
+ const MAX_TRACESTATE_ENTRIES = 32;
2
+ const MAX_TRACESTATE_LENGTH = 512;
3
+ const MAX_BAGGAGE_ENTRIES = 64;
4
+ const MAX_BAGGAGE_LENGTH = 8192;
5
+ const TRACESTATE_SIMPLE_KEY_PATTERN = /^[a-z0-9][a-z0-9_\-*/]{0,255}$/u;
6
+ const TRACESTATE_TENANT_KEY_PATTERN = /^[a-z0-9][a-z0-9_\-*/]{0,240}@[a-z][a-z0-9_\-*/]{0,13}$/u;
7
+ const TRACESTATE_VALUE_PATTERN = /^[\x20-\x2B\x2D-\x3C\x3E-\x7E]*[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u;
8
+ const BAGGAGE_KEY_PATTERN = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/u;
9
+ const BAGGAGE_PROPERTY_PATTERN = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+(?:=[!#$%&'*+\-.^_`|~0-9A-Za-z]*)?$/u;
10
+
11
+ function buildTraceContextHelpers({ SdkError, createTraceparent }) {
12
+ function parseTracestate(tracestate) {
13
+ if (typeof tracestate !== "string" || tracestate.trim() === "") {
14
+ throw new SdkError("validation_error", "tracestate must be non-empty");
15
+ }
16
+ return normalizeTracestateEntries(
17
+ tracestate.split(",")
18
+ .map((entry) => entry.trim())
19
+ .filter((entry) => entry !== "")
20
+ .map((entry) => {
21
+ const separator = entry.indexOf("=");
22
+ if (separator <= 0) {
23
+ throw new SdkError("validation_error", "tracestate entries must use key=value");
24
+ }
25
+ return {
26
+ key: entry.slice(0, separator).trim(),
27
+ value: entry.slice(separator + 1).trim()
28
+ };
29
+ })
30
+ );
31
+ }
32
+
33
+ function createTracestate(entries) {
34
+ return serializeTracestate(normalizeTracestateEntries(entries));
35
+ }
36
+
37
+ function parseBaggage(baggage) {
38
+ if (typeof baggage !== "string" || baggage.trim() === "") {
39
+ throw new SdkError("validation_error", "baggage must be non-empty");
40
+ }
41
+ return normalizeBaggageEntries(
42
+ baggage.split(",")
43
+ .map((entry) => entry.trim())
44
+ .filter((entry) => entry !== "")
45
+ .map((entry) => {
46
+ const [pair, ...rawProperties] = entry.split(";");
47
+ const separator = pair.indexOf("=");
48
+ if (separator <= 0) {
49
+ throw new SdkError("validation_error", "baggage entries must use key=value");
50
+ }
51
+ return {
52
+ key: pair.slice(0, separator).trim(),
53
+ value: decodeBaggageValue(pair.slice(separator + 1).trim()),
54
+ properties: rawProperties.map((property) => property.trim()).filter((property) => property !== "")
55
+ };
56
+ })
57
+ );
58
+ }
59
+
60
+ function createBaggage(entries) {
61
+ return serializeBaggage(normalizeBaggageEntries(entries));
62
+ }
63
+
64
+ function createTraceContextHeaders(input) {
65
+ if (!input || Array.isArray(input) || typeof input !== "object") {
66
+ throw new SdkError("validation_error", "trace context input must be an object");
67
+ }
68
+ const headers = { traceparent: createTraceparent(input) };
69
+ if (input.tracestate !== undefined) {
70
+ const tracestate = typeof input.tracestate === "string"
71
+ ? createTracestate(parseTracestate(input.tracestate))
72
+ : createTracestate(input.tracestate);
73
+ if (tracestate !== "") {
74
+ headers.tracestate = tracestate;
75
+ }
76
+ }
77
+ if (input.baggage !== undefined) {
78
+ const baggage = typeof input.baggage === "string"
79
+ ? createBaggage(parseBaggage(input.baggage))
80
+ : createBaggage(input.baggage);
81
+ if (baggage !== "") {
82
+ headers.baggage = baggage;
83
+ }
84
+ }
85
+ return headers;
86
+ }
87
+
88
+ function normalizeTracestateEntries(entries) {
89
+ if (!Array.isArray(entries)) {
90
+ throw new SdkError("validation_error", "tracestate entries must be an array");
91
+ }
92
+ if (entries.length > MAX_TRACESTATE_ENTRIES) {
93
+ throw new SdkError("validation_error", `tracestate must contain at most ${MAX_TRACESTATE_ENTRIES} entries`);
94
+ }
95
+ const seenKeys = new Set();
96
+ const normalized = entries.map((entry) => {
97
+ if (!entry || Array.isArray(entry) || typeof entry !== "object") {
98
+ throw new SdkError("validation_error", "tracestate entry must be an object");
99
+ }
100
+ const key = validateTracestateKey(entry.key);
101
+ if (seenKeys.has(key)) {
102
+ throw new SdkError("validation_error", "tracestate keys must be unique");
103
+ }
104
+ seenKeys.add(key);
105
+ return {
106
+ key,
107
+ value: validateTracestateValue(entry.value)
108
+ };
109
+ });
110
+ const serialized = serializeTracestate(normalized);
111
+ if (serialized.length > MAX_TRACESTATE_LENGTH) {
112
+ throw new SdkError("validation_error", `tracestate must be at most ${MAX_TRACESTATE_LENGTH} characters`);
113
+ }
114
+ return normalized;
115
+ }
116
+
117
+ function normalizeBaggageEntries(entries) {
118
+ if (!Array.isArray(entries)) {
119
+ throw new SdkError("validation_error", "baggage entries must be an array");
120
+ }
121
+ if (entries.length > MAX_BAGGAGE_ENTRIES) {
122
+ throw new SdkError("validation_error", `baggage must contain at most ${MAX_BAGGAGE_ENTRIES} entries`);
123
+ }
124
+ const normalized = entries.map((entry) => {
125
+ if (!entry || Array.isArray(entry) || typeof entry !== "object") {
126
+ throw new SdkError("validation_error", "baggage entry must be an object");
127
+ }
128
+ return {
129
+ key: validateBaggageKey(entry.key),
130
+ value: validateBaggageValue(entry.value),
131
+ ...normalizeBaggageProperties(entry.properties)
132
+ };
133
+ });
134
+ const serialized = serializeBaggage(normalized);
135
+ if (serialized.length > MAX_BAGGAGE_LENGTH) {
136
+ throw new SdkError("validation_error", `baggage must be at most ${MAX_BAGGAGE_LENGTH} characters`);
137
+ }
138
+ return normalized;
139
+ }
140
+
141
+ function validateTracestateKey(key) {
142
+ if (typeof key !== "string" || key.trim() === "") {
143
+ throw new SdkError("validation_error", "tracestate key must be non-empty");
144
+ }
145
+ const normalized = key.trim();
146
+ if (!TRACESTATE_SIMPLE_KEY_PATTERN.test(normalized) && !TRACESTATE_TENANT_KEY_PATTERN.test(normalized)) {
147
+ throw new SdkError("validation_error", "tracestate key must be lowercase W3C tracestate key");
148
+ }
149
+ return normalized;
150
+ }
151
+
152
+ function validateTracestateValue(value) {
153
+ if (typeof value !== "string" || value === "" || value.length > 256 || !TRACESTATE_VALUE_PATTERN.test(value)) {
154
+ throw new SdkError("validation_error", "tracestate value must be printable ASCII without comma or equals");
155
+ }
156
+ return value;
157
+ }
158
+
159
+ function validateBaggageKey(key) {
160
+ if (typeof key !== "string" || !BAGGAGE_KEY_PATTERN.test(key)) {
161
+ throw new SdkError("validation_error", "baggage key must use RFC header-name characters");
162
+ }
163
+ return key;
164
+ }
165
+
166
+ function validateBaggageValue(value) {
167
+ if (typeof value !== "string") {
168
+ throw new SdkError("validation_error", "baggage value must be a string");
169
+ }
170
+ return value;
171
+ }
172
+
173
+ function normalizeBaggageProperties(properties) {
174
+ if (properties === undefined) {
175
+ return {};
176
+ }
177
+ if (!Array.isArray(properties)) {
178
+ throw new SdkError("validation_error", "baggage properties must be an array");
179
+ }
180
+ const safeProperties = properties.map((property) => {
181
+ if (typeof property !== "string" || !BAGGAGE_PROPERTY_PATTERN.test(property)) {
182
+ throw new SdkError("validation_error", "baggage property must use RFC header-name characters");
183
+ }
184
+ return property;
185
+ });
186
+ return safeProperties.length > 0 ? { properties: safeProperties } : {};
187
+ }
188
+
189
+ function decodeBaggageValue(value) {
190
+ try {
191
+ return decodeURIComponent(value);
192
+ } catch {
193
+ throw new SdkError("validation_error", "baggage value must use valid percent encoding");
194
+ }
195
+ }
196
+
197
+ return {
198
+ createBaggage,
199
+ createTraceContextHeaders,
200
+ createTracestate,
201
+ parseBaggage,
202
+ parseTracestate
203
+ };
204
+ }
205
+
206
+ function serializeTracestate(entries) {
207
+ return entries.map((entry) => `${entry.key}=${entry.value}`).join(",");
208
+ }
209
+
210
+ function serializeBaggage(entries) {
211
+ return entries.map((entry) => {
212
+ const properties = entry.properties ? `;${entry.properties.join(";")}` : "";
213
+ return `${entry.key}=${encodeURIComponent(entry.value)}${properties}`;
214
+ }).join(",");
215
+ }
216
+
217
+ module.exports = { buildTraceContextHelpers };
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+
3
+ const fs = require("node:fs");
4
+ const path = require("node:path");
5
+
6
+ const {
7
+ createReleaseArtifactUploadArgs,
8
+ formatReleaseArtifactUploadSummary,
9
+ normalizeReleaseArtifactProjectId,
10
+ normalizeReleaseArtifactUploadOptions,
11
+ runReleaseArtifactCli,
12
+ } = require("./release-artifacts-build.cjs");
13
+
14
+ const PACKAGE_DIR = path.dirname(require.resolve("./package.json"));
15
+ const CLI_PATH = path.join(PACKAGE_DIR, "release-artifacts.js");
16
+ const DEFAULT_MANIFEST_NAME = "logbrew-release-artifacts.json";
17
+
18
+ function requiredString(options, name) {
19
+ const value = options?.[name];
20
+ if (typeof value !== "string" || value.trim() === "") {
21
+ throw new Error(`LogBrew Vite release-artifact plugin requires ${name}`);
22
+ }
23
+ return value.trim();
24
+ }
25
+
26
+ function optionalString(options, name) {
27
+ const value = options?.[name];
28
+ if (value === undefined || value === null) {
29
+ return null;
30
+ }
31
+ if (typeof value !== "string" || value.trim() === "") {
32
+ throw new Error(`LogBrew Vite release-artifact plugin option ${name} must be a non-empty string`);
33
+ }
34
+ return value.trim();
35
+ }
36
+
37
+ function normalizeStringArray(value, name) {
38
+ if (value === undefined || value === null) {
39
+ return [];
40
+ }
41
+ if (!Array.isArray(value) || value.some((item) => typeof item !== "string" || item.trim() === "")) {
42
+ throw new Error(`LogBrew Vite release-artifact plugin option ${name} must be an array of non-empty strings`);
43
+ }
44
+ return value.map((item) => item.trim());
45
+ }
46
+
47
+ function resolvePathFromRoot(root, value) {
48
+ return path.isAbsolute(value) ? path.resolve(value) : path.resolve(root, value);
49
+ }
50
+
51
+ function resolveBuildDir(root, outDir, explicitBuildDir) {
52
+ if (explicitBuildDir) {
53
+ return resolvePathFromRoot(root, explicitBuildDir);
54
+ }
55
+ return resolvePathFromRoot(root, outDir || "dist");
56
+ }
57
+
58
+ function resolveManifestPath(root, buildDir, explicitManifestPath) {
59
+ if (explicitManifestPath) {
60
+ return resolvePathFromRoot(root, explicitManifestPath);
61
+ }
62
+ return path.join(buildDir, DEFAULT_MANIFEST_NAME);
63
+ }
64
+
65
+ function createLogBrewViteReleaseArtifactsPlugin(options) {
66
+ const release = requiredString(options, "release");
67
+ const environment = requiredString(options, "environment");
68
+ const service = requiredString(options, "service");
69
+ const projectId = normalizeReleaseArtifactProjectId(options?.projectId, "Vite");
70
+ const minifiedPathPrefix = requiredString(options, "minifiedPathPrefix");
71
+ const repositoryUrl = optionalString(options, "repositoryUrl");
72
+ const commitSha = optionalString(options, "commitSha");
73
+ const explicitBuildDir = optionalString(options, "buildDir");
74
+ const explicitManifestPath = optionalString(options, "manifestPath");
75
+ const stripSourcesContent = options?.stripSourcesContent !== false;
76
+ const enableSourceMaps = options?.enableSourceMaps !== false;
77
+ const userSourcePrefixes = normalizeStringArray(options?.stripSourcePrefix, "stripSourcePrefix");
78
+ const upload = normalizeReleaseArtifactUploadOptions(options?.upload, { integration: "Vite", projectId });
79
+ let viteRoot = process.cwd();
80
+ let viteOutDir = "dist";
81
+ let viteLogger = null;
82
+
83
+ return {
84
+ name: "logbrew-vite-release-artifacts",
85
+ apply: "build",
86
+ enforce: "post",
87
+ config(config = {}) {
88
+ if (!enableSourceMaps || config.build?.sourcemap !== undefined) {
89
+ return null;
90
+ }
91
+ return { build: { sourcemap: "hidden" } };
92
+ },
93
+ configResolved(config) {
94
+ viteRoot = config?.root ? path.resolve(config.root) : process.cwd();
95
+ viteOutDir = config?.build?.outDir || "dist";
96
+ viteLogger = config?.logger && typeof config.logger.info === "function" ? config.logger : null;
97
+ },
98
+ async closeBundle() {
99
+ const buildDir = resolveBuildDir(viteRoot, viteOutDir, explicitBuildDir);
100
+ const manifestPath = resolveManifestPath(viteRoot, buildDir, explicitManifestPath);
101
+ const sourcePrefixes = userSourcePrefixes.length > 0 ? userSourcePrefixes : [viteRoot];
102
+ const prepareArgs = ["--build-dir", buildDir, "--write"];
103
+ if (stripSourcesContent) {
104
+ prepareArgs.push("--strip-sources-content");
105
+ }
106
+ for (const prefix of sourcePrefixes) {
107
+ prepareArgs.push("--strip-source-prefix", prefix);
108
+ }
109
+
110
+ runReleaseArtifactCli(CLI_PATH, "prepare-js", prepareArgs);
111
+
112
+ const manifestArgs = [
113
+ "--build-dir",
114
+ buildDir,
115
+ "--release",
116
+ release,
117
+ "--environment",
118
+ environment,
119
+ "--service",
120
+ service,
121
+ "--minified-path-prefix",
122
+ minifiedPathPrefix
123
+ ];
124
+ if (repositoryUrl) {
125
+ manifestArgs.push("--repository-url", repositoryUrl);
126
+ }
127
+ if (commitSha) {
128
+ manifestArgs.push("--commit-sha", commitSha);
129
+ }
130
+ if (projectId) {
131
+ manifestArgs.push("--project-id", projectId);
132
+ }
133
+
134
+ const { stdout } = runReleaseArtifactCli(CLI_PATH, "manifest-js", manifestArgs);
135
+ fs.mkdirSync(path.dirname(manifestPath), { recursive: true });
136
+ fs.writeFileSync(manifestPath, stdout, "utf8");
137
+ if (upload) {
138
+ const { report } = runReleaseArtifactCli(
139
+ CLI_PATH,
140
+ "upload-js",
141
+ createReleaseArtifactUploadArgs(buildDir, manifestPath, upload)
142
+ );
143
+ viteLogger?.info(formatReleaseArtifactUploadSummary(report));
144
+ }
145
+ }
146
+ };
147
+ }
148
+
149
+ module.exports = {
150
+ createLogBrewViteReleaseArtifactsPlugin,
151
+ default: createLogBrewViteReleaseArtifactsPlugin
152
+ };
@@ -0,0 +1,44 @@
1
+ export interface LogBrewViteReleaseArtifactUploadOptions {
2
+ endpoint: string;
3
+ allowHostedUpload?: boolean;
4
+ tokenEnv?: string;
5
+ dryRun?: boolean;
6
+ maxRetries?: number;
7
+ retryDelay?: number;
8
+ timeout?: number;
9
+ }
10
+
11
+ export interface LogBrewViteReleaseArtifactsPluginOptions {
12
+ release: string;
13
+ environment: string;
14
+ service: string;
15
+ projectId?: string;
16
+ minifiedPathPrefix: string;
17
+ buildDir?: string;
18
+ manifestPath?: string;
19
+ repositoryUrl?: string;
20
+ commitSha?: string;
21
+ stripSourcesContent?: boolean;
22
+ stripSourcePrefix?: string[];
23
+ enableSourceMaps?: boolean;
24
+ upload?: LogBrewViteReleaseArtifactUploadOptions;
25
+ }
26
+
27
+ export interface LogBrewViteReleaseArtifactsPlugin {
28
+ name: "logbrew-vite-release-artifacts";
29
+ apply: "build";
30
+ enforce: "post";
31
+ config(config?: { build?: { sourcemap?: unknown } }): null | { build: { sourcemap: "hidden" } };
32
+ configResolved(config: {
33
+ root?: string;
34
+ build?: { outDir?: string };
35
+ logger?: { info(message: string): void };
36
+ }): void;
37
+ closeBundle(): Promise<void>;
38
+ }
39
+
40
+ export declare function createLogBrewViteReleaseArtifactsPlugin(
41
+ options: LogBrewViteReleaseArtifactsPluginOptions
42
+ ): LogBrewViteReleaseArtifactsPlugin;
43
+
44
+ export default createLogBrewViteReleaseArtifactsPlugin;
@@ -0,0 +1,44 @@
1
+ export interface LogBrewViteReleaseArtifactUploadOptions {
2
+ endpoint: string;
3
+ allowHostedUpload?: boolean;
4
+ tokenEnv?: string;
5
+ dryRun?: boolean;
6
+ maxRetries?: number;
7
+ retryDelay?: number;
8
+ timeout?: number;
9
+ }
10
+
11
+ export interface LogBrewViteReleaseArtifactsPluginOptions {
12
+ release: string;
13
+ environment: string;
14
+ service: string;
15
+ projectId?: string;
16
+ minifiedPathPrefix: string;
17
+ buildDir?: string;
18
+ manifestPath?: string;
19
+ repositoryUrl?: string;
20
+ commitSha?: string;
21
+ stripSourcesContent?: boolean;
22
+ stripSourcePrefix?: string[];
23
+ enableSourceMaps?: boolean;
24
+ upload?: LogBrewViteReleaseArtifactUploadOptions;
25
+ }
26
+
27
+ export interface LogBrewViteReleaseArtifactsPlugin {
28
+ name: "logbrew-vite-release-artifacts";
29
+ apply: "build";
30
+ enforce: "post";
31
+ config(config?: { build?: { sourcemap?: unknown } }): null | { build: { sourcemap: "hidden" } };
32
+ configResolved(config: {
33
+ root?: string;
34
+ build?: { outDir?: string };
35
+ logger?: { info(message: string): void };
36
+ }): void;
37
+ closeBundle(): Promise<void>;
38
+ }
39
+
40
+ export declare function createLogBrewViteReleaseArtifactsPlugin(
41
+ options: LogBrewViteReleaseArtifactsPluginOptions
42
+ ): LogBrewViteReleaseArtifactsPlugin;
43
+
44
+ export default createLogBrewViteReleaseArtifactsPlugin;
@@ -0,0 +1,6 @@
1
+ import viteReleaseArtifacts from "./vite-release-artifacts.cjs";
2
+
3
+ export const createLogBrewViteReleaseArtifactsPlugin =
4
+ viteReleaseArtifacts.createLogBrewViteReleaseArtifactsPlugin;
5
+
6
+ export default createLogBrewViteReleaseArtifactsPlugin;