@transcommerce/cwm-shared 1.1.63 → 1.1.65

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.
@@ -1207,12 +1207,62 @@ const DEFAULT_API_CONFIG = {
1207
1207
  "clientId": "5dd15878-aa4c-4adf-8650-b931f32a7b67",
1208
1208
  "locationId": "10f19fc5-31d0-4d76-bad4-ad593c9803ae"
1209
1209
  };
1210
+ const API_CONFIG_SCHEMA = {
1211
+ type: "object",
1212
+ title: "API Configuration",
1213
+ properties: {
1214
+ apiBaseUrl: {
1215
+ type: "string",
1216
+ title: "API Base URL", // Custom display name
1217
+ description: "The base URL of that API",
1218
+ default: "https://api.cheapweedmenu.com"
1219
+ },
1220
+ createSubscriptionApiRoute: {
1221
+ type: "string",
1222
+ title: "CreateSubscription Route",
1223
+ description: "The route to the CreateSubscription Function",
1224
+ default: "/CreateSubscription"
1225
+ },
1226
+ getInventoryApiRoute: {
1227
+ type: "string",
1228
+ title: "GetInventory Route",
1229
+ description: "The route to the GetInventory Function",
1230
+ default: "/GetInventoryApiRoute"
1231
+ },
1232
+ apiKey: {
1233
+ type: "string",
1234
+ title: "API Access Key",
1235
+ description: "The key used for access the API",
1236
+ default: "8b66d117-523-4b81-8c2f-52142c67d0cd"
1237
+ },
1238
+ clientId: {
1239
+ type: "string",
1240
+ title: "Client ID",
1241
+ description: "The client ID used to access the API",
1242
+ default: ""
1243
+ },
1244
+ locationId: {
1245
+ type: "string",
1246
+ title: "Location ID",
1247
+ description: "The location ID used to access the API",
1248
+ default: ""
1249
+ }
1250
+ },
1251
+ required: [
1252
+ "apiBaseUrl",
1253
+ "createSubscriptionApiRoute",
1254
+ "getInventoryApiRoute",
1255
+ "apiKey",
1256
+ "clientId",
1257
+ "locationId"
1258
+ ]
1259
+ };
1210
1260
 
