@jigx/core-sdk 1.2.0-next.1 → 1.2.0-next.11

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.
Files changed (66) hide show
  1. package/README.md +6 -82
  2. package/dist/PACKAGE.d.ts +1 -0
  3. package/dist/PACKAGE.d.ts.map +1 -1
  4. package/dist/PACKAGE.js +3 -2
  5. package/dist/abstract/zod.types.d.ts +1 -1
  6. package/dist/abstract/zod.types.d.ts.map +1 -1
  7. package/dist/abstract/zod.types.js +4 -5
  8. package/dist/action/index.d.ts +1 -0
  9. package/dist/action/index.d.ts.map +1 -1
  10. package/dist/action/index.js +2 -1
  11. package/dist/action/ja.evaluate.d.ts.map +1 -1
  12. package/dist/action/ja.evaluate.js +1 -1
  13. package/dist/action/ja.in-background.d.ts +7 -0
  14. package/dist/action/ja.in-background.d.ts.map +1 -1
  15. package/dist/action/ja.in-background.factory.d.ts +2 -0
  16. package/dist/action/ja.in-background.factory.d.ts.map +1 -1
  17. package/dist/action/ja.in-background.factory.js +3 -1
  18. package/dist/action/ja.in-background.js +12 -1
  19. package/dist/action/ja.on-button.factory.d.ts +2 -0
  20. package/dist/action/ja.on-button.factory.d.ts.map +1 -1
  21. package/dist/action/ja.on-button.factory.js +3 -1
  22. package/dist/action/ja.open-media-picker.abstract.d.ts +8 -0
  23. package/dist/action/ja.open-media-picker.abstract.d.ts.map +1 -1
  24. package/dist/action/ja.open-media-picker.abstract.js +1 -1
  25. package/dist/action/ja.open-media-picker.d.ts +8 -0
  26. package/dist/action/ja.open-media-picker.d.ts.map +1 -1
  27. package/dist/action/ja.open-media-picker.js +8 -1
  28. package/dist/action/ja.set-state.d.ts +22 -0
  29. package/dist/action/ja.set-state.d.ts.map +1 -0
  30. package/dist/action/ja.set-state.js +24 -0
  31. package/dist/action/ja.sync-entities.abstract.d.ts.map +1 -1
  32. package/dist/action/ja.sync-entities.abstract.js +1 -1
  33. package/dist/application/application.sdk.d.ts.map +1 -1
  34. package/dist/application/application.sdk.js +1 -1
  35. package/dist/assets/example-extraction-cache.json +4 -4
  36. package/dist/assets/extracted-core-sdk-examples.yaml +1012 -437
  37. package/dist/component/common/jc.picker-field-options.types.d.ts +4 -0
  38. package/dist/component/common/jc.picker-field-options.types.d.ts.map +1 -1
  39. package/dist/component/common/jc.picker-field-options.types.js +1 -1
  40. package/dist/component/jc.avatar-field.d.ts.map +1 -1
  41. package/dist/component/jc.avatar-field.js +4 -1
  42. package/dist/component/jc.entity-field.d.ts.map +1 -1
  43. package/dist/component/jc.entity-field.js +1 -1
  44. package/dist/component/jc.media-field.d.ts.map +1 -1
  45. package/dist/component/jc.media-field.js +4 -1
  46. package/dist/component/jc.view.d.ts.map +1 -1
  47. package/dist/component/jc.view.js +1 -1
  48. package/dist/datasource/datasource.sdk.d.ts.map +1 -1
  49. package/dist/datasource/datasource.sdk.js +1 -1
  50. package/dist/datasource/sqlite-normalizer.d.ts.map +1 -1
  51. package/dist/datasource/sqlite-normalizer.js +1 -1
  52. package/dist/function/function.rest.types.d.ts.map +1 -1
  53. package/dist/function/function.rest.types.js +1 -1
  54. package/dist/jsonata/builder.d.ts +14 -3
  55. package/dist/jsonata/builder.d.ts.map +1 -1
  56. package/dist/jsonata/builder.js +127 -15
  57. package/dist/screen/common/screen.input-definition.d.ts.map +1 -1
  58. package/dist/screen/common/screen.input-definition.js +1 -1
  59. package/dist/screen/common/screen.placeholder.d.ts.map +1 -1
  60. package/dist/screen/common/screen.placeholder.js +1 -1
  61. package/dist/screen/common/screen.preview.d.ts.map +1 -1
  62. package/dist/screen/common/screen.preview.js +1 -1
  63. package/dist/screen/screen.list.d.ts.map +1 -1
  64. package/dist/screen/screen.list.js +2 -1
  65. package/docs/pattern-build-deploy.md +2 -2
  66. package/package.json +2 -2
@@ -13,7 +13,10 @@
13
13
  complex UI
14
14
  code: |2-
15
15
  // Main expense management application
16
- const app = new ApplicationBuilder({ name: 'expense-management', title: 'Expense Management' }).with({ category: 'business' })
16
+ const app = new ApplicationBuilder({
17
+ name: 'expense-management',
18
+ title: 'Expense Management',
19
+ }).with({ category: 'business' })
17
20
  // Main dashboard screen with complex component hierarchy
18
21
  const homeScreen = app.addScreen.default({
19
22
  screenId: 'home',
@@ -21,7 +24,11 @@
21
24
  })
22
25
  // REST function for fetching expense receipts with pagination
23
26
  const restGetExpenseReceipt = app.addFunction
24
- .rest({ functionId: 'rest-get-expense-receipt', method: 'GET', url: 'https://{acumaticaurl}ExpenseReceipt' })
27
+ .rest({
28
+ functionId: 'rest-get-expense-receipt',
29
+ method: 'GET',
30
+ url: 'https://{acumaticaurl}ExpenseReceipt',
31
+ })
25
32
  .records('=$.data')
26
33
  .forRowsWithMatchingIds(true)
