@unidy.io/sdk 1.2.0-alpha → 1.2.0-alpha3
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/cjs/{index-CvFbf5-D.js → index-DDbhp_lW.js} +75 -75
- package/dist/cjs/index-DDbhp_lW.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{newsletter-helpers-Dj0yYHZf.js → newsletter-helpers-Dr9JZ52F.js} +3 -3
- package/dist/cjs/{newsletter-helpers-Dj0yYHZf.js.map → newsletter-helpers-Dr9JZ52F.js.map} +1 -1
- package/dist/cjs/u-conditional-render.cjs.entry.js +3 -3
- package/dist/cjs/u-config.cjs.entry.js +2 -2
- package/dist/cjs/u-field.u-raw-field.entry.cjs.js.map +1 -1
- package/dist/cjs/u-field_2.cjs.entry.js +1 -1
- package/dist/cjs/u-full-profile.cjs.entry.js +1 -1
- package/dist/cjs/u-full-profile.entry.cjs.js.map +1 -1
- package/dist/cjs/u-logout-button.cjs.entry.js +4 -4
- package/dist/cjs/u-magic-code-field.cjs.entry.js +3 -3
- package/dist/cjs/u-missing-fields-submit-button.cjs.entry.js +1 -1
- package/dist/cjs/u-newsletter-checkbox.cjs.entry.js +5 -5
- package/dist/cjs/u-newsletter-logout-button.cjs.entry.js +4 -4
- package/dist/cjs/u-newsletter-preference-checkbox.cjs.entry.js +5 -5
- package/dist/cjs/u-newsletter-resend-doi-button.cjs.entry.js +3 -3
- package/dist/cjs/u-newsletter-root.cjs.entry.js +4 -4
- package/dist/cjs/u-newsletter-toggle-subscription-button.cjs.entry.js +3 -3
- package/dist/cjs/u-passkey.cjs.entry.js +2 -2
- package/dist/cjs/u-profile.u-submit-button.entry.cjs.js.map +1 -1
- package/dist/cjs/u-profile_2.cjs.entry.js +2 -2
- package/dist/cjs/u-reset-password-button.cjs.entry.js +1 -1
- package/dist/cjs/u-send-magic-code-button.cjs.entry.js +2 -2
- package/dist/cjs/u-signin-step.cjs.entry.js +3 -3
- package/dist/cjs/u-spinner.cjs.entry.js +1 -1
- package/dist/cjs/u-spinner.entry.cjs.js.map +1 -1
- package/dist/cjs/u-ticketable-list.cjs.entry.js +4 -4
- package/dist/collection/api/base-service.js.map +1 -1
- package/dist/collection/auth/api/auth.js +1 -1
- package/dist/collection/auth/api/auth.js.map +1 -1
- package/dist/collection/newsletter/api/newsletters.js +1 -1
- package/dist/collection/newsletter/api/newsletters.js.map +1 -1
- package/dist/collection/profile/api/profile.js +1 -1
- package/dist/collection/profile/api/profile.js.map +1 -1
- package/dist/collection/profile/components/field/field.css +1 -1
- package/dist/collection/profile/components/full-profile/full-profile.css +1 -1
- package/dist/collection/shared/components/spinner/spinner.css +1 -1
- package/dist/collection/shared/components/submit-button/submit-button.css +1 -1
- package/dist/collection/ticketable/api/subscriptions.js.map +1 -1
- package/dist/collection/ticketable/api/ticketable-service.js +1 -1
- package/dist/collection/ticketable/api/ticketable-service.js.map +1 -1
- package/dist/collection/ticketable/api/tickets.js.map +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/index2.js +73 -73
- package/dist/components/index2.js.map +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/submit-button.js +1 -1
- package/dist/components/submit-button.js.map +1 -1
- package/dist/components/u-full-profile.js +1 -1
- package/dist/components/u-full-profile.js.map +1 -1
- package/dist/esm/{index-2p1QEJrx.js → index-KDhlhHtE.js} +75 -75
- package/dist/esm/index-KDhlhHtE.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/{newsletter-helpers-D64LTcSM.js → newsletter-helpers-UD82sbSI.js} +3 -3
- package/dist/esm/{newsletter-helpers-D64LTcSM.js.map → newsletter-helpers-UD82sbSI.js.map} +1 -1
- package/dist/esm/u-conditional-render.entry.js +3 -3
- package/dist/esm/u-config.entry.js +2 -2
- package/dist/esm/u-field.u-raw-field.entry.js.map +1 -1
- package/dist/esm/u-field_2.entry.js +1 -1
- package/dist/esm/u-full-profile.entry.js +1 -1
- package/dist/esm/u-full-profile.entry.js.map +1 -1
- package/dist/esm/u-logout-button.entry.js +4 -4
- package/dist/esm/u-magic-code-field.entry.js +3 -3
- package/dist/esm/u-missing-fields-submit-button.entry.js +1 -1
- package/dist/esm/u-newsletter-checkbox.entry.js +5 -5
- package/dist/esm/u-newsletter-logout-button.entry.js +4 -4
- package/dist/esm/u-newsletter-preference-checkbox.entry.js +5 -5
- package/dist/esm/u-newsletter-resend-doi-button.entry.js +3 -3
- package/dist/esm/u-newsletter-root.entry.js +4 -4
- package/dist/esm/u-newsletter-toggle-subscription-button.entry.js +3 -3
- package/dist/esm/u-passkey.entry.js +2 -2
- package/dist/esm/u-profile.u-submit-button.entry.js.map +1 -1
- package/dist/esm/u-profile_2.entry.js +2 -2
- package/dist/esm/u-reset-password-button.entry.js +1 -1
- package/dist/esm/u-send-magic-code-button.entry.js +2 -2
- package/dist/esm/u-signin-step.entry.js +3 -3
- package/dist/esm/u-spinner.entry.js +1 -1
- package/dist/esm/u-spinner.entry.js.map +1 -1
- package/dist/esm/u-ticketable-list.entry.js +4 -4
- package/dist/sdk/index.esm.js +1 -1
- package/dist/sdk/p-029434d7.entry.js +2 -0
- package/dist/sdk/{p-098eef67.entry.js.map → p-029434d7.entry.js.map} +1 -1
- package/dist/sdk/{p-32da9922.entry.js → p-2c6643be.entry.js} +2 -2
- package/dist/sdk/{p-32da9922.entry.js.map → p-2c6643be.entry.js.map} +1 -1
- package/dist/sdk/{p-ecc7fcff.entry.js → p-3e4ee0cf.entry.js} +2 -2
- package/dist/sdk/{p-c4618822.entry.js → p-44be485d.entry.js} +2 -2
- package/dist/sdk/{p-a037bbe3.entry.js → p-62801f91.entry.js} +2 -2
- package/dist/sdk/{p-adcb7911.entry.js → p-63e1cdf9.entry.js} +2 -2
- package/dist/sdk/p-66d25b5e.entry.js +2 -0
- package/dist/sdk/{p-16d763fd.entry.js → p-6c76044f.entry.js} +2 -2
- package/dist/sdk/{p-1149e044.entry.js → p-6daca8d9.entry.js} +2 -2
- package/dist/sdk/p-74a76838.entry.js +2 -0
- package/dist/sdk/{p-DGDhaqCd.js → p-BO-OTPWn.js} +2 -2
- package/dist/sdk/p-BO-OTPWn.js.map +1 -0
- package/dist/sdk/{p-C4aHo4nN.js → p-BlsBg3Pe.js} +2 -2
- package/dist/sdk/{p-C4aHo4nN.js.map → p-BlsBg3Pe.js.map} +1 -1
- package/dist/sdk/{p-fb665a5c.entry.js → p-aab94643.entry.js} +2 -2
- package/dist/sdk/{p-1d404c36.entry.js → p-ad8f83a8.entry.js} +2 -2
- package/dist/sdk/p-b79d2876.entry.js +2 -0
- package/dist/sdk/{p-86d16818.entry.js.map → p-b79d2876.entry.js.map} +1 -1
- package/dist/sdk/{p-7099bd56.entry.js → p-d5a1dc7a.entry.js} +2 -2
- package/dist/sdk/{p-ce4ab77c.entry.js → p-d90bd8ef.entry.js} +2 -2
- package/dist/sdk/{p-3d3a9c90.entry.js → p-d9afbda4.entry.js} +2 -2
- package/dist/sdk/{p-67af762e.entry.js → p-da5803d2.entry.js} +2 -2
- package/dist/sdk/{p-67af762e.entry.js.map → p-da5803d2.entry.js.map} +1 -1
- package/dist/sdk/{p-fc67cf07.entry.js → p-da7f573e.entry.js} +2 -2
- package/dist/sdk/{p-43024bd6.entry.js → p-f0e650a2.entry.js} +2 -2
- package/dist/sdk/{p-ca4e57f2.entry.js → p-f548e56b.entry.js} +2 -2
- package/dist/sdk/sdk.esm.js +1 -1
- package/dist/sdk/u-field.u-raw-field.entry.esm.js.map +1 -1
- package/dist/sdk/u-full-profile.entry.esm.js.map +1 -1
- package/dist/sdk/u-profile.u-submit-button.entry.esm.js.map +1 -1
- package/dist/sdk/u-spinner.entry.esm.js.map +1 -1
- package/dist/types/api/base-service.d.ts +1 -1
- package/dist/types/auth/api/auth.d.ts +1 -1
- package/dist/types/auth/api/schemas.d.ts +66 -66
- package/dist/types/auth/auth-helpers.d.ts +74 -74
- package/dist/types/newsletter/api/newsletters.d.ts +1 -1
- package/dist/types/profile/api/profile.d.ts +1 -1
- package/dist/types/ticketable/api/subscriptions.d.ts +1 -1
- package/dist/types/ticketable/api/ticketable-service.d.ts +1 -1
- package/dist/types/ticketable/api/tickets.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/index-CvFbf5-D.js.map +0 -1
- package/dist/esm/index-2p1QEJrx.js.map +0 -1
- package/dist/sdk/p-098eef67.entry.js +0 -2
- package/dist/sdk/p-0e74de96.entry.js +0 -2
- package/dist/sdk/p-86d16818.entry.js +0 -2
- package/dist/sdk/p-DGDhaqCd.js.map +0 -1
- package/dist/sdk/p-d143e097.entry.js +0 -2
- /package/dist/sdk/{p-ecc7fcff.entry.js.map → p-3e4ee0cf.entry.js.map} +0 -0
- /package/dist/sdk/{p-c4618822.entry.js.map → p-44be485d.entry.js.map} +0 -0
- /package/dist/sdk/{p-a037bbe3.entry.js.map → p-62801f91.entry.js.map} +0 -0
- /package/dist/sdk/{p-adcb7911.entry.js.map → p-63e1cdf9.entry.js.map} +0 -0
- /package/dist/sdk/{p-d143e097.entry.js.map → p-66d25b5e.entry.js.map} +0 -0
- /package/dist/sdk/{p-16d763fd.entry.js.map → p-6c76044f.entry.js.map} +0 -0
- /package/dist/sdk/{p-1149e044.entry.js.map → p-6daca8d9.entry.js.map} +0 -0
- /package/dist/sdk/{p-0e74de96.entry.js.map → p-74a76838.entry.js.map} +0 -0
- /package/dist/sdk/{p-fb665a5c.entry.js.map → p-aab94643.entry.js.map} +0 -0
- /package/dist/sdk/{p-1d404c36.entry.js.map → p-ad8f83a8.entry.js.map} +0 -0
- /package/dist/sdk/{p-7099bd56.entry.js.map → p-d5a1dc7a.entry.js.map} +0 -0
- /package/dist/sdk/{p-ce4ab77c.entry.js.map → p-d90bd8ef.entry.js.map} +0 -0
- /package/dist/sdk/{p-3d3a9c90.entry.js.map → p-d9afbda4.entry.js.map} +0 -0
- /package/dist/sdk/{p-fc67cf07.entry.js.map → p-da7f573e.entry.js.map} +0 -0
- /package/dist/sdk/{p-43024bd6.entry.js.map → p-f0e650a2.entry.js.map} +0 -0
- /package/dist/sdk/{p-ca4e57f2.entry.js.map → p-f548e56b.entry.js.map} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-B_N5xKgH.js');
|
|
4
|
+
var profileStore = require('./profile-store-P_BcYkef.js');
|
|
4
5
|
var unidyStore = require('./unidy-store-7AbWnZ6g.js');
|
|
5
6
|
var authStore = require('./auth-store-DC9EVec8.js');
|
|
6
7
|
var i18n = require('./i18n-BAZB-eHh.js');
|
|
7
|
-
var profileStore = require('./profile-store-P_BcYkef.js');
|
|
8
|
-
var flashStore = require('./flash-store-BuIBuQDx.js');
|
|
9
8
|
var componentUtils = require('./component-utils-BpMyeVQo.js');
|
|
9
|
+
var flashStore = require('./flash-store-BuIBuQDx.js');
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Base API client with shared functionality for both browser and standalone environments.
|
|
@@ -3989,6 +3989,77 @@ const PaginationParamsSchema = object({
|
|
|
3989
3989
|
limit: number().int().min(0).max(250),
|
|
3990
3990
|
});
|
|
3991
3991
|
|
|
3992
|
+
/** Default no-op error reporter */
|
|
3993
|
+
const noopErrorReporter = {
|
|
3994
|
+
captureException: () => { },
|
|
3995
|
+
};
|
|
3996
|
+
/**
|
|
3997
|
+
* Default console logger for services.
|
|
3998
|
+
*
|
|
3999
|
+
* Note: This intentionally doesn't use the logger.ts module because:
|
|
4000
|
+
* 1. Services need to work in non-browser environments (standalone/Node.js)
|
|
4001
|
+
* 2. logger.ts is designed for Stencil components with browser-specific features
|
|
4002
|
+
* (localStorage-based log levels, UnidyComponent mixin)
|
|
4003
|
+
* 3. Services allow dependency injection of custom loggers for flexibility
|
|
4004
|
+
*/
|
|
4005
|
+
const consoleLogger = {
|
|
4006
|
+
error: console.error.bind(console),
|
|
4007
|
+
warn: console.warn.bind(console),
|
|
4008
|
+
info: console.info.bind(console),
|
|
4009
|
+
debug: console.debug.bind(console),
|
|
4010
|
+
};
|
|
4011
|
+
class BaseService {
|
|
4012
|
+
client;
|
|
4013
|
+
logger;
|
|
4014
|
+
errorReporter;
|
|
4015
|
+
getIdToken;
|
|
4016
|
+
getLocale;
|
|
4017
|
+
constructor(client, serviceName, deps) {
|
|
4018
|
+
this.client = client;
|
|
4019
|
+
// Use injected dependencies or defaults
|
|
4020
|
+
this.logger = deps?.logger ?? consoleLogger;
|
|
4021
|
+
this.errorReporter = deps?.errorReporter ?? noopErrorReporter;
|
|
4022
|
+
this.getIdToken = deps?.getIdToken ?? (async () => null);
|
|
4023
|
+
this.getLocale = deps?.getLocale ?? (() => "en");
|
|
4024
|
+
// Prefix logger if using console
|
|
4025
|
+
if (!deps?.logger) {
|
|
4026
|
+
this.logger = {
|
|
4027
|
+
error: (...args) => console.error(`[${serviceName}]`, ...args),
|
|
4028
|
+
warn: (...args) => console.warn(`[${serviceName}]`, ...args),
|
|
4029
|
+
info: (...args) => console.info(`[${serviceName}]`, ...args),
|
|
4030
|
+
debug: (...args) => console.debug(`[${serviceName}]`, ...args),
|
|
4031
|
+
};
|
|
4032
|
+
}
|
|
4033
|
+
}
|
|
4034
|
+
handleResponse(response, handler) {
|
|
4035
|
+
if (response.connectionError) {
|
|
4036
|
+
return ["connection_failed", null];
|
|
4037
|
+
}
|
|
4038
|
+
try {
|
|
4039
|
+
return handler();
|
|
4040
|
+
}
|
|
4041
|
+
catch (error) {
|
|
4042
|
+
this.logger.error("Schema validation error", error);
|
|
4043
|
+
this.errorReporter.captureException(error);
|
|
4044
|
+
// Use safeParse to avoid throwing if response.data doesn't match the schema
|
|
4045
|
+
const parsed = SchemaValidationErrorSchema.safeParse(response.data);
|
|
4046
|
+
const schemaError = parsed.success
|
|
4047
|
+
? parsed.data
|
|
4048
|
+
: { error_identifier: "schema_validation_error", errors: [String(error)] };
|
|
4049
|
+
return ["schema_validation_error", schemaError];
|
|
4050
|
+
}
|
|
4051
|
+
}
|
|
4052
|
+
buildAuthHeaders(headers) {
|
|
4053
|
+
const filtered = Object.entries(headers).reduce((acc, [key, value]) => {
|
|
4054
|
+
if (value !== undefined) {
|
|
4055
|
+
acc[key] = value;
|
|
4056
|
+
}
|
|
4057
|
+
return acc;
|
|
4058
|
+
}, {});
|
|
4059
|
+
return Object.keys(filtered).length > 0 ? filtered : undefined;
|
|
4060
|
+
}
|
|
4061
|
+
}
|
|
4062
|
+
|
|
3992
4063
|
// Field type enum
|
|
3993
4064
|
const FieldTypeEnum = _enum([
|
|
3994
4065
|
"text",
|
|
@@ -5503,77 +5574,6 @@ class Auth {
|
|
|
5503
5574
|
}
|
|
5504
5575
|
}
|
|
5505
5576
|
|
|
5506
|
-
/** Default no-op error reporter */
|
|
5507
|
-
const noopErrorReporter = {
|
|
5508
|
-
captureException: () => { },
|
|
5509
|
-
};
|
|
5510
|
-
/**
|
|
5511
|
-
* Default console logger for services.
|
|
5512
|
-
*
|
|
5513
|
-
* Note: This intentionally doesn't use the logger.ts module because:
|
|
5514
|
-
* 1. Services need to work in non-browser environments (standalone/Node.js)
|
|
5515
|
-
* 2. logger.ts is designed for Stencil components with browser-specific features
|
|
5516
|
-
* (localStorage-based log levels, UnidyComponent mixin)
|
|
5517
|
-
* 3. Services allow dependency injection of custom loggers for flexibility
|
|
5518
|
-
*/
|
|
5519
|
-
const consoleLogger = {
|
|
5520
|
-
error: console.error.bind(console),
|
|
5521
|
-
warn: console.warn.bind(console),
|
|
5522
|
-
info: console.info.bind(console),
|
|
5523
|
-
debug: console.debug.bind(console),
|
|
5524
|
-
};
|
|
5525
|
-
class BaseService {
|
|
5526
|
-
client;
|
|
5527
|
-
logger;
|
|
5528
|
-
errorReporter;
|
|
5529
|
-
getIdToken;
|
|
5530
|
-
getLocale;
|
|
5531
|
-
constructor(client, serviceName, deps) {
|
|
5532
|
-
this.client = client;
|
|
5533
|
-
// Use injected dependencies or defaults
|
|
5534
|
-
this.logger = deps?.logger ?? consoleLogger;
|
|
5535
|
-
this.errorReporter = deps?.errorReporter ?? noopErrorReporter;
|
|
5536
|
-
this.getIdToken = deps?.getIdToken ?? (async () => null);
|
|
5537
|
-
this.getLocale = deps?.getLocale ?? (() => "en");
|
|
5538
|
-
// Prefix logger if using console
|
|
5539
|
-
if (!deps?.logger) {
|
|
5540
|
-
this.logger = {
|
|
5541
|
-
error: (...args) => console.error(`[${serviceName}]`, ...args),
|
|
5542
|
-
warn: (...args) => console.warn(`[${serviceName}]`, ...args),
|
|
5543
|
-
info: (...args) => console.info(`[${serviceName}]`, ...args),
|
|
5544
|
-
debug: (...args) => console.debug(`[${serviceName}]`, ...args),
|
|
5545
|
-
};
|
|
5546
|
-
}
|
|
5547
|
-
}
|
|
5548
|
-
handleResponse(response, handler) {
|
|
5549
|
-
if (response.connectionError) {
|
|
5550
|
-
return ["connection_failed", null];
|
|
5551
|
-
}
|
|
5552
|
-
try {
|
|
5553
|
-
return handler();
|
|
5554
|
-
}
|
|
5555
|
-
catch (error) {
|
|
5556
|
-
this.logger.error("Schema validation error", error);
|
|
5557
|
-
this.errorReporter.captureException(error);
|
|
5558
|
-
// Use safeParse to avoid throwing if response.data doesn't match the schema
|
|
5559
|
-
const parsed = SchemaValidationErrorSchema.safeParse(response.data);
|
|
5560
|
-
const schemaError = parsed.success
|
|
5561
|
-
? parsed.data
|
|
5562
|
-
: { error_identifier: "schema_validation_error", errors: [String(error)] };
|
|
5563
|
-
return ["schema_validation_error", schemaError];
|
|
5564
|
-
}
|
|
5565
|
-
}
|
|
5566
|
-
buildAuthHeaders(headers) {
|
|
5567
|
-
const filtered = Object.entries(headers).reduce((acc, [key, value]) => {
|
|
5568
|
-
if (value !== undefined) {
|
|
5569
|
-
acc[key] = value;
|
|
5570
|
-
}
|
|
5571
|
-
return acc;
|
|
5572
|
-
}, {});
|
|
5573
|
-
return Object.keys(filtered).length > 0 ? filtered : undefined;
|
|
5574
|
-
}
|
|
5575
|
-
}
|
|
5576
|
-
|
|
5577
5577
|
/** Default browser dependencies using Sentry and the SDK logger */
|
|
5578
5578
|
function createBrowserDeps(serviceName) {
|
|
5579
5579
|
return {
|
|
@@ -5634,6 +5634,6 @@ exports.TicketsService = TicketsService;
|
|
|
5634
5634
|
exports.UnidyClient = UnidyClient;
|
|
5635
5635
|
exports.UserProfileSchema = UserProfileSchema;
|
|
5636
5636
|
exports.getUnidyClient = getUnidyClient;
|
|
5637
|
-
//# sourceMappingURL=index-
|
|
5637
|
+
//# sourceMappingURL=index-DDbhp_lW.js.map
|
|
5638
5638
|
|
|
5639
|
-
//# sourceMappingURL=index-
|
|
5639
|
+
//# sourceMappingURL=index-DDbhp_lW.js.map
|