1211
1261
  const DEFAULT_AUTH_CONFIG = {
1212
1262
  logLevel: "Info",
1213
1263
  clientId: "af1486e0-a27f-4c8d-8503-0752d90ce72d",
1214
1264
  tenantId: "445012c4-563a-4795-84d0-f7473a3197e0",
1215
- authority: "https://login.microsoft.com/445012c4-563a-4795-84d0-f7473a3197e0",
1265
+ authority: "https://login.microsoft.com/common",
1216
1266
  scopes: "openid,email,profile",
1217
1267
  redirect_uri: window.location.origin,
1218
1268
  logout_redirect_uri: window.location.origin + '/logout',
@@ -1221,6 +1271,86 @@ const DEFAULT_AUTH_CONFIG = {
1221
1271
  showPii: false,
1222
1272
  configConnectString: "Endpoint=https://cheap-weed-menus-appconfig.azconfig.io;Id=7F0m;Secret=7X8pkinp53tA8d4o2LfGUMHBWo54o68jYUSS7JcOnyQmh2lDXetkJQQJ99BEAC8vTInIcYexAAACAZAC2P1s"
1223
1273
  };
1274
+ const AUTH_CONFIG_SCHEMA = {
1275
+ type: "object",
1276
+ title: "Auth Configuration",
1277
+ properties: {
1278
+ logLevel: {
1279
+ type: "string",
1280
+ title: "Log Level", // Custom display name
1281
+ description: "The verbosity in which the system will log messages",
1282
+ enum: ["None", "Error", "Warn", "Info", "Debug", "Trace"],
1283
+ default: "Info"
1284
+ },
1285
+ clientId: {
1286
+ type: "string",
1287
+ title: "Client ID",
1288
+ description: "Azure AD application client identifier"
1289
+ },
1290
+ tenantId: {
1291
+ type: "string",
1292
+ title: "Tenant ID",
1293
+ description: "Azure AD tenant identifier"
1294
+ },
1295
+ authority: {
1296
+ type: "string",
1297
+ title: "Authority URL",
1298
+ description: "Azure AD authentication endpoint"
1299
+ },
1300
+ scopes: {
1301
+ type: "string",
1302
+ title: "OAuth Scopes",
1303
+ description: "Comma-separated list of permission scopes"
1304
+ },
1305
+ redirect_uri: {
1306
+ type: "string",
1307
+ title: "Redirect URI",
1308
+ description: "URL to redirect to after successful login"
1309
+ },
1310
+ logout_redirect_uri: {
1311
+ type: "string",
1312
+ title: "Logout Redirect URI",
1313
+ description: "URL to redirect to after logout"
1314
+ },
1315
+ prompt: {
1316
+ type: "string",
1317
+ title: "Login Prompt Behavior",
1318
+ description: "Controls how the login prompt is displayed",
1319
+ enum: ["none", "login", "select_account", "consent", "create"],
1320
+ default: "login"
1321
+ },
1322
+ msalDiagnosticsEnabled: {
1323
+ type: "boolean",
1324
+ title: "Enable MSAL Diagnostics",
1325
+ description: "Show detailed MSAL authentication diagnostics",
1326
+ default: false
1327
+ },
1328
+ showPii: {
1329
+ type: "boolean",
1330
+ title: "Show Personal Information",
1331
+ description: "Include personally identifiable information in logs",
1332
+ default: false
1333
+ },
1334
+ configConnectString: {
1335
+ type: "string",
1336
+ title: "App Configuration Connect String",
1337
+ description: "Connection string to the Azure App Configuration instance"
1338
+ }
1339
+ },
1340
+ required: [
1341
+ "logLevel",
1342
+ "clientId",
1343
+ "tenantId",
1344
+ "authority",
1345
+ "scopes",
1346
+ "redirect_uri",
1347
+ "logout_redirect_uri",
1348
+ "prompt",
1349
+ "msalDiagnosticsEnabled",
1350
+ "showPii",
1351
+ "configConnectString"
1352
+ ]
1353
+ };
1224
1354
  const AUTH_CONFIG = new InjectionToken('AUTH_CONFIG');
1225
1355
 
1226
1356
  const DEFAULT_CAROUSEL_CONFIG = {
@@ -1233,12 +1363,162 @@ const DEFAULT_CAROUSEL_CONFIG = {
1233
1363
  "speed": 500,
1234
1364
  "arrows": false
1235
1365
  };
1366
+ const CAROUSEL_CONFIG_SCHEMA = {
1367
+ type: "object",
1368
+ title: "Carousel Configuration",
1369
+ properties: {
1370
+ slidesToShow: {
1371
+ type: "number",
1372
+ title: "Slides to show", // Custom display name
1373
+ description: "The number of slides that will be visible",
1374
+ default: 3
1375
+ },
1376
+ slidesToScroll: {
1377
+ type: "number",
1378
+ title: "Slides to scroll",
1379
+ description: "The number of slides that will scroll on each scroll event",
1380
+ default: 1
1381
+ },
1382
+ dots: {
1383
+ type: "boolean",
1384
+ title: "Display dots",
1385
+ description: "Determines if dots are visible to represent the number of slides",
1386
+ default: false
1387
+ },
1388
+ infinite: {
1389
+ type: "boolean",
1390
+ title: "Infinite loop",
1391
+ description: "Determines if slides rotate on an infinite loop",
1392
+ default: true
1393
+ },
1394
+ autoplay: {
1395
+ type: "boolean",
1396
+ title: "Autoplay",
1397
+ description: "Determines if slides will rotate automatically",
1398
+ default: true
1399
+ },
1400
+ autoplaySpeed: {
1401
+ type: "number",
1402
+ title: "Autoplay Speed",
1403
+ description: "The delay between each slide transition in milliseconds",
1404
+ default: 10000
1405
+ },
1406
+ speed: {
1407
+ type: "number",
1408
+ title: "Transition Speed",
1409
+ description: "The speed of the slide transition in milliseconds",
1410
+ default: 500
1411
+ },
1412
+ arrows: {
1413
+ type: "boolean",
1414
+ title: "Display Arrows",
1415
+ description: "Determines if navigation arrows are visible",
1416
+ default: false
1417
+ }
1418
+ },
1419
+ required: [
1420
+ "slidesToShow",
1421
+ "slidesToScroll",
1422
+ "dots",
1423
+ "infinite",
1424
+ "autoplay",
1425
+ "autoplaySpeed",
1426
+ "speed",
1427
+ "arrows"
1428
+ ]
1429
+ };
1236
1430
 
1237
1431
  const DEFAULT_MENU_BOARD_CONFIG = {
1238
1432
  "amountToScroll": 1,
1239
1433
  "autoScrollTimeout": 20,
1240
1434
  "dataAgeThreshold": 300000
1241
1435
  };
1436
+ const MENU_BOARD_CONFIG_SCHEMA = {
1437
+ type: "object",
1438
+ title: "Menu Board Configuration",
1439
+ properties: {
1440
+ amountToScroll: {
1441
+ type: "number",
1442
+ title: "Number of pixels", // Custom display name
1443
+ description: "Number of pixels to scroll each cycle",
1444
+ default: 1
1445
+ },
1446
+ autoScrollTimeout: {
1447
+ type: "number",
1448
+ title: "Auto Scroll Timeout",
1449
+ description: "The timeout duration for auto scroll cycle in seconds",
1450
+ default: 20
1451
+ },
1452
+ dataAgeThreshold: {
1453
+ type: "number",
1454
+ title: "Data Age Threshold",
1455
+ description: "The maximum age of data in milliseconds before the data is refreshed from the API",
1456
+ default: 300000
1457
+ }
1458
+ },
1459
+ required: ["amountToScroll", "autoScrollTimeout", "dataAgeThreshold"]
1460
+ };
1461
+
1462
+ const DEFAULT_SLIDE = {
1463
+ "image": "../../../assets/images/tuesday.png",
1464
+ "title": "Doobie Tuesday",
1465
+ "description": "10% off all pre-rolls & packs<",
1466
+ "highlighted": false,
1467
+ "textColor": "black",
1468
+ "backgroundColor": "white"
1469
+ };
1470
+ const SLIDE_SCHEMA = {
1471
+ type: "object",
1472
+ title: "Slide",
1473
+ properties: {
1474
+ image: {
1475
+ type: "string",
1476
+ title: "Image URL", // Custom display name
1477
+ description: "The URL of background image for the slide",
1478
+ default: "../../../assets/images/tuesday.png"
1479
+ },
1480
+ title: {
1481
+ type: "string",
1482
+ title: "Title",
1483
+ description: "The title text displayed on the slide",
1484
+ default: "Doobie Tuesday"
1485
+ },
1486
+ description: {
1487
+ type: "string",
1488
+ title: "Description",
1489
+ description: "The description text displayed on the slide",
1490
+ default: "10% off all pre-rolls & packs<"
1491
+ },
1492
+ highlighted: {
1493
+ type: "boolean",
1494
+ title: "Highlighted",
1495
+ description: "Determines if the slide is highlighted",
1496
+ default: false
1497
+ },
1498
+ textColor: {
1499
+ type: "string",
1500
+ title: "Text Color",
1501
+ description: "The color of the text on the slide",
1502
+ enum: ['red', 'green', 'blue', 'yellow', 'black', 'white'],
1503
+ default: "black"
1504
+ },
1505
+ backgroundColor: {
1506
+ type: "string",
1507
+ title: "Background Color",
1508
+ description: "The background color of the slide",
1509
+ enum: ['red', 'green', 'blue', 'yellow', 'black', 'white'],
1510
+ default: "white"
1511
+ }
1512
+ },
1513
+ required: [
1514
+ "image",
1515
+ "title",
1516
+ "description",
1517
+ "highlighted",
1518
+ "textColor",
1519
+ "backgroundColor"
1520
+ ]
1521
+ };
1242
1522
 
1243
1523
  const DEFAULT_SUBSCRIPTION_CONFIG = {
1244
1524
  amount: 1,
@@ -1246,6 +1526,37 @@ const DEFAULT_SUBSCRIPTION_CONFIG = {
1246
1526
  totalOccurrences: 12,
1247
1527
  trialOccurrences: 0
1248
1528
  };
1529
+ const SUBSCRIPTION_CONFIG_SCHEMA = {
1530
+ type: "object",
1531
+ title: "Subscription Configuration",
1532
+ properties: {
1533
+ amount: {
1534
+ type: "number",
1535
+ title: "Cost per occurrence", // Custom display name
1536
+ description: "The amount to charge for each subscription occurrence",
1537
+ default: 1
1538
+ },
1539
+ days: {
1540
+ type: "number",
1541
+ title: "Days between occurrences",
1542
+ description: "The number of days between each subscription occurrence",
1543
+ default: 30
1544
+ },
1545
+ totalOccurrences: {
1546
+ type: "number",
1547
+ title: "Total occurrences",
1548
+ description: "The total number of occurrences for the subscription",
1549
+ default: 12
1550
+ },
1551
+ trialOccurrences: {
1552
+ type: "number",
1553
+ title: "Trial occurrences",
1554
+ description: "The number of trial occurrences (free)",
1555
+ default: 0
1556
+ }
1557
+ },
1558
+ required: ["amount", "days", "totalOccurrences", "trialOccurrences"]
1559
+ };
1249
1560
 
1250
1561
  const DEFAULT_COMPANY_NAME = 'Test Weed Dispensary';
1251
1562
  const DEFAULT_CONFIGURATION = {
@@ -1314,6 +1625,48 @@ const DEFAULT_CONFIGURATION = {
1314
1625
  }
1315
1626
  ]
1316
1627
  };
1628
+ const CONFIGURATION_SCHEMA = {
1629
+ type: "object",
1630
+ title: "Customer Configuration",
1631
+ properties: {
1632
+ companyName: {
1633
+ type: "string",
1634
+ title: "Company Name",
1635
+ default: DEFAULT_COMPANY_NAME
1636
+ },
1637
+ authConfig: {
1638
+ ...AUTH_CONFIG_SCHEMA
1639
+ },
1640
+ apiConfig: {
1641
+ ...API_CONFIG_SCHEMA
1642
+ },
1643
+ subscriptionConfig: {
1644
+ ...SUBSCRIPTION_CONFIG_SCHEMA
1645
+ },
1646
+ menuBoardConfig: {
1647
+ ...MENU_BOARD_CONFIG_SCHEMA
1648
+ },
1649
+ footerCarouselConfig: {
1650
+ ...CAROUSEL_CONFIG_SCHEMA
1651
+ },
1652
+ footerCarouselSlideConfig: {
1653
+ type: "array",
1654
+ title: "Footer Carousel Slides Collection",
1655
+ description: "Configuration for each slide in the footer carousel",
1656
+ items: SLIDE_SCHEMA,
1657
+ default: DEFAULT_CONFIGURATION.footerCarouselSlideConfig
1658
+ }
1659
+ },
1660
+ required: [
1661
+ "companyName",
1662
+ "authConfig",
1663
+ "apiConfig",
1664
+ "subscriptionConfig",
1665
+ "menuBoardConfig",
1666
+ "footerCarouselConfig",
1667
+ "footerCarouselSlideConfig"
1668
+ ]
1669
+ };
1317
1670
 
1318
1671
  const EXAMPLE_CREATE_SUBSCRIPTION_REQUEST = {
1319
1672
  "creditCard": {
@@ -27282,15 +27635,6 @@ class Product {
27282
27635
  }
27283
27636
  }
27284
27637
 
27285
- const DEFAULT_SLIDE = {
27286
- "image": "../../../assets/images/tuesday.png",
27287
- "title": "Doobie Tuesday",
27288
- "description": "10% off all pre-rolls & packs<",
27289
- "highlighted": false,
27290
- "textColor": "black",
27291
- "backgroundColor": "white"
27292
- };
27293
-
27294
27638
  class SafeHtmlPipe {
27295
27639
  sanitizer;
27296
27640
  constructor(sanitizer) {
@@ -28000,5 +28344,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
28000
28344
  * Generated bundle index. Do not edit.
28001
28345
  */
28002
28346
 
28003
- export { AUTH_CONFIG, BaseApiService, Category, ClassLoggerService, ConfigService, Customer, CwmSharedModule, DEFAULT_API_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CAROUSEL_CONFIG, DEFAULT_COMPANY_NAME, DEFAULT_CONFIGURATION, DEFAULT_CUSTOMER, DEFAULT_INVENTORY_API_RESPONSE, DEFAULT_MENU_BOARD_CONFIG, DEFAULT_PROFILE, DEFAULT_SLIDE, DEFAULT_SUBSCRIPTION_CONFIG, DbKeys, EXAMPLE_CREATE_SUBSCRIPTION_REQUEST, ExternalNavigationComponent, InventoryApiService, Justifications, LocalStorageService, LogService, LoggingVerbosity, MockConfig, MockCustomer, MockInventoryApiResponse, MockProfile, NamedColors, NavigateToRouteComponent, OnElementStyle, PageNotFoundComponent, Product, Profile, SafeHtmlPipe, Stack, SubscriptionApiService, TimeSpan, TimeSpanOverflowError, UserTypes, Utilities, decodeToken, doWithLock, isTokenValid, msalGuardConfigFactory, msalInstanceFactory, msalInterceptorConfigFactory, waitFor };
28347
+ export { API_CONFIG_SCHEMA, AUTH_CONFIG, AUTH_CONFIG_SCHEMA, BaseApiService, CAROUSEL_CONFIG_SCHEMA, CONFIGURATION_SCHEMA, Category, ClassLoggerService, ConfigService, Customer, CwmSharedModule, DEFAULT_API_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CAROUSEL_CONFIG, DEFAULT_COMPANY_NAME, DEFAULT_CONFIGURATION, DEFAULT_CUSTOMER, DEFAULT_INVENTORY_API_RESPONSE, DEFAULT_MENU_BOARD_CONFIG, DEFAULT_PROFILE, DEFAULT_SLIDE, DEFAULT_SUBSCRIPTION_CONFIG, DbKeys, EXAMPLE_CREATE_SUBSCRIPTION_REQUEST, ExternalNavigationComponent, InventoryApiService, Justifications, LocalStorageService, LogService, LoggingVerbosity, MENU_BOARD_CONFIG_SCHEMA, MockConfig, MockCustomer, MockInventoryApiResponse, MockProfile, NamedColors, NavigateToRouteComponent, OnElementStyle, PageNotFoundComponent, Product, Profile, SLIDE_SCHEMA, SUBSCRIPTION_CONFIG_SCHEMA, SafeHtmlPipe, Stack, SubscriptionApiService, TimeSpan, TimeSpanOverflowError, UserTypes, Utilities, decodeToken, doWithLock, isTokenValid, msalGuardConfigFactory, msalInstanceFactory, msalInterceptorConfigFactory, waitFor };
28004
28348
  //# sourceMappingURL=transcommerce-cwm-shared.mjs.map