27
34
  .outputTransform(`=`, {
@@ -355,7 +362,11 @@
355
362
  code: |-
356
363
  // Function with pagination support
357
364
  const fn = app.addFunction
358
- .rest({ functionId: 'rest-get-expense-receipt', method: 'GET', url: 'https://{acumaticaurl}ExpenseReceipt' })
365
+ .rest({
366
+ functionId: 'rest-get-expense-receipt',
367
+ method: 'GET',
368
+ url: 'https://{acumaticaurl}ExpenseReceipt',
369
+ })
359
370
  .records('=$.data')
360
371
  .forRowsWithMatchingIds(true)
361
372
  .outputTransform(`=`, {
@@ -443,7 +454,9 @@
443
454
  // Create database tables
444
455
  app.addDatabase.default.table('sales', 'inventory', 'customers')
445
456
  // Create datasources
446
- app.addDatasource.sqlite({ datasourceId: 'sales-summary', provider: 'dynamic' }).entity('default/sales').query(`
457
+ app.addDatasource
458
+ .sqlite({ datasourceId: 'sales-summary', provider: 'dynamic' })
459
+ .entity('default/sales').query(`
447
460
  SELECT
448
461
  id,
449
462
  json_extract(data, '$.date') as date,
@@ -453,7 +466,9 @@
453
466
  WHERE json_extract(data, '$.date') >= date('now', '-30 days')
454
467
  ORDER BY json_extract(data, '$.date') DESC
455
468
  `)
456
- app.addDatasource.sqlite({ datasourceId: 'low-inventory', provider: 'dynamic' }).entity('default/inventory').query(`
469
+ app.addDatasource
470
+ .sqlite({ datasourceId: 'low-inventory', provider: 'dynamic' })
471
+ .entity('default/inventory').query(`
457
472
  SELECT
458
473
  id,
459
474
  json_extract(data, '$.name') as name,
@@ -521,7 +536,9 @@
521
536
  in joins
522
537
  code: |-
523
538
  // 1. Declare entities in datasource
524
- app.addDatasource.sqlite({ datasourceId: 'customers', provider: 'local' }).entities('customers', 'products') // Must match table names used in query
539
+ app.addDatasource
540
+ .sqlite({ datasourceId: 'customers', provider: 'local' })
541
+ .entities('customers', 'products') // Must match table names used in query
525
542
  // 2. Ensure tables exist in database
526
543
  app.addDatabase.default
527
544
  - id: rest-function-integration-example
@@ -609,7 +626,12 @@
609
626
  code: |-
610
627
  // SOAP function for web service integration
611
628
  const weatherFunction = app.addFunction
612
- .soap({ functionId: 'get-weather', connection: 'weather-service', method: 'GetWeather', wsdl: 'https://weather.com/wsdl' })
629
+ .soap({
630
+ functionId: 'get-weather',
631
+ connection: 'weather-service',
632
+ method: 'GetWeather',
633
+ wsdl: 'https://weather.com/wsdl',
634
+ })
613
635
  .outputTransform('$.Temperature')
614
636
  weatherFunction.params
615
637
  .body('city', 'London')
@@ -634,7 +656,8 @@
634
656
  code: |-
635
657
  // SQL function for database queries
636
658
  const app = new ApplicationBuilder({ name: 'sql-function-example' })
637
- const getCustomersFunction = app.addFunction.sql({ functionId: 'get-customers', connection: 'mydb' })
659
+ const getCustomersFunction = app.addFunction
660
+ .sql({ functionId: 'get-customers', connection: 'mydb' })
638
661
  .sql('SELECT * FROM customers WHERE active = @active AND region = @region')
639
662
  getCustomersFunction.params
640
663
  .input('$active', 'boolean', { value: true })
@@ -648,7 +671,8 @@
648
671
  "SELECT id, data FROM [default/customers] ORDER BY json_extract(data, '$.created_at') DESC",
649
672
  )
650
673
  // Stored procedure SQL functions
651
- const updateCustomerFunction = app.addFunction.sql({ functionId: 'update-customer', connection: 'mydb', method: 'execute' })
674
+ const updateCustomerFunction = app.addFunction
675
+ .sql({ functionId: 'update-customer', connection: 'mydb', method: 'execute' })
652
676
  .sql('sp_UpdateCustomer', 'procedure')
653
677
  updateCustomerFunction.params
654
678
  .input('$customerId', 'number', { value: 123 })
@@ -678,7 +702,10 @@
678
702
  datasource.query(`SELECT id, data FROM [default/products]`)
679
703
  // Query patterns based on datasource naming:
680
704
  // Single record - inferred from "customer", "get-customer", "customer-by-name"
681
- const singleCustomer = app.addDatasource.sqlite({ datasourceId: 'customer-by-name', provider: 'local' })
705
+ const singleCustomer = app.addDatasource.sqlite({
706
+ datasourceId: 'customer-by-name',
707
+ provider: 'local',
708
+ })
682
709
  singleCustomer.entity('default/customers')
683
710
  singleCustomer.query(`
684
711
  SELECT cus.id,
@@ -689,7 +716,10 @@
689
716
  `)
690
717
  singleCustomer.queryParameter('name', '=@ctx.jig.inputs.customerName')
691
718
  // List records - inferred from "products", "all-products", "product-list"
692
- const productList = app.addDatasource.sqlite({ datasourceId: 'product-list', provider: 'local' })
719
+ const productList = app.addDatasource.sqlite({
720
+ datasourceId: 'product-list',
721
+ provider: 'local',
722
+ })
693
723
  productList.entity('default/products')
694
724
  productList.query(`
695
725
  SELECT prd.id,
@@ -701,7 +731,10 @@
701
731
  ORDER BY json_extract(prd.data, '$.name')
702
732
  `)
703
733
  // Sorted records - inferred from "contacts-sorted-by-name"
704
- const sortedContacts = app.addDatasource.sqlite({ datasourceId: 'contacts-by-last-login', provider: 'local' })
734
+ const sortedContacts = app.addDatasource.sqlite({
735
+ datasourceId: 'contacts-by-last-login',
736
+ provider: 'local',
737
+ })
705
738
  sortedContacts.entity('default/contacts')
706
739
  sortedContacts.query(`
707
740
  SELECT con.id,
@@ -720,7 +753,10 @@
720
753
  FROM [default/parts] AS prt
721
754
  `)
722
755
  // Complex joins with parameters
723
- const customerOrders = app.addDatasource.sqlite({ datasourceId: 'customer-orders', provider: 'dynamic' })
756
+ const customerOrders = app.addDatasource.sqlite({
757
+ datasourceId: 'customer-orders',
758
+ provider: 'dynamic',
759
+ })
724
760
  customerOrders.entity('default/customers')
725
761
  customerOrders.entity('default/orders')
726
762
  customerOrders.query(`
@@ -959,8 +995,14 @@
959
995
  customerInfo.addControl
960
996
  .entityField({ label: 'Name', value: '=@ctx.datasources.customer-detail.data.name' }) // Direct access, no [0]
961
997
  .with({ style: { isPrimary: true } })
962
- customerInfo.addControl.entityField({ label: 'Email', value: '=@ctx.datasources.customer-detail.data.email' })
963
- customerInfo.addControl.entityField({ label: 'Phone', value: '=@ctx.datasources.customer-detail.data.phone' })
998
+ customerInfo.addControl.entityField({
999
+ label: 'Email',
1000
+ value: '=@ctx.datasources.customer-detail.data.email',
1001
+ })
1002
+ customerInfo.addControl.entityField({
1003
+ label: 'Phone',
1004
+ value: '=@ctx.datasources.customer-detail.data.phone',
1005
+ })
964
1006
  customerInfo.addControl.entityField({
965
1007
  label: 'Address',
966
1008
  value:
@@ -1082,8 +1124,9 @@
1082
1124
  helperText: 'Between $1 and $10,000',
1083
1125
  })
1084
1126
  // Create datasource for validation errors (simulated)
1085
- app.addDatasource.sqlite({ datasourceId: 'validation-errors', provider: 'local' }).entity('default/validation-errors')
1086
- .query(`
1127
+ app.addDatasource
1128
+ .sqlite({ datasourceId: 'validation-errors', provider: 'local' })
1129
+ .entity('default/validation-errors').query(`
1087
1130
  SELECT
1088
1131
  id,
1089
1132
  json_extract(data, '$.field') as field,
@@ -1131,7 +1174,11 @@
1131
1174
  external sources on-demand or scheduled
1132
1175
  code: |-
1133
1176
  // 1. REST function to provide data
1134
- const getUsersApi = app.addFunction.rest({ functionId: 'get-users-api', method: 'GET', url: 'https://api.company.com/users' })
1177
+ const getUsersApi = app.addFunction.rest({
1178
+ functionId: 'get-users-api',
1179
+ method: 'GET',
1180
+ url: 'https://api.company.com/users',
1181
+ })
1135
1182
  getUsersApi.params.header('Authorization', 'Bearer =@ctx.solution.state.apiToken')
1136
1183
  getUsersApi.json()
1137
1184
  getUsersApi.records('=$.data.users')
@@ -1139,7 +1186,10 @@
1139
1186
  const usersData = app.addDatasource.sqlite({ datasourceId: 'users', provider: 'dynamic' })
1140
1187
  usersData.entity('default/users')
1141
1188
  // 3. SQL function for complex data processing
1142
- const getSalesMetrics = app.addFunction.sql({ functionId: 'sales-metrics', connection: 'analytics-db' })
1189
+ const getSalesMetrics = app.addFunction.sql({
1190
+ functionId: 'sales-metrics',
1191
+ connection: 'analytics-db',
1192
+ })
1143
1193
  getSalesMetrics.providerQuery(`
1144
1194
  SELECT
1145
1195
  region,
@@ -1155,14 +1205,24 @@
1155
1205
  value: '=@ctx.jig.inputs.dateRange.start',
1156
1206
  })
1157
1207
  // 4. Function-driven datasource with SQL function
1158
- const salesData = app.addDatasource.sqlite({ datasourceId: 'sales-metrics', provider: 'dynamic' })
1208
+ const salesData = app.addDatasource.sqlite({
1209
+ datasourceId: 'sales-metrics',
1210
+ provider: 'dynamic',
1211
+ })
1159
1212
  salesData.entity('default/sales')
1160
1213
  // 5. Multiple REST endpoints combined
1161
- const getInventoryApi = app.addFunction.rest({ functionId: 'inventory-api', method: 'GET', url: 'https://api.inventory.com/items' })
1214
+ const getInventoryApi = app.addFunction.rest({
1215
+ functionId: 'inventory-api',
1216
+ method: 'GET',
1217
+ url: 'https://api.inventory.com/items',
1218
+ })
1162
1219
  getInventoryApi.params.query('status', { value: 'active', type: 'string' })
1163
1220
  getInventoryApi.params.header('API-Key', '=@ctx.solution.state.inventoryKey')
1164
1221
  getInventoryApi.json()
1165
- const inventoryData = app.addDatasource.sqlite({ datasourceId: 'inventory', provider: 'dynamic' })
1222
+ const inventoryData = app.addDatasource.sqlite({
1223
+ datasourceId: 'inventory',
1224
+ provider: 'dynamic',
1225
+ })
1166
1226
  inventoryData.entity('default/inventory')
1167
1227
  - id: entity-sync-and-queue-management-example
1168
1228
  name: Entity Sync and Queue Management
@@ -1356,7 +1416,9 @@
1356
1416
  automatically when connection is restored
1357
1417
  code: |2-
1358
1418
  // Configure datasource with offline support
1359
- app.addDatasource.sqlite({ datasourceId: 'customers', provider: 'local' }).entity('default/customers').query(`
1419
+ app.addDatasource
1420
+ .sqlite({ datasourceId: 'customers', provider: 'local' })
1421
+ .entity('default/customers').query(`
1360
1422
  SELECT id, data FROM [default/customers]
1361
1423
  WHERE json_extract(data, '$.active') = true
1362
1424
  ORDER BY json_extract(data, '$.lastModified') DESC
@@ -1819,7 +1881,9 @@
1819
1881
  navigates to detail screen. Demonstrates master-detail pattern in Jigx"
1820
1882
  code: |2-
1821
1883
  // Create datasource for students
1822
- app.addDatasource.sqlite({ datasourceId: 'students', provider: 'dynamic' }).entity('default/students').query(`
1884
+ app.addDatasource
1885
+ .sqlite({ datasourceId: 'students', provider: 'dynamic' })
1886
+ .entity('default/students').query(`
1823
1887
  SELECT
1824
1888
  id,
1825
1889
  json_extract(data, '$.firstName') as firstName,
@@ -2015,11 +2079,14 @@
2015
2079
  value: '=@ctx.jig.inputs.city',
2016
2080
  })
2017
2081
  // Dropdown with static datasource
2018
- app.addDatasource.static({ datasourceId: 'us-states', data: [
2019
- { id: 'WA', state: 'Washington' },
2020
- { id: 'CA', state: 'California' },
2021
- { id: 'NY', state: 'New York' },
2022
- ] })
2082
+ app.addDatasource.static({
2083
+ datasourceId: 'us-states',
2084
+ data: [
2085
+ { id: 'WA', state: 'Washington' },
2086
+ { id: 'CA', state: 'California' },
2087
+ { id: 'NY', state: 'New York' },
2088
+ ],
2089
+ })
2023
2090
  const stateDropdown = step2Screen.addControl.dropdown({
2024
2091
  instanceId: 'state',
2025
2092
  label: 'State',
@@ -2125,7 +2192,9 @@
2125
2192
  alerts"
2126
2193
  code: |2-
2127
2194
  // Auto-refreshing datasource
2128
- app.addDatasource.sqlite({ datasourceId: 'system-status', provider: 'dynamic' }).entity('default/status').query(`
2195
+ app.addDatasource
2196
+ .sqlite({ datasourceId: 'system-status', provider: 'dynamic' })
2197
+ .entity('default/status').query(`
2129
2198
  SELECT
2130
2199
  id,
2131
2200
  json_extract(data, '$.health') as health,
@@ -2433,7 +2502,9 @@
2433
2502
  tabs and widget grid. Support conditional display based on user roles
2434
2503
  code: |-
2435
2504
  // Configure home hub
2436
- const app = new ApplicationBuilder({ name: 'my-app', title: 'My Business App' }).with({ category: 'business' })
2505
+ const app = new ApplicationBuilder({ name: 'my-app', title: 'My Business App' }).with({
2506
+ category: 'business',
2507
+ })
2437
2508
  // Add home hub with navigation tabs
2438
2509
  app.addTab({ screenId: 'dashboard', icon: 'home', label: 'Dashboard' })
2439
2510
  app.addTab({ screenId: 'tasks', icon: 'task-checklist', label: 'Tasks' })
@@ -2453,7 +2524,7 @@
2453
2524
  data
2454
2525
  code: |-
2455
2526
  // Widget with navigation
2456
- const screen = app.addScreen.staticGrid({ screenId: 'grid-1', title: 'Static Grid', })
2527
+ const screen = app.addScreen.staticGrid({ screenId: 'grid-1', title: 'Static Grid' })
2457
2528
  // Add a grid item
2458
2529
  screen.addControl.gridItem().addControl.widget().screenId('some-jig-id')
2459
2530
  - id: widget-grid-configuration-example
@@ -2470,7 +2541,7 @@
2470
2541
  different widget sizes and conditional display. Enable navigation and data
2471
2542
  binding
2472
2543
  code: |-
2473
- const screen = app.addScreen.staticGrid({ screenId: 'grid-1', title: 'Static Grid', })
2544
+ const screen = app.addScreen.staticGrid({ screenId: 'grid-1', title: 'Static Grid' })
2474
2545
  // Add a grid item
2475
2546
  screen.addControl
2476
2547
  .gridItem()
@@ -2670,7 +2741,9 @@
2670
2741
  authentication requirements. Support deep linking with parameters
2671
2742
  code: |2-
2672
2743
  // Create datasource for navigation items
2673
- app.addDatasource.sqlite({ datasourceId: 'nav-items', provider: 'local' }).entity('default/nav-items').query(`
2744
+ app.addDatasource
2745
+ .sqlite({ datasourceId: 'nav-items', provider: 'local' })
2746
+ .entity('default/nav-items').query(`
2674
2747
  SELECT
2675
2748
  id,
2676
2749
  json_extract(data, '$.title') as title,
@@ -2693,7 +2766,7 @@
2693
2766
  listItem.subtitle('=@ctx.current.item.type')
2694
2767
  // Conditional navigation based on item type
2695
2768
  const buttons = screen.bottomPanel({ numberOfVisibleActions: 1 })
2696
- const navButton = buttons.add.list({ concurrency: 'sequential', title: 'Navigate' })
2769
+ const navButton = buttons.add.list({ concurrency: 'sequential', title: 'Navigate' })
2697
2770
  // Check if external URL
2698
2771
  navButton.actions.openUrl({
2699
2772
  instanceId: 'open-external',
@@ -2808,8 +2881,8 @@
2808
2881
  // Common date formats
2809
2882
  .value('=$fromMillis($now(), "[Y]-[M01]-[D01]")') // 2024-03-15
2810
2883
  .value('=$fromMillis($now(), "[D] [MNn] [Y]")') // 15 Mar 2024
2811
- .value('=$fromMillis($now(), "[h]:[m01] [P]")') // 3:45 PM
2812
- .value(`=(
2884
+ // 3:45 PM
2885
+ .value('=$fromMillis($now(), "[h]:[m01] [P]")').value(`=(
2813
2886
  $diff := $now() - @ctx.jig.inputs.timestamp;
2814
2887
  $days := $floor($diff / 86400000);
2815
2888
  $hours := $floor($diff / 3600000);
@@ -3976,7 +4049,10 @@
3976
4049
  intermediate results. Improve readability and debugging
3977
4050
  code: |-
3978
4051
  // Instead of one massive expression, use state
3979
- const actions = screen.onFocus.list({ concurrency: 'sequential', instanceId: 'simplify-logic' }).actions
4052
+ const actions = screen.onFocus.list({
4053
+ concurrency: 'sequential',
4054
+ instanceId: 'simplify-logic',
4055
+ }).actions
3980
4056
  actions.setScreenState({
3981
4057
  instanceId: 'filter-items',
3982
4058
  keys: {
@@ -4005,15 +4081,17 @@
4005
4081
  related fields
4006
4082
  code: |2-
4007
4083
  // Create datasources for countries and states
4008
- const countries = app.addDatasource.sqlite({ datasourceId: 'countries', provider: 'local' }).entity('default/countries')
4009
- .query(`
4084
+ const countries = app.addDatasource
4085
+ .sqlite({ datasourceId: 'countries', provider: 'local' })
4086
+ .entity('default/countries').query(`
4010
4087
  SELECT
4011
4088
  id,
4012
4089
  json_extract(data, '$.name') as name,
4013
4090
  json_extract(data, '$.code') as code
4014
4091
  FROM [default/countries]
4015
4092
  `)
4016
- app.addDatasource.sqlite({ datasourceId: 'states', provider: 'local' }).entity('default/states').query(`
4093
+ app.addDatasource.sqlite({ datasourceId: 'states', provider: 'local' }).entity('default/states')
4094
+ .query(`
4017
4095
  SELECT
4018
4096
  id,
4019
4097
  json_extract(data, '$.name') as name,
@@ -4304,7 +4382,7 @@
4304
4382
  code: |-
4305
4383
  // Example: One button that does multiple things
4306
4384
  const buttons = screen.bottomPanel({ numberOfVisibleActions: 1 })
4307
- const actionList = buttons.add.list({ concurrency: 'sequential', title: 'Save and Close' })
4385
+ const actionList = buttons.add.list({ concurrency: 'sequential', title: 'Save and Close' })
4308
4386
  const sequentialActions = actionList.actions
4309
4387
  sequentialActions
4310
4388
  .executeEntity({ instanceId: 'create-customer' })
@@ -4408,7 +4486,10 @@
4408
4486
  code: |-
4409
4487
  // 1. Sequential workflow for order processing (order matters)
4410
4488
  const orderActions = orderScreen.bottomPanel({ numberOfVisibleActions: 2 })
4411
- const processOrder = orderActions.add.list({ concurrency: 'sequential', title: 'Process Order' })
4489
+ const processOrder = orderActions.add.list({
4490
+ concurrency: 'sequential',
4491
+ title: 'Process Order',
4492
+ })
4412
4493
  const sequentialActions = processOrder.actions
4413
4494
  // Execute in order: validate → save → update status → notify
4414
4495
  sequentialActions
@@ -4445,7 +4526,10 @@
4445
4526
  },
4446
4527
  })
4447
4528
  // 2. Parallel batch operations for analytics (order doesn't matter)
4448
- const analyticsActions = orderActions.add.list({ concurrency: 'parallel', title: 'Track Analytics' })
4529
+ const analyticsActions = orderActions.add.list({
4530
+ concurrency: 'parallel',
4531
+ title: 'Track Analytics',
4532
+ })
4449
4533
  const parallelActions = analyticsActions.actions
4450
4534
  // Execute simultaneously: user activity + system metrics + performance data
4451
4535
  parallelActions
@@ -4479,7 +4563,7 @@
4479
4563
  // These action lists execute automatically during app lifecycle events (onLoad, onFocus, onRefresh)
4480
4564
  // Use app.onLoad.list({ concurrency: 'sequential' }) or app.onLoad.list({ concurrency: 'parallel' }) for background workflow orchestration
4481
4565
  // 3. Application-level sequential sync on startup
4482
- const appSync = app.onLoad.list({ concurrency: 'sequential', instanceId: 'app-startup-sync' })
4566
+ const appSync = app.onLoad.list({ concurrency: 'sequential', instanceId: 'app-startup-sync' })
4483
4567
  const syncActions = appSync.actions
4484
4568
  // Sync critical data first, then secondary data
4485
4569
  syncActions
@@ -4508,7 +4592,8 @@
4508
4592
  // More examples of user-triggered action lists with conditional logic
4509
4593
  // 4. Conditional action list for error handling
4510
4594
  const recoveryActions = errorScreen.bottomPanel({ numberOfVisibleActions: 1 })
4511
- const retryWorkflow = recoveryActions.add.list({ concurrency: 'sequential',
4595
+ const retryWorkflow = recoveryActions.add.list({
4596
+ concurrency: 'sequential',
4512
4597
  title: 'Retry Operation',
4513
4598
  when: '=@ctx.response.status >= 500',
4514
4599
  })
@@ -5030,7 +5115,10 @@
5030
5115
  // These actions execute automatically during app lifecycle events (onLoad, onFocus, onRefresh)
5031
5116
  // Use app.onLoad.list({ concurrency: 'sequential' }).actions.deleteSyncScope() for background scope cleanup
5032
5117
  // 3. Background sync scope management
5033
- const appActions = app.onLoad.list({ concurrency: 'sequential', instanceId: 'sync-scope-cleanup' }).actions
5118
+ const appActions = app.onLoad.list({
5119
+ concurrency: 'sequential',
5120
+ instanceId: 'sync-scope-cleanup',
5121
+ }).actions
5034
5122
  // Auto-cleanup on app start
5035
5123
  appActions.deleteSyncScope({
5036
5124
  itemId: 'auto-cleanup-temp',
@@ -5115,7 +5203,10 @@
5115
5203
  // These actions execute automatically during app lifecycle events (onLoad, onFocus, onRefresh)
5116
5204
  // Use app.onLoad.list({ concurrency: 'sequential' }).actions.deleteSyncStatus() for background status management
5117
5205
  // 3. Background sync status management
5118
- const appActions = app.onLoad.list({ concurrency: 'sequential', instanceId: 'cleanup-status' }).actions
5206
+ const appActions = app.onLoad.list({
5207
+ concurrency: 'sequential',
5208
+ instanceId: 'cleanup-status',
5209
+ }).actions
5119
5210
  // Auto-cleanup old statuses
5120
5211
  appActions.deleteSyncStatus({
5121
5212
  itemId: 'cleanup-old-statuses',
@@ -7624,7 +7715,7 @@
7624
7715
  when: '=@ctx.solution.state.hasTimeSensitiveFailures',
7625
7716
  })
7626
7717
  // Screen-level retry on focus
7627
- const screenActions = errorDashboard.onFocus.list({ concurrency: 'parallel', }).actions
7718
+ const screenActions = errorDashboard.onFocus.list({ concurrency: 'parallel' }).actions
7628
7719
  // Retry on screen focus
7629
7720
  screenActions.retryQueueCommand({
7630
7721
  commandId: 'focus-retry-failed',
@@ -7815,7 +7906,8 @@
7815
7906
  instanceId: 'track-app-start',
7816
7907
  keys: {
7817
7908
  lastAppStart: '=$now()',
7818
- appStartCount: '=(@ctx.solution.state.appStartCount ? @ctx.solution.state.appStartCount : 0) + 1',
7909
+ appStartCount:
7910
+ '=(@ctx.solution.state.appStartCount ? @ctx.solution.state.appStartCount : 0) + 1',
7819
7911
  },
7820
7912
  })
7821
7913
  // Initialize default state
@@ -7842,7 +7934,8 @@
7842
7934
  instanceId: 'cleanup-on-refresh',
7843
7935
  keys: {
7844
7936
  lastRefreshTime: '=$now()',
7845
- refreshCount: '=(@ctx.solution.state.refreshCount ? @ctx.solution.state.refreshCount : 0) + 1',
7937
+ refreshCount:
7938
+ '=(@ctx.solution.state.refreshCount ? @ctx.solution.state.refreshCount : 0) + 1',
7846
7939
  },
7847
7940
  })
7848
7941
  - id: action.action.set-screen-state
@@ -7895,7 +7988,8 @@
7895
7988
  instanceId: 'track-interaction',
7896
7989
  keys: {
7897
7990
  lastAction: '=@ctx.solution.state.lastAction',
7898
- interactionCount: '=(@ctx.jig.state.interactionCount ? @ctx.jig.state.interactionCount : 0) + 1',
7991
+ interactionCount:
7992
+ '=(@ctx.jig.state.interactionCount ? @ctx.jig.state.interactionCount : 0) + 1',
7899
7993
  sessionTime: '=Date.now() - @ctx.jig.state.sessionStart',
7900
7994
  },
7901
7995
  })
@@ -8947,7 +9041,8 @@
8947
9041
  - icon
8948
9042
  description: Create parallel action list button with icon and primary styling
8949
9043
  code: |-
8950
- const parallel = screen.bottomPanel().add.list({ concurrency: 'parallel',
9044
+ const parallel = screen.bottomPanel().add.list({
9045
+ concurrency: 'parallel',
8951
9046
  title: 'Execute Actions',
8952
9047
  icon: 'play',
8953
9048
  isPrimary: true,
@@ -8964,10 +9059,9 @@
8964
9059
  - sequential
8965
9060
  description: Execute navigation action sequentially in background workflow
8966
9061
  code: |-
8967
- const sequential = screen.bottomPanel().add.list({ concurrency: 'sequential',
8968
- title: 'Test Action List',
8969
- instanceId: 'list-1',
8970
- })
9062
+ const sequential = screen
9063
+ .bottomPanel()
9064
+ .add.list({ concurrency: 'sequential', title: 'Test Action List', instanceId: 'list-1' })
8971
9065
  sequential.actions.goto({ linkTo: 'home' })
8972
9066
  - id: action-list-example-2
8973
9067
  name: Action List Sequential Execution Mode (background)
@@ -8981,7 +9075,8 @@
8981
9075
  - conditional
8982
9076
  description: Execute actions sequentially with conditional when expression
8983
9077
  code: |-
8984
- const sequential = screen.bottomPanel().add.list({ concurrency: 'sequential',
9078
+ const sequential = screen.bottomPanel().add.list({
9079
+ concurrency: 'sequential',
8985
9080
  title: 'Sequential Actions',
8986
9081
  when: '=@ctx.jig.state.canExecute',
8987
9082
  })
@@ -8997,7 +9092,9 @@
8997
9092
  - parallel
8998
9093
  description: Execute multiple actions simultaneously in parallel mode
8999
9094
  code: |-
9000
- const parallel = screen.bottomPanel().add.list({ concurrency: 'parallel', title: 'Test Action List' })
9095
+ const parallel = screen
9096
+ .bottomPanel()
9097
+ .add.list({ concurrency: 'parallel', title: 'Test Action List' })
9001
9098
  parallel.actions.goto({ linkTo: 'home' })
9002
9099
  - id: clear-queue.button-example-1
9003
9100
  name: Clear Queue Button (button)
@@ -17204,6 +17301,42 @@
17204
17301
  lastRefresh: '=$now()',
17205
17302
  },
17206
17303
  })
17304
+ - id: set-state.button-example
17305
+ name: Toggle Photo Search Button (button)
17306
+ category: action
17307
+ tags:
17308
+ - action
17309
+ - button
17310
+ - set-state
17311
+ - solution-state
17312
+ - styling
17313
+ - icon
17314
+ description: Set a solution state flag from a primary button
17315
+ code: |-
17316
+ const setStateButton = buttonActions.add.setState({
17317
+ title: 'Search Photos',
17318
+ instanceId: 'btn-set-1',
17319
+ stateKey: '=@ctx.solution.state.showPhotoSearch',
17320
+ value: true,
17321
+ icon: 'search',
17322
+ isPrimary: true,
17323
+ })
17324
+ - id: set-state-example
17325
+ name: Remember Selected Appointment in Solution State (background)
17326
+ category: action
17327
+ tags:
17328
+ - action
17329
+ - background
17330
+ - set-state
17331
+ - solution-state
17332
+ - expressions
17333
+ description: Store the selected item id in a solution state key
17334
+ code: |-
17335
+ const setState = backgroundActions.setState({
17336
+ instanceId: 'set-1',
17337
+ stateKey: '=@ctx.solution.state.selectedAppointmentId',
17338
+ value: '=@ctx.current.item.id',
17339
+ })
17207
17340
  - id: share.button-example-1
17208
17341
  name: Basic Share Button
17209
17342
  category: action
@@ -20487,8 +20620,10 @@
20487
20620
  categorization and metadata
20488
20621
  code: |-
20489
20622
  // Basic application setup with metadata
20490
- const customerApp = new ApplicationBuilder({ name: 'customer-management', title: 'Customer Management' })
20491
- .with({ category: 'business', description: 'Complete CRM solution for field sales teams' })
20623
+ const customerApp = new ApplicationBuilder({
20624
+ name: 'customer-management',
20625
+ title: 'Customer Management',
20626
+ }).with({ category: 'business', description: 'Complete CRM solution for field sales teams' })
20492
20627
  // Configure database tables for offline storage
20493
20628
  customerApp.addDatabase.default
20494
20629
  .table('customers', 'orders', 'products')
@@ -20573,8 +20708,10 @@
20573
20708
  action: 'sync-customers',
20574
20709
  })
20575
20710
  // E-commerce application example
20576
- const ecommerceApp = new ApplicationBuilder({ name: 'mobile-store', title: 'Mobile Store' })
20577
- .with({ category: 'sales', description: 'Mobile shopping application with product catalog' })
20711
+ const ecommerceApp = new ApplicationBuilder({
20712
+ name: 'mobile-store',
20713
+ title: 'Mobile Store',
20714
+ }).with({ category: 'sales', description: 'Mobile shopping application with product catalog' })
20578
20715
  // Product catalog database
20579
20716
  ecommerceApp.addDatabase.default
20580
20717
  .table('products', 'categories', 'cart')
@@ -20636,8 +20773,9 @@
20636
20773
  application state. Use CTX helpers for building expressions with proper
20637
20774
  syntax and validation
20638
20775
  code: |-
20639
- const contextApp = new ApplicationBuilder({ name: 'context-demo', title: 'Context Demo' })
20640
- .with({ category: 'business', description: 'Demonstrates context and state management patterns' })
20776
+ const contextApp = new ApplicationBuilder({ name: 'context-demo', title: 'Context Demo' }).with(
20777
+ { category: 'business', description: 'Demonstrates context and state management patterns' },
20778
+ )
20641
20779
  // Setup application state and expressions
20642
20780
  contextApp.expression('userRole', '=@ctx.solution.state.userRole')
20643
20781
  contextApp.expression('isLoggedIn', '=@ctx.solution.state.isLoggedIn')
@@ -20655,11 +20793,14 @@
20655
20793
  .query(
20656
20794
  "SELECT id, json_extract(data, '$.message') AS message, json_extract(data, '$.read') AS read FROM [default/notifications]",
20657
20795
  )
20658
- contextApp.addDatasource.static({ datasourceId: 'settings', data: [
20659
- { key: 'theme', value: 'dark' },
20660
- { key: 'language', value: 'en' },
20661
- { key: 'notifications', value: true },
20662
- ] })
20796
+ contextApp.addDatasource.static({
20797
+ datasourceId: 'settings',
20798
+ data: [
20799
+ { key: 'theme', value: 'dark' },
20800
+ { key: 'language', value: 'en' },
20801
+ { key: 'notifications', value: true },
20802
+ ],
20803
+ })
20663
20804
  // Create screens that demonstrate context usage
20664
20805
  const dashboard = contextApp.addScreen.default({
20665
20806
  screenId: 'dashboard',
@@ -20709,7 +20850,10 @@
20709
20850
  value: '=@ctx.datasources.settings[key = "language"].value',
20710
20851
  })
20711
20852
  // Advanced context usage examples
20712
- const advancedApp = new ApplicationBuilder({ name: 'advanced-context', title: 'Advanced Context' }).with({ category: 'analytics' })
20853
+ const advancedApp = new ApplicationBuilder({
20854
+ name: 'advanced-context',
20855
+ title: 'Advanced Context',
20856
+ }).with({ category: 'analytics' })
20713
20857
  // Complex expression using multiple context sources
20714
20858
  advancedApp.expression(
20715
20859
  'userStatus',
@@ -20724,7 +20868,11 @@
20724
20868
  ']',
20725
20869
  )
20726
20870
  // Function call with context parameters
20727
- advancedApp.addFunction.rest({ functionId: 'user-data', method: 'GET', url: 'https://api.example.com/users' })
20871
+ advancedApp.addFunction.rest({
20872
+ functionId: 'user-data',
20873
+ method: 'GET',
20874
+ url: 'https://api.example.com/users',
20875
+ })
20728
20876
  advancedApp.expression('userData', '=@ctx.datasources.userData')
20729
20877
  // Screen with complex state management
20730
20878
  const analyticsScreen = advancedApp.addScreen.default({
@@ -20765,15 +20913,20 @@
20765
20913
  visibility
20766
20914
  code: |-
20767
20915
  // Basic tab navigation setup
20768
- const businessApp = new ApplicationBuilder({ name: 'business-dashboard', title: 'Business Dashboard' })
20769
- .with({ category: 'business', description: 'Complete business management application' })
20916
+ const businessApp = new ApplicationBuilder({
20917
+ name: 'business-dashboard',
20918
+ title: 'Business Dashboard',
20919
+ }).with({ category: 'business', description: 'Complete business management application' })
20770
20920
  // Core navigation tabs with icons and labels
20771
20921
  businessApp.addTab({ screenId: 'home', icon: 'home', label: 'Dashboard' })
20772
20922
  businessApp.addTab({ screenId: 'customers', icon: 'multiple-users-3', label: 'Customers' })
20773
20923
  businessApp.addTab({ screenId: 'orders', icon: 'shopping-cart', label: 'Orders' })
20774
20924
  businessApp.addTab({ screenId: 'reports', icon: 'analytics-graph-bar', label: 'Reports' })
20775
20925
  // Advanced tab configuration with badges and conditions
20776
- const messagingApp = new ApplicationBuilder({ name: 'team-messenger', title: 'Team Messenger' }).with({ category: 'communications' })
20926
+ const messagingApp = new ApplicationBuilder({
20927
+ name: 'team-messenger',
20928
+ title: 'Team Messenger',
20929
+ }).with({ category: 'communications' })
20777
20930
  // Message tab with unread count badge
20778
20931
  messagingApp.addTab({
20779
20932
  screenId: 'messages',
@@ -20798,7 +20951,9 @@
20798
20951
  when: '=@ctx.solution.state.user.role = "admin"',
20799
20952
  })
20800
20953
  // E-commerce app with dynamic badges
20801
- const shopApp = new ApplicationBuilder({ name: 'mobile-shop', title: 'Mobile Shop' }).with({ category: 'sales' })
20954
+ const shopApp = new ApplicationBuilder({ name: 'mobile-shop', title: 'Mobile Shop' }).with({
20955
+ category: 'sales',
20956
+ })
20802
20957
  // Product catalog tab
20803
20958
  shopApp.addTab({ screenId: 'catalog', icon: 'grid-layout-module-1', label: 'Products' })
20804
20959
  // Shopping cart with item count
@@ -20820,7 +20975,9 @@
20820
20975
  // Account tab
20821
20976
  shopApp.addTab({ screenId: 'account', icon: 'single-man-circle', label: 'Account' })
20822
20977
  // Field service app with status-based badges
20823
- const fieldApp = new ApplicationBuilder({ name: 'field-service', title: 'Field Service' }).with({ category: 'field-services' })
20978
+ const fieldApp = new ApplicationBuilder({ name: 'field-service', title: 'Field Service' }).with(
20979
+ { category: 'field-services' },
20980
+ )
20824
20981
  // Tasks tab with priority count
20825
20982
  fieldApp.addTab({
20826
20983
  screenId: 'tasks',
@@ -20950,7 +21107,10 @@
20950
21107
  - category
20951
21108
  - description
20952
21109
  description: Create basic business application with title, category, and description
20953
- code: ".with({ category: 'business', description: 'A test application' })"
21110
+ code: |2-
21111
+ category: 'business',
21112
+ description: 'A test application',
21113
+ })
20954
21114
  - id: application-example-2
20955
21115
  name: Application with Tab Navigation Configuration
20956
21116
  category: application
@@ -21009,7 +21169,10 @@
21009
21169
  description: Build complete application with database tables, SQLite datasource,
21010
21170
  and REST function
21011
21171
  code: |-
21012
- const app: ApplicationBuilder = new ApplicationBuilder({ name: 'complete-app', title: 'Complete App' })
21172
+ const app: ApplicationBuilder = new ApplicationBuilder({
21173
+ name: 'complete-app',
21174
+ title: 'Complete App',
21175
+ })
21013
21176
  // Use the application's bound factories
21014
21177
  app.addDatabase.default.table('users').table('orders')
21015
21178
  app.addDatasource
@@ -21048,8 +21211,12 @@
21048
21211
  - build
21049
21212
  - properties
21050
21213
  description: Create application with description property for app metadata
21051
- code: "const app = new ApplicationBuilder({ name: 'descriptive-app', title:
21052
- 'Descriptive App', description: 'App with detailed description' })"
21214
+ code: |-
21215
+ const app = new ApplicationBuilder({
21216
+ name: 'descriptive-app',
21217
+ title: 'Descriptive App',
21218
+ description: 'App with detailed description',
21219
+ })
21053
21220
  - id: component.jc.left-right.element-1
21054
21221
  name: Left-Side Element Components
21055
21222
  category: component
@@ -23174,11 +23341,14 @@
23174
23341
  .title('=@ctx.current.item.name')
23175
23342
  .value('=@ctx.current.item.id')
23176
23343
  // 2. Choice field with static datasource
23177
- app.addDatasource.static({ datasourceId: 'task-priorities', data: [
23178
- { id: 'low', name: 'Low Priority', color: 'green' },
23179
- { id: 'medium', name: 'Medium Priority', color: 'yellow' },
23180
- { id: 'high', name: 'High Priority', color: 'red' },
23181
- ] })
23344
+ app.addDatasource.static({
23345
+ datasourceId: 'task-priorities',
23346
+ data: [
23347
+ { id: 'low', name: 'Low Priority', color: 'green' },
23348
+ { id: 'medium', name: 'Medium Priority', color: 'yellow' },
23349
+ { id: 'high', name: 'High Priority', color: 'red' },
23350
+ ],
23351
+ })
23182
23352
  const priorityForm = screen.addControl.form({ instanceId: 'priority-form' })
23183
23353
  const priorityChoice = priorityForm.addControl.choiceField({
23184
23354
  instanceId: 'priority-field',
@@ -23378,27 +23548,30 @@
23378
23548
  })
23379
23549
  // 1. Payment method selector (single choice with icons)
23380
23550
  const paymentForm = screen.addControl.form({ instanceId: 'payment' })
23381
- app.addDatasource.static({ datasourceId: 'payment-methods', data: [
23382
- {
23383
- id: 'credit',
23384
- name: 'Credit Card',
23385
- icon: 'credit-card',
23386
- description: 'Visa, MasterCard, Amex',
23387
- },
23388
- {
23389
- id: 'debit',
23390
- name: 'Debit Card',
23391
- icon: 'credit-card-payment',
23392
- description: 'Direct bank payment',
23393
- },
23394
- {
23395
- id: 'paypal',
23396
- name: 'PayPal',
23397
- icon: 'payment-paypal-logo',
23398
- description: 'PayPal account',
23399
- },
23400
- { id: 'apple', name: 'Apple Pay', icon: 'apple', description: 'Touch ID payment' },
23401
- ] })
23551
+ app.addDatasource.static({
23552
+ datasourceId: 'payment-methods',
23553
+ data: [
23554
+ {
23555
+ id: 'credit',
23556
+ name: 'Credit Card',
23557
+ icon: 'credit-card',
23558
+ description: 'Visa, MasterCard, Amex',
23559
+ },
23560
+ {
23561
+ id: 'debit',
23562
+ name: 'Debit Card',
23563
+ icon: 'credit-card-payment',
23564
+ description: 'Direct bank payment',
23565
+ },
23566
+ {
23567
+ id: 'paypal',
23568
+ name: 'PayPal',
23569
+ icon: 'payment-paypal-logo',
23570
+ description: 'PayPal account',
23571
+ },
23572
+ { id: 'apple', name: 'Apple Pay', icon: 'apple', description: 'Touch ID payment' },
23573
+ ],
23574
+ })
23402
23575
  const paymentMethod = paymentForm.addControl.choiceField({
23403
23576
  instanceId: 'payment-method',
23404
23577
  label: 'Payment Method',
@@ -23452,13 +23625,16 @@
23452
23625
  })
23453
23626
  // 3. Size selection with custom layout
23454
23627
  const sizeForm = screen.addControl.form({ instanceId: 'sizing' })
23455
- app.addDatasource.static({ datasourceId: 'sizes', data: [
23456
- { code: 'XS', label: 'Extra Small', available: true },
23457
- { code: 'S', label: 'Small', available: true },
23458
- { code: 'M', label: 'Medium', available: true },
23459
- { code: 'L', label: 'Large', available: false },
23460
- { code: 'XL', label: 'Extra Large', available: true },
23461
- ] })
23628
+ app.addDatasource.static({
23629
+ datasourceId: 'sizes',
23630
+ data: [
23631
+ { code: 'XS', label: 'Extra Small', available: true },
23632
+ { code: 'S', label: 'Small', available: true },
23633
+ { code: 'M', label: 'Medium', available: true },
23634
+ { code: 'L', label: 'Large', available: false },
23635
+ { code: 'XL', label: 'Extra Large', available: true },
23636
+ ],
23637
+ })
23462
23638
  const sizeChoice = sizeForm.addControl.choiceField({
23463
23639
  instanceId: 'size',
23464
23640
  label: 'Size',
@@ -23515,12 +23691,15 @@
23515
23691
  eligibilityCheck: true,
23516
23692
  })
23517
23693
  // Priority level with business constraints
23518
- app.addDatasource.static({ datasourceId: 'priority-levels', data: [
23519
- { level: 'low', name: 'Low Priority', cost: 0 },
23520
- { level: 'normal', name: 'Normal Priority', cost: 10 },
23521
- { level: 'high', name: 'High Priority', cost: 25 },
23522
- { level: 'urgent', name: 'Urgent Priority', cost: 50 },
23523
- ] })
23694
+ app.addDatasource.static({
23695
+ datasourceId: 'priority-levels',
23696
+ data: [
23697
+ { level: 'low', name: 'Low Priority', cost: 0 },
23698
+ { level: 'normal', name: 'Normal Priority', cost: 10 },
23699
+ { level: 'high', name: 'High Priority', cost: 25 },
23700
+ { level: 'urgent', name: 'Urgent Priority', cost: 50 },
23701
+ ],
23702
+ })
23524
23703
  const priorityChoice = planForm.addControl.choiceField({
23525
23704
  instanceId: 'priority-level',
23526
23705
  label: 'Priority Level',
@@ -23608,13 +23787,16 @@
23608
23787
  .title('=@ctx.current.item.name')
23609
23788
  .value('=@ctx.current.item.id')
23610
23789
  // Survey question with conditional follow-up
23611
- app.addDatasource.static({ datasourceId: 'satisfaction-ratings', data: [
23612
- { rating: 1, label: 'Very Dissatisfied', followUp: true },
23613
- { rating: 2, label: 'Dissatisfied', followUp: true },
23614
- { rating: 3, label: 'Neutral', followUp: false },
23615
- { rating: 4, label: 'Satisfied', followUp: false },
23616
- { rating: 5, label: 'Very Satisfied', followUp: false },
23617
- ] })
23790
+ app.addDatasource.static({
23791
+ datasourceId: 'satisfaction-ratings',
23792
+ data: [
23793
+ { rating: 1, label: 'Very Dissatisfied', followUp: true },
23794
+ { rating: 2, label: 'Dissatisfied', followUp: true },
23795
+ { rating: 3, label: 'Neutral', followUp: false },
23796
+ { rating: 4, label: 'Satisfied', followUp: false },
23797
+ { rating: 5, label: 'Very Satisfied', followUp: false },
23798
+ ],
23799
+ })
23618
23800
  const surveyChoice = configForm.addControl.choiceField({
23619
23801
  instanceId: 'satisfaction',
23620
23802
  label: 'How satisfied are you with our service?',
@@ -23629,12 +23811,15 @@
23629
23811
  .title('=@ctx.current.item.label')
23630
23812
  .value('=@ctx.current.item.rating')
23631
23813
  // Accessibility preferences
23632
- app.addDatasource.static({ datasourceId: 'accessibility-features', data: [
23633
- { feature: 'high-contrast', name: 'High Contrast Mode' },
23634
- { feature: 'large-text', name: 'Large Text' },
23635
- { feature: 'screen-reader', name: 'Screen Reader Support' },
23636
- { feature: 'reduced-motion', name: 'Reduced Motion' },
23637
- ] })
23814
+ app.addDatasource.static({
23815
+ datasourceId: 'accessibility-features',
23816
+ data: [
23817
+ { feature: 'high-contrast', name: 'High Contrast Mode' },
23818
+ { feature: 'large-text', name: 'Large Text' },
23819
+ { feature: 'screen-reader', name: 'Screen Reader Support' },
23820
+ { feature: 'reduced-motion', name: 'Reduced Motion' },
23821
+ ],
23822
+ })
23638
23823
  const accessibilityChoice = configForm.addControl.choiceField({
23639
23824
  instanceId: 'accessibility',
23640
23825
  isMultiple: true,
@@ -24563,11 +24748,14 @@
24563
24748
  .subtitle('=@ctx.current.item.description')
24564
24749
  // 2. Dropdown with icon elements
24565
24750
  const priorityForm = screen.addControl.form({ instanceId: 'priority-form' })
24566
- app.addDatasource.static({ datasourceId: 'task-priorities', data: [
24567
- { id: 'low', name: 'Low Priority', icon: 'arrow-down', color: 'green' },
24568
- { id: 'medium', name: 'Medium Priority', icon: 'minus', color: 'yellow' },
24569
- { id: 'high', name: 'High Priority', icon: 'arrow-up', color: 'red' },
24570
- ] })
24751
+ app.addDatasource.static({
24752
+ datasourceId: 'task-priorities',
24753
+ data: [
24754
+ { id: 'low', name: 'Low Priority', icon: 'arrow-down', color: 'green' },
24755
+ { id: 'medium', name: 'Medium Priority', icon: 'minus', color: 'yellow' },
24756
+ { id: 'high', name: 'High Priority', icon: 'arrow-up', color: 'red' },
24757
+ ],
24758
+ })
24571
24759
  const priorityDropdown = priorityForm.addControl.dropdown({
24572
24760
  instanceId: 'priority-dropdown',
24573
24761
  label: 'Task Priority',
@@ -24873,12 +25061,15 @@
24873
25061
  // Icon with color coding for skill category
24874
25062
  .leftElement.icon('=@ctx.current.item.categoryIcon')
24875
25063
  // 3. Project priority with static datasource and time estimates
24876
- app.addDatasource.static({ datasourceId: 'project-priorities', data: [
24877
- { id: 'urgent', display: 'Urgent', sla: '2 hours', color: 'negative', impact: 'critical' },
24878
- { id: 'high', display: 'High Priority', sla: '1 day', color: 'warning', impact: 'major' },
24879
- { id: 'normal', display: 'Normal', sla: '3 days', color: 'primary', impact: 'moderate' },
24880
- { id: 'low', display: 'Low Priority', sla: '1 week', color: 'neutral', impact: 'minor' },
24881
- ] })
25064
+ app.addDatasource.static({
25065
+ datasourceId: 'project-priorities',
25066
+ data: [
25067
+ { id: 'urgent', display: 'Urgent', sla: '2 hours', color: 'negative', impact: 'critical' },
25068
+ { id: 'high', display: 'High Priority', sla: '1 day', color: 'warning', impact: 'major' },
25069
+ { id: 'normal', display: 'Normal', sla: '3 days', color: 'primary', impact: 'moderate' },
25070
+ { id: 'low', display: 'Low Priority', sla: '1 week', color: 'neutral', impact: 'minor' },
25071
+ ],
25072
+ })
24882
25073
  const priorityDropdown = form.addControl.dropdown({
24883
25074
  instanceId: 'priority',
24884
25075
  isRequired: true,
@@ -24962,11 +25153,14 @@
24962
25153
  screenId: 'dropdown-test',
24963
25154
  title: 'Dropdown Test',
24964
25155
  })
24965
- app.addDatasource.static({ datasourceId: 'test-options', data: [
24966
- { title: 'Option 1', value: 'option1' },
24967
- { title: 'Option 2', value: 'option2' },
24968
- { title: 'Option 3', value: 'option3' },
24969
- ] })
25156
+ app.addDatasource.static({
25157
+ datasourceId: 'test-options',
25158
+ data: [
25159
+ { title: 'Option 1', value: 'option1' },
25160
+ { title: 'Option 2', value: 'option2' },
25161
+ { title: 'Option 3', value: 'option3' },
25162
+ ],
25163
+ })
24970
25164
  const dropdown = form.addControl.dropdown({
24971
25165
  instanceId: 'test-dropdown',
24972
25166
  isMultiple: true,
@@ -25030,10 +25224,13 @@
25030
25224
  screenId: 'inline-test',
25031
25225
  title: 'Inline Test',
25032
25226
  })
25033
- app.addDatasource.static({ datasourceId: 'inline-options', data: [
25034
- { id: 1, name: 'Option 1', active: true },
25035
- { id: 2, name: 'Option 2', active: false },
25036
- ] })
25227
+ app.addDatasource.static({
25228
+ datasourceId: 'inline-options',
25229
+ data: [
25230
+ { id: 1, name: 'Option 1', active: true },
25231
+ { id: 2, name: 'Option 2', active: false },
25232
+ ],
25233
+ })
25037
25234
  const inlineDropdown = form.addControl.dropdown({
25038
25235
  instanceId: 'inline',
25039
25236
  when: '=@ctx.solution.state.canSelect',
@@ -25643,7 +25840,11 @@
25643
25840
  const statusSection = screen.addControl.section({ instanceId: 'system-status' })
25644
25841
  const statusEntity = statusSection.addControl.entity({ instanceId: 'status-entity' })
25645
25842
  statusEntity.addControl
25646
- .entityField({ instanceId: 'server-status', label: 'Server Status', value: '=@ctx.jig.inputs.status' })
25843
+ .entityField({
25844
+ instanceId: 'server-status',
25845
+ label: 'Server Status',
25846
+ value: '=@ctx.jig.inputs.status',
25847
+ })
25647
25848
  .with({
25648
25849
  style: {
25649
25850
  isPositive: '=@ctx.jig.inputs.status = "Online"',
@@ -25755,7 +25956,10 @@
25755
25956
  label: 'Total Revenue',
25756
25957
  value: '="$" & $string(@ctx.jig.inputs.totalRevenue)',
25757
25958
  })
25758
- .with({ style: { isPrimary: true, isPositive: '=@ctx.jig.inputs.revenueGrowth > 0' }, rightIcon: 'arrow-up' })
25959
+ .with({
25960
+ style: { isPrimary: true, isPositive: '=@ctx.jig.inputs.revenueGrowth > 0' },
25961
+ rightIcon: 'arrow-up',
25962
+ })
25759
25963
  financialEntity.addControl.entityField({
25760
25964
  instanceId: 'profit-margin',
25761
25965
  label: 'Profit Margin',
@@ -25908,7 +26112,11 @@
25908
26112
  rightIcon: 'hash',
25909
26113
  })
25910
26114
  productEntity.addControl
25911
- .entityField({ instanceId: 'price', label: 'Price', value: '="$" & @ctx.entity.product.price' })
26115
+ .entityField({
26116
+ instanceId: 'price',
26117
+ label: 'Price',
26118
+ value: '="$" & @ctx.entity.product.price',
26119
+ })
25912
26120
  .with({ style: { isPositive: '=@ctx.entity.product.onSale' }, rightIcon: 'money-atm' })
25913
26121
  productEntity.addControl.entityField({
25914
26122
  instanceId: 'availability',
@@ -26038,7 +26246,8 @@
26038
26246
  value: '=@ctx.entity.device.batteryLevel & "%"',
26039
26247
  style: {
26040
26248
  isPositive: '=@ctx.entity.device.batteryLevel > 50',
26041
- isWarning: '=@ctx.entity.device.batteryLevel > 20 and @ctx.entity.device.batteryLevel <= 50',
26249
+ isWarning:
26250
+ '=@ctx.entity.device.batteryLevel > 20 and @ctx.entity.device.batteryLevel <= 50',
26042
26251
  isNegative: '=@ctx.entity.device.batteryLevel <= 20',
26043
26252
  },
26044
26253
  rightIcon: 'battery-full',
@@ -26119,7 +26328,8 @@
26119
26328
  value: '=@ctx.entity.customer.healthScore & "/100"',
26120
26329
  style: {
26121
26330
  isPositive: '=@ctx.entity.customer.healthScore >= 80',
26122
- isWarning: '=@ctx.entity.customer.healthScore >= 60 and @ctx.entity.customer.healthScore < 80',
26331
+ isWarning:
26332
+ '=@ctx.entity.customer.healthScore >= 60 and @ctx.entity.customer.healthScore < 80',
26123
26333
  isNegative: '=@ctx.entity.customer.healthScore < 60',
26124
26334
  },
26125
26335
  rightIcon: 'gift-heart',
@@ -26890,12 +27100,10 @@
26890
27100
  value: '=@ctx.jig.state.price',
26891
27101
  format: { numberStyle: 'currency', currency: 'USD' },
26892
27102
  })
26893
- app.addDatasource.static({ datasourceId: 'product-categories', data: [
26894
- { name: 'Electronics' },
26895
- { name: 'Clothing' },
26896
- { name: 'Books' },
26897
- { name: 'Home' },
26898
- ] })
27103
+ app.addDatasource.static({
27104
+ datasourceId: 'product-categories',
27105
+ data: [{ name: 'Electronics' }, { name: 'Clothing' }, { name: 'Books' }, { name: 'Home' }],
27106
+ })
26899
27107
  productRow.addControl
26900
27108
  .dropdown({
26901
27109
  instanceId: 'category',
@@ -27084,11 +27292,14 @@
27084
27292
  const settingsForm = screen.addControl.form({ instanceId: 'app-settings' })
27085
27293
  const appearanceSection = settingsForm.addControl.section({ instanceId: 'appearance' })
27086
27294
  appearanceSection.title('Appearance')
27087
- app.addDatasource.static({ datasourceId: 'themes', data: [
27088
- { label: 'Light', value: 'light' },
27089
- { label: 'Dark', value: 'dark' },
27090
- { label: 'Auto', value: 'auto' },
27091
- ] })
27295
+ app.addDatasource.static({
27296
+ datasourceId: 'themes',
27297
+ data: [
27298
+ { label: 'Light', value: 'light' },
27299
+ { label: 'Dark', value: 'dark' },
27300
+ { label: 'Auto', value: 'auto' },
27301
+ ],
27302
+ })
27092
27303
  const themeDropdown = appearanceSection.addControl.dropdown({
27093
27304
  instanceId: 'theme',
27094
27305
  label: 'Theme',
@@ -27147,12 +27358,15 @@
27147
27358
  errorText: 'Please enter a valid email address',
27148
27359
  })
27149
27360
  // Dropdown with validation
27150
- app.addDatasource.static({ datasourceId: 'priorities', data: [
27151
- { label: 'Low', value: 'low' },
27152
- { label: 'Normal', value: 'normal' },
27153
- { label: 'High', value: 'high' },
27154
- { label: 'Urgent', value: 'urgent' },
27155
- ] })
27361
+ app.addDatasource.static({
27362
+ datasourceId: 'priorities',
27363
+ data: [
27364
+ { label: 'Low', value: 'low' },
27365
+ { label: 'Normal', value: 'normal' },
27366
+ { label: 'High', value: 'high' },
27367
+ { label: 'Urgent', value: 'urgent' },
27368
+ ],
27369
+ })
27156
27370
  const priorityDropdown = contactForm.addControl.dropdown({
27157
27371
  instanceId: 'priority',
27158
27372
  isRequired: true,
@@ -27193,11 +27407,14 @@
27193
27407
  isDiscardChangesAlertEnabled: false,
27194
27408
  })
27195
27409
  // Account type selector affects other fields
27196
- app.addDatasource.static({ datasourceId: 'account-types', data: [
27197
- { label: 'Personal', value: 'personal' },
27198
- { label: 'Business', value: 'business' },
27199
- { label: 'Enterprise', value: 'enterprise' },
27200
- ] })
27410
+ app.addDatasource.static({
27411
+ datasourceId: 'account-types',
27412
+ data: [
27413
+ { label: 'Personal', value: 'personal' },
27414
+ { label: 'Business', value: 'business' },
27415
+ { label: 'Enterprise', value: 'enterprise' },
27416
+ ],
27417
+ })
27201
27418
  const accountTypeDropdown = dynamicForm.addControl.dropdown({
27202
27419
  instanceId: 'account-type',
27203
27420
  isRequired: true,
@@ -27554,7 +27771,10 @@
27554
27771
  .interactiveImageItem({
27555
27772
  instanceId: 'room-marker',
27556
27773
  title: '=@ctx.current.item.roomName',
27557
- percentageCoordinates: { x: '=@ctx.current.item.xPercent', y: '=@ctx.current.item.yPercent' },
27774
+ percentageCoordinates: {
27775
+ x: '=@ctx.current.item.xPercent',
27776
+ y: '=@ctx.current.item.yPercent',
27777
+ },
27558
27778
  })
27559
27779
  .with({ color: '=@ctx.current.item.statusColor' })
27560
27780
  roomItem.onPress.goto({
@@ -27650,7 +27870,10 @@
27650
27870
  .interactiveImageItem({
27651
27871
  instanceId: 'store-marker',
27652
27872
  groupId: '=@ctx.current.item.category',
27653
- percentageCoordinates: { x: '=@ctx.current.item.locationX', y: '=@ctx.current.item.locationY' },
27873
+ percentageCoordinates: {
27874
+ x: '=@ctx.current.item.locationX',
27875
+ y: '=@ctx.current.item.locationY',
27876
+ },
27654
27877
  })
27655
27878
  .with({ title: '=@ctx.current.item.storeName' })
27656
27879
  storeItem.onPress.goto({
@@ -27687,7 +27910,9 @@
27687
27910
  title: '=@ctx.current.item.departmentName',
27688
27911
  groupId: '=@ctx.current.item.zone',
27689
27912
  })
27690
- .with({ percentageCoordinates: { x: '=@ctx.current.item.coordX', y: '=@ctx.current.item.coordY' } })
27913
+ .with({
27914
+ percentageCoordinates: { x: '=@ctx.current.item.coordX', y: '=@ctx.current.item.coordY' },
27915
+ })
27691
27916
  departmentItem.onPress
27692
27917
  .executeEntity({ instanceId: 'show-department-info' })
27693
27918
  .dynamicData('default/departments', 'update')
@@ -27764,7 +27989,10 @@
27764
27989
  instanceId: 'sensor-marker',
27765
27990
  title: '=@ctx.current.item.sensorId',
27766
27991
  groupId: '=@ctx.current.item.sensorType',
27767
- percentageCoordinates: { x: '=@ctx.current.item.positionX', y: '=@ctx.current.item.positionY' },
27992
+ percentageCoordinates: {
27993
+ x: '=@ctx.current.item.positionX',
27994
+ y: '=@ctx.current.item.positionY',
27995
+ },
27768
27996
  color:
27769
27997
  "=@ctx.current.item.alertLevel = 'critical' ? 'negative' : (@ctx.current.item.alertLevel = 'warning' ? 'warning' : 'positive')",
27770
27998
  })
@@ -27863,10 +28091,12 @@
27863
28091
  })
27864
28092
  const locationHeader = locationScreen.header()
27865
28093
  locationHeader.with({ height: 'small' })
27866
- locationHeader.addControl.location({ instanceId: 'header-map' }).with({ viewPoint:{
27867
- latitude: 40.7128,
27868
- longitude: -74.006,
27869
- }})
28094
+ locationHeader.addControl.location({ instanceId: 'header-map' }).with({
28095
+ viewPoint: {
28096
+ latitude: 40.7128,
28097
+ longitude: -74.006,
28098
+ },
28099
+ })
27870
28100
  locationHeader.actions.goBack({ title: 'Back' })
27871
28101
  locationHeader.actions.openUrl({
27872
28102
  title: 'Directions',
@@ -27879,12 +28109,10 @@
27879
28109
  })
27880
28110
  const videoHeader = videoScreen.header()
27881
28111
  videoHeader.with({ height: 'medium' })
27882
- videoHeader.addControl
27883
- .videoPlayer({ instanceId: 'header-video' })
27884
- .with({
27885
- url: '=@ctx.solution.state.media.headerVideoUrl',
27886
- title: '=@ctx.solution.state.media.videoTitle',
27887
- })
28112
+ videoHeader.addControl.videoPlayer({ instanceId: 'header-video' }).with({
28113
+ url: '=@ctx.solution.state.media.headerVideoUrl',
28114
+ title: '=@ctx.solution.state.media.videoTitle',
28115
+ })
27888
28116
  videoHeader.actions.goto({ title: 'Full Video', linkTo: 'video-screen' })
27889
28117
  // 4. Action screen with multiple actions
27890
28118
  const actionScreen = app.addScreen.default({
@@ -27927,10 +28155,12 @@
27927
28155
  })
27928
28156
  const venueHeader = venueScreen.header()
27929
28157
  venueHeader.with({ height: 'medium' })
27930
- venueHeader.addControl.location({ instanceId: 'venue-location' }).with({ viewPoint:{
27931
- latitude: '=@ctx.solution.state.venue.coordinates.latitude',
27932
- longitude: '=@ctx.solution.state.venue.coordinates.longitude',
27933
- }})
28158
+ venueHeader.addControl.location({ instanceId: 'venue-location' }).with({
28159
+ viewPoint: {
28160
+ latitude: '=@ctx.solution.state.venue.coordinates.latitude',
28161
+ longitude: '=@ctx.solution.state.venue.coordinates.longitude',
28162
+ },
28163
+ })
27934
28164
  venueHeader.actions.goBack({ title: 'Back to List' })
27935
28165
  venueHeader.actions.openUrl({
27936
28166
  title: 'Get Directions',
@@ -27944,12 +28174,10 @@
27944
28174
  })
27945
28175
  const galleryHeader = galleryScreen.header()
27946
28176
  galleryHeader.with({ height: 'medium' })
27947
- galleryHeader.addControl
27948
- .videoPlayer({ instanceId: 'gallery-preview' })
27949
- .with({
27950
- url: '=@ctx.solution.state.gallery.featuredVideoUrl',
27951
- title: '=@ctx.solution.state.gallery.videoTitle',
27952
- })
28177
+ galleryHeader.addControl.videoPlayer({ instanceId: 'gallery-preview' }).with({
28178
+ url: '=@ctx.solution.state.gallery.featuredVideoUrl',
28179
+ title: '=@ctx.solution.state.gallery.videoTitle',
28180
+ })
27953
28181
  galleryHeader.actions.goBack({ title: 'Back to Gallery' })
27954
28182
  galleryHeader.actions.goto({ title: 'Full Screen', linkTo: 'fullscreen-video' })
27955
28183
  // Dashboard header with branding
@@ -28019,10 +28247,12 @@
28019
28247
  })
28020
28248
  const mapHeader = mapScreen.header()
28021
28249
  mapHeader.with({ height: 'medium' })
28022
- mapHeader.addControl.location({ instanceId: 'main-location' }).with({ viewPoint:{
28023
- latitude: '=@ctx.solution.state.userLocation.latitude',
28024
- longitude: '=@ctx.solution.state.userLocation.longitude',
28025
- }})
28250
+ mapHeader.addControl.location({ instanceId: 'main-location' }).with({
28251
+ viewPoint: {
28252
+ latitude: '=@ctx.solution.state.userLocation.latitude',
28253
+ longitude: '=@ctx.solution.state.userLocation.longitude',
28254
+ },
28255
+ })
28026
28256
  mapHeader.actions.goBack({ title: 'Back' })
28027
28257
  mapHeader.actions.goto({ title: 'Nearby', linkTo: 'nearby-screen' })
28028
28258
  // Media header for entertainment apps
@@ -28032,12 +28262,10 @@
28032
28262
  })
28033
28263
  const mediaHeader = mediaScreen.header()
28034
28264
  mediaHeader.with({ height: 'medium' })
28035
- mediaHeader.addControl
28036
- .videoPlayer({ instanceId: 'featured-content' })
28037
- .with({
28038
- url: '=@ctx.solution.state.media.featuredVideoUrl',
28039
- title: '=@ctx.solution.state.media.videoTitle',
28040
- })
28265
+ mediaHeader.addControl.videoPlayer({ instanceId: 'featured-content' }).with({
28266
+ url: '=@ctx.solution.state.media.featuredVideoUrl',
28267
+ title: '=@ctx.solution.state.media.videoTitle',
28268
+ })
28041
28269
  mediaHeader.actions.goBack({ title: 'Back to Library' })
28042
28270
  mediaHeader.actions.goto({ title: 'Related Content', linkTo: 'related-screen' })
28043
28271
  // Minimal header for form screens
@@ -29051,7 +29279,8 @@
29051
29279
  })
29052
29280
  vehicleMarker.addIcon({
29053
29281
  icon: "=@ctx.current.item.vehicleType = 'truck' ? 'truck' : 'car'",
29054
- color: "=@ctx.current.item.status = 'active' ? 'positive' : (@ctx.current.item.status = 'maintenance' ? 'warning' : 'negative')",
29282
+ color:
29283
+ "=@ctx.current.item.status = 'active' ? 'positive' : (@ctx.current.item.status = 'maintenance' ? 'warning' : 'negative')",
29055
29284
  })
29056
29285
  // Field service territories
29057
29286
  const serviceSection = screen.addControl.section({ instanceId: 'service-territories' })
@@ -29075,7 +29304,8 @@
29075
29304
  })
29076
29305
  appointmentMarker.addIcon({
29077
29306
  icon: "=@ctx.current.item.priority = 'urgent' ? 'alert' : 'wrench'",
29078
- color: "=@ctx.current.item.status = 'scheduled' ? 'color1' : (@ctx.current.item.status = 'in-progress' ? 'warning' : 'positive')",
29307
+ color:
29308
+ "=@ctx.current.item.status = 'scheduled' ? 'color1' : (@ctx.current.item.status = 'in-progress' ? 'warning' : 'positive')",
29079
29309
  })
29080
29310
  // Emergency response system
29081
29311
  const emergencySection = screen.addControl.section({ instanceId: 'emergency-response' })
@@ -29101,7 +29331,8 @@
29101
29331
  })
29102
29332
  incidentMarker.addIcon({
29103
29333
  icon: "=@ctx.current.item.severity = 'critical' ? 'alert-triangle' : 'information-circle'",
29104
- color: "=@ctx.current.item.severity = 'critical' ? 'negative' : (@ctx.current.item.severity = 'high' ? 'warning' : 'positive')",
29334
+ color:
29335
+ "=@ctx.current.item.severity = 'critical' ? 'negative' : (@ctx.current.item.severity = 'high' ? 'warning' : 'positive')",
29105
29336
  })
29106
29337
  // Asset tracking with geofencing
29107
29338
  const assetSection = screen.addControl.section({ instanceId: 'asset-tracking' })
@@ -29160,18 +29391,16 @@
29160
29391
  .dynamicData('default/selected_locations', 'update')
29161
29392
  // Location-aware content
29162
29393
  const contentSection = screen.addControl.section({ instanceId: 'location-content' })
29163
- const contextMap = contentSection.addControl
29164
- .location({ instanceId: 'contextual-map' })
29165
- .with({
29166
- markersData: '=@ctx.datasources.nearby_points_of_interest',
29167
- viewPoint: {
29168
- latitude: '=@ctx.solution.state.userLatitude',
29169
- longitude: '=@ctx.solution.state.userLongitude',
29170
- zoomLevel: '=@ctx.solution.state.preferredZoom',
29171
- centerPosition: 'middle',
29172
- isFollowUserLocationEnabled: '=@ctx.solution.state.trackUserMovement',
29173
- },
29174
- })
29394
+ const contextMap = contentSection.addControl.location({ instanceId: 'contextual-map' }).with({
29395
+ markersData: '=@ctx.datasources.nearby_points_of_interest',
29396
+ viewPoint: {
29397
+ latitude: '=@ctx.solution.state.userLatitude',
29398
+ longitude: '=@ctx.solution.state.userLongitude',
29399
+ zoomLevel: '=@ctx.solution.state.preferredZoom',
29400
+ centerPosition: 'middle',
29401
+ isFollowUserLocationEnabled: '=@ctx.solution.state.trackUserMovement',
29402
+ },
29403
+ })
29175
29404
  const poiMarker = contextMap.addControl.markerItem({
29176
29405
  instanceId: 'poi-marker',
29177
29406
  latitude: '=@ctx.current.item.position.lat',
@@ -29203,7 +29432,8 @@
29203
29432
  })
29204
29433
  comparisonMarker.addIcon({
29205
29434
  icon: "=@ctx.current.item.isSelected ? 'check-circle' : 'circle'",
29206
- color: "=@ctx.current.item.rank <= 3 ? 'positive' : (@ctx.current.item.rank <= 6 ? 'warning' : 'color2')",
29435
+ color:
29436
+ "=@ctx.current.item.rank <= 3 ? 'positive' : (@ctx.current.item.rank <= 6 ? 'warning' : 'color2')",
29207
29437
  })
29208
29438
  // Dynamic location clustering
29209
29439
  const clusterSection = screen.addControl.section({ instanceId: 'location-clusters' })
@@ -29230,7 +29460,8 @@
29230
29460
  })
29231
29461
  clusterMarker.addIcon({
29232
29462
  icon: "=@ctx.current.item.count > 10 ? 'layers' : 'pin-map'",
29233
- color: "=@ctx.current.item.density = 'high' ? 'negative' : (@ctx.current.item.density = 'medium' ? 'warning' : 'positive')",
29463
+ color:
29464
+ "=@ctx.current.item.density = 'high' ? 'negative' : (@ctx.current.item.density = 'medium' ? 'warning' : 'positive')",
29234
29465
  })
29235
29466
  - id: component.component.marker-item-1
29236
29467
  name: Map Marker Component
@@ -29270,7 +29501,9 @@
29270
29501
  latitude: '=@ctx.current.item.latitude',
29271
29502
  longitude: '=@ctx.current.item.longitude',
29272
29503
  })
29273
- .with({ radius: { value: '=@ctx.current.item.serviceRadius', unit: 'miles', color: 'positive' } })
29504
+ .with({
29505
+ radius: { value: '=@ctx.current.item.serviceRadius', unit: 'miles', color: 'positive' },
29506
+ })
29274
29507
  customerMarker.addIcon({ icon: '=@ctx.current.item.markerIcon' })
29275
29508
  - id: component.component.marker-item-2
29276
29509
  name: Advanced Marker Configurations
@@ -29306,7 +29539,14 @@
29306
29539
  latitude: '=@ctx.current.item.centerLat',
29307
29540
  longitude: '=@ctx.current.item.centerLng',
29308
29541
  })
29309
- .with({ radius: { value: '=@ctx.current.item.coverageRadius', unit: 'meters', color: '=(@ctx.current.item.isActive) ? "positive" : "neutral"', isEnabled: '=@ctx.current.item.showCoverage' } })
29542
+ .with({
29543
+ radius: {
29544
+ value: '=@ctx.current.item.coverageRadius',
29545
+ unit: 'meters',
29546
+ color: '=(@ctx.current.item.isActive) ? "positive" : "neutral"',
29547
+ isEnabled: '=@ctx.current.item.showCoverage',
29548
+ },
29549
+ })
29310
29550
  dynamicZone.addIcon({ icon: '=@ctx.current.item.zoneType' })
29311
29551
  - id: component.component.marker-item-3
29312
29552
  name: Marker Builder Patterns
@@ -31154,11 +31394,13 @@
31154
31394
  .with({
31155
31395
  left: {
31156
31396
  title: 'Last Month',
31157
- subtitle: '=@ctx.current.item.metrics.previousMonth.value & @ctx.current.item.metrics.unit',
31397
+ subtitle:
31398
+ '=@ctx.current.item.metrics.previousMonth.value & @ctx.current.item.metrics.unit',
31158
31399
  },
31159
31400
  right: {
31160
31401
  title: 'This Month',
31161
- subtitle: '=@ctx.current.item.metrics.currentMonth.value & @ctx.current.item.metrics.unit',
31402
+ subtitle:
31403
+ '=@ctx.current.item.metrics.currentMonth.value & @ctx.current.item.metrics.unit',
31162
31404
  },
31163
31405
  })
31164
31406
  performanceStage.onPress.goto({
@@ -34033,10 +34275,13 @@
34033
34275
  description: Create choice field item referencing a static datasource with
34034
34276
  dynamic title expressions
34035
34277
  code: |-
34036
- app.addDatasource.static({ datasourceId: 'inline-options', data: [
34037
- { id: 'x', label: 'X' },
34038
- { id: 'y', label: 'Y' },
34039
- ] })
34278
+ app.addDatasource.static({
34279
+ datasourceId: 'inline-options',
34280
+ data: [
34281
+ { id: 'x', label: 'X' },
34282
+ { id: 'y', label: 'Y' },
34283
+ ],
34284
+ })
34040
34285
  const choices = screen.addControl.choiceField({
34041
34286
  instanceId: 'inline-choices',
34042
34287
  data: '=@ctx.datasources.inline-options',
@@ -34117,10 +34362,13 @@
34117
34362
  - options
34118
34363
  description: Create choice field referencing a static datasource
34119
34364
  code: |-
34120
- app.addDatasource.static({ datasourceId: 'choice-options', data: [
34121
- { id: 'a', label: 'A' },
34122
- { id: 'b', label: 'B' },
34123
- ] })
34365
+ app.addDatasource.static({
34366
+ datasourceId: 'choice-options',
34367
+ data: [
34368
+ { id: 'a', label: 'A' },
34369
+ { id: 'b', label: 'B' },
34370
+ ],
34371
+ })
34124
34372
  const choices = screen.addControl.choiceField({
34125
34373
  instanceId: 'inline-choices',
34126
34374
  label: 'Inline',
@@ -34608,11 +34856,14 @@
34608
34856
  - required
34609
34857
  description: Create required country dropdown referencing a static datasource
34610
34858
  code: |-
34611
- app.addDatasource.static({ datasourceId: 'countries', data: [
34612
- { countryCode: 'US', countryName: 'United States' },
34613
- { countryCode: 'CA', countryName: 'Canada' },
34614
- { countryCode: 'MX', countryName: 'Mexico' },
34615
- ] })
34859
+ app.addDatasource.static({
34860
+ datasourceId: 'countries',
34861
+ data: [
34862
+ { countryCode: 'US', countryName: 'United States' },
34863
+ { countryCode: 'CA', countryName: 'Canada' },
34864
+ { countryCode: 'MX', countryName: 'Mexico' },
34865
+ ],
34866
+ })
34616
34867
  const dropdown = screen.addControl.dropdown({
34617
34868
  instanceId: 'country-select',
34618
34869
  isRequired: true,
@@ -34794,7 +35045,11 @@
34794
35045
  user profile display
34795
35046
  code: |-
34796
35047
  const userEntity = screen.addControl.entity()
34797
- userEntity.addControl.entityField({ instanceId: 'name-field', label: 'Name', value: 'John Doe' })
35048
+ userEntity.addControl.entityField({
35049
+ instanceId: 'name-field',
35050
+ label: 'Name',
35051
+ value: 'John Doe',
35052
+ })
34798
35053
  userEntity.addControl
34799
35054
  .entityField({ instanceId: 'email-field', label: 'Email' })
34800
35055
  .with({ value: 'john@example.com' })
@@ -34816,11 +35071,19 @@
34816
35071
  instanceId: 'product-entity',
34817
35072
  isCompact: true,
34818
35073
  })
34819
- productEntity.addControl.entityField({ instanceId: 'product-name', label: 'Product Name', value: 'Laptop' })
35074
+ productEntity.addControl.entityField({
35075
+ instanceId: 'product-name',
35076
+ label: 'Product Name',
35077
+ value: 'Laptop',
35078
+ })
34820
35079
  productEntity.addControl
34821
35080
  .entityField({ instanceId: 'product-price', label: 'Price' })
34822
35081
  .with({ value: '$999.99' })
34823
- productEntity.addControl.entityField({ instanceId: 'product-stock', label: 'In Stock', value: 'Yes' })
35082
+ productEntity.addControl.entityField({
35083
+ instanceId: 'product-stock',
35084
+ label: 'In Stock',
35085
+ value: 'Yes',
35086
+ })
34824
35087
  - id: jc.event-example-1
34825
35088
  name: Team Meeting Event with Full Details
34826
35089
  category: component
@@ -36274,7 +36537,10 @@
36274
36537
  },
36275
36538
  markersData: '=@ctx.datasources.locations',
36276
36539
  })
36277
- .with({ isShowUserLocationEnabled: '=@ctx.jig.state.map.showUser', paths: '=@ctx.datasources.routes' })
36540
+ .with({
36541
+ isShowUserLocationEnabled: '=@ctx.jig.state.map.showUser',
36542
+ paths: '=@ctx.datasources.routes',
36543
+ })
36278
36544
  - id: jc.location-example-8
36279
36545
  name: Location Maps with Different Radius Unit Types
36280
36546
  category: component
@@ -37802,7 +38068,10 @@
37802
38068
  sync across devices and users
37803
38069
  code: |-
37804
38070
  // Dynamic SQLite datasource - synced across devices for collaborative data
37805
- const customerData = app.addDatasource.sqlite({ datasourceId: 'customers', provider: 'dynamic' })
38071
+ const customerData = app.addDatasource.sqlite({
38072
+ datasourceId: 'customers',
38073
+ provider: 'dynamic',
38074
+ })
37806
38075
  customerData.entity('default/customers')
37807
38076
  customerData.query(`
37808
38077
  SELECT
@@ -37834,7 +38103,10 @@
37834
38103
  orderData.queryParameter('minAmount', 100)
37835
38104
  orderData.queryParameter('maxResults', 50)
37836
38105
  // Multiple entities with relationships
37837
- const inventoryData = app.addDatasource.sqlite({ datasourceId: 'inventory', provider: 'dynamic' })
38106
+ const inventoryData = app.addDatasource.sqlite({
38107
+ datasourceId: 'inventory',
38108
+ provider: 'dynamic',
38109
+ })
37838
38110
  inventoryData.entity('default/products')
37839
38111
  inventoryData.entity('default/categories')
37840
38112
  inventoryData.query(`
@@ -37850,7 +38122,10 @@
37850
38122
  WHERE json_extract(p.data, '$.active') = true
37851
38123
  `)
37852
38124
  // Single document mode - for detail views and singleton data
37853
- const customerDetail = app.addDatasource.sqlite({ datasourceId: 'customer-detail', provider: 'dynamic' })
38125
+ const customerDetail = app.addDatasource.sqlite({
38126
+ datasourceId: 'customer-detail',
38127
+ provider: 'dynamic',
38128
+ })
37854
38129
  customerDetail.entity('default/customers')
37855
38130
  customerDetail.query(`
37856
38131
  SELECT
@@ -37866,7 +38141,10 @@
37866
38141
  customerDetail.jsonProperties('data')
37867
38142
  customerDetail.isDocument(true) // Returns single document instead of array
37868
38143
  // Dashboard statistics - single aggregated row
37869
- const dashboardStats = app.addDatasource.sqlite({ datasourceId: 'dashboard-stats', provider: 'dynamic' })
38144
+ const dashboardStats = app.addDatasource.sqlite({
38145
+ datasourceId: 'dashboard-stats',
38146
+ provider: 'dynamic',
38147
+ })
37870
38148
  dashboardStats.entity('default/orders')
37871
38149
  dashboardStats.query(`
37872
38150
  SELECT
@@ -37895,7 +38173,10 @@
37895
38173
  device-specific information
37896
38174
  code: |-
37897
38175
  // Local SQLite datasource - device-only storage for preferences and temporary data
37898
- const userPrefs = app.addDatasource.sqlite({ datasourceId: 'user-preferences', provider: 'local' })
38176
+ const userPrefs = app.addDatasource.sqlite({
38177
+ datasourceId: 'user-preferences',
38178
+ provider: 'local',
38179
+ })
37899
38180
  userPrefs.entity('preferences')
37900
38181
  userPrefs.query(`
37901
38182
  SELECT
@@ -37922,7 +38203,10 @@
37922
38203
  `)
37923
38204
  localCache.queryParameter('currentTime', '=@ctx.solution.state.currentTimestamp')
37924
38205
  // Device-specific settings and configuration
37925
- const deviceSettings = app.addDatasource.sqlite({ datasourceId: 'device-settings', provider: 'local' })
38206
+ const deviceSettings = app.addDatasource.sqlite({
38207
+ datasourceId: 'device-settings',
38208
+ provider: 'local',
38209
+ })
37926
38210
  deviceSettings.entity('settings')
37927
38211
  deviceSettings.query(`
37928
38212
  SELECT
@@ -37951,99 +38235,111 @@
37951
38235
  doesn't require database storage
37952
38236
  code: |-
37953
38237
  // Basic static datasource for dropdown options
37954
- app.addDatasource.static({ datasourceId: 'order-statuses', data: [
37955
- { id: 'pending', label: 'Pending Review', color: '#FFA500' },
37956
- { id: 'approved', label: 'Approved', color: '#28A745' },
37957
- { id: 'rejected', label: 'Rejected', color: '#DC3545' },
37958
- { id: 'processing', label: 'Processing', color: '#17A2B8' },
37959
- { id: 'completed', label: 'Completed', color: '#6F42C1' },
37960
- ] })
38238
+ app.addDatasource.static({
38239
+ datasourceId: 'order-statuses',
38240
+ data: [
38241
+ { id: 'pending', label: 'Pending Review', color: '#FFA500' },
38242
+ { id: 'approved', label: 'Approved', color: '#28A745' },
38243
+ { id: 'rejected', label: 'Rejected', color: '#DC3545' },
38244
+ { id: 'processing', label: 'Processing', color: '#17A2B8' },
38245
+ { id: 'completed', label: 'Completed', color: '#6F42C1' },
38246
+ ],
38247
+ })
37961
38248
  // Configuration options for app settings
37962
- app.addDatasource.static({ datasourceId: 'theme-options', data: [
37963
- {
37964
- id: 'light',
37965
- name: 'Light Theme',
37966
- description: 'Clean bright interface',
37967
- primaryColor: '#007BFF',
37968
- backgroundColor: '#FFFFFF',
37969
- },
37970
- {
37971
- id: 'dark',
37972
- name: 'Dark Theme',
37973
- description: 'Easy on the eyes',
37974
- primaryColor: '#BB86FC',
37975
- backgroundColor: '#121212',
37976
- },
37977
- {
37978
- id: 'auto',
37979
- name: 'System Default',
37980
- description: 'Follows device setting',
37981
- primaryColor: '#6C757D',
37982
- backgroundColor: 'auto',
37983
- },
37984
- ] })
38249
+ app.addDatasource.static({
38250
+ datasourceId: 'theme-options',
38251
+ data: [
38252
+ {
38253
+ id: 'light',
38254
+ name: 'Light Theme',
38255
+ description: 'Clean bright interface',
38256
+ primaryColor: '#007BFF',
38257
+ backgroundColor: '#FFFFFF',
38258
+ },
38259
+ {
38260
+ id: 'dark',
38261
+ name: 'Dark Theme',
38262
+ description: 'Easy on the eyes',
38263
+ primaryColor: '#BB86FC',
38264
+ backgroundColor: '#121212',
38265
+ },
38266
+ {
38267
+ id: 'auto',
38268
+ name: 'System Default',
38269
+ description: 'Follows device setting',
38270
+ primaryColor: '#6C757D',
38271
+ backgroundColor: 'auto',
38272
+ },
38273
+ ],
38274
+ })
37985
38275
  // Complex lookup data with nested properties
37986
- app.addDatasource.static({ datasourceId: 'countries', data: [
37987
- {
37988
- id: 'us',
37989
- name: 'United States',
37990
- code: 'US',
37991
- currency: { symbol: '$', code: 'USD' },
37992
- regions: [
37993
- { id: 'north', name: 'North' },
37994
- { id: 'south', name: 'South' },
37995
- { id: 'east', name: 'East' },
37996
- { id: 'west', name: 'West' },
37997
- ],
37998
- },
37999
- {
38000
- id: 'uk',
38001
- name: 'United Kingdom',
38002
- code: 'GB',
38003
- currency: { symbol: '£', code: 'GBP' },
38004
- regions: [
38005
- { id: 'england', name: 'England' },
38006
- { id: 'scotland', name: 'Scotland' },
38007
- { id: 'wales', name: 'Wales' },
38008
- { id: 'ni', name: 'Northern Ireland' },
38009
- ],
38010
- },
38011
- ] })
38276
+ app.addDatasource.static({
38277
+ datasourceId: 'countries',
38278
+ data: [
38279
+ {
38280
+ id: 'us',
38281
+ name: 'United States',
38282
+ code: 'US',
38283
+ currency: { symbol: '$', code: 'USD' },
38284
+ regions: [
38285
+ { id: 'north', name: 'North' },
38286
+ { id: 'south', name: 'South' },
38287
+ { id: 'east', name: 'East' },
38288
+ { id: 'west', name: 'West' },
38289
+ ],
38290
+ },
38291
+ {
38292
+ id: 'uk',
38293
+ name: 'United Kingdom',
38294
+ code: 'GB',
38295
+ currency: { symbol: '£', code: 'GBP' },
38296
+ regions: [
38297
+ { id: 'england', name: 'England' },
38298
+ { id: 'scotland', name: 'Scotland' },
38299
+ { id: 'wales', name: 'Wales' },
38300
+ { id: 'ni', name: 'Northern Ireland' },
38301
+ ],
38302
+ },
38303
+ ],
38304
+ })
38012
38305
  // Priority levels for task management
38013
- app.addDatasource.static({ datasourceId: 'priority-levels', data: [
38014
- {
38015
- id: 1,
38016
- name: 'Low',
38017
- color: '#28A745',
38018
- description: 'Nice to have',
38019
- urgencyScore: 1,
38020
- escalationDays: 30,
38021
- },
38022
- {
38023
- id: 2,
38024
- name: 'Medium',
38025
- color: '#FFC107',
38026
- description: 'Should be addressed',
38027
- urgencyScore: 5,
38028
- escalationDays: 7,
38029
- },
38030
- {
38031
- id: 3,
38032
- name: 'High',
38033
- color: '#FD7E14',
38034
- description: 'Important issue',
38035
- urgencyScore: 8,
38036
- escalationDays: 2,
38037
- },
38038
- {
38039
- id: 4,
38040
- name: 'Critical',
38041
- color: '#DC3545',
38042
- description: 'Immediate attention required',
38043
- urgencyScore: 10,
38044
- escalationDays: 0,
38045
- },
38046
- ] })
38306
+ app.addDatasource.static({
38307
+ datasourceId: 'priority-levels',
38308
+ data: [
38309
+ {
38310
+ id: 1,
38311
+ name: 'Low',
38312
+ color: '#28A745',
38313
+ description: 'Nice to have',
38314
+ urgencyScore: 1,
38315
+ escalationDays: 30,
38316
+ },
38317
+ {
38318
+ id: 2,
38319
+ name: 'Medium',
38320
+ color: '#FFC107',
38321
+ description: 'Should be addressed',
38322
+ urgencyScore: 5,
38323
+ escalationDays: 7,
38324
+ },
38325
+ {
38326
+ id: 3,
38327
+ name: 'High',
38328
+ color: '#FD7E14',
38329
+ description: 'Important issue',
38330
+ urgencyScore: 8,
38331
+ escalationDays: 2,
38332
+ },
38333
+ {
38334
+ id: 4,
38335
+ name: 'Critical',
38336
+ color: '#DC3545',
38337
+ description: 'Immediate attention required',
38338
+ urgencyScore: 10,
38339
+ escalationDays: 0,
38340
+ },
38341
+ ],
38342
+ })
38047
38343
  - id: datasource.datasource.system
38048
38344
  name: System Datasource Configuration
38049
38345
  category: datasource
@@ -38240,8 +38536,10 @@
38240
38536
  - entity
38241
38537
  - object-form
38242
38538
  description: Use entity({ entity }) to emit the explicit object shape for a table
38243
- code: "app.addDatasource.sqlite({ datasourceId: 'test-ds', provider: 'local'
38244
- }).entity({ entity: 'customers' })"
38539
+ code: |-
38540
+ app.addDatasource
38541
+ .sqlite({ datasourceId: 'test-ds', provider: 'local' })
38542
+ .entity({ entity: 'customers' })
38245
38543
  - id: datasource.sqlite-example-7
38246
38544
  name: SQLite Datasource Entity with Sync Function
38247
38545
  category: datasource
@@ -38273,8 +38571,10 @@
38273
38571
  - external
38274
38572
  description: Use entityPackaged(name, packageName) to reference a table from an
38275
38573
  external package
38276
- code: "app.addDatasource.sqlite({ datasourceId: 'test-ds', provider: 'local'
38277
- }).entityPackaged('users', 'erp')"
38574
+ code: |-
38575
+ app.addDatasource
38576
+ .sqlite({ datasourceId: 'test-ds', provider: 'local' })
38577
+ .entityPackaged('users', 'erp')
38278
38578
  - id: datasource.static-example-1
38279
38579
  name: Static Datasource with Color Objects
38280
38580
  category: datasource
@@ -38326,10 +38626,13 @@
38326
38626
  - properties
38327
38627
  description: Store color data with name and hex value properties
38328
38628
  code: |-
38329
- app.addDatasource.static({ datasourceId: 'colors', data: [
38330
- { name: 'Red', value: '#FF0000' },
38331
- { name: 'Green', value: '#00FF00' },
38332
- ] })
38629
+ app.addDatasource.static({
38630
+ datasourceId: 'colors',
38631
+ data: [
38632
+ { name: 'Red', value: '#FF0000' },
38633
+ { name: 'Green', value: '#00FF00' },
38634
+ ],
38635
+ })
38333
38636
  - id: datasource.static-example-5
38334
38637
  name: Static Datasource with Number Array
38335
38638
  category: datasource
@@ -38355,8 +38658,10 @@
38355
38658
  - comma-delimiter
38356
38659
  description: Parse comma-separated priority values into array using default
38357
38660
  comma delimiter
38358
- code: "app.addDatasource.static({ datasourceId: 'priorities', data: []
38359
- }).csv('urgent, high, medium, low')"
38661
+ code: |-
38662
+ app.addDatasource
38663
+ .static({ datasourceId: 'priorities', data: [] })
38664
+ .csv('urgent, high, medium, low')
38360
38665
  - id: datasource.static-example-7
38361
38666
  name: Static Datasource with Pipe-Delimited CSV Colors
38362
38667
  category: datasource
@@ -38368,8 +38673,10 @@
38368
38673
  - whitespace
38369
38674
  - colors
38370
38675
  description: Parse pipe-delimited color values with automatic whitespace trimming
38371
- code: "app.addDatasource.static({ datasourceId: 'colors', data: [] }).csv(' red
38372
- | green | blue ', '|')"
38676
+ code: |-
38677
+ app.addDatasource
38678
+ .static({ datasourceId: 'colors', data: [] })
38679
+ .csv(' red | green | blue ', '|')
38373
38680
  - id: datasource.static-example-8
38374
38681
  name: Static Datasource with JSON Array Parsing
38375
38682
  category: datasource
@@ -38394,8 +38701,10 @@
38394
38701
  - key-value-pairs
38395
38702
  - configuration
38396
38703
  description: Convert JSON configuration object to key-value pair array
38397
- code: "app.addDatasource.static({ datasourceId: 'config', data: []
38398
- }).json('{\"debug\": true, \"port\": 3000}')"
38704
+ code: |-
38705
+ app.addDatasource
38706
+ .static({ datasourceId: 'config', data: [] })
38707
+ .json('{"debug": true, "port": 3000}')
38399
38708
  - id: datasource.system-example-1
38400
38709
  name: System Datasource for Feature Flags
38401
38710
  category: datasource
@@ -38458,7 +38767,11 @@
38458
38767
  managing continuation tokens for REST APIs
38459
38768
  code: |-
38460
38769
  // 1. Basic REST function with simple pagination
38461
- const getUsersFunction = app.addFunction.rest({ functionId: 'get-users', method: 'GET', url: 'https://api.example.com/users' })
38770
+ const getUsersFunction = app.addFunction.rest({
38771
+ functionId: 'get-users',
38772
+ method: 'GET',
38773
+ url: 'https://api.example.com/users',
38774
+ })
38462
38775
  getUsersFunction.params.query('page', { value: 1, type: 'number' })
38463
38776
  getUsersFunction.params.header('Authorization', 'Bearer token123')
38464
38777
  getUsersFunction.json()
@@ -38468,7 +38781,11 @@
38468
38781
  usersContinuation.when('=$.hasMore')
38469
38782
  usersContinuation.url('=$.nextPageUrl')
38470
38783
  // 2. Microsoft Graph API with OAuth continuation
38471
- const getGraphUsers = app.addFunction.rest({ functionId: 'get-graph-users', method: 'GET', url: 'https://graph.microsoft.com/v1.0/users' })
38784
+ const getGraphUsers = app.addFunction.rest({
38785
+ functionId: 'get-graph-users',
38786
+ method: 'GET',
38787
+ url: 'https://graph.microsoft.com/v1.0/users',
38788
+ })
38472
38789
  getGraphUsers.params.header('Authorization', '=@ctx.solution.state.user.graphToken')
38473
38790
  getGraphUsers.json()
38474
38791
  getGraphUsers.records('=$.value')
@@ -38477,7 +38794,11 @@
38477
38794
  graphContinuation.when('=$."@odata.nextLink"')
38478
38795
  graphContinuation.url('=$."@odata.nextLink"')
38479
38796
  // 3. Advanced pagination with cursor-based continuation
38480
- const searchCustomers = app.addFunction.rest({ functionId: 'search-customers', method: 'POST', url: 'https://api.crm.com/customers/search' })
38797
+ const searchCustomers = app.addFunction.rest({
38798
+ functionId: 'search-customers',
38799
+ method: 'POST',
38800
+ url: 'https://api.crm.com/customers/search',
38801
+ })
38481
38802
  searchCustomers.params.body('query', { name: 'John', active: true })
38482
38803
  searchCustomers.params.header('API-Key', '=@ctx.solution.state.crmApiKey')
38483
38804
  searchCustomers.json()
@@ -38489,7 +38810,11 @@
38489
38810
  '=@ctx.solution.state.apiUrl & "/customers/search?cursor=" & $.pagination.nextCursor',
38490
38811
  )
38491
38812
  // 4. Pagination with dynamic parameter updates
38492
- const getOrderHistory = app.addFunction.rest({ functionId: 'get-order-history', method: 'GET', url: 'https://api.orders.com/history' })
38813
+ const getOrderHistory = app.addFunction.rest({
38814
+ functionId: 'get-order-history',
38815
+ method: 'GET',
38816
+ url: 'https://api.orders.com/history',
38817
+ })
38493
38818
  getOrderHistory.params.query('limit', { value: 100, type: 'number' })
38494
38819
  getOrderHistory.params.query('offset', { value: 0, type: 'number' })
38495
38820
  getOrderHistory.params.header('X-API-Key', '=@ctx.solution.state.ordersApiKey')
@@ -38502,7 +38827,11 @@
38502
38827
  '=@ctx.solution.state.ordersUrl & "/history?offset=" & ($.offset + $.limit) & "&limit=" & $.limit',
38503
38828
  )
38504
38829
  // 5. Complex continuation with authentication renewal
38505
- const syncInventory = app.addFunction.rest({ functionId: 'sync-inventory', method: 'GET', url: 'https://api.inventory.com/items' })
38830
+ const syncInventory = app.addFunction.rest({
38831
+ functionId: 'sync-inventory',
38832
+ method: 'GET',
38833
+ url: 'https://api.inventory.com/items',
38834
+ })
38506
38835
  syncInventory.params.header('Authorization', 'Bearer =@ctx.solution.state.inventoryToken')
38507
38836
  syncInventory.params.query('pageSize', { value: 50, type: 'number' })
38508
38837
  syncInventory.json()
@@ -38527,14 +38856,22 @@
38527
38856
  PUT, DELETE methods with full parameter and header control
38528
38857
  code: |-
38529
38858
  // 1. Basic GET request with authentication
38530
- const getUsersFunction = app.addFunction.rest({ functionId: 'get-users', method: 'GET', url: 'https://api.example.com/users' })
38859
+ const getUsersFunction = app.addFunction.rest({
38860
+ functionId: 'get-users',
38861
+ method: 'GET',
38862
+ url: 'https://api.example.com/users',
38863
+ })
38531
38864
  getUsersFunction.json()
38532
38865
  getUsersFunction.params
38533
38866
  .header('Authorization', 'Bearer =@ctx.solution.state.auth.token')
38534
38867
  .query('page', { type: 'number', value: 1 })
38535
38868
  .query('limit', { type: 'number', value: 10 })
38536
38869
  // 2. POST request with body data and API key
38537
- const createUserFunction = app.addFunction.rest({ functionId: 'create-user', method: 'POST', url: 'https://api.example.com/users' })
38870
+ const createUserFunction = app.addFunction.rest({
38871
+ functionId: 'create-user',
38872
+ method: 'POST',
38873
+ url: 'https://api.example.com/users',
38874
+ })
38538
38875
  createUserFunction.json()
38539
38876
  createUserFunction.params.apiKey('=@ctx.solution.state.settings.apiKey').body('user', {
38540
38877
  name: '=@ctx.components.name.state.value',
@@ -38542,7 +38879,11 @@
38542
38879
  department: '=@ctx.solution.state.user.department',
38543
38880
  })
38544
38881
  // 3. Advanced configuration with output transformation and entity storage
38545
- const getProductsFunction = app.addFunction.rest({ functionId: 'get-products', method: 'GET', url: 'https://api.example.com/products' })
38882
+ const getProductsFunction = app.addFunction.rest({
38883
+ functionId: 'get-products',
38884
+ method: 'GET',
38885
+ url: 'https://api.example.com/products',
38886
+ })
38546
38887
  getProductsFunction.json().outputTransform('$.data.products').entity('default/products')
38547
38888
  getProductsFunction.params
38548
38889
  .header('X-API-Version', '2.0')
@@ -38565,7 +38906,11 @@
38565
38906
  response strategies
38566
38907
  code: |-
38567
38908
  // 1. Function with comprehensive error handling
38568
- const syncDataFunction = app.addFunction.rest({ functionId: 'sync-data', method: 'POST', url: 'https://api.example.com/sync' })
38909
+ const syncDataFunction = app.addFunction.rest({
38910
+ functionId: 'sync-data',
38911
+ method: 'POST',
38912
+ url: 'https://api.example.com/sync',
38913
+ })
38569
38914
  syncDataFunction.json()
38570
38915
  syncDataFunction.params.bearer('=@ctx.auth.accessToken').body('data', '=@ctx.pendingSync.data')
38571
38916
  // Server error with retry
@@ -38598,7 +38943,11 @@
38598
38943
  .icon('lock')
38599
38944
  .notification(true)
38600
38945
  // 2. Function with data conversion and error handling
38601
- const uploadImageFunction = app.addFunction.rest({ functionId: 'upload-image', method: 'POST', url: 'https://api.example.com/upload' })
38946
+ const uploadImageFunction = app.addFunction.rest({
38947
+ functionId: 'upload-image',
38948
+ method: 'POST',
38949
+ url: 'https://api.example.com/upload',
38950
+ })
38602
38951
  uploadImageFunction.json().base64ToUri('image', 'uploaded-image.jpg')
38603
38952
  uploadImageFunction.params
38604
38953
  .header('Content-Type', 'application/json')
@@ -38633,7 +38982,11 @@
38633
38982
  for mobile-optimized performance
38634
38983
  code: |-
38635
38984
  // 1. Paginated API with continuation logic
38636
- const getOrdersFunction = app.addFunction.rest({ functionId: 'get-orders', method: 'GET', url: 'https://api.example.com/orders' })
38985
+ const getOrdersFunction = app.addFunction.rest({
38986
+ functionId: 'get-orders',
38987
+ method: 'GET',
38988
+ url: 'https://api.example.com/orders',
38989
+ })
38637
38990
  getOrdersFunction.json().outputTransform('$.orders').entity('default/orders')
38638
38991
  getOrdersFunction.params
38639
38992
  .header('Authorization', 'Bearer =@ctx.solution.state.auth.token')
@@ -38642,7 +38995,11 @@
38642
38995
  // Continuation for next page
38643
38996
  getOrdersFunction.continuation.when('=$.hasMore').url('=$.nextPageUrl')
38644
38997
  // 2. Function with file conversion and row filtering
38645
- const getCustomersFunction = app.addFunction.rest({ functionId: 'get-customers', method: 'GET', url: 'https://api.example.com/customers' })
38998
+ const getCustomersFunction = app.addFunction.rest({
38999
+ functionId: 'get-customers',
39000
+ method: 'GET',
39001
+ url: 'https://api.example.com/customers',
39002
+ })
38646
39003
  getCustomersFunction
38647
39004
  .json()
38648
39005
  .outputTransform('$.data.customers')
@@ -38654,7 +39011,11 @@
38654
39011
  .query('includeInactive', { type: 'boolean', value: false })
38655
39012
  .query('fields', { value: 'id,name,email,profileImage,status,lastLoginDays' })
38656
39013
  // 3. Bulk data processing with transformation
38657
- const getAnalyticsFunction = app.addFunction.rest({ functionId: 'get-analytics', method: 'GET', url: 'https://api.example.com/analytics' })
39014
+ const getAnalyticsFunction = app.addFunction.rest({
39015
+ functionId: 'get-analytics',
39016
+ method: 'GET',
39017
+ url: 'https://api.example.com/analytics',
39018
+ })
38658
39019
  getAnalyticsFunction.json().outputTransform('$.metrics')
38659
39020
  getAnalyticsFunction.params
38660
39021
  .query('dateFrom', { value: '=@ctx.jig.state.filter.startDate' })
@@ -38677,14 +39038,24 @@
38677
39038
  construction, authentication, and XML response parsing
38678
39039
  code: |-
38679
39040
  // 1. Basic SOAP service call with authentication
38680
- const getUserDetailsFunction = app.addFunction.soap({ functionId: 'get-user-details', connection: 'legacy-service', method: 'GetUserDetails', wsdl: 'https://legacy-api.company.com/UserService.wsdl' })
39041
+ const getUserDetailsFunction = app.addFunction.soap({
39042
+ functionId: 'get-user-details',
39043
+ connection: 'legacy-service',
39044
+ method: 'GetUserDetails',
39045
+ wsdl: 'https://legacy-api.company.com/UserService.wsdl',
39046
+ })
38681
39047
  getUserDetailsFunction.params
38682
39048
  .header('SOAPAction', 'GetUserDetails')
38683
39049
  .header('Authorization', 'Basic =@ctx.solution.state.auth.basicToken')
38684
39050
  .body('UserId', '=@ctx.user.id')
38685
39051
  .body('IncludeDetails', true)
38686
39052
  // 2. SOAP service with complex parameters
38687
- const createOrderFunction = app.addFunction.soap({ functionId: 'create-order', connection: 'erp-service', method: 'CreateOrder', wsdl: 'https://erp.company.com/OrderService.wsdl' })
39053
+ const createOrderFunction = app.addFunction.soap({
39054
+ functionId: 'create-order',
39055
+ connection: 'erp-service',
39056
+ method: 'CreateOrder',
39057
+ wsdl: 'https://erp.company.com/OrderService.wsdl',
39058
+ })
38688
39059
  createOrderFunction.params
38689
39060
  .header('SOAPAction', 'CreateOrder')
38690
39061
  .header('X-API-Key', '=@ctx.solution.state.settings.erpApiKey')
@@ -38696,7 +39067,12 @@
38696
39067
  PaymentMethod: '=@ctx.jig.inputs.payment.method',
38697
39068
  })
38698
39069
  // 3. SOAP service with output transformation
38699
- const getInventoryFunction = app.addFunction.soap({ functionId: 'get-inventory', connection: 'wms-service', method: 'GetInventoryStatus', wsdl: 'https://wms.company.com/InventoryService.wsdl' })
39070
+ const getInventoryFunction = app.addFunction.soap({
39071
+ functionId: 'get-inventory',
39072
+ connection: 'wms-service',
39073
+ method: 'GetInventoryStatus',
39074
+ wsdl: 'https://wms.company.com/InventoryService.wsdl',
39075
+ })
38700
39076
  getInventoryFunction
38701
39077
  .outputTransform('$.Body.GetInventoryStatusResponse.InventoryItems.Item')
38702
39078
  .entity('inventory')
@@ -38721,7 +39097,12 @@
38721
39097
  authentication errors, and enterprise messaging patterns
38722
39098
  code: |-
38723
39099
  // 1. Enterprise service with comprehensive error handling
38724
- const syncEmployeeDataFunction = app.addFunction.soap({ functionId: 'sync-employee-data', connection: 'hr-service', method: 'SyncEmployeeData', wsdl: 'https://hr.company.com/EmployeeService.wsdl' })
39100
+ const syncEmployeeDataFunction = app.addFunction.soap({
39101
+ functionId: 'sync-employee-data',
39102
+ connection: 'hr-service',
39103
+ method: 'SyncEmployeeData',
39104
+ wsdl: 'https://hr.company.com/EmployeeService.wsdl',
39105
+ })
38725
39106
  syncEmployeeDataFunction.params
38726
39107
  .header('SOAPAction', 'SyncEmployeeData')
38727
39108
  .header('Authorization', 'Bearer =@ctx.solution.state.auth.enterpriseToken')
@@ -38754,7 +39135,12 @@
38754
39135
  maxRetries: 2,
38755
39136
  })
38756
39137
  // 2. Legacy financial system integration
38757
- const processPaymentFunction = app.addFunction.soap({ functionId: 'process-payment', connection: 'finance-service', method: 'ProcessPayment', wsdl: 'https://finance.company.com/PaymentService.wsdl' })
39138
+ const processPaymentFunction = app.addFunction.soap({
39139
+ functionId: 'process-payment',
39140
+ connection: 'finance-service',
39141
+ method: 'ProcessPayment',
39142
+ wsdl: 'https://finance.company.com/PaymentService.wsdl',
39143
+ })
38758
39144
  processPaymentFunction.params
38759
39145
  .header('SOAPAction', 'ProcessPayment')
38760
39146
  .header('X-System-Id', 'MOBILE_APP')
@@ -38794,7 +39180,12 @@
38794
39180
  integration, and enterprise data patterns
38795
39181
  code: |-
38796
39182
  // 1. Multi-step customer onboarding workflow
38797
- const initiateCustomerOnboardingFunction = app.addFunction.soap({ functionId: 'initiate-customer-onboarding', connection: 'crm-service', method: 'InitiateOnboarding', wsdl: 'https://crm.company.com/OnboardingService.wsdl' })
39183
+ const initiateCustomerOnboardingFunction = app.addFunction.soap({
39184
+ functionId: 'initiate-customer-onboarding',
39185
+ connection: 'crm-service',
39186
+ method: 'InitiateOnboarding',
39187
+ wsdl: 'https://crm.company.com/OnboardingService.wsdl',
39188
+ })
38798
39189
  initiateCustomerOnboardingFunction.outputTransform(
38799
39190
  '$.Body.InitiateOnboardingResponse.OnboardingProcess',
38800
39191
  )
@@ -38817,7 +39208,12 @@
38817
39208
  ReferralSource: '=@ctx.jig.inputs.referral.source',
38818
39209
  })
