@api-client/core 0.18.19 → 0.18.20

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.
@@ -42074,10 +42074,10 @@
42074
42074
  "@id": "#200"
42075
42075
  },
42076
42076
  {
42077
- "@id": "#203"
42077
+ "@id": "#206"
42078
42078
  },
42079
42079
  {
42080
- "@id": "#206"
42080
+ "@id": "#203"
42081
42081
  },
42082
42082
  {
42083
42083
  "@id": "#209"
@@ -43520,7 +43520,7 @@
43520
43520
  "doc:ExternalDomainElement",
43521
43521
  "doc:DomainElement"
43522
43522
  ],
43523
- "doc:raw": "code: 'J'\ndescription: 'Information and communication'\n",
43523
+ "doc:raw": "code: '7487'\ndescription: 'Financial and insurance activities'\ntype: \"PRIMARY\"\nclassificationCode: 'BE_NACEBEL2008'\nactivityGroupCode: 'ABCDE'\n",
43524
43524
  "core:mediaType": "application/yaml",
43525
43525
  "sourcemaps:sources": [
43526
43526
  {
@@ -43541,7 +43541,7 @@
43541
43541
  "doc:ExternalDomainElement",
43542
43542
  "doc:DomainElement"
43543
43543
  ],
43544
- "doc:raw": "code: '7487'\ndescription: 'Financial and insurance activities'\ntype: \"PRIMARY\"\nclassificationCode: 'BE_NACEBEL2008'\nactivityGroupCode: 'ABCDE'\n",
43544
+ "doc:raw": "code: 'J'\ndescription: 'Information and communication'\n",
43545
43545
  "core:mediaType": "application/yaml",
43546
43546
  "sourcemaps:sources": [
43547
43547
  {
@@ -44776,12 +44776,12 @@
44776
44776
  {
44777
44777
  "@id": "#205/source-map/lexical/element_0",
44778
44778
  "sourcemaps:element": "amf://id#205",
44779
- "sourcemaps:value": "[(1,0)-(3,0)]"
44779
+ "sourcemaps:value": "[(1,0)-(6,0)]"
44780
44780
  },
44781
44781
  {
44782
44782
  "@id": "#208/source-map/lexical/element_0",
44783
44783
  "sourcemaps:element": "amf://id#208",
44784
- "sourcemaps:value": "[(1,0)-(6,0)]"
44784
+ "sourcemaps:value": "[(1,0)-(3,0)]"
44785
44785
  },
44786
44786
  {
44787
44787
  "@id": "#223/source-map/lexical/element_0",
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.19",
4
+ "version": "0.18.20",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
7
7
  "./browser.js": {
@@ -314,6 +314,7 @@ export function addOwnerField(entity: DomainEntity, info: Partial<IThing> = {}):
314
314
  return prop
315
315
  }
316
316
 
317
+ // This is owner with different name. Use that one instead.
317
318
  // function addCreatedByField(entity: DomainEntity): DomainElement {
318
319
  // const existing = findCreatedByField(entity, true)
319
320
  // if (existing) {
@@ -43,6 +43,18 @@ import {
43
43
  addBooleanField,
44
44
  addQuantityField,
45
45
  } from '../helpers/Intelisense.js'
46
+ import type { CreateTemplateOptions } from './types.js'
47
+
48
+ function createDomain(): DataDomain {
49
+ return new DataDomain({
50
+ info: {
51
+ name: 'Blog Publishing Platform',
52
+ displayName: 'Blog Publishing Platform',
53
+ description:
54
+ 'A comprehensive content management and publishing platform for blogs, magazines, and digital publications',
55
+ },
56
+ })
57
+ }
46
58
 
47
59
  /**
48
60
  * Creates a comprehensive blog/publishing data domain following domain-driven design principles.
@@ -56,17 +68,9 @@ import {
56
68
  *
57
69
  * @returns A fully configured DataDomain with all blog/publishing entities and relationships
58
70
  */
59
- export function createBlogDomain(): DataDomain {
60
- // Create the root data domain
61
- const domain = new DataDomain({
62
- info: {
63
- name: 'Blog Publishing Platform',
64
- displayName: 'Blog Publishing Platform',
65
- description:
66
- 'A comprehensive content management and publishing platform for blogs, magazines, and digital publications',
67
- version: '1.0.0',
68
- },
69
- })
71
+ export default function createBlogDomain(options: CreateTemplateOptions = {}): DataDomain {
72
+ // Ensure the root data domain
73
+ const domain = options.domain ?? createDomain()
70
74
 
71
75
  //
72
76
  // 1. CONTENT MANAGEMENT NAMESPACE
@@ -782,6 +786,3 @@ export function createBlogDomain(): DataDomain {
782
786
 
783
787
  return domain
784
788
  }
785
-
786
- // Export the creation function for use in other files
787
- export default createBlogDomain
@@ -52,6 +52,18 @@ import {
52
52
  addUnitPriceField,
53
53
  addCurrencyAmountField,
54
54
  } from '../helpers/Intelisense.js'
55
+ import type { CreateTemplateOptions } from './types.js'
56
+
57
+ function createDomain(): DataDomain {
58
+ return new DataDomain({
59
+ info: {
60
+ name: 'E-Commerce Platform',
61
+ displayName: 'E-Commerce Platform',
62
+ description:
63
+ 'A comprehensive e-commerce platform with user management, product catalog, and order processing capabilities',
64
+ },
65
+ })
66
+ }
55
67
 
56
68
  /**
57
69
  * Creates a comprehensive e-commerce data domain following domain-driven design principles.
@@ -65,18 +77,9 @@ import {
65
77
  *
66
78
  * @returns A fully configured DataDomain with all e-commerce entities and relationships
67
79
  */
68
- export function createEcommerceDomain(): DataDomain {
69
- // Create the root data domain
70
- const domain = new DataDomain({
71
- key: 'ecommerce-platform',
72
- info: {
73
- name: 'E-Commerce Platform',
74
- displayName: 'E-Commerce Platform',
75
- description:
76
- 'A comprehensive e-commerce platform with user management, product catalog, and order processing capabilities',
77
- version: '1.0.0',
78
- },
79
- })
80
+ export default function createEcommerceDomain(options: CreateTemplateOptions = {}): DataDomain {
81
+ // Ensure the root data domain
82
+ const domain = options.domain ?? createDomain()
80
83
 
81
84
  //
82
85
  // 1. USER MANAGEMENT NAMESPACE
@@ -829,6 +832,3 @@ export function createEcommerceDomain(): DataDomain {
829
832
 
830
833
  return domain
831
834
  }
832
-
833
- // Export the creation function for use in other files
834
- export default createEcommerceDomain
@@ -0,0 +1,9 @@
1
+ import type { DataDomain } from '../DataDomain.js'
2
+
3
+ export interface CreateTemplateOptions {
4
+ /**
5
+ * The DataDomain instance to use for the template.
6
+ * If not provided, a new DataDomain instance will be created.
7
+ */
8
+ domain?: DataDomain
9
+ }