@api-client/core 0.18.55 → 0.18.57

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 (148) hide show
  1. package/build/src/modeling/Semantics.js +1 -1
  2. package/build/src/modeling/Semantics.js.map +1 -1
  3. package/build/src/modeling/helpers/Intelisense.d.ts +1 -0
  4. package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
  5. package/build/src/modeling/helpers/Intelisense.js +23 -0
  6. package/build/src/modeling/helpers/Intelisense.js.map +1 -1
  7. package/build/tsconfig.tsbuildinfo +1 -1
  8. package/data/models/example-generator-api.json +15 -15
  9. package/package.json +2 -7
  10. package/src/modeling/Semantics.ts +1 -1
  11. package/src/modeling/helpers/Intelisense.ts +23 -0
  12. package/tests/unit/modeling/helpers/intellisense.spec.ts +46 -0
  13. package/build/src/modeling/templates/index.d.ts +0 -21
  14. package/build/src/modeling/templates/index.d.ts.map +0 -1
  15. package/build/src/modeling/templates/index.js +0 -176
  16. package/build/src/modeling/templates/index.js.map +0 -1
  17. package/build/src/modeling/templates/meta/blog-publishing-platform.json +0 -1
  18. package/build/src/modeling/templates/meta/ecommerce-platform.json +0 -1
  19. package/build/src/modeling/templates/meta/education-management-platform.json +0 -1
  20. package/build/src/modeling/templates/meta/financial-services-platform.json +0 -1
  21. package/build/src/modeling/templates/meta/gaming-platform.json +0 -1
  22. package/build/src/modeling/templates/meta/healthcare-management-platform.json +0 -1
  23. package/build/src/modeling/templates/meta/hospitality-platform.json +0 -1
  24. package/build/src/modeling/templates/meta/index.d.ts +0 -64
  25. package/build/src/modeling/templates/meta/index.d.ts.map +0 -1
  26. package/build/src/modeling/templates/meta/index.js +0 -150
  27. package/build/src/modeling/templates/meta/index.js.map +0 -1
  28. package/build/src/modeling/templates/meta/iot-smart-home-platform.json +0 -1
  29. package/build/src/modeling/templates/meta/legal-services-platform.json +0 -1
  30. package/build/src/modeling/templates/meta/manufacturing-platform.json +0 -1
  31. package/build/src/modeling/templates/meta/non-profit-platform.json +0 -1
  32. package/build/src/modeling/templates/meta/real-estate-management-platform.json +0 -1
  33. package/build/src/modeling/templates/template-registry.d.ts +0 -55
  34. package/build/src/modeling/templates/template-registry.d.ts.map +0 -1
  35. package/build/src/modeling/templates/template-registry.js +0 -111
  36. package/build/src/modeling/templates/template-registry.js.map +0 -1
  37. package/build/src/modeling/templates/types.d.ts +0 -167
  38. package/build/src/modeling/templates/types.d.ts.map +0 -1
  39. package/build/src/modeling/templates/types.js +0 -2
  40. package/build/src/modeling/templates/types.js.map +0 -1
  41. package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.d.ts +0 -39
  42. package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.d.ts.map +0 -1
  43. package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js +0 -672
  44. package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js.map +0 -1
  45. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts +0 -40
  46. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts.map +0 -1
  47. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js +0 -942
  48. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js.map +0 -1
  49. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts +0 -45
  50. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts.map +0 -1
  51. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js +0 -797
  52. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js.map +0 -1
  53. package/build/src/modeling/templates/verticals/business-services/index.d.ts +0 -21
  54. package/build/src/modeling/templates/verticals/business-services/index.d.ts.map +0 -1
  55. package/build/src/modeling/templates/verticals/business-services/index.js +0 -50
  56. package/build/src/modeling/templates/verticals/business-services/index.js.map +0 -1
  57. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts +0 -46
  58. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts.map +0 -1
  59. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js +0 -837
  60. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js.map +0 -1
  61. package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts +0 -40
  62. package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts.map +0 -1
  63. package/build/src/modeling/templates/verticals/education-training/education-domain.js +0 -725
  64. package/build/src/modeling/templates/verticals/education-training/education-domain.js.map +0 -1
  65. package/build/src/modeling/templates/verticals/education-training/index.d.ts +0 -18
  66. package/build/src/modeling/templates/verticals/education-training/index.d.ts.map +0 -1
  67. package/build/src/modeling/templates/verticals/education-training/index.js +0 -21
  68. package/build/src/modeling/templates/verticals/education-training/index.js.map +0 -1
  69. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts +0 -40
  70. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts.map +0 -1
  71. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js +0 -859
  72. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js.map +0 -1
  73. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts +0 -18
  74. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts.map +0 -1
  75. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js +0 -21
  76. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js.map +0 -1
  77. package/build/src/modeling/templates/verticals/index.d.ts +0 -79
  78. package/build/src/modeling/templates/verticals/index.d.ts.map +0 -1
  79. package/build/src/modeling/templates/verticals/index.js +0 -186
  80. package/build/src/modeling/templates/verticals/index.js.map +0 -1
  81. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts +0 -18
  82. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts.map +0 -1
  83. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js +0 -22
  84. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js.map +0 -1
  85. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts +0 -45
  86. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts.map +0 -1
  87. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js +0 -710
  88. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js.map +0 -1
  89. package/build/src/modeling/templates/verticals/public-sector/index.d.ts +0 -18
  90. package/build/src/modeling/templates/verticals/public-sector/index.d.ts.map +0 -1
  91. package/build/src/modeling/templates/verticals/public-sector/index.js +0 -22
  92. package/build/src/modeling/templates/verticals/public-sector/index.js.map +0 -1
  93. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts +0 -47
  94. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts.map +0 -1
  95. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js +0 -864
  96. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js.map +0 -1
  97. package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts +0 -18
  98. package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts.map +0 -1
  99. package/build/src/modeling/templates/verticals/real-estate-construction/index.js +0 -21
  100. package/build/src/modeling/templates/verticals/real-estate-construction/index.js.map +0 -1
  101. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts +0 -40
  102. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts.map +0 -1
  103. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js +0 -727
  104. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js.map +0 -1
  105. package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts +0 -40
  106. package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts.map +0 -1
  107. package/build/src/modeling/templates/verticals/technology-media/blog-domain.js +0 -629
  108. package/build/src/modeling/templates/verticals/technology-media/blog-domain.js.map +0 -1
  109. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts +0 -46
  110. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts.map +0 -1
  111. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js +0 -1033
  112. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js.map +0 -1
  113. package/build/src/modeling/templates/verticals/technology-media/index.d.ts +0 -21
  114. package/build/src/modeling/templates/verticals/technology-media/index.d.ts.map +0 -1
  115. package/build/src/modeling/templates/verticals/technology-media/index.js +0 -42
  116. package/build/src/modeling/templates/verticals/technology-media/index.js.map +0 -1
  117. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts +0 -47
  118. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts.map +0 -1
  119. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js +0 -1029
  120. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js.map +0 -1
  121. package/src/modeling/templates/meta/blog-publishing-platform.json +0 -1
  122. package/src/modeling/templates/meta/ecommerce-platform.json +0 -1
  123. package/src/modeling/templates/meta/education-management-platform.json +0 -1
  124. package/src/modeling/templates/meta/financial-services-platform.json +0 -1
  125. package/src/modeling/templates/meta/gaming-platform.json +0 -1
  126. package/src/modeling/templates/meta/healthcare-management-platform.json +0 -1
  127. package/src/modeling/templates/meta/hospitality-platform.json +0 -1
  128. package/src/modeling/templates/meta/iot-smart-home-platform.json +0 -1
  129. package/src/modeling/templates/meta/legal-services-platform.json +0 -1
  130. package/src/modeling/templates/meta/manufacturing-platform.json +0 -1
  131. package/src/modeling/templates/meta/non-profit-platform.json +0 -1
  132. package/src/modeling/templates/meta/real-estate-management-platform.json +0 -1
  133. package/src/modeling/templates/readme.md +0 -260
  134. package/src/modeling/templates/template-registry.ts +0 -140
  135. package/src/modeling/templates/types.ts +0 -175
  136. package/src/modeling/templates/verticals/README.md +0 -122
  137. package/src/modeling/templates/verticals/business-services/ecommerce-domain.ts +0 -844
  138. package/src/modeling/templates/verticals/business-services/financial-services-domain.ts +0 -1177
  139. package/src/modeling/templates/verticals/business-services/hospitality-domain.ts +0 -994
  140. package/src/modeling/templates/verticals/business-services/legal-services-domain.ts +0 -1059
  141. package/src/modeling/templates/verticals/education-training/education-domain.ts +0 -922
  142. package/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.ts +0 -1111
  143. package/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.ts +0 -895
  144. package/src/modeling/templates/verticals/public-sector/non-profit-domain.ts +0 -1109
  145. package/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.ts +0 -944
  146. package/src/modeling/templates/verticals/technology-media/blog-domain.ts +0 -796
  147. package/src/modeling/templates/verticals/technology-media/gaming-domain.ts +0 -1290
  148. package/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.ts +0 -1289