38819
39210
  // 2. Document processing and approval workflow
38820
- const submitDocumentForApprovalFunction = app.addFunction.soap({ functionId: 'submit-document-approval', connection: 'workflow-service', method: 'SubmitForApproval', wsdl: 'https://workflow.company.com/ApprovalService.wsdl' })
39211
+ const submitDocumentForApprovalFunction = app.addFunction.soap({
39212
+ functionId: 'submit-document-approval',
39213
+ connection: 'workflow-service',
39214
+ method: 'SubmitForApproval',
39215
+ wsdl: 'https://workflow.company.com/ApprovalService.wsdl',
39216
+ })
38821
39217
  submitDocumentForApprovalFunction.base64ToUri('documentContent', 'document.pdf')
38822
39218
  submitDocumentForApprovalFunction.params
38823
39219
  .header('SOAPAction', 'SubmitForApproval')
@@ -38834,7 +39230,12 @@
38834
39230
  },
38835
39231
  })
38836
39232
  // 3. Complex reporting service with aggregated data
38837
- const generateComplianceReportFunction = app.addFunction.soap({ functionId: 'generate-compliance-report', connection: 'compliance-service', method: 'GenerateComplianceReport', wsdl: 'https://compliance.company.com/ReportingService.wsdl' })
39233
+ const generateComplianceReportFunction = app.addFunction.soap({
39234
+ functionId: 'generate-compliance-report',
39235
+ connection: 'compliance-service',
39236
+ method: 'GenerateComplianceReport',
39237
+ wsdl: 'https://compliance.company.com/ReportingService.wsdl',
39238
+ })
38838
39239
  generateComplianceReportFunction.outputTransform(
38839
39240
  '$.Body.GenerateComplianceReportResponse.ReportData.Sections',
38840
39241
  )
