@api-client/core 0.17.4 → 0.17.6
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.
- package/build/src/modeling/Semantics.d.ts +9 -5
- package/build/src/modeling/Semantics.d.ts.map +1 -1
- package/build/src/modeling/Semantics.js +14 -10
- package/build/src/modeling/Semantics.js.map +1 -1
- package/build/src/modeling/definitions/{Price.d.ts → Currency.d.ts} +24 -24
- package/build/src/modeling/definitions/Currency.d.ts.map +1 -0
- package/build/src/modeling/definitions/{Price.js → Currency.js} +18 -18
- package/build/src/modeling/definitions/Currency.js.map +1 -0
- package/build/src/modeling/definitions/Email.d.ts +2 -2
- package/build/src/modeling/definitions/Email.d.ts.map +1 -1
- package/build/src/modeling/definitions/Email.js.map +1 -1
- package/build/src/modeling/definitions/GeospatialCoordinates.d.ts +46 -1
- package/build/src/modeling/definitions/GeospatialCoordinates.d.ts.map +1 -1
- package/build/src/modeling/definitions/GeospatialCoordinates.js.map +1 -1
- package/build/src/modeling/definitions/HTML.d.ts +17 -4
- package/build/src/modeling/definitions/HTML.d.ts.map +1 -1
- package/build/src/modeling/definitions/HTML.js +0 -1
- package/build/src/modeling/definitions/HTML.js.map +1 -1
- package/build/src/modeling/definitions/Markdown.d.ts +12 -4
- package/build/src/modeling/definitions/Markdown.d.ts.map +1 -1
- package/build/src/modeling/definitions/Markdown.js +0 -1
- package/build/src/modeling/definitions/Markdown.js.map +1 -1
- package/build/src/modeling/definitions/Phone.d.ts +5 -7
- package/build/src/modeling/definitions/Phone.d.ts.map +1 -1
- package/build/src/modeling/definitions/Phone.js +2 -2
- package/build/src/modeling/definitions/Phone.js.map +1 -1
- package/build/src/modeling/definitions/PublicUniqueName.d.ts +1 -9
- package/build/src/modeling/definitions/PublicUniqueName.d.ts.map +1 -1
- package/build/src/modeling/definitions/PublicUniqueName.js +0 -1
- package/build/src/modeling/definitions/PublicUniqueName.js.map +1 -1
- package/build/src/modeling/definitions/SKU.d.ts +4 -1
- package/build/src/modeling/definitions/SKU.d.ts.map +1 -1
- package/build/src/modeling/definitions/SKU.js.map +1 -1
- package/build/src/modeling/definitions/Status.d.ts +1 -1
- package/build/src/modeling/definitions/Status.d.ts.map +1 -1
- package/build/src/modeling/definitions/Status.js +1 -0
- package/build/src/modeling/definitions/Status.js.map +1 -1
- package/build/src/modeling/definitions/URL.d.ts +1 -4
- package/build/src/modeling/definitions/URL.d.ts.map +1 -1
- package/build/src/modeling/definitions/URL.js +0 -1
- package/build/src/modeling/definitions/URL.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +10 -10
- package/package.json +1 -1
- package/src/modeling/Semantics.ts +14 -10
- package/src/modeling/definitions/{Price.examples.md → Currency.examples.md} +12 -12
- package/src/modeling/definitions/{Price.ts → Currency.ts} +26 -26
- package/src/modeling/definitions/Email.ts +2 -2
- package/src/modeling/definitions/GeospatialCoordinates.ts +46 -1
- package/src/modeling/definitions/HTML.ts +17 -5
- package/src/modeling/definitions/Markdown.ts +12 -5
- package/src/modeling/definitions/Phone.ts +6 -8
- package/src/modeling/definitions/PublicUniqueName.ts +1 -10
- package/src/modeling/definitions/SKU.ts +4 -1
- package/src/modeling/definitions/Status.ts +2 -1
- package/src/modeling/definitions/URL.ts +1 -5
- package/tests/unit/modeling/definitions/{price.spec.ts → currency.spec.ts} +114 -114
- package/tests/unit/modeling/definitions/derived.spec.ts +1 -2
- package/tests/unit/modeling/definitions/description.spec.ts +0 -2
- package/tests/unit/modeling/definitions/url.spec.ts +0 -1
- package/tests/unit/modeling/semantic-configs.spec.ts +45 -46
- package/tests/unit/modeling/semantics.spec.ts +10 -1
- package/build/src/modeling/definitions/Price.d.ts.map +0 -1
- package/build/src/modeling/definitions/Price.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Status.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,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ACf,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,KAAK;SACnB;KACF;IACD,QAAQ,EAAE;QACR,gBAAgB,EAAE,KAAK;QACvB,iBAAiB,EAAE,KAAK;QACxB,UAAU,EAAE,IAAI;QAChB,gBAAgB,EAAE,KAAK;KACxB;CACF,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Status semantic.\n * These options control state management and workflow behavior.\n */\nexport interface StatusConfig {\n /**\n * Allowed states for this status field.\n * Only required when the field doesn't have enum values defined in the schema.\n * If enum values are defined in DomainProperty > Schema, those values will be used instead.\n */\n allowedStates?: string[]\n\n /**\n * Default state when creating new records.\n * Must be one of the allowedStates (if specified) or enum values from the schema.\n */\n defaultState
|
|
1
|
+
{"version":3,"file":"Status.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/Status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAoK9C;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAA6B,EAAqC,EAAE;IACnG,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,MAAM,CAAA;AAC5C,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAgC,EAAE,EAAyB,EAAE;IAChG,MAAM,YAAY,GAAG;QACnB,GAAG,qBAAqB;QACxB,GAAG,MAAM;QACT,4BAA4B;QAC5B,cAAc,EAAE,MAAM,CAAC,cAAc;YACnC,CAAC,CAAC,EAAE,GAAG,qBAAqB,CAAC,cAAc,EAAE,GAAG,MAAM,CAAC,cAAc,EAAE;YACvE,CAAC,CAAC,qBAAqB,CAAC,cAAc;QACxC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACvB,CAAC,CAAC,EAAE,GAAG,qBAAqB,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE;YAC3D,CAAC,CAAC,qBAAqB,CAAC,QAAQ;KACnC,CAAA;IAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,YAAY,CAAC,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAChD,CAAC;IAED,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,MAAM;QACvB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,aAAa,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC;IACjD,YAAY,EAAE,OAAO;IACrB,cAAc,EAAE;QACd,KAAK,EAAE;YACL,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,IAAI;SAClB;QACD,SAAS,EAAE;YACT,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,KAAK;SACnB;KACF;IACD,QAAQ,EAAE;QACR,gBAAgB,EAAE,KAAK;QACvB,iBAAiB,EAAE,KAAK;QACxB,UAAU,EAAE,IAAI;QAChB,gBAAgB,EAAE,KAAK;KACxB;CACF,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the Status semantic.\n * These options control state management and workflow behavior.\n */\nexport interface StatusConfig {\n /**\n * Allowed states for this status field.\n * Only required when the field doesn't have enum values defined in the schema.\n * If enum values are defined in DomainProperty > Schema, those values will be used instead.\n */\n allowedStates?: string[]\n\n /**\n * Default state when creating new records.\n * Must be one of the allowedStates (if specified) or enum values from the schema.\n */\n defaultState?: string\n\n /**\n * State transitions configuration.\n * Maps from current state to array of allowed next states.\n */\n transitions?: Record<string, string[]>\n\n /**\n * State-specific behaviors and permissions.\n */\n stateBehaviors?: Record<\n string,\n {\n /**\n * Whether records in this state are publicly visible.\n * Defaults to true if not specified.\n */\n isPublic?: boolean\n\n /**\n * Whether records in this state can be edited.\n * Defaults to true if not specified.\n */\n isEditable?: boolean\n\n /**\n * Whether records in this state can be deleted.\n * Defaults to false if not specified.\n */\n isDeletable?: boolean\n\n /**\n * Whether this state requires approval before transition.\n * Defaults to false if not specified.\n */\n requiresApproval?: boolean\n\n /**\n * Custom display name for this state.\n */\n displayName?: string\n\n /**\n * Custom description for this state.\n */\n description?: string\n\n /**\n * Color or visual indicator for this state.\n */\n color?: string\n\n /**\n * Icon for this state.\n */\n icon?: string\n }\n >\n\n /**\n * Workflow configuration for status management.\n */\n workflow?: {\n /**\n * Whether status changes require approval.\n * Defaults to false if not specified.\n */\n requiresApproval?: boolean\n\n /**\n * Roles that can approve status changes.\n * Required if requiresApproval is true.\n */\n approvalRoles?: string[]\n\n /**\n * Whether to send notifications on status changes.\n * Defaults to false if not specified.\n */\n sendNotifications?: boolean\n\n /**\n * Notification channels to use.\n */\n notificationChannels?: ('email' | 'sms' | 'push' | 'webhook')[]\n\n /**\n * Whether to log status change history.\n * Defaults to true if not specified.\n */\n logHistory?: boolean\n\n /**\n * Whether to allow bulk status changes.\n * Defaults to false if not specified.\n */\n allowBulkChanges?: boolean\n }\n\n /**\n * Auto-transitions based on conditions.\n */\n autoTransitions?: {\n /**\n * Current state that triggers the auto-transition.\n */\n from: string\n\n /**\n * Target state to transition to.\n */\n to: string\n\n /**\n * Condition that triggers the transition.\n * Examples: \"after 24 hours\", \"when approved\", \"when payment received\"\n */\n condition: string\n\n /**\n * Whether this auto-transition requires approval.\n * Defaults to false if not specified.\n */\n requiresApproval?: boolean\n }[]\n\n /**\n * Custom metadata for the status field.\n */\n metadata?: Record<string, unknown>\n\n /**\n * Index signature to allow additional properties.\n */\n [key: string]: unknown\n}\n\n/**\n * Type-safe configuration for Status semantic.\n */\nexport interface AppliedStatusSemantic extends AppliedDataSemantic {\n id: SemanticType.Status\n config?: StatusConfig\n}\n\n/**\n * Type guard to check if a semantic is a Status semantic.\n */\nexport const isStatusSemantic = (semantic: AppliedDataSemantic): semantic is AppliedStatusSemantic => {\n return semantic.id === SemanticType.Status\n}\n\n/**\n * Helper function to create a Status semantic with configuration.\n */\nexport const createStatusSemantic = (config: Partial<StatusConfig> = {}): AppliedStatusSemantic => {\n const mergedConfig = {\n ...DEFAULT_STATUS_CONFIG,\n ...config,\n // Deep merge nested objects\n stateBehaviors: config.stateBehaviors\n ? { ...DEFAULT_STATUS_CONFIG.stateBehaviors, ...config.stateBehaviors }\n : DEFAULT_STATUS_CONFIG.stateBehaviors,\n workflow: config.workflow\n ? { ...DEFAULT_STATUS_CONFIG.workflow, ...config.workflow }\n : DEFAULT_STATUS_CONFIG.workflow,\n }\n\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.Status,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for Status semantic.\n */\nexport const DEFAULT_STATUS_CONFIG: StatusConfig = {\n allowedStates: ['draft', 'published', 'archived'],\n defaultState: 'draft',\n stateBehaviors: {\n draft: {\n isPublic: false,\n isEditable: true,\n isDeletable: true,\n },\n published: {\n isPublic: true,\n isEditable: true,\n isDeletable: false,\n },\n archived: {\n isPublic: false,\n isEditable: false,\n isDeletable: false,\n },\n },\n workflow: {\n requiresApproval: false,\n sendNotifications: false,\n logHistory: true,\n allowBulkChanges: false,\n },\n}\n"]}
|
|
@@ -5,12 +5,9 @@ import { SemanticType } from '../Semantics.js';
|
|
|
5
5
|
* Controls validation, allowed protocols, and formatting.
|
|
6
6
|
*/
|
|
7
7
|
export interface URLConfig {
|
|
8
|
-
/**
|
|
9
|
-
* List of allowed protocols (e.g., ['http', 'https']).
|
|
10
|
-
*/
|
|
11
|
-
allowedProtocols?: string[];
|
|
12
8
|
/**
|
|
13
9
|
* Whether to require HTTPS protocol (default: false).
|
|
10
|
+
* When not set, both HTTP and HTTPS are allowed.
|
|
14
11
|
*/
|
|
15
12
|
requireHttps?: boolean;
|
|
16
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"URL.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/URL.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB
|
|
1
|
+
{"version":3,"file":"URL.d.ts","sourceRoot":"","sources":["../../../../src/modeling/definitions/URL.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D,EAAE,EAAE,YAAY,CAAC,GAAG,CAAA;IACpB,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,mBAAmB,KAAG,QAAQ,IAAI,kBAEzE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAQ,SAAc,KAAG,kBAa1D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAQhC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"URL.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/URL.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"URL.js","sourceRoot":"","sources":["../../../../src/modeling/definitions/URL.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAsD9C;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAA6B,EAAkC,EAAE;IAC7F,OAAO,QAAQ,CAAC,EAAE,KAAK,YAAY,CAAC,GAAG,CAAA;AACzC,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAoB,EAAE,EAAsB,EAAE;IAC9E,MAAM,YAAY,GAAG;QACnB,GAAG,kBAAkB;QACrB,GAAG,MAAM;KACV,CAAA;IACD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,YAAY,CAAC,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAChD,CAAC;IAED,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,GAAG;QACpB,MAAM,EAAE,YAAY;KACrB,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAc;IAC3C,YAAY,EAAE,KAAK;IACnB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,kBAAkB,EAAE,IAAI;IACxB,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,mBAAmB,EAAE,KAAK;CAC3B,CAAA","sourcesContent":["import type { AppliedDataSemantic } from '../Semantics.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Configuration options for the URL semantic.\n * Controls validation, allowed protocols, and formatting.\n */\nexport interface URLConfig {\n /**\n * Whether to require HTTPS protocol (default: false).\n * When not set, both HTTP and HTTPS are allowed.\n */\n requireHttps?: boolean\n /**\n * Whether to allow query parameters in the URL.\n */\n allowQueryParams?: boolean\n /**\n * Whether to allow URL fragments (e.g., #section).\n */\n allowFragments?: boolean\n /**\n * Whether to allow internationalized domain names.\n */\n allowInternational?: boolean\n /**\n * Whether to allow IP addresses as hostnames.\n */\n allowIP?: boolean\n /**\n * Whether to allow port numbers in the URL.\n */\n allowPort?: boolean\n /**\n * Whether to allow authentication info (user:pass@host).\n */\n allowAuthentication?: boolean\n /**\n * Custom metadata for the URL field.\n */\n metadata?: Record<string, unknown>\n /**\n * Index signature to allow additional properties.\n */\n [key: string]: unknown\n}\n\n/**\n * Type-safe configuration for URL semantic.\n */\nexport interface AppliedURLSemantic extends AppliedDataSemantic {\n id: SemanticType.URL\n config?: URLConfig\n}\n\n/**\n * Type guard to check if a semantic is a URL semantic.\n */\nexport const isURLSemantic = (semantic: AppliedDataSemantic): semantic is AppliedURLSemantic => {\n return semantic.id === SemanticType.URL\n}\n\n/**\n * Helper function to create a URL semantic with configuration.\n */\nexport const createURLSemantic = (config: URLConfig = {}): AppliedURLSemantic => {\n const mergedConfig = {\n ...DEFAULT_URL_CONFIG,\n ...config,\n }\n if (config.metadata) {\n mergedConfig.metadata = { ...config.metadata }\n }\n\n return {\n id: SemanticType.URL,\n config: mergedConfig,\n }\n}\n\n/**\n * Default configuration for URL semantic.\n */\nexport const DEFAULT_URL_CONFIG: URLConfig = {\n requireHttps: false,\n allowQueryParams: true,\n allowFragments: true,\n allowInternational: true,\n allowIP: true,\n allowPort: true,\n allowAuthentication: false,\n}\n"]}
|