@@ -42062,13 +42062,13 @@
42062
42062
  "@id": "#209"
42063
42063
  },
42064
42064
  {
42065
- "@id": "#191"
42065
+ "@id": "#194"
42066
42066
  },
42067
42067
  {
42068
- "@id": "#197"
42068
+ "@id": "#191"
42069
42069
  },
42070
42070
  {
42071
- "@id": "#194"
42071
+ "@id": "#197"
42072
42072
  },
42073
42073
  {
42074
42074
  "@id": "#200"
@@ -42816,10 +42816,10 @@
42816
42816
  "@id": "#213"
42817
42817
  },
42818
42818
  {
42819
- "@id": "#219"
42819
+ "@id": "#216"
42820
42820
  },
42821
42821
  {
42822
- "@id": "#216"
42822
+ "@id": "#219"
42823
42823
  }
42824
42824
  ],
42825
42825
  "doc:root": false,
@@ -43436,7 +43436,7 @@
43436
43436
  "doc:ExternalDomainElement",
43437
43437
  "doc:DomainElement"
43438
43438
  ],
43439
- "doc:raw": "countryCode: \"BE\"\ngraydonEnterpriseId: 1057155523\nregistrationId: \"0422319093\"\nvatNumber: \"BE0422319093\"\ngraydonCompanyId: \"0422319093\"\nisBranchOffice: false\n",
43439
+ "doc:raw": "addressType: 'REGISTERED-OFFICE-ADDRESS'\nstreetName: 'UITBREIDINGSTRAAT'\nhouseNumber: '84'\nhouseNumberAddition: '/1'\npostalCode: '2600'\ncity: 'BERCHEM (ANTWERPEN)'\ncountry: 'Belgium'\ncountryCode: 'BE'\nfullFormatedAddress: \"UITBREIDINGSTRAAT 84 /1, 2600 BERCHEM (ANTWERPEN), BELIUM\"\n",
43440
43440
  "core:mediaType": "application/yaml",