@@ -38873,7 +39274,10 @@
38873
39274
  input/output parameters
38874
39275
  code: |-
38875
39276
  // 1. Basic SELECT query with parameters
38876
- const getCustomersFunction = app.addFunction.sql({ functionId: 'get-customers', connection: 'customerDb' })
39277
+ const getCustomersFunction = app.addFunction.sql({
39278
+ functionId: 'get-customers',
39279
+ connection: 'customerDb',
39280
+ })
38877
39281
  getCustomersFunction
38878
39282
  .providerQuery('SELECT * FROM customers WHERE active = @active AND region = @region')
38879
39283
  .entity('customers')
@@ -38881,7 +39285,11 @@
38881
39285
  .input('active', 'boolean', { value: true })
38882
39286
  .input('region', 'string', { value: '=@ctx.solution.state.user.region' })
38883
39287
  // 2. Stored procedure with input and output parameters
38884
- const updateCustomerFunction = app.addFunction.sql({ functionId: 'update-customer', connection: 'customerDb', method: 'execute' })
39288
+ const updateCustomerFunction = app.addFunction.sql({
39289
+ functionId: 'update-customer',
39290
+ connection: 'customerDb',
39291
+ method: 'execute',
39292
+ })
38885
39293
  updateCustomerFunction.procedure('sp_UpdateCustomer')
