@funnelsgrove/runtime 0.1.9 → 0.1.10
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.
|
@@ -61,9 +61,6 @@ export declare const RUNTIME_PUBLIC_DEFAULTS: {
|
|
|
61
61
|
readonly supportEmail: "support@example.com";
|
|
62
62
|
readonly timezone: "UTC";
|
|
63
63
|
};
|
|
64
|
-
export declare const RUNTIME_PREVIEW_PAYMENT_DEFAULTS: {
|
|
65
|
-
readonly funnelSdkPublishableKey: "pk_test_51SopXWPEfkEVo5kh6foOs9zVyKsVSKLhlQw8YsAfMMymRlGH3Qp8U5I7j5bHivmOB232oJiQZi8cEv1wkmV80QGg00vPcI1DZI";
|
|
66
|
-
};
|
|
67
64
|
export type RuntimeStaticExportEnv = Record<string, string | undefined>;
|
|
68
65
|
export declare const resolveNextStaticExportRuntimeEnv: (env: RuntimeStaticExportEnv) => Record<string, string>;
|
|
69
66
|
export declare const isSeedFunnelSdkPublishableKey: (value: string | null | undefined) => boolean;
|
|
@@ -5,7 +5,6 @@ const DEFAULT_API_BASE_URL = 'https://sdk-api.funnelsgrove.com';
|
|
|
5
5
|
const DEFAULT_FUNNEL_SDK_PUBLISHABLE_KEY = 'pk_test_app_deals_seed_public';
|
|
6
6
|
const DEFAULT_SUPPORT_EMAIL = 'support@example.com';
|
|
7
7
|
const DEFAULT_TIMEZONE = 'UTC';
|
|
8
|
-
const DEFAULT_PREVIEW_PAYMENT_PUBLISHABLE_KEY = 'pk_test_51SopXWPEfkEVo5kh6foOs9zVyKsVSKLhlQw8YsAfMMymRlGH3Qp8U5I7j5bHivmOB232oJiQZi8cEv1wkmV80QGg00vPcI1DZI';
|
|
9
8
|
const trimTrailingSlash = (value) => {
|
|
10
9
|
return value.replace(/\/+$/, '');
|
|
11
10
|
};
|
|
@@ -87,9 +86,6 @@ export const RUNTIME_PUBLIC_DEFAULTS = {
|
|
|
87
86
|
supportEmail: DEFAULT_SUPPORT_EMAIL,
|
|
88
87
|
timezone: DEFAULT_TIMEZONE,
|
|
89
88
|
};
|
|
90
|
-
export const RUNTIME_PREVIEW_PAYMENT_DEFAULTS = {
|
|
91
|
-
funnelSdkPublishableKey: DEFAULT_PREVIEW_PAYMENT_PUBLISHABLE_KEY,
|
|
92
|
-
};
|
|
93
89
|
const NEXT_STATIC_EXPORT_RUNTIME_PUBLIC_KEYS = [
|
|
94
90
|
{
|
|
95
91
|
outputKey: 'NEXT_PUBLIC_APP_DEALS_API_BASE_URL',
|
|
@@ -167,22 +163,23 @@ export const resolveNextStaticExportRuntimeEnv = (env) => {
|
|
|
167
163
|
return value ? [[outputKey, value]] : [];
|
|
168
164
|
}));
|
|
169
165
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
};
|
|
166
|
+
const publishableKey = readNonEmptyStaticExportEnv(env, [
|
|
167
|
+
PROJECT_ENV_STANDARD_KEYS.funnelSdkPublishableKey,
|
|
168
|
+
]);
|
|
169
|
+
return Object.assign(Object.assign({}, (publishableKey ? { [PROJECT_ENV_STANDARD_KEYS.funnelSdkPublishableKey]: publishableKey } : {})), { [PROJECT_ENV_STANDARD_KEYS.funnelId]: ((_b = env.NEXT_PUBLIC_RAG_FUNNEL_ID) === null || _b === void 0 ? void 0 : _b.trim()) || '' });
|
|
174
170
|
};
|
|
175
171
|
export const isSeedFunnelSdkPublishableKey = (value) => {
|
|
176
172
|
const normalized = (value === null || value === void 0 ? void 0 : value.trim()) || '';
|
|
177
173
|
return !normalized || normalized === DEFAULT_FUNNEL_SDK_PUBLISHABLE_KEY;
|
|
178
174
|
};
|
|
179
175
|
export const isPreviewPaymentPublishableKey = (value) => {
|
|
180
|
-
|
|
176
|
+
void value;
|
|
177
|
+
return false;
|
|
181
178
|
};
|
|
182
179
|
export const resolvePreviewPaymentPublishableKey = (value) => {
|
|
183
180
|
const normalized = (value === null || value === void 0 ? void 0 : value.trim()) || '';
|
|
184
181
|
if (isSeedFunnelSdkPublishableKey(normalized)) {
|
|
185
|
-
return
|
|
182
|
+
return '';
|
|
186
183
|
}
|
|
187
184
|
return normalized;
|
|
188
185
|
};
|