43441
43441
  "sourcemaps:sources": [
43442
43442
  {
@@ -43457,7 +43457,7 @@
43457
43457
  "doc:ExternalDomainElement",
43458
43458
  "doc:DomainElement"
43459
43459
  ],
43460
- "doc:raw": "code: '5'\ndescription: 'Limited company'\n",
43460
+ "doc:raw": "countryCode: \"BE\"\ngraydonEnterpriseId: 1057155523\nregistrationId: \"0422319093\"\nvatNumber: \"BE0422319093\"\ngraydonCompanyId: \"0422319093\"\nisBranchOffice: false\n",
43461
43461
  "core:mediaType": "application/yaml",
43462
43462
  "sourcemaps:sources": [
43463
43463
  {
@@ -43478,7 +43478,7 @@
43478
43478
  "doc:ExternalDomainElement",
43479
43479
  "doc:DomainElement"
43480
43480
  ],
43481
- "doc:raw": "addressType: 'REGISTERED-OFFICE-ADDRESS'\nstreetName: 'UITBREIDINGSTRAAT'\nhouseNumber: '84'\nhouseNumberAddition: '/1'\npostalCode: '2600'\ncity: 'BERCHEM (ANTWERPEN)'\ncountry: 'Belgium'\ncountryCode: 'BE'\nfullFormatedAddress: \"UITBREIDINGSTRAAT 84 /1, 2600 BERCHEM (ANTWERPEN), BELIUM\"\n",
43481
+ "doc:raw": "code: '5'\ndescription: 'Limited company'\n",
43482
43482
  "core:mediaType": "application/yaml",
43483
43483
  "sourcemaps:sources": [
43484
43484
  {
@@ -44274,7 +44274,7 @@
44274
44274
  "doc:ExternalDomainElement",
44275
44275
  "doc:DomainElement"
44276
44276
  ],
44277
- "doc:raw": "type: \"GENERAL\"\nvalue: \"www.company.be\"\n",
44277
+ "doc:raw": "-\n type: 'GENERAL'\n value: 'info@company.be'\n-\n type: 'IT_DEPT'\n value: 'it-service@company.be'\n",
44278
44278
  "core:mediaType": "application/yaml",
44279
44279
  "sourcemaps:sources": [
44280
44280
  {
@@ -44295,7 +44295,7 @@
44295
44295
  "doc:ExternalDomainElement",
44296
44296
  "doc:DomainElement"
44297
44297
  ],
44298
- "doc:raw": "-\n type: 'GENERAL'\n value: 'info@company.be'\n-\n type: 'IT_DEPT'\n value: 'it-service@company.be'\n",
44298
+ "doc:raw": "type: \"GENERAL\"\nvalue: \"www.company.be\"\n",
44299
44299
  "core:mediaType": "application/yaml",
44300
44300
  "sourcemaps:sources": [
44301
44301
  {
@@ -44756,17 +44756,17 @@
44756
44756
  {
44757
44757
  "@id": "#193/source-map/lexical/element_0",
44758
44758
  "sourcemaps:element": "amf://id#193",
44759
- "sourcemaps:value": "[(1,0)-(7,0)]"
44759
+ "sourcemaps:value": "[(1,0)-(10,0)]"
44760
44760
  },
44761
44761
  {
44762
44762
  "@id": "#196/source-map/lexical/element_0",
44763
44763
  "sourcemaps:element": "amf://id#196",
44764
- "sourcemaps:value": "[(1,0)-(3,0)]"
44764
+ "sourcemaps:value": "[(1,0)-(7,0)]"
44765
44765
  },
44766
44766
  {
44767
44767
  "@id": "#199/source-map/lexical/element_0",
44768
44768
  "sourcemaps:element": "amf://id#199",
44769
- "sourcemaps:value": "[(1,0)-(10,0)]"
44769
+ "sourcemaps:value": "[(1,0)-(3,0)]"
44770
44770
  },
44771
44771
  {
44772
44772
  "@id": "#202/source-map/lexical/element_0",
@@ -45126,12 +45126,12 @@
45126
45126
  {
45127
45127
  "@id": "#218/source-map/lexical/element_0",
45128
45128
  "sourcemaps:element": "amf://id#218",
45129
- "sourcemaps:value": "[(1,0)-(3,0)]"
45129
+ "sourcemaps:value": "[(1,0)-(7,0)]"
45130
45130
  },
45131
45131
  {
45132
45132
  "@id": "#221/source-map/lexical/element_0",
45133
45133
  "sourcemaps:element": "amf://id#221",
45134
- "sourcemaps:value": "[(1,0)-(7,0)]"
45134
+ "sourcemaps:value": "[(1,0)-(3,0)]"
45135
45135
  },
45136
45136
  {
45137
45137
  "@id": "#338/source-map/synthesized-field/element_1",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@api-client/core",
3
3
  "description": "The API Client's core client library. Works in NodeJS and in a ES enabled browser.",
4
- "version": "0.18.55",
4
+ "version": "0.18.57",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
7
7
  "./browser.js": {
@@ -288,14 +288,9 @@
288
288
  "command": "prettier \"**/*.ts\" --write"
289
289
  }
290
290
  },
291
- "husky": {
292
- "hooks": {
293
- "pre-commit": "lint-staged"
294
- }
295
- },
296
291
  "lint-staged": {
297
292
  "*.ts": [
298
- "eslint --fix"
293
+ "npm run format"
299
294
  ]
300
295
  },
301
296
  "engines": {
@@ -886,7 +886,7 @@ export const DataSemantics: Record<SemanticType, DataSemantic> = {
886
886
  description: 'Postal or zip code',
887
887
  category: SemanticCategory.Contact,
888
888
  applicableDataTypes: ['string'],
889
- hasConfig: false,
889
+ hasConfig: true,
890
890
  runtime: {
891
891
  timing: SemanticTiming.None,
892
892
  operations: [],
@@ -87,6 +87,8 @@ export function addAutoField(entity: DomainEntity, autoField: string): DomainEle
87
87
  return addUnitPriceField(entity)
88
88
  case 'street-address':
89
89
  return addStreetAddressField(entity)
90
+ case 'street-address-supplemental':
91
+ return addStreetAddressSupplementalField(entity)
90
92
  case 'city':
91
93
  return addCityField(entity)
92
94
  case 'postal-code':
@@ -1391,6 +1393,27 @@ function findStreetAddressField(entity: DomainEntity, direct = false): DomainPro
1391
1393
  return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.StreetAddress), direct)
1392
1394
  }
1393
1395
 
1396
+ export function addStreetAddressSupplementalField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {
1397
+ // we do not look for duplicates here, because the address can have multiple supplements (like line2, line3, etc.)
1398
+ let latest = 0
1399
+ for (const prop of entity.properties) {
1400
+ if (prop.hasSemantic(SemanticType.StreetAddressSupplemental)) {
1401
+ const match = prop.info.name?.match(/street_address_(\d+)/)
1402
+ if (match) {
1403
+ const num = parseInt(match[1], 10)
1404
+ if (num > latest) latest = num
1405
+ }
1406
+ }
1407
+ }
1408
+ const prop = entity.addProperty({
1409
+ info: { name: `street_address_${latest + 1}`, displayName: `Street Address ${latest + 1}`, ...info },
1410
+ type: 'string',
1411
+ required: false,
1412
+ })
1413
+ prop.addSemantic({ id: SemanticType.StreetAddressSupplemental })
1414
+ return prop
1415
+ }
1416
+
1394
1417
  export function addCityField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {
1395
1418
  const existing = findCityField(entity, true)
1396
1419
  if (existing) return existing
@@ -39,6 +39,7 @@ import {
39
39
  addStreetAddressField,
40
40
  addCityField,
41
41
  addRegionField,
42
+ addStreetAddressSupplementalField,
42
43
  } from '../../../../src/modeling/helpers/Intelisense.js'
43
44
  import { SemanticType } from '../../../../src/modeling/Semantics.js'
44
45
  import { createCountrySemantic } from '../../../../src/modeling/definitions/Country.js'
@@ -1237,3 +1238,48 @@ test.group('addRegionField()', () => {
1237
1238
  assert.equal(field.info.description, 'Region XXX')
1238
1239
  })
1239
1240
  })
1241
+
1242
+ test.group('addStreetAddressSupplementalField()', () => {
1243
+ test('creates first supplemental field when none exists', ({ assert }) => {
1244
+ const entity = createTestEntity()
1245
+ const field = addStreetAddressSupplementalField(entity)
1246
+ assert.instanceOf(field, DomainProperty)
1247
+ assert.equal(field.info.name, 'street_address_1')
1248
+ assert.equal(field.info.displayName, 'Street Address 1')
1249
+ assert.equal(field.type, 'string')
1250
+ assert.isFalse(field.required)
1251
+ assert.isTrue(field.hasSemantic(SemanticType.StreetAddressSupplemental))
1252
+ })
1253
+
1254
+ test('increments supplemental field index', ({ assert }) => {
1255
+ const entity = createTestEntity()
1256
+ const field1 = addStreetAddressSupplementalField(entity)
1257
+ const field2 = addStreetAddressSupplementalField(entity)
1258
+
1259
+ assert.equal(field1.info.name, 'street_address_1')
1260
+ assert.equal(field2.info.name, 'street_address_2')
1261
+ assert.equal(field2.info.displayName, 'Street Address 2')
1262
+ })
1263
+
1264
+ test('handles gaps in numbering', ({ assert }) => {
1265
+ const entity = createTestEntity()
1266
+ // Manually add a field mimicking a higher number
1267
+ const manualField = entity.addProperty({
1268
+ info: { name: 'street_address_5', displayName: 'Street Address 5' },
1269
+ type: 'string',
1270
+ required: false,
1271
+ })
1272
+ manualField.addSemantic({ id: SemanticType.StreetAddressSupplemental })
1273
+
1274
+ const field = addStreetAddressSupplementalField(entity)
1275
+ assert.equal(field.info.name, 'street_address_6')
1276
+ assert.equal(field.info.displayName, 'Street Address 6')
1277
+ })
1278
+
1279
+ test('merges custom info', ({ assert }) => {
1280
+ const entity = createTestEntity()
1281
+ const field = addStreetAddressSupplementalField(entity, { description: 'Extra line' })
1282
+ assert.equal(field.info.name, 'street_address_1')
1283
+ assert.equal(field.info.description, 'Extra line')
1284
+ })
1285
+ })
@@ -1,21 +0,0 @@
1
- import type { DataDomain } from '../DataDomain.js';
2
- import type { DomainTemplate, DomainTemplateStructure } from './types.js';
3
- export * from './verticals/index.js';
4
- /**
5
- * Creates template metadata from a DataDomain instance for UI presentation
6
- */
7
- export declare function createTemplateMetadata(domain: DataDomain, templateInfo: {
8
- id: string;
9
- name: string;
10
- description: string;
11
- version: string;
12
- author: string;
13
- tags?: string[];
14
- createdAt: string;
15
- updatedAt: string;
16
- }): DomainTemplate;
17
- /**
18
- * Analyzes a DataDomain to extract structural information for UI presentation
19
- */
20
- export declare function analyzeDomainStructure(domain: DataDomain): DomainTemplateStructure;
21
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modeling/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAMlD,OAAO,KAAK,EAEV,cAAc,EACd,uBAAuB,EAKxB,MAAM,YAAY,CAAA;AAGnB,cAAc,sBAAsB,CAAA;AAEpC;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,GACA,cAAc,CAchB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,UAAU,GAAG,uBAAuB,CAgClF"}
@@ -1,176 +0,0 @@
1
- // Import vertical organization
2
- export * from './verticals/index.js';
3
- /**
4
- * Creates template metadata from a DataDomain instance for UI presentation
5
- */
6
- export function createTemplateMetadata(domain, templateInfo) {
7
- const structure = analyzeDomainStructure(domain);
8
- return {
9
- id: templateInfo.id,
10
- name: templateInfo.name,
11
- description: templateInfo.description,
12
- createdAt: templateInfo.createdAt,
13
- updatedAt: templateInfo.updatedAt,
14
- version: templateInfo.version,
15
- author: templateInfo.author,
16
- tags: templateInfo.tags || [],
17
- structure,
18
- };
19
- }
20
- /**
21
- * Analyzes a DataDomain to extract structural information for UI presentation
22
- */
23
- export function analyzeDomainStructure(domain) {
24
- const namespaces = [];
25
- let totalEntities = 0;
26
- let totalProperties = 0;
27
- let totalAssociations = 0;
28
- // Analyze each namespace
29
- for (const namespace of domain.listNamespaces()) {
30
- const namespaceInfo = analyzeNamespace(namespace);
31
- namespaces.push(namespaceInfo);
32
- totalEntities += namespaceInfo.entityCount;
33
- totalProperties += namespaceInfo.models.reduce((sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.propertyCount, 0), 0);
34
- totalAssociations += namespaceInfo.models.reduce((sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.associationCount, 0), 0);
35
- }
36
- return {
37
- domain: {
38
- name: domain.info.name || 'Unnamed Domain',
39
- description: domain.info.description,
40
- totalEntities,
41
- totalProperties,
42
- totalAssociations,
43
- },
44
- namespaces,
45
- };
46
- }
47
- /**
48
- * Analyzes a DomainNamespace to extract information for UI presentation
49
- */
50
- function analyzeNamespace(namespace) {
51
- const models = [];
52
- let entityCount = 0;
53
- // Analyze each model in the namespace
54
- for (const model of namespace.listModels()) {
55
- const modelInfo = analyzeModel(model);
56
- models.push(modelInfo);
57
- entityCount += modelInfo.entityCount;
58
- }
59
- return {
60
- name: namespace.info.name || 'Unnamed Namespace',
61
- displayName: namespace.info.displayName,
62
- description: namespace.info.description,
63
- modelCount: models.length,
64
- entityCount,
65
- models,
66
- };
67
- }
68
- /**
69
- * Analyzes a DomainModel to extract information for UI presentation
70
- */
71
- function analyzeModel(model) {
72
- const entities = [];
73
- // Analyze each entity in the model
74
- for (const entity of model.listEntities()) {
75
- const entityInfo = analyzeEntity(entity);
76
- entities.push(entityInfo);
77
- }
78
- return {
79
- name: model.info.name || 'Unnamed Model',
80
- displayName: model.info.displayName,
81
- description: model.info.description,
82
- entityCount: entities.length,
83
- entities,
84
- };
85
- }
86
- /**
87
- * Analyzes a DomainEntity to extract information for UI presentation
88
- */
89
- function analyzeEntity(entity) {
90
- const properties = [];
91
- const associations = [];
92
- // Analyze properties
93
- for (const property of entity.listProperties()) {
94
- properties.push(analyzeProperty(property));
95
- }
96
- // Analyze associations
97
- for (const association of entity.listAssociations()) {
98
- associations.push(analyzeAssociation(association));
99
- }
100
- return {
101
- name: entity.info.name || 'Unnamed Entity',
102
- displayName: entity.info.displayName,
103
- description: entity.info.description,
104
- propertyCount: properties.length,
105
- associationCount: associations.length,
106
- deprecated: entity.deprecated,
107
- properties,
108
- associations,
109
- semantics: entity.semantics?.map((s) => s.id) || [],
110
- };
111
- }
112
- /**
113
- * Analyzes a DomainProperty to extract information for UI presentation
114
- */
115
- function analyzeProperty(property) {
116
- const semantics = property.semantics?.map((s) => s.id) || [];
117
- // Extract enum values if present
118
- let enumValues;
119
- if (property.schema?.enum && Array.isArray(property.schema.enum)) {
120
- enumValues = property.schema.enum.map((v) => String(v));
121
- }
122
- // Extract default value
123
- let defaultValue;
124
- if (property.schema?.defaultValue) {
125
- if (property.schema.defaultValue.type === 'literal') {
126
- defaultValue = String(property.schema.defaultValue.value);
127
- }
128
- }
129
- return {
130
- name: property.info.name || 'Unnamed Property',
131
- displayName: property.info.displayName,
132
- description: property.info.description,
133
- type: property.type || 'string',
134
- required: property.required,
135
- multiple: property.multiple,
136
- primary: property.primary,
137
- unique: property.unique,
138
- readOnly: property.readOnly,
139
- writeOnly: property.writeOnly,
140
- deprecated: property.deprecated,
141
- semantics,
142
- enumValues,
143
- defaultValue,
144
- };
145
- }
146
- /**
147
- * Analyzes a DomainAssociation to extract information for UI presentation
148
- */
149
- function analyzeAssociation(association) {
150
- const semantics = association.semantics?.map((s) => s.id) || [];
151
- // Get target entity names
152
- const targetEntities = association.targets?.map((target) => {
153
- // Try to resolve the target entity to get its name
154
- const targetEntity = association.domain.findEntity(target.key);
155
- return targetEntity?.info.name || target.key;
156
- }) || [];
157
- // Determine cardinality description
158
- let cardinality = 'One-to-One';
159
- if (association.multiple) {
160
- cardinality = 'One-to-Many';
161
- }
162
- // Note: Many-to-Many would typically be determined by looking at the reverse association
163
- // but for simplicity in UI presentation, we'll use the current association's multiplicity
164
- return {
165
- name: association.info.name || 'Unnamed Association',
166
- displayName: association.info.displayName,
167
- description: association.info.description,
168
- required: association.required,
169
- multiple: association.multiple,
170
- readOnly: association.readOnly,
171
- targetEntities,
172
- semantics,
173
- cardinality,
174
- };
175
- }
176
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modeling/templates/index.ts"],"names":[],"mappings":"AAgBA,+BAA+B;AAC/B,cAAc,sBAAsB,CAAA;AAEpC;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAkB,EAClB,YASC;IAED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GAEG;AACH,SAAS,kBAAkB,CAAC,WAA8B;IACxD,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;IAE/D,0BAA0B;IAC1B,MAAM,cAAc,GAClB,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAClC,mDAAmD;QACnD,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC9D,OAAO,YAAY,EAAE,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,GAAG,CAAA;IAC9C,CAAC,CAAC,IAAI,EAAE,CAAA;IAEV,oCAAoC;IACpC,IAAI,WAAW,GAAG,YAAY,CAAA;IAC9B,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QACzB,WAAW,GAAG,aAAa,CAAA;IAC7B,CAAC;IACD,yFAAyF;IACzF,0FAA0F;IAE1F,OAAO;QACL,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,qBAAqB;QACpD,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,WAAW;QACzC,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,WAAW;QACzC,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,cAAc;QACd,SAAS;QACT,WAAW;KACZ,CAAA;AACH,CAAC","sourcesContent":["import type { DataDomain } from '../DataDomain.js'\nimport type { DomainNamespace } from '../DomainNamespace.js'\nimport type { DomainModel } from '../DomainModel.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type {\n AssociationInfo,\n DomainTemplate,\n DomainTemplateStructure,\n EntityInfo,\n ModelInfo,\n NamespaceInfo,\n PropertyInfo,\n} from './types.js'\n\n// Import vertical organization\nexport * from './verticals/index.js'\n\n/**\n * Creates template metadata from a DataDomain instance for UI presentation\n */\nexport function createTemplateMetadata(\n domain: DataDomain,\n templateInfo: {\n id: string\n name: string\n description: string\n version: string\n author: string\n tags?: string[]\n createdAt: string\n updatedAt: string\n }\n): DomainTemplate {\n const structure = analyzeDomainStructure(domain)\n\n return {\n id: templateInfo.id,\n name: templateInfo.name,\n description: templateInfo.description,\n createdAt: templateInfo.createdAt,\n updatedAt: templateInfo.updatedAt,\n version: templateInfo.version,\n author: templateInfo.author,\n tags: templateInfo.tags || [],\n structure,\n }\n}\n\n/**\n * Analyzes a DataDomain to extract structural information for UI presentation\n */\nexport function analyzeDomainStructure(domain: DataDomain): DomainTemplateStructure {\n const namespaces: NamespaceInfo[] = []\n let totalEntities = 0\n let totalProperties = 0\n let totalAssociations = 0\n\n // Analyze each namespace\n for (const namespace of domain.listNamespaces()) {\n const namespaceInfo = analyzeNamespace(namespace)\n namespaces.push(namespaceInfo)\n\n totalEntities += namespaceInfo.entityCount\n totalProperties += namespaceInfo.models.reduce(\n (sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.propertyCount, 0),\n 0\n )\n totalAssociations += namespaceInfo.models.reduce(\n (sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.associationCount, 0),\n 0\n )\n }\n\n return {\n domain: {\n name: domain.info.name || 'Unnamed Domain',\n description: domain.info.description,\n totalEntities,\n totalProperties,\n totalAssociations,\n },\n namespaces,\n }\n}\n\n/**\n * Analyzes a DomainNamespace to extract information for UI presentation\n */\nfunction analyzeNamespace(namespace: DomainNamespace): NamespaceInfo {\n const models: ModelInfo[] = []\n let entityCount = 0\n\n // Analyze each model in the namespace\n for (const model of namespace.listModels()) {\n const modelInfo = analyzeModel(model)\n models.push(modelInfo)\n entityCount += modelInfo.entityCount\n }\n\n return {\n name: namespace.info.name || 'Unnamed Namespace',\n displayName: namespace.info.displayName,\n description: namespace.info.description,\n modelCount: models.length,\n entityCount,\n models,\n }\n}\n\n/**\n * Analyzes a DomainModel to extract information for UI presentation\n */\nfunction analyzeModel(model: DomainModel): ModelInfo {\n const entities: EntityInfo[] = []\n\n // Analyze each entity in the model\n for (const entity of model.listEntities()) {\n const entityInfo = analyzeEntity(entity)\n entities.push(entityInfo)\n }\n\n return {\n name: model.info.name || 'Unnamed Model',\n displayName: model.info.displayName,\n description: model.info.description,\n entityCount: entities.length,\n entities,\n }\n}\n\n/**\n * Analyzes a DomainEntity to extract information for UI presentation\n */\nfunction analyzeEntity(entity: DomainEntity): EntityInfo {\n const properties: PropertyInfo[] = []\n const associations: AssociationInfo[] = []\n\n // Analyze properties\n for (const property of entity.listProperties()) {\n properties.push(analyzeProperty(property))\n }\n\n // Analyze associations\n for (const association of entity.listAssociations()) {\n associations.push(analyzeAssociation(association))\n }\n\n return {\n name: entity.info.name || 'Unnamed Entity',\n displayName: entity.info.displayName,\n description: entity.info.description,\n propertyCount: properties.length,\n associationCount: associations.length,\n deprecated: entity.deprecated,\n properties,\n associations,\n semantics: entity.semantics?.map((s) => s.id) || [],\n }\n}\n\n/**\n * Analyzes a DomainProperty to extract information for UI presentation\n */\nfunction analyzeProperty(property: DomainProperty): PropertyInfo {\n const semantics = property.semantics?.map((s) => s.id) || []\n\n // Extract enum values if present\n let enumValues: string[] | undefined\n if (property.schema?.enum && Array.isArray(property.schema.enum)) {\n enumValues = property.schema.enum.map((v) => String(v))\n }\n\n // Extract default value\n let defaultValue: string | undefined\n if (property.schema?.defaultValue) {\n if (property.schema.defaultValue.type === 'literal') {\n defaultValue = String(property.schema.defaultValue.value)\n }\n }\n\n return {\n name: property.info.name || 'Unnamed Property',\n displayName: property.info.displayName,\n description: property.info.description,\n type: property.type || 'string',\n required: property.required,\n multiple: property.multiple,\n primary: property.primary,\n unique: property.unique,\n readOnly: property.readOnly,\n writeOnly: property.writeOnly,\n deprecated: property.deprecated,\n semantics,\n enumValues,\n defaultValue,\n }\n}\n\n/**\n * Analyzes a DomainAssociation to extract information for UI presentation\n */\nfunction analyzeAssociation(association: DomainAssociation): AssociationInfo {\n const semantics = association.semantics?.map((s) => s.id) || []\n\n // Get target entity names\n const targetEntities =\n association.targets?.map((target) => {\n // Try to resolve the target entity to get its name\n const targetEntity = association.domain.findEntity(target.key)\n return targetEntity?.info.name || target.key\n }) || []\n\n // Determine cardinality description\n let cardinality = 'One-to-One'\n if (association.multiple) {\n cardinality = 'One-to-Many'\n }\n // Note: Many-to-Many would typically be determined by looking at the reverse association\n // but for simplicity in UI presentation, we'll use the current association's multiplicity\n\n return {\n name: association.info.name || 'Unnamed Association',\n displayName: association.info.displayName,\n description: association.info.description,\n required: association.required,\n multiple: association.multiple,\n readOnly: association.readOnly,\n targetEntities,\n semantics,\n cardinality,\n }\n}\n"]}
@@ -1 +0,0 @@
1
- { "id": "blog-publishing-platform", "name": "Blog Publishing Platform", "description": "A comprehensive content management and publishing platform for blogs, magazines, and digital publications. Includes content management, user roles, publishing workflow, and social features.", "createdAt": "2025-07-27T21:14:57.328Z", "updatedAt": "2025-07-27T21:14:57.328Z", "version": "1.0.0", "author": "API Now! Core Team", "tags": ["blog", "cms", "publishing", "content", "media", "editorial"], "structure": { "domain": { "name": "Blog Publishing Platform", "description": "A comprehensive content management and publishing platform for blogs, magazines, and digital publications", "totalEntities": 8, "totalProperties": 70, "totalAssociations": 14 }, "namespaces": [{ "name": "ContentManagement", "displayName": "Content Management", "description": "Core content creation, editing, and organization features", "modelCount": 2, "entityCount": 4, "models": [{ "name": "Publications", "displayName": "Publications Management", "description": "Individual blogs, magazines, or publications within the platform", "entityCount": 1, "entities": [{ "name": "publication", "displayName": "Publication", "description": "Individual blog or publication site", "propertyCount": 8, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Publication ID", "description": "Unique identifier for the publication", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Publication Name", "description": "Display name of the publication", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "slug", "displayName": "URL Slug", "description": "URL-friendly identifier for the publication", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }, { "name": "description", "displayName": "Description", "description": "Publication description and tagline", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "domain", "displayName": "Custom Domain", "description": "Custom domain name for the publication", "type": "string", "semantics": [] }, { "name": "logo_url", "displayName": "Logo URL", "description": "URL to publication logo image", "type": "string", "semantics": ["Semantic#ImageURL"] }, { "name": "status", "displayName": "Publication Status", "description": "Current status of the publication", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["active", "suspended", "archived"], "defaultValue": "active" }, { "name": "created_at", "displayName": "Created At", "description": "When the publication was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [], "semantics": [] }] }, { "name": "Content", "displayName": "Content Management", "description": "Posts, pages, and other content types", "entityCount": 3, "entities": [{ "name": "category", "displayName": "Content Category", "description": "Content categorization for organization and navigation", "propertyCount": 5, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Category ID", "description": "Unique identifier for the category", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Category Name", "description": "Display name of the category", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "slug", "displayName": "URL Slug", "description": "URL-friendly identifier for the category", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }, { "name": "description", "displayName": "Description", "description": "Category description", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "color", "displayName": "Color", "description": "Theme color for the category", "type": "string", "semantics": [] }], "associations": [{ "name": "publication", "displayName": "Publication", "description": "Publication this category belongs to", "required": true, "multiple": false, "targetEntities": ["publication"], "semantics": [], "cardinality": "One-to-One" }, { "name": "parentCategory", "displayName": "Parent Category", "description": "Parent category for hierarchical organization", "required": false, "multiple": false, "targetEntities": ["category"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }, { "name": "Tag", "displayName": "Content Tag", "description": "Tags for flexible content labeling and discovery", "propertyCount": 3, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Tag ID", "description": "Unique identifier for the tag", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Tag Name", "description": "Display name of the tag", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "slug", "displayName": "URL Slug", "description": "URL-friendly identifier for the tag", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }], "associations": [{ "name": "publication", "displayName": "Publication", "description": "Publication this tag belongs to", "required": true, "multiple": false, "targetEntities": ["publication"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }, { "name": "Post", "displayName": "Blog Post", "description": "Individual blog posts and articles", "propertyCount": 16, "associationCount": 4, "properties": [{ "name": "id", "displayName": "Post ID", "description": "Unique identifier for the post", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "title", "displayName": "Post Title", "description": "Title of the blog post", "type": "string", "required": true, "semantics": ["Semantic#Title"] }, { "name": "slug", "displayName": "URL Slug", "description": "URL-friendly identifier for the post", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }, { "name": "excerpt", "displayName": "Excerpt", "description": "Brief summary or excerpt of the post", "type": "string", "semantics": ["Semantic#Summary"] }, { "name": "content", "displayName": "Content", "description": "Full content of the post in HTML or Markdown", "type": "string", "required": true, "semantics": ["Semantic#HTML"] }, { "name": "content_format", "displayName": "Content Format", "description": "Format of the content (HTML, Markdown, etc.)", "type": "string", "required": true, "semantics": [], "enumValues": ["html", "markdown", "richtext"], "defaultValue": "markdown" }, { "name": "featured_image_url", "displayName": "Featured Image URL", "description": "URL to featured image", "type": "string", "semantics": ["Semantic#ImageURL"] }, { "name": "status", "displayName": "Post Status", "description": "Current publishing status of the post", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["draft", "pending_review", "scheduled", "published", "archived"], "defaultValue": "draft" }, { "name": "published_at", "displayName": "Published At", "description": "When the post was published", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "scheduled_at", "displayName": "Scheduled At", "description": "When the post is scheduled to be published", "type": "datetime", "semantics": [] }, { "name": "view_count", "displayName": "View Count", "description": "Number of times the post has been viewed", "type": "number", "required": true, "semantics": [] }, { "name": "reading_time", "displayName": "Reading Time", "description": "Estimated reading time in minutes", "type": "number", "readOnly": true, "semantics": ["Semantic#Calculated"] }, { "name": "word_count", "displayName": "Word Count", "description": "Number of words in the post content", "type": "number", "readOnly": true, "semantics": ["Semantic#Calculated"] }, { "name": "meta_title", "displayName": "Meta Title", "description": "SEO meta title", "type": "string", "semantics": [] }, { "name": "meta_description", "displayName": "Meta Description", "description": "SEO meta description", "type": "string", "semantics": [] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the post was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [{ "name": "publication", "displayName": "Publication", "description": "Publication this post belongs to", "required": true, "multiple": false, "targetEntities": ["publication"], "semantics": [], "cardinality": "One-to-One" }, { "name": "categories", "displayName": "Post Categories", "description": "Categories this post belongs to", "required": false, "multiple": true, "targetEntities": ["category"], "semantics": ["Semantic#Categories"], "cardinality": "One-to-Many" }, { "name": "tags", "displayName": "Post Tags", "description": "Tags associated with this post", "required": false, "multiple": true, "targetEntities": ["Tag"], "semantics": ["Semantic#Tags"], "cardinality": "One-to-Many" }, { "name": "author", "displayName": "Post Author", "description": "Author who wrote this post", "required": true, "multiple": false, "targetEntities": ["user"], "semantics": ["Semantic#ResourceOwnerIdentifier"], "cardinality": "One-to-One" }], "semantics": [] }] }] }, { "name": "UserManagement", "displayName": "User Management", "description": "Authors, editors, subscribers, and user roles management", "modelCount": 1, "entityCount": 1, "models": [{ "name": "Users", "displayName": "User Management", "description": "User accounts and authentication", "entityCount": 1, "entities": [{ "name": "user", "displayName": "User Account", "description": "User account for authors, editors, and subscribers", "propertyCount": 14, "associationCount": 0, "properties": [{ "name": "id", "displayName": "User ID", "description": "Unique identifier for the user", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "email", "displayName": "Email Address", "description": "User email address for login and communication", "type": "string", "required": true, "semantics": ["Semantic#Email"] }, { "name": "password", "displayName": "Password", "description": "Encrypted password for authentication", "type": "string", "required": true, "semantics": ["Semantic#Password"] }, { "name": "username", "displayName": "Username", "description": "Unique username for the user", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }, { "name": "display_name", "displayName": "Display Name", "description": "Public display name for the user", "type": "string", "required": true, "semantics": [] }, { "name": "first_name", "displayName": "First Name", "description": "User first name", "type": "string", "semantics": [] }, { "name": "last_name", "displayName": "Last Name", "description": "User last name", "type": "string", "semantics": [] }, { "name": "bio", "displayName": "Biography", "description": "User biography and description", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "avatar_url", "displayName": "Avatar URL", "description": "URL to user profile picture", "type": "string", "semantics": ["Semantic#ImageURL"] }, { "name": "website", "displayName": "Website", "description": "User personal website URL", "type": "string", "semantics": ["Semantic#URL"] }, { "name": "role", "displayName": "User Role", "description": "User role for permission management", "type": "string", "required": true, "semantics": ["Semantic#UserRole"], "enumValues": ["subscriber", "author", "editor", "admin", "super_admin"], "defaultValue": "subscriber" }, { "name": "status", "displayName": "User Status", "description": "Current status of the user account", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["active", "inactive", "suspended", "pending_verification"], "defaultValue": "active" }, { "name": "emailVerified", "displayName": "Email Verified", "description": "Whether the user has verified their email", "type": "boolean", "required": true, "semantics": [], "defaultValue": "false" }, { "name": "created_at", "displayName": "Created At", "description": "When the user account was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [], "semantics": ["Semantic#User"] }] }] }, { "name": "SocialFeatures", "displayName": "Social Features", "description": "Comments, likes, shares, and social interactions", "modelCount": 1, "entityCount": 1, "models": [{ "name": "Comments", "displayName": "Comment System", "description": "Post comments and replies", "entityCount": 1, "entities": [{ "name": "comment", "displayName": "Comment", "description": "User comments on posts", "propertyCount": 7, "associationCount": 3, "properties": [{ "name": "id", "displayName": "Comment ID", "description": "Unique identifier for the comment", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "content", "displayName": "Comment Content", "description": "Content of the comment", "type": "string", "required": true, "semantics": [] }, { "name": "author_name", "displayName": "Author Name", "description": "Name of the comment author (for guest comments)", "type": "string", "semantics": [] }, { "name": "author_email", "displayName": "Author Email", "description": "Email of the comment author (for guest comments)", "type": "string", "required": true, "semantics": ["Semantic#Email"] }, { "name": "status", "displayName": "Comment Status", "description": "Moderation status of the comment", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["pending", "approved", "rejected", "spam"], "defaultValue": "pending" }, { "name": "user_agent", "displayName": "User Agent", "description": "Browser user agent string", "type": "string", "semantics": [] }, { "name": "created_at", "displayName": "Created At", "description": "When the comment was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "post", "displayName": "Post", "description": "Post this comment belongs to", "required": true, "multiple": false, "targetEntities": ["Post"], "semantics": [], "cardinality": "One-to-One" }, { "name": "author", "displayName": "Comment Author", "description": "Registered user who wrote this comment", "required": false, "multiple": false, "targetEntities": ["user"], "semantics": ["Semantic#ResourceOwnerIdentifier"], "cardinality": "One-to-One" }, { "name": "parent_comment", "displayName": "Parent Comment", "description": "Parent comment for replies", "required": false, "multiple": false, "targetEntities": ["comment"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }] }, { "name": "Analytics", "displayName": "Analytics & Tracking", "description": "Analytics, metrics, and performance tracking", "modelCount": 1, "entityCount": 1, "models": [{ "name": "Analytics", "displayName": "Content Analytics", "description": "Content performance and user engagement metrics", "entityCount": 1, "entities": [{ "name": "page_view", "displayName": "Page View", "description": "Individual page view tracking record", "propertyCount": 7, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Page View ID", "description": "Unique identifier for the page view", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "path", "displayName": "Page Path", "description": "URL path of the viewed page", "type": "string", "required": true, "semantics": [] }, { "name": "referrer", "displayName": "Referrer", "description": "Referring URL", "type": "string", "semantics": ["Semantic#URL"] }, { "name": "ip_address", "displayName": "IP Address", "description": "Visitor IP address", "type": "string", "semantics": ["Semantic#ClientIPAddress"] }, { "name": "user_agent", "displayName": "User Agent", "description": "Browser user agent string", "type": "string", "semantics": [] }, { "name": "session_id", "displayName": "Session ID", "description": "Visitor session identifier", "type": "string", "semantics": [] }, { "name": "viewed_at", "displayName": "Viewed At", "description": "When the page was viewed", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "post", "displayName": "Viewed Post", "description": "Post that was viewed (if applicable)", "required": false, "multiple": false, "targetEntities": ["Post"], "semantics": [], "cardinality": "One-to-One" }, { "name": "publication", "displayName": "Publication", "description": "Publication this page view belongs to", "required": true, "multiple": false, "targetEntities": ["publication"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }] }, { "name": "MediaManagement", "displayName": "Media Management", "description": "Image, video, and file upload management", "modelCount": 1, "entityCount": 1, "models": [{ "name": "Media", "displayName": "Media Library", "description": "Uploaded files, images, and media assets", "entityCount": 1, "entities": [{ "name": "media_file", "displayName": "Media File", "description": "Uploaded media files (images, videos, documents)", "propertyCount": 10, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Media File ID", "description": "Unique identifier for the media file", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "filename", "displayName": "File Name", "description": "Original filename of the uploaded file", "type": "string", "required": true, "semantics": [] }, { "name": "storage_key", "displayName": "Storage Key", "description": "Unique storage key for the file", "type": "string", "required": true, "unique": true, "semantics": [] }, { "name": "url", "displayName": "File URL", "description": "Public URL to access the file", "type": "string", "required": true, "semantics": ["Semantic#URL"] }, { "name": "mime_type", "displayName": "MIME Type", "description": "MIME type of the file", "type": "string", "required": true, "semantics": [] }, { "name": "file_size", "displayName": "File Size", "description": "File size in bytes", "type": "number", "required": true, "semantics": [] }, { "name": "width", "displayName": "Image Width", "description": "Width in pixels (for images)", "type": "number", "required": true, "semantics": [] }, { "name": "height", "displayName": "Image Height", "description": "Height in pixels (for images)", "type": "number", "required": true, "semantics": [] }, { "name": "alt_text", "displayName": "Alt Text", "description": "Alternative text for accessibility", "type": "string", "semantics": [] }, { "name": "uploaded_at", "displayName": "Uploaded At", "description": "When the file was uploaded", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "uploader", "displayName": "File Uploader", "description": "User who uploaded this file", "required": true, "multiple": false, "targetEntities": ["user"], "semantics": ["Semantic#ResourceOwnerIdentifier"], "cardinality": "One-to-One" }, { "name": "publication", "displayName": "Publication", "description": "Publication this media file belongs to", "required": true, "multiple": false, "targetEntities": ["publication"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }] }] } }
@@ -1 +0,0 @@
1
- { "id": "ecommerce-platform", "name": "E-Commerce Platform", "description": "A comprehensive e-commerce platform with user management, product catalog, inventory, and order processing capabilities. Perfect for online stores, marketplaces, and retail businesses.", "createdAt": "2025-07-27T21:14:57.328Z", "updatedAt": "2025-07-27T21:14:57.328Z", "version": "1.0.0", "author": "API Now! Core Team", "tags": ["e-commerce", "retail", "shopping", "business", "inventory", "orders"], "structure": { "domain": { "name": "E-Commerce Platform", "description": "A comprehensive e-commerce platform with user management, product catalog, and order processing capabilities", "totalEntities": 11, "totalProperties": 73, "totalAssociations": 14 }, "namespaces": [{ "name": "UserManagement", "displayName": "User Management", "description": "Handles user authentication, authorization, and profile management", "modelCount": 2, "entityCount": 3, "models": [{ "name": "Authentication", "displayName": "User Authentication", "description": "User accounts and authentication data", "entityCount": 1, "entities": [{ "name": "User", "displayName": "User Account", "description": "Represents a user account in the system", "propertyCount": 9, "associationCount": 2, "properties": [{ "name": "id", "displayName": "User ID", "description": "Unique identifier for the user", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "email", "displayName": "Email Address", "description": "User email address for login and communication", "type": "string", "required": true, "semantics": ["Semantic#Email"] }, { "name": "password", "displayName": "Password", "description": "User password for authentication", "type": "string", "required": true, "semantics": ["Semantic#Password"] }, { "name": "first_name", "displayName": "First Name", "description": "User first name", "type": "string", "required": true, "semantics": [] }, { "name": "last_name", "displayName": "Last Name", "description": "User last name", "type": "string", "required": true, "semantics": [] }, { "name": "role", "displayName": "User Role", "description": "User role for permission management", "type": "string", "required": true, "semantics": ["Semantic#UserRole"], "enumValues": ["customer", "admin", "moderator"], "defaultValue": "customer" }, { "name": "email_verified", "displayName": "Email Verified", "description": "Whether the user has verified their email address", "type": "boolean", "required": true, "semantics": [], "defaultValue": "false" }, { "name": "created_at", "displayName": "Created At", "description": "When the user account was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the user account was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [{ "name": "profile", "displayName": "User Profile", "description": "Link to extended profile information", "required": false, "multiple": false, "targetEntities": ["user_profile"], "semantics": [], "cardinality": "One-to-One" }, { "name": "addresses", "displayName": "User Addresses", "description": "User shipping and billing addresses", "required": false, "multiple": true, "targetEntities": ["address"], "semantics": [], "cardinality": "One-to-Many" }], "semantics": ["Semantic#User"] }] }, { "name": "UserProfile", "displayName": "User Profile", "description": "Extended user profile information", "entityCount": 2, "entities": [{ "name": "user_profile", "displayName": "User Profile", "description": "Extended profile information for users", "propertyCount": 4, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Profile ID", "description": "Unique identifier for the profile", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "birthdate", "displayName": "Date of Birth", "description": "User date of birth", "type": "date", "semantics": [] }, { "name": "phone", "displayName": "Phone Number", "description": "User phone number", "type": "string", "semantics": ["Semantic#Phone"] }, { "name": "avatar_url", "displayName": "Avatar URL", "description": "URL to user profile picture", "type": "string", "semantics": ["Semantic#ImageURL"] }], "associations": [], "semantics": [] }, { "name": "address", "displayName": "Address", "description": "Physical address information", "propertyCount": 9, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Address ID", "description": "Unique identifier for the address", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "type", "displayName": "Address Type", "description": "Type of address (shipping, billing, etc.)", "type": "string", "required": true, "semantics": [], "enumValues": ["shipping", "billing", "both"] }, { "name": "line1", "displayName": "Address Line 1", "description": "Primary street address, including house number and street name", "type": "string", "required": true, "semantics": [] }, { "name": "line2", "displayName": "Address Line 2", "description": "Optional field for additional street-level information like apartment numbers or building names.", "type": "string", "required": false, "semantics": [] }, { "name": "line3", "displayName": "Address Line 3", "description": "Optional field for additional street-level information like apartment numbers or building names.", "type": "string", "required": false, "semantics": [] }, { "name": "city", "displayName": "City", "description": "City name", "type": "string", "required": true, "semantics": [] }, { "name": "state", "displayName": "State/Province", "description": "State or province", "type": "string", "required": true, "semantics": [] }, { "name": "postal_code", "displayName": "ZIP/Postal Code", "description": "ZIP or postal code", "type": "string", "required": true, "semantics": [] }, { "name": "country", "displayName": "Country", "description": "Country name", "type": "string", "required": true, "semantics": [] }], "associations": [], "semantics": [] }] }] }, { "name": "ProductCatalog", "displayName": "Product Catalog", "description": "Product information, categories, and inventory management", "modelCount": 2, "entityCount": 3, "models": [{ "name": "Products", "displayName": "Product Management", "description": "Core product entities and relationships", "entityCount": 2, "entities": [{ "name": "category", "displayName": "Product Category", "description": "Product categorization for organization and navigation", "propertyCount": 4, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Category ID", "description": "Unique identifier for the category", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Category Name", "description": "Display name of the category", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "slug", "displayName": "URL Slug", "description": "URL-friendly identifier for the category", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }, { "name": "description", "displayName": "Description", "description": "Category description", "type": "string", "semantics": ["Semantic#Description"] }], "associations": [{ "name": "parent_category", "displayName": "Parent Category", "description": "Parent category for hierarchical organization", "required": false, "multiple": false, "targetEntities": ["category"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }, { "name": "product", "displayName": "Product", "description": "Core product information and specifications", "propertyCount": 13, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Product ID", "description": "Unique identifier for the product", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Product Name", "description": "Display name of the product", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "slug", "displayName": "URL Slug", "description": "URL-friendly identifier for the product", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#PublicUniqueName"] }, { "name": "description", "displayName": "Description", "description": "Detailed product description", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "short_description", "displayName": "Short Description", "description": "Brief product summary", "type": "string", "semantics": ["Semantic#Summary"] }, { "name": "sku", "displayName": "SKU", "description": "Stock Keeping Unit - unique product identifier", "type": "string", "required": true, "unique": true, "semantics": ["Semantic#SKU"] }, { "name": "price", "displayName": "Price", "description": "Product price in cents (USD)", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "compare_at_price", "displayName": "Compare at Price", "description": "Original price for discount display", "type": "number", "semantics": ["Semantic#Currency"] }, { "name": "status", "displayName": "Status", "description": "Current status of the product", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["inactive", "active", "pending", "archived"], "defaultValue": "inactive" }, { "name": "weight", "displayName": "Weight", "description": "Product weight in grams", "type": "number", "semantics": [] }, { "name": "images", "displayName": "Images", "description": "Array of product image URLs", "type": "string", "multiple": true, "semantics": ["Semantic#ImageURL"] }, { "name": "created_at", "displayName": "Created At", "description": "When the product was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the product was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [{ "name": "categories", "displayName": "Product Categories", "description": "Categories this product belongs to", "required": true, "multiple": true, "targetEntities": ["category"], "semantics": ["Semantic#Categories"], "cardinality": "One-to-Many" }, { "name": "inventory", "displayName": "Product Inventory", "description": "Inventory information for this product", "required": true, "multiple": false, "targetEntities": ["inventory"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }, { "name": "Inventory", "displayName": "Inventory Management", "description": "Stock levels and inventory tracking", "entityCount": 1, "entities": [{ "name": "inventory", "displayName": "Inventory", "description": "Stock levels and inventory information for products", "propertyCount": 4, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Inventory ID", "description": "Unique identifier for the inventory record", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "quantity", "displayName": "Stock Quantity", "description": "Available stock quantity", "type": "number", "required": true, "semantics": [], "defaultValue": "0" }, { "name": "trackQuantity", "displayName": "Track Quantity", "description": "Whether to track inventory for this product", "type": "boolean", "required": true, "semantics": [], "defaultValue": "true" }, { "name": "allowBackorder", "displayName": "Allow Backorder", "description": "Whether to allow ordering when out of stock", "type": "boolean", "required": true, "semantics": [], "defaultValue": "false" }], "associations": [], "semantics": [] }] }] }, { "name": "OrderManagement", "displayName": "Order Management", "description": "Shopping cart, orders, and payment processing", "modelCount": 3, "entityCount": 5, "models": [{ "name": "ShoppingCart", "displayName": "Shopping Cart", "description": "Shopping cart and cart items", "entityCount": 2, "entities": [{ "name": "cart", "displayName": "Shopping Cart", "description": "User shopping cart", "propertyCount": 5, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Cart ID", "description": "Unique identifier for the cart", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "sessionId", "displayName": "Session ID", "description": "Session identifier for guest carts", "type": "string", "semantics": [] }, { "name": "expiresAt", "displayName": "Expires At", "description": "When the cart expires for cleanup", "type": "datetime", "semantics": [] }, { "name": "created_at", "displayName": "Created At", "description": "When the cart was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the cart was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [{ "name": "user", "displayName": "Cart Owner", "description": "User who owns this cart", "required": false, "multiple": false, "targetEntities": ["User"], "semantics": ["Semantic#ResourceOwnerIdentifier"], "cardinality": "One-to-One" }, { "name": "items", "displayName": "Cart Items", "description": "Items in this cart", "required": false, "multiple": true, "targetEntities": ["cart_item"], "semantics": [], "cardinality": "One-to-Many" }], "semantics": [] }, { "name": "cart_item", "displayName": "Cart Item", "description": "Individual items in a shopping cart", "propertyCount": 4, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Cart Item ID", "description": "Unique identifier for the cart item", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "quantity", "displayName": "Quantity", "description": "Number of items", "type": "number", "required": true, "semantics": [] }, { "name": "unitPrice", "displayName": "Unit Price", "description": "Price per unit at time of adding to cart", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "total_price", "displayName": "Total Price", "description": "Total price for this line item", "type": "number", "required": true, "readOnly": true, "semantics": ["Semantic#Currency", "Semantic#Calculated"] }], "associations": [{ "name": "product", "displayName": "Product", "description": "Product for this cart item", "required": true, "multiple": false, "targetEntities": ["product"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }, { "name": "Orders", "displayName": "Order Processing", "description": "Orders and order fulfillment", "entityCount": 2, "entities": [{ "name": "order", "displayName": "Order", "description": "Customer order", "propertyCount": 10, "associationCount": 5, "properties": [{ "name": "id", "displayName": "Order ID", "description": "Unique identifier for the order", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "order_number", "displayName": "Order Number", "description": "Human-readable order number", "type": "string", "required": true, "unique": true, "semantics": [] }, { "name": "status", "displayName": "Order Status", "description": "Current status of the order", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["pending", "confirmed", "processing", "shipped", "delivered", "cancelled", "refunded"], "defaultValue": "pending" }, { "name": "subtotal", "displayName": "Subtotal", "description": "Order subtotal before taxes and shipping", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "taxAmount", "displayName": "Tax Amount", "description": "Total tax amount", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "shippingAmount", "displayName": "Shipping Amount", "description": "Shipping cost", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "total_amount", "displayName": "Total Amount", "description": "Final order total", "type": "number", "required": true, "semantics": ["Semantic#Currency", "Semantic#Calculated"] }, { "name": "notes", "displayName": "Order Notes", "description": "Customer notes or special instructions", "type": "string", "semantics": [] }, { "name": "created_at", "displayName": "Created At", "description": "When the order was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the order was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [{ "name": "customer", "displayName": "Customer", "description": "Customer who placed this order", "required": true, "multiple": false, "targetEntities": ["User"], "semantics": ["Semantic#ResourceOwnerIdentifier"], "cardinality": "One-to-One" }, { "name": "shipping_address", "displayName": "Shipping Address", "description": "Address for order delivery", "required": true, "multiple": false, "targetEntities": ["address"], "semantics": [], "cardinality": "One-to-One" }, { "name": "billing_address", "displayName": "Billing Address", "description": "Address for billing purposes", "required": true, "multiple": false, "targetEntities": ["address"], "semantics": [], "cardinality": "One-to-One" }, { "name": "items", "displayName": "Order Items", "description": "Items in this order", "required": true, "multiple": true, "targetEntities": ["order_item"], "semantics": [], "cardinality": "One-to-Many" }, { "name": "payments", "displayName": "Order Payments", "description": "Payment transactions for this order", "required": false, "multiple": true, "targetEntities": ["payment"], "semantics": [], "cardinality": "One-to-Many" }], "semantics": [] }, { "name": "order_item", "displayName": "Order Line Item", "description": "Individual line items in an order", "propertyCount": 4, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Order Item ID", "description": "Unique identifier for the order item", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "quantity", "displayName": "Quantity", "description": "Number of items ordered", "type": "number", "required": true, "semantics": [] }, { "name": "unitPrice", "displayName": "Unit Price", "description": "Price per unit at time of order", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "total_price", "displayName": "Total Price", "description": "Total price for this line item", "type": "number", "required": true, "readOnly": true, "semantics": ["Semantic#Currency", "Semantic#Calculated"] }], "associations": [{ "name": "product", "displayName": "Product", "description": "Product for this order item", "required": true, "multiple": false, "targetEntities": ["product"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }, { "name": "Payments", "displayName": "Payment Processing", "description": "Payment methods and transactions", "entityCount": 1, "entities": [{ "name": "payment", "displayName": "Payment", "description": "Payment transaction record", "propertyCount": 7, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Payment ID", "description": "Unique identifier for the payment", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "method", "displayName": "Payment Method", "description": "Method used for payment", "type": "string", "required": true, "semantics": [], "enumValues": ["credit_card", "debit_card", "paypal", "bank_transfer", "apple_pay", "google_pay"] }, { "name": "status", "displayName": "Payment Status", "description": "Current status of the payment", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["pending", "authorized", "captured", "failed", "cancelled", "refunded"], "defaultValue": "pending" }, { "name": "amount", "displayName": "Payment Amount", "description": "Amount charged", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "currency", "displayName": "Currency", "description": "Currency code for the payment", "type": "string", "required": true, "semantics": [], "defaultValue": "USD" }, { "name": "transaction_id", "displayName": "Transaction ID", "description": "External payment processor transaction ID", "type": "string", "semantics": [] }, { "name": "created_at", "displayName": "Created At", "description": "When the payment was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [], "semantics": [] }] }] }] } }