@cap-ts/soap-adapter 0.1.0 → 0.1.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.
@@ -1,96 +0,0 @@
1
- export type TraceContext = import("../orchestrator").TraceContext;
2
- export type CdsEntity = import("../orchestrator").CdsEntity;
3
- export type SoapHeaderObject = import("../orchestrator").SoapHeaderObject;
4
- /**
5
- * @typedef {import('../orchestrator').TraceContext} TraceContext
6
- * @typedef {import('../orchestrator').CdsEntity} CdsEntity
7
- * @typedef {import('../orchestrator').SoapHeaderObject} SoapHeaderObject
8
- */
9
- /**
10
- * Abstract foundational class defining structural contracts and lifecycle hook registration chains
11
- * for CAP-to-SOAP adapter overrides. This class cannot be instantiated directly.
12
- *
13
- * @abstract
14
- */
15
- export class Base {
16
- /**
17
- * Initializes the abstract service base layout.
18
- * @param {CdsEntity} entity - Contextual meta-reflection model representing the current execution entity instance.
19
- * @param {cds.Request} req - The incoming runtime context parameter bundle payload managed by the active application framework.
20
- * @param {TraceContext} traceContext - Unique execution tracking identifier context map used for logging.
21
- * @throws {TypeError} If this abstract class is directly instantiated via `new Base()`.
22
- */
23
- constructor(entity: CdsEntity, req: cds.Request, traceContext: TraceContext);
24
- entity: import("../orchestrator").CdsEntity;
25
- req: cds.Request;
26
- traceContext: import("../orchestrator").TraceContext;
27
- _requestHandlers: {};
28
- _responseHandlers: {};
29
- _mockHandlers: {};
30
- _headerHandlers: {};
31
- /**
32
- * Abstract initialization sequence triggered automatically during instance generation.
33
- * Must be overridden in child classes to establish event listeners.
34
- * @abstract
35
- * @throws {Error} If the derived child class does not implement this method.
36
- * @returns {void}
37
- */
38
- init(): void;
39
- /**
40
- * @callback SoapHeaderEvaluator
41
- * @param {cds.Request} req - The incoming CAP request context.
42
- * @param {*} [data] - The optional secondary payload data context.
43
- * @returns {Promise.<SoapHeaderObject>|SoapHeaderObject}
44
- */
45
- /**
46
- * Registers a custom SOAP header factory interceptor or a static structural payload value for a specific entity.
47
- * @param {string} entityName - Unqualified short name modifier string targeting an internal entity definition.
48
- * @param {SoapHeaderObject|SoapHeaderEvaluator} handler - A static header matching object configurations or an executable factory generator function.
49
- * @throws {Error} If the provided handler is neither a functional execution block nor an object structure.
50
- * @returns {void}
51
- */
52
- header(entityName: string, handler: SoapHeaderObject | ((req: cds.Request, data?: any) => Promise<SoapHeaderObject> | SoapHeaderObject)): void;
53
- /**
54
- * @callback SoapRequestEvaluator
55
- * @param {cds.Request} req - The incoming CAP request context.
56
- * @param {*} [data] - The optional secondary payload data context.
57
- * @returns {Promise.<*>|*}
58
- */
59
- /**
60
- * Appends a pre-flight payload manipulation interceptor function to the execution chain of an entity.
61
- * @param {string} entityName - Unqualified short name modifier string targeting an internal entity definition.
62
- * @param {SoapRequestEvaluator} handler - Callback function mutating incoming outbound arguments.
63
- * @throws {Error} If the handler input fails functional type evaluation checks.
64
- * @returns {void}
65
- */
66
- request(entityName: string, handler: (req: cds.Request, data?: any) => Promise<any> | any): void;
67
- /**
68
- * @callback SoapMockEvaluator
69
- * @param {cds.Request} req - The incoming CAP request context.
70
- * @param {*} [data] - The optional secondary payload data context.
71
- * @returns {Promise.<*>|*}
72
- */
73
- /**
74
- * Registers a single intercept sandbox bypass mock handler function for an entity, overriding native network requests entirely.
75
- * @param {string} entityName - Unqualified short name modifier string targeting an internal entity definition.
76
- * @param {SoapMockEvaluator} handler - Intercept bypass simulation callback executing sandboxed returns.
77
- * @throws {Error} If the handler input fails functional type evaluation checks.
78
- * @returns {void}
79
- */
80
- mock(entityName: string, handler: (req: cds.Request, data?: any) => Promise<any> | any): void;
81
- /**
82
- * @callback SoapResponseEvaluator
83
- * @param {cds.Request} req - The incoming CAP request context.
84
- * @param {*} data - The response data context.
85
- * @returns {Promise.<Array.<Object>>|Array.<Object>}
86
- */
87
- /**
88
- * Appends a post-flight response extraction array mapping transformation interceptor function to the execution chain of an entity.
89
- * @param {string} entityName - Unqualified short name modifier string targeting an internal entity definition.
90
- * @param {SoapResponseEvaluator} handler - Translation mapper formatting downstream runtime array structures.
91
- * @throws {Error} If the handler input fails functional type evaluation checks.
92
- * @returns {void}
93
- */
94
- response(entityName: string, handler: (req: cds.Request, data: any) => Promise<Array<any>> | Array<any>): void;
95
- }
96
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../.types/lib/base/index.js"],"names":[],"mappings":"2BACa,OAAO,iBAAiB,EAAE,YAAY;wBACtC,OAAO,iBAAiB,EAAE,SAAS;+BACnC,OAAO,iBAAiB,EAAE,gBAAgB;AAHvD;;;;GAIG;AAEH;;;;;GAKG;AACH;IACI;;;;;;OAMG;IACH,oBALW,SAAS,OACT,GAAG,CAAC,OAAO,gBACX,YAAY,EAkBtB;IAdG,4CAAoB;IACpB,iBAAc;IACd,qDAAgC;IAGhC,qBAA0B;IAC1B,sBAA2B;IAC3B,kBAAuB;IACvB,oBAAyB;IAQ7B;;;;;;OAMG;IACH,QAFa,IAAI,CAIhB;IAED;;;;;OAKG;IAEH;;;;;;OAMG;IACH,mBALW,MAAM,WACN,gBAAgB,UARhB,GAAG,CAAC,OAAO,SACX,GAAC,KACC,OAAO,CAAE,gBAAgB,CAAC,GAAC,gBAAgB,CAMT,GAElC,IAAI,CAQhB;IAED;;;;;OAKG;IAEH;;;;;;OAMG;IACH,oBALW,MAAM,iBAPN,GAAG,CAAC,OAAO,SACX,GAAC,KACC,OAAO,CAAE,GAAC,CAAC,GAAC,GAAC,GAQb,IAAI,CAMhB;IAED;;;;;OAKG;IAEH;;;;;;OAMG;IACH,iBALW,MAAM,iBAPN,GAAG,CAAC,OAAO,SACX,GAAC,KACC,OAAO,CAAE,GAAC,CAAC,GAAC,GAAC,GAQb,IAAI,CAKhB;IAEA;;;;;MAKE;IAEH;;;;;;OAMG;IACH,qBALW,MAAM,iBAPN,GAAG,CAAC,OAAO,QACX,GAAC,KACC,OAAO,CAAE,KAAK,KAAS,CAAC,GAAC,KAAK,KAAS,GAQvC,IAAI,CAMhB;CACJ"}
@@ -1,3 +0,0 @@
1
- export function getSoapClient(serviceName: any, localWsdlPath: any): Promise<soap.Client>;
2
- import soap = require("soap");
3
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../.types/lib/client.js"],"names":[],"mappings":"AAIA,0FA4CC"}
@@ -1,180 +0,0 @@
1
- export type TraceContext = {
2
- /**
3
- * - Unique execution tracking identifier used for log tracking.
4
- */
5
- correlationId: string;
6
- /**
7
- * - ID of the acting user or 'anonymous'.
8
- */
9
- user: string;
10
- /**
11
- * - ISO timestamp string indicating when the pipeline transaction initiated.
12
- */
13
- timestamp: string;
14
- };
15
- export type SoapBindingConfig = {
16
- /**
17
- * - The exact SOAP operation/method name exposed by the WSDL.
18
- */
19
- operation: string;
20
- /**
21
- * - Optional constructor reference for an adapter class handling lifecycle hook overrides.
22
- */
23
- resolvedAdapterClass?: Function;
24
- /**
25
- * - Overriding XML root element wrapper tag for outgoing payloads. Uses "none" to pass raw data.
26
- */
27
- rootRequest?: string;
28
- /**
29
- * - Explicit dot-notation pathway string indicating where the dataset payload array sits inside the incoming response.
30
- */
31
- rootResponse?: string;
32
- };
33
- /**
34
- * [@soap.path] - Explicit target data pathway mapping override to navigate the raw SOAP object graph.
35
- */
36
- export type CdsEntityElement = {
37
- /**
38
- * - The primitive data type classification string (e.g., 'cds.String').
39
- */
40
- type?: string;
41
- ""?: string;
42
- };
43
- export type CdsEntity = {
44
- /**
45
- * - The fully qualified name string of the underlying domain model entity.
46
- */
47
- name: string;
48
- /**
49
- * - Key-value pair configuration maps of the entity fields.
50
- */
51
- elements: {
52
- [x: string]: CdsEntityElement;
53
- };
54
- "": SoapBindingConfig;
55
- };
56
- export type SoapHeaderObject = {
57
- /**
58
- * - The core body value or sub-graph assigned inside the soap header layer block.
59
- */
60
- value?: any;
61
- /**
62
- * - Target namespace tag name descriptor applied to XML tracking.
63
- */
64
- name?: string;
65
- /**
66
- * - Extracted XML prefix label binding node structure entries.
67
- */
68
- prefix?: string;
69
- /**
70
- * - Full target URI qualification schema address string.
71
- */
72
- xmlns?: string;
73
- };
74
- export type BaseAdapterInstance = {
75
- /**
76
- * - Registered request mutation callback stacks.
77
- */
78
- _requestHandlers: {
79
- [x: string]: ((arg0: any, arg1: cds.Request) => (Promise<any> | any))[];
80
- };
81
- /**
82
- * - Sandbox mock boundary intercept hooks.
83
- */
84
- _mockHandlers: {
85
- [x: string]: (arg0: any, arg1: cds.Request) => (Promise<any> | any);
86
- };
87
- /**
88
- * - Custom explicit security header factory injectors.
89
- */
90
- _headerHandlers: {
91
- [x: string]: (SoapHeaderObject | ((arg0: any, arg1: cds.Request) => (Promise<SoapHeaderObject> | SoapHeaderObject)))[];
92
- };
93
- /**
94
- * - Dynamic override translation format steps.
95
- */
96
- _responseHandlers: {
97
- [x: string]: ((arg0: any, arg1: cds.Request) => (Promise<Array<any>> | Array<any>))[];
98
- };
99
- };
100
- /**
101
- * @typedef {Object} TraceContext
102
- * @property {string} correlationId - Unique execution tracking identifier used for log tracking.
103
- * @property {string} user - ID of the acting user or 'anonymous'.
104
- * @property {string} timestamp - ISO timestamp string indicating when the pipeline transaction initiated.
105
- */
106
- /**
107
- * @typedef {Object} SoapBindingConfig
108
- * @property {string} operation - The exact SOAP operation/method name exposed by the WSDL.
109
- * @property {Function} [resolvedAdapterClass] - Optional constructor reference for an adapter class handling lifecycle hook overrides.
110
- * @property {string} [rootRequest] - Overriding XML root element wrapper tag for outgoing payloads. Uses "none" to pass raw data.
111
- * @property {string} [rootResponse] - Explicit dot-notation pathway string indicating where the dataset payload array sits inside the incoming response.
112
- */
113
- /**
114
- * @typedef {Object} CdsEntityElement
115
- * @property {string} [type] - The primitive data type classification string (e.g., 'cds.String').
116
- * @property {string} [@soap.path] - Explicit target data pathway mapping override to navigate the raw SOAP object graph.
117
- */
118
- /**
119
- * @typedef {Object} CdsEntity
120
- * @property {string} name - The fully qualified name string of the underlying domain model entity.
121
- * @property {Object.<string, CdsEntityElement>} elements - Key-value pair configuration maps of the entity fields.
122
- * @property {SoapBindingConfig} @soap.binding - Embedded annotations directive containing runtime transport instructions.
123
- * @property {Object} parent - Positional contextual parent registry handle.
124
- * @property {string} parent.name - The explicit namespace identifier of the parent service.
125
- */
126
- /**
127
- * @typedef {Object} SoapHeaderObject
128
- * @property {*} [value] - The core body value or sub-graph assigned inside the soap header layer block.
129
- * @property {string} [name] - Target namespace tag name descriptor applied to XML tracking.
130
- * @property {string} [prefix] - Extracted XML prefix label binding node structure entries.
131
- * @property {string} [xmlns] - Full target URI qualification schema address string.
132
- */
133
- /**
134
- * @typedef {Object} BaseAdapterInstance
135
- * @property {Object.<string, Array<function(*, cds.Request): (Promise.<*>|*)>>} _requestHandlers - Registered request mutation callback stacks.
136
- * @property {Object.<string, function(*, cds.Request): (Promise.<*>|*)>} _mockHandlers - Sandbox mock boundary intercept hooks.
137
- * @property {Object.<string, Array<(SoapHeaderObject|function(*, cds.Request): (Promise.<SoapHeaderObject>|SoapHeaderObject))>>} _headerHandlers - Custom explicit security header factory injectors.
138
- * @property {Object.<string, Array<function(*, cds.Request): (Promise.<Array.<Object>>|Array.<Object>)>>} _responseHandlers - Dynamic override translation format steps.
139
- */
140
- /**
141
- * Orchestrates CAP-to-SOAP middleware pipelines by managing boot-time target file system validations,
142
- * dynamically fetching soap client proxies, executing lifecycle event hooks, parsing path lookups,
143
- * and converting structural nested objects into planar array datasets.
144
- */
145
- export class Orchestrator {
146
- /**
147
- * Reusable utility to normalize the WSDL path string by handling relative normalization
148
- * and hardcoding the suffix fallback extension if the user left it off.
149
- * @param {string} [configuredPath] - The raw path configuration string to evaluate.
150
- * @returns {string} The finalized absolute file system path, or an empty string if input evaluates to falsy.
151
- * @static
152
- */
153
- static resolveWsdlPath(configuredPath?: string): string;
154
- /**
155
- * Traverses a deeply nested complex object structure down an explicit dot-notation path, resolving unwrapped
156
- * `$value` fields or underlying item collection arrays where necessary.
157
- * @param {*} obj - The base root object graph to traverse.
158
- * @param {string} [pathStr] - A dot-separated string path mapping out destination elements (e.g., 'Result.Data.Record').
159
- * @returns {*} Evaluated value at target path, unnested item collection arrays, or `undefined` if parsing falls flat.
160
- * @static
161
- */
162
- static getNestedValue(obj: any, pathStr?: string): any;
163
- /**
164
- * Fail-Fast Integrity Guard running checks on application boot sequence.
165
- * Iterates over framework environment requirements on initialization to enforce fail-fast application boot structural safety.
166
- * @throws {Error} If a configured SOAP service lacks a specified tracking path or the target storage asset is physically missing.
167
- * @returns {void}
168
- */
169
- validateProjectConfigurations(): void;
170
- /**
171
- * Executes the lifecycle pipeline tracking processing workflow loop for intercepted interface interactions.
172
- * Handles payload pre-processing, automatic XML root generation packaging, header injection, live network communication or mocking,
173
- * and recursive flattening conversions into mapping models.
174
- * @param {cds.Request} req - The incoming runtime context parameter bundle payload managed by the active application framework.
175
- * @returns {Promise<Array<Object>|void>} Resolves with a flat array mapping extracted data elements, or undefined if configuration conditions break early.
176
- * @async
177
- */
178
- handleEvent(req: cds.Request): Promise<Array<any> | void>;
179
- }
180
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../.types/lib/orchestrator/index.js"],"names":[],"mappings":";;;;mBAMc,MAAM;;;;UACN,MAAM;;;;eACN,MAAM;;;;;;eAKN,MAAM;;;;;;;;kBAEN,MAAM;;;;mBACN,MAAM;;;;;;;;;WAKN,MAAM;SACN,MAAM;;;;;;UAKN,MAAM;;;;;;;QAEN,iBAAiB;;;;;;YAOjB,GAAC;;;;WACD,MAAM;;;;aACN,MAAM;;;;YACN,MAAM;;;;;;;6BAKyB,GAAC,QAAE,GAAG,CAAC,OAAO,KAAG,CAAC,OAAO,CAAE,GAAC,CAAC,GAAC,GAAC,CAAC;;;;;;4BACtC,GAAC,QAAE,GAAG,CAAC,OAAO,KAAG,CAAC,OAAO,CAAE,GAAC,CAAC,GAAC,GAAC,CAAC;;;;;;iDACR,GAAC,QAAE,GAAG,CAAC,OAAO,KAAG,CAAC,OAAO,CAAE,gBAAgB,CAAC,GAAC,gBAAgB,CAAC;;;;;;6BAChF,GAAC,QAAE,GAAG,CAAC,OAAO,KAAG,CAAC,OAAO,CAAE,KAAK,KAAS,CAAC,GAAC,KAAK,KAAS,CAAC;;;AA3CvG;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;GAIG;AAEH;;;;;;;GAOG;AAEH;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH;;;;GAIG;AACH;IASI;;;;;;OAMG;IACH,wCAJW,MAAM,GACJ,MAAM,CASlB;IAwBD;;;;;;;OAOG;IACH,2BALW,GAAC,YACD,MAAM,GACJ,GAAC,CAgBb;IA3CD;;;;;OAKG;IACH,iCAFa,IAAI,CAgBhB;IAyBD;;;;;;;OAOG;IACH,iBAJW,GAAG,CAAC,OAAO,GACT,OAAO,CAAC,KAAK,KAAQ,GAAC,IAAI,CAAC,CAsGvC;CACJ"}
@@ -1,3 +0,0 @@
1
- declare function _exports(): void;
2
- export = _exports;
3
- //# sourceMappingURL=plugin-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-loader.d.ts","sourceRoot":"","sources":["../../.types/lib/plugin-loader.js"],"names":[],"mappings":"AAMiB,kCA8FhB"}