38886
39294
  updateCustomerFunction.params
38887
39295
  .input('customerId', 'number', { value: '=@ctx.jig.inputs.customer.id' })
@@ -38890,7 +39298,10 @@
38890
39298
  .output('result', 'string')
38891
39299
  .output('affectedRows', 'number')
38892
39300
  // 3. Complex query with data transformation
38893
- const getOrderStatsFunction = app.addFunction.sql({ functionId: 'get-order-stats', connection: 'analyticsDb' })
39301
+ const getOrderStatsFunction = app.addFunction.sql({
39302
+ functionId: 'get-order-stats',
39303
+ connection: 'analyticsDb',
39304
+ })
38894
39305
  getOrderStatsFunction.providerQuery(`
38895
39306
  SELECT
38896
39307
  customerId,
@@ -38923,7 +39334,11 @@
38923
39334
  handling of database constraints, locks, and file operations
38924
39335
  code: |-
38925
39336
  // 1. Insert operation with comprehensive error handling
38926
- const createOrderFunction = app.addFunction.sql({ functionId: 'create-order', connection: 'ordersDb', method: 'execute' })
39337
+ const createOrderFunction = app.addFunction.sql({
39338
+ functionId: 'create-order',
39339
+ connection: 'ordersDb',
39340
+ method: 'execute',
39341
+ })
38927
39342
  createOrderFunction.procedure('sp_CreateOrder')
38928
39343
  createOrderFunction.params
38929
39344
  .input('customerId', 'number', { value: '=@ctx.jig.inputs.customer.id' })
@@ -38949,7 +39364,10 @@
38949
39364
  maxRetries: 3,
38950
39365
  })
38951
39366
  // 2. Function with file conversion and row operations
38952
- const getProductsWithImagesFunction = app.addFunction.sql({ functionId: 'get-products-with-images', connection: 'catalogDb' })
39367
+ const getProductsWithImagesFunction = app.addFunction.sql({
39368
+ functionId: 'get-products-with-images',
39369
+ connection: 'catalogDb',
39370
+ })
38953
39371
  getProductsWithImagesFunction
38954
39372
  .providerQuery('SELECT * FROM products WHERE categoryId = @categoryId')
38955
39373
  .entity('products')
@@ -38959,7 +39377,11 @@
38959
39377
  value: '=@ctx.current.item.category.id',
38960
39378
  })
38961
39379
  // 3. Bulk operation with table operations and conditions
38962
- const syncInventoryFunction = app.addFunction.sql({ functionId: 'sync-inventory', connection: 'inventoryDb', method: 'execute' })
39380
+ const syncInventoryFunction = app.addFunction.sql({
39381
+ functionId: 'sync-inventory',
39382
+ connection: 'inventoryDb',
39383
+ method: 'execute',
39384
+ })
38963
39385
  syncInventoryFunction.procedure('sp_SyncInventory')
38964
39386
  syncInventoryFunction.params
38965
39387
  .input('inventoryData', 'string', { value: '=JSON.stringify(@ctx.datasources.inventory)' })
@@ -38994,17 +39416,26 @@
38994
39416
  operations
38995
39417
  code: |-
38996
39418
  // 1. Dynamic SELECT query with helper methods
38997
- const getFilteredCustomersFunction = app.addFunction.sql({ functionId: 'get-filtered-customers', connection: 'reportsDb' })
39419
+ const getFilteredCustomersFunction = app.addFunction.sql({
39420
+ functionId: 'get-filtered-customers',
39421
+ connection: 'reportsDb',
39422
+ })
38998
39423
  getFilteredCustomersFunction
38999
39424
  .select(['id', 'name', 'email', 'region', 'lastOrderDate'], 'customers', 'active = @active')
39000
39425
  .entity('customers')
39001
39426
  getFilteredCustomersFunction.params.input('active', 'boolean', { value: true })
39002
39427
  // 2. Simple SELECT ALL with conditions
39003
- const getAllProductsFunction = app.addFunction.sql({ functionId: 'get-all-products', connection: 'catalogDb' })
39428
+ const getAllProductsFunction = app.addFunction.sql({
39429
+ functionId: 'get-all-products',
39430
+ connection: 'catalogDb',
39431
+ })
39004
39432
  getAllProductsFunction.selectAll('products', 'discontinued = @discontinued').entity('products')
39005
39433
  getAllProductsFunction.params.input('discontinued', 'boolean', { value: false })
39006
39434
  // 3. Complex analytics query
39007
- const getSalesReportFunction = app.addFunction.sql({ functionId: 'get-sales-report', connection: 'analyticsDb' })
39435
+ const getSalesReportFunction = app.addFunction.sql({
39436
+ functionId: 'get-sales-report',
39437
+ connection: 'analyticsDb',
39438
+ })
39008
39439
  getSalesReportFunction.providerQuery(`
39009
39440
  WITH monthly_sales AS (
39010
39441
  SELECT
@@ -39032,7 +39463,11 @@
39032
39463
  value: '=@ctx.jig.inputs.report.startDate',
39033
39464
  })
