@transcommerce/cwm-shared 1.1.63 → 1.1.64

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