39034
39465
  // 4. Batch processing with file operations
39035
- const processBatchUploadsFunction = app.addFunction.sql({ functionId: 'process-batch-uploads', connection: 'processingDb', method: 'execute' })
39466
+ const processBatchUploadsFunction = app.addFunction.sql({
39467
+ functionId: 'process-batch-uploads',
39468
+ connection: 'processingDb',
39469
+ method: 'execute',
39470
+ })
39036
39471
  processBatchUploadsFunction.procedure('sp_ProcessBatch').uriToBase64('uploadFile')
39037
39472
  processBatchUploadsFunction.params
39038
39473
  .input('batchId', 'string', { value: '=@ctx.jig.inputs.batch.id' })
@@ -39053,7 +39488,11 @@
39053
39488
  result expression
39054
39489
  code: |-
39055
39490
  const app = new ApplicationBuilder({ name: 'test-app' })
39056
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'POST', url: 'https://api.example.com/test' })
39491
+ const fn = app.addFunction.rest({
39492
+ functionId: 'test-function',
39493
+ method: 'POST',
39494
+ url: 'https://api.example.com/test',
39495
+ })
39057
39496
  fn.guard('guard-function')
39058
39497
  .parameters({
39059
39498
  accessToken: 'acuerp',
@@ -39074,7 +39513,11 @@
39074
39513
  tables with parameterized statements
39075
39514
  code: |-
39076
39515
  const app = new ApplicationBuilder({ name: 'test-app' })
39077
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'POST', url: 'https://api.example.com/test' })
39516
+ const fn = app.addFunction.rest({
39517
+ functionId: 'test-function',
39518
+ method: 'POST',
39519
+ url: 'https://api.example.com/test',
39520
+ })
39078
39521
  const guard = fn
39079
39522
  .guard('guard-function')
39080
39523
  .parameters({ id: '=@ctx.parameters.id' })
@@ -39100,7 +39543,11 @@
39100
39543
  replace records
39101
39544
  code: |-
39102
39545
  const app = new ApplicationBuilder({ name: 'test-app' })
39103
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'POST', url: 'https://api.example.com/test' })
39546
+ const fn = app.addFunction.rest({
39547
+ functionId: 'test-function',
39548
+ method: 'POST',
39549
+ url: 'https://api.example.com/test',
39550
+ })
39104
39551
  const guard = fn.guard('guard-function').result('=true')
39105
39552
  guard
39106
39553
  .operation()
@@ -39117,7 +39564,11 @@
39117
39564
  process response data
39118
39565
  code: |-
39119
39566
  const app = new ApplicationBuilder({ name: 'test-app' })
39120
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'GET', url: 'https://api.example.com/data' })
39567
+ const fn = app.addFunction.rest({
39568
+ functionId: 'test-function',
39569
+ method: 'GET',
39570
+ url: 'https://api.example.com/data',
39571
+ })
39121
39572
  fn.operation('=@ctx.response.body.items').upsertMerge(
39122
39573
  'items',
39123
39574
  '=$map(@ctx.response.body.items, function($v) {$merge([$v, {"Remote": true}])})',
@@ -39133,7 +39584,11 @@
39133
39584
  description: Configure function with root-level execute-sql operation to update local data
39134
39585
  code: |-
39135
39586
  const app = new ApplicationBuilder({ name: 'test-app' })
39136
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'GET', url: 'https://api.example.com/data' })
39587
+ const fn = app.addFunction.rest({
39588
+ functionId: 'test-function',
39589
+ method: 'GET',
39590
+ url: 'https://api.example.com/data',
39591
+ })
39137
39592
  fn.operation().executeSql(
39138
39593
  ['items'],
39139
39594
  'UPDATE items SET data = json_set(data, "$.Remote", false)',
@@ -39151,7 +39606,11 @@
39151
39606
  execution based on parameters
39152
39607
  code: |-
39153
39608
  const app = new ApplicationBuilder({ name: 'test-app' })
39154
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'GET', url: 'https://api.example.com/data' })
39609
+ const fn = app.addFunction.rest({
39610
+ functionId: 'test-function',
39611
+ method: 'GET',
39612
+ url: 'https://api.example.com/data',
39613
+ })
39155
39614
  fn.operation()
39156
39615
  .when('=@ctx.parameters.deleteRequired = "y"')
39157
39616
  .executeSql(['items'], 'DELETE FROM items WHERE json_extract(data, "$.Remote") is false')
@@ -39169,7 +39628,11 @@
39169
39628
  and conditional execute-sql
39170
39629
  code: |-
39171
39630
  const app = new ApplicationBuilder({ name: 'test-app' })
39172
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'GET', url: 'https://api.example.com/data' })
39631
+ const fn = app.addFunction.rest({
39632
+ functionId: 'test-function',
39633
+ method: 'GET',
39634
+ url: 'https://api.example.com/data',
39635
+ })
39173
39636
  fn.operation().upsertMerge('items', '=@ctx.response.body')
39174
39637
  fn.operation()
39175
39638
  .when('=@ctx.parameters.cleanup = true')
@@ -39224,7 +39687,11 @@
39224
39687
  values from function execution
39225
39688
  code: |-
39226
39689
  const app = new ApplicationBuilder({ name: 'test-app' })
39227
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'POST', url: 'https://api.example.com/payment' })
39690
+ const fn = app.addFunction.rest({
39691
+ functionId: 'test-function',
39692
+ method: 'POST',
39693
+ url: 'https://api.example.com/payment',
39694
+ })
39228
39695
  fn.params
39229
39696
  .body('amount', undefined, { type: 'number', required: true })
39230
39697
  .output('prePaymentTransactionId', { type: 'string', required: false })
@@ -39242,7 +39709,11 @@
39242
39709
  description: Configure guard with when condition to control when guard evaluation runs
39243
39710
  code: |-
39244
39711
  const app = new ApplicationBuilder({ name: 'test-app' })
39245
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'POST', url: 'https://api.example.com/test' })
39712
+ const fn = app.addFunction.rest({
39713
+ functionId: 'test-function',
39714
+ method: 'POST',
39715
+ url: 'https://api.example.com/test',
39716
+ })
39246
39717
  fn.guard('guard-function').when('=@ctx.user.authenticated').result('=@ctx.guard.output.valid')
39247
39718
  - id: function.guard-example-12
39248
39719
  name: Guard with Retry and Continuation Lifecycle Options
@@ -39257,7 +39728,11 @@
39257
39728
  robust sync workflows
39258
39729
  code: |-
39259
39730
  const app = new ApplicationBuilder({ name: 'test-app' })
39260
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'POST', url: 'https://api.example.com/test' })
39731
+ const fn = app.addFunction.rest({
39732
+ functionId: 'test-function',
39733
+ method: 'POST',
39734
+ url: 'https://api.example.com/test',
39735
+ })
39261
39736
  fn.guard('guard-function').onRetry().onContinuation().result('=@ctx.guard.output.valid')
39262
39737
  - id: function.guard-example-13
39263
39738
  name: Guard with Dynamic onInitial Expression
@@ -39272,7 +39747,11 @@
39272
39747
  initial guard evaluation
39273
39748
  code: |-
39274
39749
  const app = new ApplicationBuilder({ name: 'test-app' })
39275
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'POST', url: 'https://api.example.com/test' })
39750
+ const fn = app.addFunction.rest({
39751
+ functionId: 'test-function',
39752
+ method: 'POST',
39753
+ url: 'https://api.example.com/test',
39754
+ })
39276
39755
  fn.guard('guard-function')
39277
39756
  .onInitial('=@ctx.parameters.runGuard')
39278
39757
  .result('=@ctx.guard.output.valid')
@@ -39288,7 +39767,11 @@
39288
39767
  records in a table
39289
39768
  code: |-
39290
39769
  const app = new ApplicationBuilder({ name: 'test-app' })
39291
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'GET', url: 'https://api.example.com/data' })
39770
+ const fn = app.addFunction.rest({
39771
+ functionId: 'test-function',
39772
+ method: 'GET',
39773
+ url: 'https://api.example.com/data',
39774
+ })
39292
39775
  fn.operation('=@ctx.response.body.items').upsertReplace('items', '=@ctx.response.body.items')
39293
39776
  - id: function.guard-example-15
39294
39777
  name: Function with Find-Replace Operation for Temp ID Resolution
@@ -39303,7 +39786,11 @@
39303
39786
  server-assigned IDs across multiple tables including the command queue
39304
39787
  code: |-
39305
39788
  const app = new ApplicationBuilder({ name: 'test-app' })
39306
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'POST', url: 'https://api.example.com/data' })
39789
+ const fn = app.addFunction.rest({
39790
+ functionId: 'test-function',
39791
+ method: 'POST',
39792
+ url: 'https://api.example.com/data',
39793
+ })
39307
39794
  fn.operation().findReplace(
39308
39795
  'temp-id-123',
39309
39796
  '=@ctx.response.body.id',
@@ -39323,7 +39810,11 @@
39323
39810
  timestamp columns for conflict resolution
39324
39811
  code: |-
39325
39812
  const app = new ApplicationBuilder({ name: 'test-app' })
39326
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'GET', url: 'https://api.example.com/data' })
39813
+ const fn = app.addFunction.rest({
39814
+ functionId: 'test-function',
39815
+ method: 'GET',
39816
+ url: 'https://api.example.com/data',
39817
+ })
39327
39818
  fn.operation('=@ctx.response.body')
39328
39819
  .upsertMerge('items', '=@ctx.response.body')
39329
39820
  .primaryKey('itemId')
@@ -39341,7 +39832,11 @@
39341
39832
  formats during sync
39342
39833
  code: |-
39343
39834
  const app = new ApplicationBuilder({ name: 'test-app' })
39344
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'GET', url: 'https://api.example.com/data' })
39835
+ const fn = app.addFunction.rest({
39836
+ functionId: 'test-function',
39837
+ method: 'GET',
39838
+ url: 'https://api.example.com/data',
39839
+ })
39345
39840
  fn.operation('=@ctx.response.body')
39346
39841
  .upsertMerge('items', '=@ctx.response.body')
39347
39842
  .conversions([{ property: 'image', from: 'base64', to: 'local-uri' }])
@@ -39358,7 +39853,11 @@
39358
39853
  failed transactions from local tables
39359
39854
  code: |-
39360
39855
  const app = new ApplicationBuilder({ name: 'test-app' })
39361
- const fn = app.addFunction.rest({ functionId: 'test-function', method: 'POST', url: 'https://api.example.com/payment' })
39856
+ const fn = app.addFunction.rest({
39857
+ functionId: 'test-function',
39858
+ method: 'POST',
39859
+ url: 'https://api.example.com/payment',
39860
+ })
39362
39861
  fn.error('=@ctx.response.status = 500')
39363
39862
  .operation('=@ctx.response.body')
39364
39863
  .executeSql(
@@ -39407,7 +39906,11 @@
39407
39906
  starting_after parameter and bearer token authentication
39408
39907
  code: |-
39409
39908
  const fn = app.addFunction
39410
- .rest({ functionId: 'stripe-api', method: 'GET', url: 'https://api.stripe.com/v1/customers' })
39909
+ .rest({
39910
+ functionId: 'stripe-api',
39911
+ method: 'GET',
39912
+ url: 'https://api.stripe.com/v1/customers',
39913
+ })
39411
39914
  .json()
39412
39915
  .bearerToken('=@ctx.solution.state.stripeApiKey')
39413
39916
  fn.params.query('limit', { value: 100 })
@@ -39476,7 +39979,11 @@
39476
39979
  notifications, data transformation, operations and retry logic
39477
39980
  code: |-
39478
39981
  const app = new ApplicationBuilder({ name: 'test-application' })
39479
- const fn = app.addFunction.rest({ functionId: 'comprehensive-api', method: 'GET', url: 'https://api.example.com/data' })
39982
+ const fn = app.addFunction.rest({
39983
+ functionId: 'comprehensive-api',
39984
+ method: 'GET',
39985
+ url: 'https://api.example.com/data',
39986
+ })
39480
39987
  const errorHandler = fn
39481
39988
  .error('=@ctx.response.status >= 500')
39482
39989
  .title('Request Failed')
@@ -39508,7 +40015,11 @@
39508
40015
  conditions and retry strategies
39509
40016
  code: |-
39510
40017
  const app = new ApplicationBuilder({ name: 'test-application' })
39511
- const fn = app.addFunction.rest({ functionId: 'api-with-errors', method: 'GET', url: 'https://api.example.com/data' })
40018
+ const fn = app.addFunction.rest({
40019
+ functionId: 'api-with-errors',
40020
+ method: 'GET',
40021
+ url: 'https://api.example.com/data',
40022
+ })
39512
40023
  fn.error(true).title('Default Error')
39513
40024
  fn.error('=@ctx.response.status = 404').title('Not Found')
39514
40025
  fn.error('=@ctx.response.status >= 500').title('Server Error').retry({ delay: 5000 })
@@ -39567,7 +40078,11 @@
39567
40078
  description: Configure REST function pagination with continuation expressions
39568
40079
  for hasNext and nextUrl
39569
40080
  code: |-
39570
- const fn = app.addFunction.rest({ functionId: 'list-items', method: 'GET', url: 'https://api.example.com/items' })
40081
+ const fn = app.addFunction.rest({
40082
+ functionId: 'list-items',
40083
+ method: 'GET',
40084
+ url: 'https://api.example.com/items',
40085
+ })
39571
40086
  fn.continuation.when(toExpression('=$.hasNext')).url(toExpression('=$.nextUrl'))
39572
40087
  - id: function.rest-example-3
39573
40088
  name: REST Function with Entity Storage and Data Conversions
@@ -39584,7 +40099,11 @@
39584
40099
  from base64 to buffer and local URI
39585
40100
  code: |-
39586
40101
  app.addFunction
39587
- .rest({ functionId: 'get-products', method: 'GET', url: 'https://api.example.com/products' })
40102
+ .rest({
40103
+ functionId: 'get-products',
40104
+ method: 'GET',
40105
+ url: 'https://api.example.com/products',
40106
+ })
39588
40107
  .entity('default/products')
39589
40108
  .conversion('price', 'base64', 'buffer')
39590
40109
  .conversion('image', 'base64', 'local-uri', 'product-image.jpg')
@@ -39684,7 +40203,12 @@
39684
40203
  parameters and output transformation
39685
40204
  code: |-
39686
40205
  const fn = app.addFunction
39687
- .soap({ functionId: 'get-weather', connection: 'weather-service', method: 'GetWeather', wsdl: 'https://weather.com/wsdl' })
40206
+ .soap({
40207
+ functionId: 'get-weather',
40208
+ connection: 'weather-service',
40209
+ method: 'GetWeather',
40210
+ wsdl: 'https://weather.com/wsdl',
40211
+ })
39688
40212
  .outputTransform('$.Temperature')
39689
40213
  fn.params.body('city', 'London').header('apiKey', 'secret-key')
39690
40214
  - id: function.soap-example-2
@@ -39701,7 +40225,12 @@
39701
40225
  storage for order processing
39702
40226
  code: |-
39703
40227
  app.addFunction
39704
- .soap({ functionId: 'create-order', connection: 'order-service', method: 'CreateOrder', wsdl: 'https://orders.com/wsdl' })
40228
+ .soap({
40229
+ functionId: 'create-order',
40230
+ connection: 'order-service',
40231
+ method: 'CreateOrder',
40232
+ wsdl: 'https://orders.com/wsdl',
40233
+ })
39705
40234
  .inputTransform('="123"')
39706
40235
  .entity('orders')
39707
40236
  - id: function.soap-example-3
@@ -39719,7 +40248,12 @@
39719
40248
  conversions for thumbnails and source images
39720
40249
  code: |-
39721
40250
  const fn = app.addFunction
39722
- .soap({ functionId: 'process-image', connection: 'image-service', method: 'ProcessImage', wsdl: 'https://image.com/wsdl' })
40251
+ .soap({
40252
+ functionId: 'process-image',
40253
+ connection: 'image-service',
40254
+ method: 'ProcessImage',
40255
+ wsdl: 'https://image.com/wsdl',
40256
+ })
39723
40257
  .base64ToUri('thumbnail', 'thumb.jpg')
39724
40258
  .uriToBase64('source')
39725
40259
  fn.params.body('image', '=@ctx.solution.state.imageData')
@@ -39738,7 +40272,12 @@
39738
40272
  SOAP faults and network timeouts with retry logic
39739
40273
  code: |-
39740
40274
  const fn = app.addFunction
39741
- .soap({ functionId: 'weather-api', connection: 'weather-service', method: 'GetWeatherForecast', wsdl: 'https://weather.example.com/service?wsdl' })
40275
+ .soap({
40276
+ functionId: 'weather-api',
40277
+ connection: 'weather-service',
40278
+ method: 'GetWeatherForecast',
40279
+ wsdl: 'https://weather.example.com/service?wsdl',
40280
+ })
39742
40281
  .outputTransform('$.GetWeatherForecastResult')
39743
40282
  fn.params
39744
40283
  .body('city', '=@ctx.jig.inputs.location.city')
@@ -39775,7 +40314,8 @@
39775
40314
  description: Create SQL query function for customers with boolean parameter and
39776
40315
  entity storage
39777
40316
  code: |-
39778
- const fn = app.addFunction.sql({ functionId: 'get-customers', connection: 'mydb' })
40317
+ const fn = app.addFunction
40318
+ .sql({ functionId: 'get-customers', connection: 'mydb' })
39779
40319
  .sql('SELECT * FROM customers WHERE active = @active')
39780
40320
  fn.params.input('$active', 'boolean', { value: true })
39781
40321
  fn.entity('customers')
@@ -39792,7 +40332,8 @@
39792
40332
  description: Configure SQL function to execute stored procedure with input and
39793
40333
  output parameters for customer updates
39794
40334
  code: |-
39795
- const fn = app.addFunction.sql({ functionId: 'update-customer', connection: 'mydb', method: 'execute' })
40335
+ const fn = app.addFunction
40336
+ .sql({ functionId: 'update-customer', connection: 'mydb', method: 'execute' })
39796
40337
  .sql('sp_UpdateCustomer', 'procedure')
39797
40338
  fn.params
39798
40339
  .input('$customerId', 'number', { value: 123 })
@@ -39811,7 +40352,8 @@
39811
40352
  description: Generate SQL function with select helper for specific columns and
39812
40353
  active status filter
39813
40354
  code: |-
39814
- const fn = app.addFunction.sql({ functionId: 'get-customers', connection: 'mydb' })
40355
+ const fn = app.addFunction
40356
+ .sql({ functionId: 'get-customers', connection: 'mydb' })
39815
40357
  .select(['id', 'name', 'email'], 'customers', 'active = @active')
39816
40358
  fn.params.input('active', 'boolean', { value: true })
39817
40359
  - id: function.sql-example-4
@@ -39825,8 +40367,10 @@
39825
40367
  - no-where-clause
39826
40368
  description: Generate SQL function with select all helper to retrieve all
39827
40369
  products without filtering
39828
- code: "app.addFunction.sql({ functionId: 'get-all-products', connection: 'mydb'
39829
- }).selectAll('products')"
40370
+ code: |-
40371
+ app.addFunction
40372
+ .sql({ functionId: 'get-all-products', connection: 'mydb' })
40373
+ .selectAll('products')
39830
40374
  - id: function.sql-example-5
39831
40375
  name: SQL Function with Select All Helper and WHERE Clause Filter
39832
40376
  category: function
@@ -39840,7 +40384,8 @@
39840
40384
  description: Generate SQL function with select all helper and status parameter
39841
40385
  for active product filtering
39842
40386
  code: |-
39843
- const fn = app.addFunction.sql({ functionId: 'get-active-products', connection: 'mydb' })
40387
+ const fn = app.addFunction
40388
+ .sql({ functionId: 'get-active-products', connection: 'mydb' })
39844
40389
  .selectAll('products', 'status = @status')
39845
40390
  fn.params.input('status', 'string', { value: 'active' })
39846
40391
  - id: function.sql-example-6
@@ -39858,7 +40403,8 @@
39858
40403
  description: Configure SQL order sync function with comprehensive database error
39859
40404
  handling including constraint violations, lock errors and retry logic
39860
40405
  code: |-
39861
- const fn = app.addFunction.sql({ functionId: 'sync-orders', connection: 'orders_db' })
40406
+ const fn = app.addFunction
40407
+ .sql({ functionId: 'sync-orders', connection: 'orders_db' })
39862
40408
  .sql(
39863
40409
  'INSERT INTO orders (id, customer_id, total, status) VALUES (@id, @customer_id, @total, @status)',
39864
40410
  )
@@ -39922,7 +40468,11 @@
39922
40468
  description: Configure REST function header using branded ParameterName type
39923
40469
  code: |-
39924
40470
  const paramName = toParameterName('apiKey')
39925
- const builder = app.addFunction.rest({ functionId: 'test', method: 'GET', url: 'https://api.test.com' })
40471
+ const builder = app.addFunction.rest({
40472
+ functionId: 'test',
40473
+ method: 'GET',
40474
+ url: 'https://api.test.com',
40475
+ })
39926
40476
  // Should not throw with valid parameter name
39927
40477
  builder.params.header(paramName, 'secret')
39928
40478
  - id: function-example-3
@@ -39943,7 +40493,11 @@
39943
40493
  dependencies, and continuation support using config object
39944
40494
  code: |-
39945
40495
  const app = new ApplicationBuilder({ name: 'test-application' })
39946
- const fn = app.addFunction.rest({ functionId: 'config-query', method: 'GET', url: 'https://api.test.com' })
40496
+ const fn = app.addFunction.rest({
40497
+ functionId: 'config-query',
40498
+ method: 'GET',
40499
+ url: 'https://api.test.com',
40500
+ })
39947
40501
  fn.query('items', {
39948
40502
  statement: 'SELECT * FROM items WHERE active = 1',
39949
40503
  resultType: 'records',
@@ -39967,7 +40521,11 @@
39967
40521
  and scalar/record result type
39968
40522
  code: |-
39969
40523
  const app = new ApplicationBuilder({ name: 'test-application' })
39970
- const fn = app.addFunction.rest({ functionId: 'param-config-query', method: 'GET', url: 'https://api.test.com' })
40524
+ const fn = app.addFunction.rest({
40525
+ functionId: 'param-config-query',
40526
+ method: 'GET',
40527
+ url: 'https://api.test.com',
40528
+ })
39971
40529
  fn.query('lookup', {
39972
40530
  statement: 'SELECT * FROM items WHERE id = @id',
39973
40531
  parameters: { id: '=@ctx.user.id' },
@@ -39984,7 +40542,11 @@
39984
40542
  description: Set output expression to control what the function returns to its caller
39985
40543
  code: |-
39986
40544
  const app = new ApplicationBuilder({ name: 'test-application' })
39987
- const fn = app.addFunction.rest({ functionId: 'output-fn', method: 'GET', url: 'https://api.test.com' })
40545
+ const fn = app.addFunction.rest({
40546
+ functionId: 'output-fn',
40547
+ method: 'GET',
40548
+ url: 'https://api.test.com',
40549
+ })
39988
40550
  fn.output('=@ctx.response.body.result')
39989
40551
  - id: screen.bottom-sheet-example-1
39990
40552
  name: Bottom Sheet with Child Screens
@@ -40643,7 +41205,7 @@
40643
41205
  template component
40644
41206
  code: |-
40645
41207
  const dynamicGridScreen = app.addScreen
40646
- .dynamicGrid({ screenId: 'grid-1', title: 'Dynamic Grid', })
41208
+ .dynamicGrid({ screenId: 'grid-1', title: 'Dynamic Grid' })
40647
41209
  .data('=@ctx.datasources.dynamic')
40648
41210
  // Add required item template
40649
41211
  dynamicGridScreen.addControl.gridItem({ instanceId: 'item-1', size: '1x1' })
@@ -40663,7 +41225,7 @@
40663
41225
  subtitle for dynamic content
40664
41226
  code: |-
40665
41227
  const dynamicGridWithWidget = app.addScreen
40666
- .dynamicGrid({ screenId: 'dynamic-widget-test', title: 'Widget Test', })
41228
+ .dynamicGrid({ screenId: 'dynamic-widget-test', title: 'Widget Test' })
40667
41229
  .data('=@ctx.datasources.items') // Add required data
40668
41230
  // Add required item template
40669
41231
  dynamicGridWithWidget.addControl.gridItem({ instanceId: 'item-1', size: '1x1' })
@@ -40685,7 +41247,7 @@
40685
41247
  data-bound items
40686
41248
  code: |-
40687
41249
  const screen = app.addScreen
40688
- .dynamicGrid({ screenId: 'dynamic-item-test', title: 'Item Test', })
41250
+ .dynamicGrid({ screenId: 'dynamic-item-test', title: 'Item Test' })
40689
41251
  .data('=@ctx.datasources.items') // Add required data
40690
41252
  screen.addControl.gridItem()
40691
41253
  - id: screen.grid-dynamic-example-4
@@ -40703,7 +41265,7 @@
40703
41265
  line chart series data
40704
41266
  code: |-
40705
41267
  const dynamicGridWithChart = app.addScreen
40706
- .dynamicGrid({ screenId: 'dg', title: 'Dynamic Grid', })
41268
+ .dynamicGrid({ screenId: 'dg', title: 'Dynamic Grid' })
40707
41269
  .data('=@ctx.datasources.items') // Add required data
40708
41270
  // Add item template and widget
40709
41271
  dynamicGridWithChart.addControl.gridItem()
@@ -41579,7 +42141,7 @@
41579
42141
  from solution state
41580
42142
  code: |-
41581
42143
  const gridWithDynamicSummary = app.addScreen
41582
- .dynamicGrid({ screenId: 'dynamic-summary-test', title: 'Dynamic Summary', })
42144
+ .dynamicGrid({ screenId: 'dynamic-summary-test', title: 'Dynamic Summary' })
41583
42145
  .data('=@ctx.datasources.items')
41584
42146
  gridWithDynamicSummary.addControl.gridItem({ size: '1x1' })
41585
42147
  gridWithDynamicSummary.summary().addControl.default({
@@ -42023,7 +42585,9 @@
42023
42585
  concurrency: 'parallel',
42024
42586
  instanceId: 'load-data',
42025
42587
  })
42026
- const ds = screen.addDatasource.sqlite({ datasourceId: 'preferences', provider: 'local' }).entity('default/notifications')
42588
+ const ds = screen.addDatasource
42589
+ .sqlite({ datasourceId: 'preferences', provider: 'local' })
42590
+ .entity('default/notifications')
42027
42591
  onFocusAction.actions
42028
42592
  .executeEntity({ instanceId: 'load-notifications' })
42029
42593
  .dynamicData('default/notifications', 'update')
@@ -42690,7 +43254,11 @@
42690
43254
  productPreview.title('Product Showcase')
42691
43255
  productPreview.subtitle('Browse our product collection')
42692
43256
  const productEntity = productPreview.addControl.entity({ instanceId: 'product-preview' })
42693
- productEntity.addControl.entityField({ instanceId: 'name', label: 'Product Name', value: 'Premium Widget' })
43257
+ productEntity.addControl.entityField({
43258
+ instanceId: 'name',
43259
+ label: 'Product Name',
43260
+ value: 'Premium Widget',
43261
+ })
42694
43262
  productEntity.addControl.entityField({ instanceId: 'price', label: 'Price', value: '$99.99' })
42695
43263
  // Dashboard screen with compact preview
42696
43264
  const dashboard = app.addScreen.default({
@@ -44329,7 +44897,14 @@
44329
44897
  instanceId: 'office-marker',
44330
44898
  address: '=@ctx.current.item.address',
44331
44899
  })
44332
- officeMarker.with({ radius: { value: 0.5, unit: 'kilometers', color: 'primary', isEnabled: '=@ctx.current.item.showCoverage' } })
44900
+ officeMarker.with({
44901
+ radius: {
44902
+ value: 0.5,
44903
+ unit: 'kilometers',
44904
+ color: 'primary',
44905
+ isEnabled: '=@ctx.current.item.showCoverage',
44906
+ },
44907
+ })
44333
44908
  officeMarker.addIcon({ icon: 'office-building-tall-1', color: 'info' })
44334
44909
  // Create grid to display widgets (custom/static mode for map dashboard)
44335
44910
  const staticGrid = screen.addControl.grid()