@sap-cloud-sdk/generator 2.0.0-alpha.0 → 2.0.0-beta.1-20220107142408.0
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/dist/action-function-import/action.d.ts.map +1 -1
- package/dist/action-function-import/action.js +7 -2
- package/dist/action-function-import/action.js.map +1 -1
- package/dist/action-function-import/file.js +3 -3
- package/dist/action-function-import/file.js.map +1 -1
- package/dist/action-function-import/function.d.ts.map +1 -1
- package/dist/action-function-import/function.js +10 -12
- package/dist/action-function-import/function.js.map +1 -1
- package/dist/action-function-import/import.d.ts.map +1 -1
- package/dist/action-function-import/import.js +43 -19
- package/dist/action-function-import/import.js.map +1 -1
- package/dist/action-function-import/parameters-interface.js +1 -1
- package/dist/action-function-import/parameters-interface.js.map +1 -1
- package/dist/action-function-import/request-builder-arguments.d.ts.map +1 -1
- package/dist/action-function-import/request-builder-arguments.js +2 -1
- package/dist/action-function-import/request-builder-arguments.js.map +1 -1
- package/dist/action-function-import/return-type.js +1 -1
- package/dist/action-function-import/return-type.js.map +1 -1
- package/dist/batch/file.d.ts.map +1 -1
- package/dist/batch/file.js +0 -7
- package/dist/batch/file.js.map +1 -1
- package/dist/batch/function.d.ts.map +1 -1
- package/dist/batch/function.js +14 -11
- package/dist/batch/function.js.map +1 -1
- package/dist/batch/imports.d.ts.map +1 -1
- package/dist/batch/imports.js +3 -6
- package/dist/batch/imports.js.map +1 -1
- package/dist/batch/type.js +4 -4
- package/dist/batch/type.js.map +1 -1
- package/dist/complex-type/field-type-class.d.ts.map +1 -1
- package/dist/complex-type/field-type-class.js +9 -5
- package/dist/complex-type/field-type-class.js.map +1 -1
- package/dist/complex-type/imports.d.ts.map +1 -1
- package/dist/complex-type/imports.js +10 -8
- package/dist/complex-type/imports.js.map +1 -1
- package/dist/complex-type/interface.js +2 -3
- package/dist/complex-type/interface.js.map +1 -1
- package/dist/edmx-to-vdm/common/action-function-return-types.d.ts +2 -2
- package/dist/edmx-to-vdm/common/action-function-return-types.d.ts.map +1 -1
- package/dist/edmx-to-vdm/common/action-function-return-types.js +17 -10
- package/dist/edmx-to-vdm/common/action-function-return-types.js.map +1 -1
- package/dist/edmx-to-vdm/v2/function-import.d.ts +1 -1
- package/dist/edmx-to-vdm/v2/function-import.d.ts.map +1 -1
- package/dist/edmx-to-vdm/v2/function-import.js +2 -2
- package/dist/edmx-to-vdm/v2/function-import.js.map +1 -1
- package/dist/edmx-to-vdm/v2/service-entities.d.ts +1 -1
- package/dist/edmx-to-vdm/v2/service-entities.d.ts.map +1 -1
- package/dist/edmx-to-vdm/v2/service-entities.js +2 -2
- package/dist/edmx-to-vdm/v2/service-entities.js.map +1 -1
- package/dist/edmx-to-vdm/v4/action-import.d.ts +1 -1
- package/dist/edmx-to-vdm/v4/action-import.d.ts.map +1 -1
- package/dist/edmx-to-vdm/v4/action-import.js +2 -2
- package/dist/edmx-to-vdm/v4/action-import.js.map +1 -1
- package/dist/edmx-to-vdm/v4/function-import.d.ts +1 -1
- package/dist/edmx-to-vdm/v4/function-import.d.ts.map +1 -1
- package/dist/edmx-to-vdm/v4/function-import.js +2 -2
- package/dist/edmx-to-vdm/v4/function-import.js.map +1 -1
- package/dist/edmx-to-vdm/v4/service-entities.d.ts +1 -1
- package/dist/edmx-to-vdm/v4/service-entities.d.ts.map +1 -1
- package/dist/edmx-to-vdm/v4/service-entities.js +4 -4
- package/dist/edmx-to-vdm/v4/service-entities.js.map +1 -1
- package/dist/entity/class.d.ts +7 -1
- package/dist/entity/class.d.ts.map +1 -1
- package/dist/entity/class.js +46 -96
- package/dist/entity/class.js.map +1 -1
- package/dist/entity/file.d.ts.map +1 -1
- package/dist/entity/file.js +2 -4
- package/dist/entity/file.js.map +1 -1
- package/dist/entity/imports.d.ts.map +1 -1
- package/dist/entity/imports.js +2 -18
- package/dist/entity/imports.js.map +1 -1
- package/dist/entity/interface.d.ts.map +1 -1
- package/dist/entity/interface.js +4 -5
- package/dist/entity/interface.js.map +1 -1
- package/dist/entity/namespace.d.ts +3 -1
- package/dist/entity/namespace.d.ts.map +1 -1
- package/dist/entity/namespace.js +30 -9
- package/dist/entity/namespace.js.map +1 -1
- package/dist/generator-common/create-file.d.ts +2 -0
- package/dist/generator-common/create-file.d.ts.map +1 -0
- package/dist/generator-common/create-file.js +38 -0
- package/dist/generator-common/create-file.js.map +1 -0
- package/dist/generator-common/imports.d.ts +16 -0
- package/dist/generator-common/imports.d.ts.map +1 -0
- package/dist/generator-common/imports.js +12 -0
- package/dist/generator-common/imports.js.map +1 -0
- package/dist/generator-common/index.d.ts +3 -0
- package/dist/generator-common/index.d.ts.map +1 -0
- package/dist/generator-common/index.js +15 -0
- package/dist/generator-common/index.js.map +1 -0
- package/dist/generator-options.d.ts +0 -1
- package/dist/generator-options.d.ts.map +1 -1
- package/dist/generator-options.js +1 -6
- package/dist/generator-options.js.map +1 -1
- package/dist/generator-utils.d.ts.map +1 -1
- package/dist/generator-utils.js +1 -1
- package/dist/generator-utils.js.map +1 -1
- package/dist/generator-without-ts-morph/de-serializers-generic-types.d.ts +4 -0
- package/dist/generator-without-ts-morph/de-serializers-generic-types.d.ts.map +1 -0
- package/dist/generator-without-ts-morph/de-serializers-generic-types.js +51 -0
- package/dist/generator-without-ts-morph/de-serializers-generic-types.js.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/class.d.ts +3 -0
- package/dist/generator-without-ts-morph/entity-api/class.d.ts.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/class.js +67 -0
- package/dist/generator-without-ts-morph/entity-api/class.js.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/file.d.ts +3 -0
- package/dist/generator-without-ts-morph/entity-api/file.d.ts.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/file.js +87 -0
- package/dist/generator-without-ts-morph/entity-api/file.js.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/imports.d.ts +24 -0
- package/dist/generator-without-ts-morph/entity-api/imports.d.ts.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/imports.js +91 -0
- package/dist/generator-without-ts-morph/entity-api/imports.js.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/index.d.ts +3 -0
- package/dist/generator-without-ts-morph/entity-api/index.d.ts.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/index.js +15 -0
- package/dist/generator-without-ts-morph/entity-api/index.js.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/match-entity.d.ts +3 -0
- package/dist/generator-without-ts-morph/entity-api/match-entity.d.ts.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/match-entity.js +12 -0
- package/dist/generator-without-ts-morph/entity-api/match-entity.js.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/navigation-properties.d.ts +4 -0
- package/dist/generator-without-ts-morph/entity-api/navigation-properties.d.ts.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/navigation-properties.js +57 -0
- package/dist/generator-without-ts-morph/entity-api/navigation-properties.js.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/schema.d.ts +6 -0
- package/dist/generator-without-ts-morph/entity-api/schema.d.ts.map +1 -0
- package/dist/generator-without-ts-morph/entity-api/schema.js +37 -0
- package/dist/generator-without-ts-morph/entity-api/schema.js.map +1 -0
- package/dist/generator-without-ts-morph/index.d.ts +2 -0
- package/dist/generator-without-ts-morph/index.d.ts.map +1 -0
- package/dist/generator-without-ts-morph/index.js +14 -0
- package/dist/generator-without-ts-morph/index.js.map +1 -0
- package/dist/generator-without-ts-morph/service/class.d.ts +11 -0
- package/dist/generator-without-ts-morph/service/class.d.ts.map +1 -0
- package/dist/generator-without-ts-morph/service/class.js +91 -0
- package/dist/generator-without-ts-morph/service/class.js.map +1 -0
- package/dist/generator-without-ts-morph/service/file.d.ts +5 -0
- package/dist/generator-without-ts-morph/service/file.d.ts.map +1 -0
- package/dist/generator-without-ts-morph/service/file.js +58 -0
- package/dist/generator-without-ts-morph/service/file.js.map +1 -0
- package/dist/generator-without-ts-morph/service/index.d.ts +3 -0
- package/dist/generator-without-ts-morph/service/index.d.ts.map +1 -0
- package/dist/generator-without-ts-morph/service/index.js +15 -0
- package/dist/generator-without-ts-morph/service/index.js.map +1 -0
- package/dist/generator.d.ts +8 -1
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +34 -21
- package/dist/generator.js.map +1 -1
- package/dist/imports.d.ts +2 -5
- package/dist/imports.d.ts.map +1 -1
- package/dist/imports.js +6 -17
- package/dist/imports.js.map +1 -1
- package/dist/request-builder/class.js +21 -18
- package/dist/request-builder/class.js.map +1 -1
- package/dist/request-builder/imports.d.ts.map +1 -1
- package/dist/request-builder/imports.js +10 -4
- package/dist/request-builder/imports.js.map +1 -1
- package/dist/sdk-metadata/code-samples.d.ts +1 -1
- package/dist/sdk-metadata/code-samples.d.ts.map +1 -1
- package/dist/sdk-metadata/code-samples.js +10 -4
- package/dist/sdk-metadata/code-samples.js.map +1 -1
- package/dist/sdk-metadata/generation-and-usage.d.ts.map +1 -1
- package/dist/sdk-metadata/generation-and-usage.js +3 -3
- package/dist/sdk-metadata/generation-and-usage.js.map +1 -1
- package/dist/service/index-file.d.ts.map +1 -1
- package/dist/service/index-file.js +4 -2
- package/dist/service/index-file.js.map +1 -1
- package/dist/service/index.d.ts +0 -1
- package/dist/service/index.d.ts.map +1 -1
- package/dist/service/index.js +0 -1
- package/dist/service/index.js.map +1 -1
- package/dist/service/package-json.d.ts.map +1 -1
- package/dist/service/package-json.js +0 -2
- package/dist/service/package-json.js.map +1 -1
- package/dist/service-generator.d.ts.map +1 -1
- package/dist/service-generator.js +2 -2
- package/dist/service-generator.js.map +1 -1
- package/dist/vdm-types.d.ts +1 -1
- package/dist/vdm-types.d.ts.map +1 -1
- package/dist/vdm-types.js.map +1 -1
- package/package.json +5 -5
- package/dist/service/typedoc-json.d.ts +0 -5
- package/dist/service/typedoc-json.d.ts.map +0 -1
- package/dist/service/typedoc-json.js +0 -16
- package/dist/service/typedoc-json.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/action-function-import/action.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAiB,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AASnE;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,eAAe,EAC7B,OAAO,EAAE,kBAAkB,GAC1B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/action-function-import/action.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAiB,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AASnE;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,eAAe,EAC7B,OAAO,EAAE,kBAAkB,GAC1B,4BAA4B,CA2B9B"}
|
|
@@ -16,12 +16,17 @@ function actionImportFunction(actionImport, service) {
|
|
|
16
16
|
const returnType = (0, return_type_1.actionImportReturnType)(actionImport);
|
|
17
17
|
return {
|
|
18
18
|
kind: ts_morph_1.StructureKind.Function,
|
|
19
|
-
name: actionImport.name
|
|
19
|
+
name: `${actionImport.name}<DeSerializersT extends DeSerializers = DefaultDeSerializers>`,
|
|
20
20
|
isExported: true,
|
|
21
21
|
parameters: [
|
|
22
22
|
{
|
|
23
23
|
name: parameterName,
|
|
24
|
-
type: actionImport.parametersTypeName
|
|
24
|
+
type: `${actionImport.parametersTypeName}<DeSerializersT>`
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'deSerializers',
|
|
28
|
+
type: 'DeSerializersT',
|
|
29
|
+
initializer: 'defaultDeSerializers as any'
|
|
25
30
|
}
|
|
26
31
|
],
|
|
27
32
|
returnType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/action-function-import/action.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AAC9C,uCAAuE;AAEvE,kDAAkE;AAClE,2EAA6E;AAC7E,yCAAqE;AACrE,+CAAuD;AAEvD,MAAM,aAAa,GAAG,YAAY,CAAC;AAEnC,uCAAuC;AACvC;;GAEG;AACH,SAAgB,oBAAoB,CAClC,YAA6B,EAC7B,OAA2B;IAE3B,MAAM,UAAU,GAAG,IAAA,oCAAsB,EAAC,YAAY,CAAC,CAAC;IACxD,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,QAAQ;QAC5B,IAAI,EAAE,YAAY,CAAC,IAAI;
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/action-function-import/action.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AAC9C,uCAAuE;AAEvE,kDAAkE;AAClE,2EAA6E;AAC7E,yCAAqE;AACrE,+CAAuD;AAEvD,MAAM,aAAa,GAAG,YAAY,CAAC;AAEnC,uCAAuC;AACvC;;GAEG;AACH,SAAgB,oBAAoB,CAClC,YAA6B,EAC7B,OAA2B;IAE3B,MAAM,UAAU,GAAG,IAAA,oCAAsB,EAAC,YAAY,CAAC,CAAC;IACxD,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,QAAQ;QAC5B,IAAI,EAAE,GAAG,YAAY,CAAC,IAAI,+DAA+D;QACzF,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,GAAG,YAAY,CAAC,kBAAkB,kBAAkB;aAC3D;YACD;gBACE,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,gBAAgB;gBACtB,WAAW,EAAE,6BAA6B;aAC3C;SACF;QACD,UAAU;QACV,UAAU,EAAE,yBAAyB,CAAC,YAAY,EAAE,OAAO,CAAC;QAC5D,IAAI,EAAE;YACJ;gBACE,iBAAiB,CAAC,YAAY,CAAC;gBAC/B,6EAA6E;gBAC7E,2GAA2G;aAC5G,CAAC,IAAI,CAAC,cAAO,CAAC;SAChB;KACF,CAAC;AACJ,CAAC;AA9BD,oDA8BC;AAED,SAAS,iBAAiB,CAAC,YAA6B;IACtD,OAAO,GAAG,YAAY,CAAC,WAAW,IAChC,IAAA,kCAAyB,EAAC,YAAY,CAAC,UAAU,CAAC;QAChD,CAAC,CAAC,kDAAuC;QACzC,CAAC,CAAC,EACN,GAAG,cAAO,EAAE,CAAC;AACf,CAAC;AAED,SAAS,yBAAyB,CAChC,YAA6B,EAC7B,OAA2B;IAE3B,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU;QACrC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,iBAAiB,EAAE,EAAE;YAC9D,IAAI,SAAS,KAAK,mBAAmB,cAAO,EAAE,EAAE;gBAC9C,SAAS,IAAI,IAAI,cAAO,EAAE,CAAC;aAC5B;YACD,SAAS,IAAI,GAAG,iBAAiB,CAAC,aAAa,gCAAgC,iBAAiB,CAAC,YAAY,OAAO,iBAAiB,CAAC,OAAO,MAAM,aAAa,IAAI,iBAAiB,CAAC,aAAa,GAAG,CAAC;YACvM,OAAO,SAAS,CAAC;QACnB,CAAC,EAAE,mBAAmB,cAAO,EAAE,CAAC,GAAG,GAAG,cAAO,GAAG;QAClD,CAAC,CAAC,IAAI,CAAC;IAET,MAAM,UAAU,GAAG,IAAA,0DAA8B,EAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACzE,MAAM,eAAe,GAAG,yCAAyC,UAAU,CAAC,IAAI,CAC9E,IAAI,CACL,IAAI,CAAC;IAEN,OAAO,OAAO,GAAG,cAAO,GAAG,cAAO,GAAG,eAAe,CAAC;AACvD,CAAC"}
|
|
@@ -13,15 +13,15 @@ const function_1 = require("./function");
|
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
15
|
function actionImportSourceFile(service) {
|
|
16
|
-
if (!service.
|
|
16
|
+
if (!service.actionImports) {
|
|
17
17
|
throw new Error('Tried to create action import source files without actions in service metadata.');
|
|
18
18
|
}
|
|
19
19
|
return {
|
|
20
20
|
kind: ts_morph_1.StructureKind.SourceFile,
|
|
21
21
|
statements: [
|
|
22
22
|
...(0, import_1.importDeclarationsFunction)(service),
|
|
23
|
-
...(0, util_1.flat)(service.
|
|
24
|
-
(0, export_statement_1.exportStatement)(service.
|
|
23
|
+
...(0, util_1.flat)(service.actionImports.map(action => actionImportStatements(action, service))),
|
|
24
|
+
(0, export_statement_1.exportStatement)(service.actionImports, 'actionImports')
|
|
25
25
|
]
|
|
26
26
|
};
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/action-function-import/file.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAC3C,uCAKkB;AAElB,iEAA6D;AAC7D,yDAAqD;AACrD,qCAAgD;AAChD,qCAAgF;AAChF,yCAAoD;AACpD,gCAAgC;AAEhC;;GAEG;AACH,SAAgB,sBAAsB,CACpC,OAA2B;IAE3B,IAAI,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/action-function-import/file.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAC3C,uCAKkB;AAElB,iEAA6D;AAC7D,yDAAqD;AACrD,qCAAgD;AAChD,qCAAgF;AAChF,yCAAoD;AACpD,gCAAgC;AAEhC;;GAEG;AACH,SAAgB,sBAAsB,CACpC,OAA2B;IAE3B,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;QAC1B,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;KACH;IACD,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,UAAU;QAC9B,UAAU,EAAE;YACV,GAAG,IAAA,mCAA0B,EAAC,OAAO,CAAC;YACtC,GAAG,IAAA,WAAI,EACL,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CACjC,sBAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,CACxC,CACF;YACD,IAAA,kCAAe,EAAC,OAAO,CAAC,aAAa,EAAE,eAAe,CAAC;SACxD;KACF,CAAC;AACJ,CAAC;AApBD,wDAoBC;AAED,SAAS,sBAAsB,CAC7B,YAA+B,EAC/B,OAA2B;IAE3B,OAAO;QACL,IAAA,0CAAmB,EAAC,YAAY,CAAC;QACjC,IAAA,6BAAoB,EAAC,YAAY,EAAE,OAAO,CAAC;KAC5C,CAAC;AACJ,CAAC;AACD;;GAEG;AACH,SAAgB,wBAAwB,CACtC,OAA2B;IAE3B,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,UAAU;QAC9B,UAAU,EAAE;YACV,GAAG,IAAA,iCAAwB,EAAC,OAAO,CAAC;YACpC,GAAG,IAAA,WAAI,EACL,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,wBAAwB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CACzE;YACD,IAAA,kCAAe,EAAC,OAAO,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAC5D;KACF,CAAC;AACJ,CAAC;AAbD,4DAaC;AAED,SAAS,wBAAwB,CAC/B,cAAiC,EACjC,OAA2B;IAE3B,OAAO;QACL,IAAA,0CAAmB,EAAC,cAAc,CAAC;QACnC,IAAA,iCAAsB,EAAC,cAAc,EAAE,OAAO,CAAC;KAChD,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../src/action-function-import/function.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAiB,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAQrE;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,iBAAiB,EACjC,OAAO,EAAE,kBAAkB,GAC1B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../src/action-function-import/function.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAiB,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAQrE;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,iBAAiB,EACjC,OAAO,EAAE,kBAAkB,GAC1B,4BAA4B,CA2B9B;AACD;;GAEG;AACH,eAAO,MAAM,uCAAuC,0IACqF,CAAC"}
|
|
@@ -15,12 +15,17 @@ function functionImportFunction(functionImport, service) {
|
|
|
15
15
|
const returnType = (0, return_type_1.functionImportReturnType)(functionImport);
|
|
16
16
|
return {
|
|
17
17
|
kind: ts_morph_1.StructureKind.Function,
|
|
18
|
-
name: functionImport.name
|
|
18
|
+
name: `${functionImport.name}<DeSerializersT extends DeSerializers = DefaultDeSerializers>`,
|
|
19
19
|
isExported: true,
|
|
20
20
|
parameters: [
|
|
21
21
|
{
|
|
22
22
|
name: parameterName,
|
|
23
|
-
type: functionImport.parametersTypeName
|
|
23
|
+
type: `${functionImport.parametersTypeName}<DeSerializersT>`
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'deSerializers',
|
|
27
|
+
type: 'DeSerializersT',
|
|
28
|
+
initializer: 'defaultDeSerializers as any'
|
|
24
29
|
}
|
|
25
30
|
],
|
|
26
31
|
returnType,
|
|
@@ -45,20 +50,13 @@ function getDocDescription(functionImport) {
|
|
|
45
50
|
: ''}`;
|
|
46
51
|
}
|
|
47
52
|
function getFunctionImportStatements(functionImport, service) {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
if (cumulator !== `const params = {${util_1.unixEOL}`) {
|
|
51
|
-
cumulator += `,${util_1.unixEOL}`;
|
|
52
|
-
}
|
|
53
|
-
cumulator += `${currentParameters.parameterName}: new FunctionImportParameter('${currentParameters.originalName}', '${currentParameters.edmType}', ${parameterName}.${currentParameters.parameterName})`;
|
|
54
|
-
return cumulator;
|
|
55
|
-
}, `const params = {${util_1.unixEOL}`) + `${util_1.unixEOL}}`
|
|
56
|
-
: '{}';
|
|
53
|
+
const paramsLines = (functionImport.parameters || []).map(param => `${param.parameterName}: new FunctionImportParameter('${param.originalName}', '${param.edmType}', ${parameterName}.${param.parameterName})`);
|
|
54
|
+
const params = `const params = {\n${paramsLines.join(',\n')}\n};`;
|
|
57
55
|
let parameters = (0, request_builder_arguments_1.getRequestBuilderArgumentsBase)(functionImport, service);
|
|
58
56
|
if (service.oDataVersion === 'v2') {
|
|
59
57
|
parameters = [`'${functionImport.httpMethod}'`, ...parameters];
|
|
60
58
|
}
|
|
61
59
|
const returnStatement = `return new FunctionImportRequestBuilder(${parameters.join(', ')});`;
|
|
62
|
-
return
|
|
60
|
+
return [params, '\n', returnStatement].join('\n');
|
|
63
61
|
}
|
|
64
62
|
//# sourceMappingURL=function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.js","sourceRoot":"","sources":["../../src/action-function-import/function.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AAC9C,uCAAuE;AAEvE,kDAAkE;AAClE,2EAA6E;AAC7E,+CAAyD;AAEzD,MAAM,aAAa,GAAG,YAAY,CAAC;AACnC,gCAAgC;AAEhC;;GAEG;AACH,SAAgB,sBAAsB,CACpC,cAAiC,EACjC,OAA2B;IAE3B,MAAM,UAAU,GAAG,IAAA,sCAAwB,EAAC,cAAc,CAAC,CAAC;IAC5D,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,QAAQ;QAC5B,IAAI,EAAE,cAAc,CAAC,IAAI;
|
|
1
|
+
{"version":3,"file":"function.js","sourceRoot":"","sources":["../../src/action-function-import/function.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AAC9C,uCAAuE;AAEvE,kDAAkE;AAClE,2EAA6E;AAC7E,+CAAyD;AAEzD,MAAM,aAAa,GAAG,YAAY,CAAC;AACnC,gCAAgC;AAEhC;;GAEG;AACH,SAAgB,sBAAsB,CACp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AI,CAAC,KAAK,CAAC,MAAM,CAAC;IAElE,IAAI,UAAU,GAAG,IAAA,0DAA8B,EAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACzE,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,EAAE;QACjC,UAAU,GAAG,CAAC,IAAI,cAAc,CAAC,UAAU,GAAG,EAAE,GAAG,UAAU,CAAC,CAAC;KAChE;IAED,MAAM,eAAe,GAAG,2CAA2C,UAAU,CAAC,IAAI,CAChF,IAAI,CACL,IAAI,CAAC;IAEN,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../src/action-function-import/import.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAiB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../src/action-function-import/import.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAiB,MAAM,UAAU,CAAC;AAErE,OAAO,EAIL,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAyHtB;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,kBAAkB,GAC1B,0BAA0B,EAAE,CAoB9B;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,kBAAkB,GAC1B,0BAA0B,EAAE,CAiB9B"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.importDeclarationsAction = exports.importDeclarationsFunction = void 0;
|
|
4
7
|
const util_1 = require("@sap-cloud-sdk/util");
|
|
5
8
|
const ts_morph_1 = require("ts-morph");
|
|
9
|
+
const voca_1 = __importDefault(require("voca"));
|
|
6
10
|
const vdm_types_1 = require("../vdm-types");
|
|
7
11
|
const imports_1 = require("../imports");
|
|
8
12
|
const common_1 = require("../edmx-to-vdm/common");
|
|
9
13
|
const response_transformer_function_1 = require("./response-transformer-function");
|
|
10
14
|
/* eslint-disable valid-jsdoc */
|
|
11
|
-
function actionFunctionImportDeclarations(returnTypes, parameters, additionalImports, oDataVersion) {
|
|
15
|
+
function actionFunctionImportDeclarations(returnTypes, parameters, additionalImports, { oDataVersion, className }) {
|
|
12
16
|
const responseTransformerFunctionCommon = returnTypes.find(returnType => (0, common_1.isEntityNotDeserializable)(returnType))
|
|
13
17
|
? ['throwErrorWhenReturnTypeIsUnionType']
|
|
14
18
|
: [];
|
|
@@ -23,23 +27,29 @@ function actionFunctionImportDeclarations(returnTypes, parameters, additionalImp
|
|
|
23
27
|
}, [[], []]);
|
|
24
28
|
return [
|
|
25
29
|
...(0, imports_1.externalImportDeclarations)(parameters),
|
|
26
|
-
(0, imports_1.odataCommonImportDeclaration)([
|
|
27
|
-
...(0, imports_1.propertyTypeImportNames)(parameters),
|
|
28
|
-
...common,
|
|
29
|
-
...responseTransformerFunctionCommon
|
|
30
|
-
]),
|
|
31
30
|
(0, imports_1.odataImportDeclaration)([
|
|
32
31
|
...edmRelatedImports(returnTypes),
|
|
33
32
|
...complexTypeRelatedImports(returnTypes),
|
|
34
33
|
...version,
|
|
35
|
-
...responseTransformerFunctionVersionDependent
|
|
34
|
+
...responseTransformerFunctionVersionDependent,
|
|
35
|
+
'DeSerializers',
|
|
36
|
+
'DefaultDeSerializers',
|
|
37
|
+
'defaultDeSerializers',
|
|
38
|
+
...(0, imports_1.propertyTypeImportNames)(parameters),
|
|
39
|
+
...common,
|
|
40
|
+
...responseTransformerFunctionCommon
|
|
36
41
|
], oDataVersion),
|
|
42
|
+
{
|
|
43
|
+
kind: ts_morph_1.StructureKind.ImportDeclaration,
|
|
44
|
+
namedImports: [voca_1.default.decapitalize(className)],
|
|
45
|
+
moduleSpecifier: './service'
|
|
46
|
+
},
|
|
37
47
|
...returnTypeImports(returnTypes)
|
|
38
48
|
];
|
|
39
49
|
}
|
|
40
50
|
function complexTypeRelatedImports(returnTypes) {
|
|
41
51
|
return returnTypes.some(returnType => returnType.returnTypeCategory === vdm_types_1.VdmReturnTypeCategory.COMPLEX_TYPE)
|
|
42
|
-
? ['
|
|
52
|
+
? ['entityDeserializer']
|
|
43
53
|
: [];
|
|
44
54
|
}
|
|
45
55
|
function edmRelatedImports(returnTypes) {
|
|
@@ -52,28 +62,41 @@ function returnTypeImports(returnTypes) {
|
|
|
52
62
|
.filter(returnType => returnType.returnTypeCategory !== vdm_types_1.VdmReturnTypeCategory.EDM_TYPE &&
|
|
53
63
|
returnType.returnTypeCategory !== vdm_types_1.VdmReturnTypeCategory.VOID &&
|
|
54
64
|
returnType.returnTypeCategory !== vdm_types_1.VdmReturnTypeCategory.NEVER)
|
|
55
|
-
.
|
|
65
|
+
.reduce((imports, returnType) => [...imports, ...returnTypeImport(returnType)], []));
|
|
56
66
|
}
|
|
57
67
|
function returnTypeImport(returnType) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
const typeImports = [
|
|
69
|
+
{
|
|
70
|
+
kind: ts_morph_1.StructureKind.ImportDeclaration,
|
|
71
|
+
namedImports: [returnType.returnType],
|
|
72
|
+
moduleSpecifier: `./${returnType.returnType}`
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
if (returnType.returnTypeCategory === vdm_types_1.VdmReturnTypeCategory.ENTITY) {
|
|
76
|
+
return [
|
|
77
|
+
...typeImports,
|
|
78
|
+
{
|
|
79
|
+
kind: ts_morph_1.StructureKind.ImportDeclaration,
|
|
80
|
+
namedImports: [`${returnType.returnType}Api`],
|
|
81
|
+
moduleSpecifier: `./${returnType.returnType}Api`
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
return typeImports;
|
|
63
86
|
}
|
|
64
87
|
/**
|
|
65
88
|
* @internal
|
|
66
89
|
*/
|
|
67
90
|
function importDeclarationsFunction(service) {
|
|
68
|
-
if (!service.
|
|
91
|
+
if (!service.actionImports) {
|
|
69
92
|
return [];
|
|
70
93
|
}
|
|
71
|
-
const actionImportPayloadElements = (0, util_1.flat)(service.
|
|
72
|
-
const returnTypes = service.
|
|
94
|
+
const actionImportPayloadElements = (0, util_1.flat)(service.actionImports.map(actionImport => actionImport.parameters));
|
|
95
|
+
const returnTypes = service.actionImports.map(actionImport => actionImport.returnType);
|
|
73
96
|
return actionFunctionImportDeclarations(returnTypes, actionImportPayloadElements, [
|
|
74
97
|
{ name: 'ActionImportRequestBuilder', version: service.oDataVersion },
|
|
75
98
|
{ name: 'ActionImportParameter', version: service.oDataVersion }
|
|
76
|
-
], service
|
|
99
|
+
], service);
|
|
77
100
|
}
|
|
78
101
|
exports.importDeclarationsFunction = importDeclarationsFunction;
|
|
79
102
|
/**
|
|
@@ -84,8 +107,9 @@ function importDeclarationsAction(service) {
|
|
|
84
107
|
const returnTypes = service.functionImports.map(functionImport => functionImport.returnType);
|
|
85
108
|
return actionFunctionImportDeclarations(returnTypes, functionImportParameters, [
|
|
86
109
|
{ name: 'FunctionImportRequestBuilder', version: service.oDataVersion },
|
|
110
|
+
{ name: 'DeSerializers', version: service.oDataVersion },
|
|
87
111
|
{ name: 'FunctionImportParameter', version: 'common' }
|
|
88
|
-
], service
|
|
112
|
+
], service);
|
|
89
113
|
}
|
|
90
114
|
exports.importDeclarationsAction = importDeclarationsAction;
|
|
91
115
|
//# sourceMappingURL=import.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/action-function-import/import.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/action-function-import/import.ts"],"names":[],"mappings":";;;;;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AAO,CAAC,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,CACzE,CAAC;IACF,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,GAAG,CAC7C,cAAc,CAAC,EAAE,CAAC,cAAc,CAAC,UAAU,CAC5C,CAAC;IACF,OAAO,gCAAgC,CACrC,WAAW,EACX,wBAAwB,EACxB;QACE,EAAE,IAAI,EAAE,8BAA8B,EAAE,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE;QACvE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE;QACxD,EAAE,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,QAAQ,EAAE;KACvD,EACD,OAAO,CACR,CAAC;AACJ,CAAC;AAnBD,4DAmBC"}
|
|
@@ -10,7 +10,7 @@ const typedoc_1 = require("../typedoc");
|
|
|
10
10
|
function parametersInterface(actionFunctionImport) {
|
|
11
11
|
return {
|
|
12
12
|
kind: ts_morph_1.StructureKind.Interface,
|
|
13
|
-
name: actionFunctionImport.parametersTypeName
|
|
13
|
+
name: `${actionFunctionImport.parametersTypeName}<DeSerializersT extends DeSerializers>`,
|
|
14
14
|
isExported: true,
|
|
15
15
|
properties: actionFunctionImport.parameters.map(parameter => ({
|
|
16
16
|
name: parameter.parameterName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameters-interface.js","sourceRoot":"","sources":["../../src/action-function-import/parameters-interface.ts"],"names":[],"mappings":";;;AAAA,uCAAwE;AAExE,wCAA+C;AAC/C,gCAAgC;AAEhC;;GAEG;AACH,SAAgB,mBAAmB,CACjC,oBAAyD;IAEzD,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,SAAS;QAC7B,IAAI,EAAE,oBAAoB,CAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"parameters-interface.js","sourceRoot":"","sources":["../../src/action-function-import/parameters-interface.ts"],"names":[],"mappings":";;;AAAA,uCAAwE;AAExE,wCAA+C;AAC/C,gCAAgC;AAEhC;;GAEG;AACH,SAAgB,mBAAmB,CACjC,oBAAyD;IAEzD,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,SAAS;QAC7B,IAAI,EAAE,GAAG,oBAAoB,CAAC,kBAAkB,wCAAwC;QACxF,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,oBAAoB,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YAC5D,IAAI,EAAE,SAAS,CAAC,aAAa;YAC7B,IAAI,EAAE,SAAS,CAAC,QAAQ;gBACtB,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,SAAS;gBAC9B,CAAC,CAAC,SAAS,CAAC,MAAM;YACpB,gBAAgB,EAAE,SAAS,CAAC,QAAQ;YACpC,IAAI,EAAE,CAAC,IAAA,2BAAiB,EAAC,SAAS,CAAC,WAAW,CAAC,CAAC;SACjD,CAAC,CAAC;QACH,IAAI,EAAE;YACJ,IAAA,2BAAiB,EACf,4CAA4C,oBAAoB,CAAC,IAAI,KAAK,CAC3E;SACF;KACF,CAAC;AACJ,CAAC;AArBD,kDAqBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-builder-arguments.d.ts","sourceRoot":"","sources":["../../src/action-function-import/request-builder-arguments.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAKtB;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,oBAAoB,EAAE,iBAAiB,GAAG,eAAe,EACzD,OAAO,EAAE,kBAAkB,GAC1B,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"request-builder-arguments.d.ts","sourceRoot":"","sources":["../../src/action-function-import/request-builder-arguments.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAKtB;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,oBAAoB,EAAE,iBAAiB,GAAG,eAAe,EACzD,OAAO,EAAE,kBAAkB,GAC1B,MAAM,EAAE,CASV"}
|
|
@@ -13,7 +13,8 @@ function getRequestBuilderArgumentsBase(actionFunctionImport, service) {
|
|
|
13
13
|
`'${service.servicePath}'`,
|
|
14
14
|
`'${actionFunctionImport.originalName}'`,
|
|
15
15
|
transformer,
|
|
16
|
-
'params'
|
|
16
|
+
'params',
|
|
17
|
+
'deSerializers'
|
|
17
18
|
];
|
|
18
19
|
}
|
|
19
20
|
exports.getRequestBuilderArgumentsBase = getRequestBuilderArgumentsBase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-builder-arguments.js","sourceRoot":"","sources":["../../src/action-function-import/request-builder-arguments.ts"],"names":[],"mappings":";;;AAKA,kDAAkE;AAClE,mFAAkF;AAElF,uCAAuC;AACvC;;GAEG;AACH,SAAgB,8BAA8B,CAC5C,oBAAyD,EACzD,OAA2B;IAE3B,MAAM,WAAW,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC;IACzD,OAAO;QACL,IAAI,OAAO,CAAC,WAAW,GAAG;QAC1B,IAAI,oBAAoB,CAAC,YAAY,GAAG;QACxC,WAAW;QACX,QAAQ;
|
|
1
|
+
{"version":3,"file":"request-builder-arguments.js","sourceRoot":"","sources":["../../src/action-function-import/request-builder-arguments.ts"],"names":[],"mappings":";;;AAKA,kDAAkE;AAClE,mFAAkF;AAElF,uCAAuC;AACvC;;GAEG;AACH,SAAgB,8BAA8B,CAC5C,oBAAyD,EACzD,OAA2B;IAE3B,MAAM,WAAW,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC;IACzD,OAAO;QACL,IAAI,OAAO,CAAC,WAAW,GAAG;QAC1B,IAAI,oBAAoB,CAAC,YAAY,GAAG;QACxC,WAAW;QACX,QAAQ;QACR,eAAe;KAChB,CAAC;AACJ,CAAC;AAZD,wEAYC;AAED,SAAS,cAAc,CACrB,oBAAyD;IAEzD,IAAI,IAAA,kCAAyB,EAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE;QAC9D,OAAO,wDAAwD,oBAAoB,CAAC,YAAY,IAAI,CAAC;KACtG;IACD,IAAI,oBAAoB,CAAC,UAAU,CAAC,eAAe,EAAE;QACnD,OAAO,aAAa,IAAA,+DAA+B,EACjD,oBAAoB,CAAC,UAAU,CAChC,UAAU,oBAAoB,CAAC,UAAU,CAAC,eAAe,GAAG,CAAC;KAC/D;IACD,MAAM,KAAK,CACT,uCAAuC,oBAAoB,CAAC,YAAY,kCAAkC,oBAAoB,CAAC,UAAU,CAAC,eAAe,cAAc,CACxK,CAAC;AACJ,CAAC"}
|
|
@@ -20,7 +20,7 @@ function actionFunctionImportReturnType(actionOrFunctionImport, requestBuilderNa
|
|
|
20
20
|
return type;
|
|
21
21
|
}
|
|
22
22
|
function wrapRequestBuilderAroundType(requestBuilderName, parameterName, type) {
|
|
23
|
-
return `${requestBuilderName}
|
|
23
|
+
return `${requestBuilderName}<DeSerializersT, ${parameterName}<DeSerializersT>, ${type}>`;
|
|
24
24
|
}
|
|
25
25
|
/* eslint-disable valid-jsdoc */
|
|
26
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"return-type.js","sourceRoot":"","sources":["../../src/action-function-import/return-type.ts"],"names":[],"mappings":";;;AACA,kDAAkE;AAElE,SAAS,8BAA8B,CACrC,sBAA2D,EAC3D,kBAA0B;IAE1B,IAAI,IAAI,GAAG,sBAAsB,CAAC,UAAU,CAAC,UAAU,CAAC;IACxD,MAAM,UAAU,GAAG,sBAAsB,CAAC,UAAU,CAAC;IAErD,IAAI,IAAA,kCAAyB,EAAC,UAAU,CAAC,EAAE;QACzC,IAAI,GAAG,4BAA4B,CACjC,kBAAkB,EAClB,sBAAsB,CAAC,kBAAkB,EACzC,IAAI,CACL,CAAC;QACF,IAAI,GAAG,QAAQ,IAAI,cAAc,CAAC;QAClC,OAAO,IAAI,CAAC;KACb;IAED,IAAI,UAAU,CAAC,YAAY,EAAE;QAC3B,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC;KACpB;IAED,IAAI,UAAU,CAAC,UAAU,EAAE;QACzB,IAAI,GAAG,GAAG,IAAI,SAAS,CAAC;KACzB;IACD,IAAI,GAAG,4BAA4B,CACjC,kBAAkB,EAClB,sBAAsB,CAAC,kBAAkB,EACzC,IAAI,CACL,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,4BAA4B,CACnC,kBAA0B,EAC1B,aAAqB,EACrB,IAAY;IAEZ,OAAO,GAAG,kBAAkB,
|
|
1
|
+
{"version":3,"file":"return-type.js","sourceRoot":"","sources":["../../src/action-function-import/return-type.ts"],"names":[],"mappings":";;;AACA,kDAAkE;AAElE,SAAS,8BAA8B,CACrC,sBAA2D,EAC3D,kBAA0B;IAE1B,IAAI,IAAI,GAAG,sBAAsB,CAAC,UAAU,CAAC,UAAU,CAAC;IACxD,MAAM,UAAU,GAAG,sBAAsB,CAAC,UAAU,CAAC;IAErD,IAAI,IAAA,kCAAyB,EAAC,UAAU,CAAC,EAAE;QACzC,IAAI,GAAG,4BAA4B,CACjC,kBAAkB,EAClB,sBAAsB,CAAC,kBAAkB,EACzC,IAAI,CACL,CAAC;QACF,IAAI,GAAG,QAAQ,IAAI,cAAc,CAAC;QAClC,OAAO,IAAI,CAAC;KACb;IAED,IAAI,UAAU,CAAC,YAAY,EAAE;QAC3B,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC;KACpB;IAED,IAAI,UAAU,CAAC,UAAU,EAAE;QACzB,IAAI,GAAG,GAAG,IAAI,SAAS,CAAC;KACzB;IACD,IAAI,GAAG,4BAA4B,CACjC,kBAAkB,EAClB,sBAAsB,CAAC,kBAAkB,EACzC,IAAI,CACL,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,4BAA4B,CACnC,kBAA0B,EAC1B,aAAqB,EACrB,IAAY;IAEZ,OAAO,GAAG,kBAAkB,oBAAoB,aAAa,qBAAqB,IAAI,GAAG,CAAC;AAC5F,CAAC;AACD,gCAAgC;AAEhC;;GAEG;AACH,SAAgB,sBAAsB,CAAC,YAA6B;IAClE,OAAO,8BAA8B,CACnC,YAAY,EACZ,4BAA4B,CAC7B,CAAC;AACJ,CAAC;AALD,wDAKC;AACD;;GAEG;AACH,SAAgB,wBAAwB,CACtC,YAA6B;IAE7B,OAAO,8BAA8B,CACnC,YAAY,EACZ,8BAA8B,CAC/B,CAAC;AACJ,CAAC;AAPD,4DAOC"}
|
package/dist/batch/file.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/batch/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAiB,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAMlD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,kBAAkB,GAC1B,mBAAmB,
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/batch/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAiB,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAMlD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,kBAAkB,GAC1B,mBAAmB,CAYrB"}
|
package/dist/batch/file.js
CHANGED
|
@@ -17,17 +17,10 @@ function batchSourceFile(service) {
|
|
|
17
17
|
(0, function_1.batchFunction)(service),
|
|
18
18
|
(0, function_1.changesetFunction)(service),
|
|
19
19
|
`export const default${service.className}Path = '${service.servicePath}';`,
|
|
20
|
-
`const map = ${mappingInitializer(service)};`,
|
|
21
20
|
(0, type_1.readRequestType)(service),
|
|
22
21
|
(0, type_1.writeRequestType)(service)
|
|
23
22
|
]
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
exports.batchSourceFile = batchSourceFile;
|
|
27
|
-
function mappingInitializer(service) {
|
|
28
|
-
const mapBody = service.entities
|
|
29
|
-
.map(e => `'${e.entitySetName}' : ${e.className}`)
|
|
30
|
-
.join(', ');
|
|
31
|
-
return `{${mapBody}}`;
|
|
32
|
-
}
|
|
33
26
|
//# sourceMappingURL=file.js.map
|
package/dist/batch/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/batch/file.ts"],"names":[],"mappings":";;;AAAA,uCAA8D;AAE9D,yCAA8D;AAC9D,uCAAoD;AACpD,iCAA2D;AAC3D,gCAAgC;AAEhC;;GAEG;AACH,SAAgB,eAAe,CAC7B,OAA2B;IAE3B,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,UAAU;QAC9B,UAAU,EAAE;YACV,GAAG,IAAA,iCAAuB,EAAC,OAAO,CAAC;YACnC,IAAA,wBAAa,EAAC,OAAO,CAAC;YACtB,IAAA,4BAAiB,EAAC,OAAO,CAAC;YAC1B,uBAAuB,OAAO,CAAC,SAAS,WAAW,OAAO,CAAC,WAAW,IAAI;YAC1E,
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/batch/file.ts"],"names":[],"mappings":";;;AAAA,uCAA8D;AAE9D,yCAA8D;AAC9D,uCAAoD;AACpD,iCAA2D;AAC3D,gCAAgC;AAEhC;;GAEG;AACH,SAAgB,eAAe,CAC7B,OAA2B;IAE3B,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,UAAU;QAC9B,UAAU,EAAE;YACV,GAAG,IAAA,iCAAuB,EAAC,OAAO,CAAC;YACnC,IAAA,wBAAa,EAAC,OAAO,CAAC;YACtB,IAAA,4BAAiB,EAAC,OAAO,CAAC;YAC1B,uBAAuB,OAAO,CAAC,SAAS,WAAW,OAAO,CAAC,WAAW,IAAI;YAC1E,IAAA,sBAAe,EAAC,OAAO,CAAC;YACxB,IAAA,uBAAgB,EAAC,OAAO,CAAC;SAC1B;KACF,CAAC;AACJ,CAAC;AAdD,0CAcC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../src/batch/function.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,4BAA4B,EAE7B,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,kBAAkB,GAC1B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../src/batch/function.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,4BAA4B,EAE7B,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,kBAAkB,GAC1B,4BAA4B,CAqD9B;AACD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,kBAAkB,GAC1B,4BAA4B,CAmD9B"}
|
package/dist/batch/function.js
CHANGED
|
@@ -28,25 +28,28 @@ function batchFunction(service) {
|
|
|
28
28
|
{
|
|
29
29
|
kind: ts_morph_1.StructureKind.FunctionOverload,
|
|
30
30
|
parameters: [{ name: '...requests', type: asArray(type) }],
|
|
31
|
-
returnType: 'ODataBatchRequestBuilder',
|
|
31
|
+
returnType: 'ODataBatchRequestBuilder<DeSerializersT>',
|
|
32
32
|
docs
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
kind: ts_morph_1.StructureKind.FunctionOverload,
|
|
36
36
|
parameters: [{ name: 'requests', type: asArray(type) }],
|
|
37
|
-
returnType: 'ODataBatchRequestBuilder'
|
|
37
|
+
returnType: 'ODataBatchRequestBuilder<DeSerializersT>'
|
|
38
38
|
}
|
|
39
39
|
];
|
|
40
40
|
return {
|
|
41
41
|
kind: ts_morph_1.StructureKind.Function,
|
|
42
|
-
name: 'batch',
|
|
42
|
+
name: 'batch<DeSerializersT extends DeSerializers>',
|
|
43
43
|
isExported: true,
|
|
44
44
|
parameters: [
|
|
45
45
|
{ name: 'first', type: `undefined|${type}|${asArray(type)}` },
|
|
46
46
|
{ name: '...rest', type: asArray(type) }
|
|
47
47
|
],
|
|
48
|
-
returnType: 'ODataBatchRequestBuilder',
|
|
49
|
-
statements: `return new ODataBatchRequestBuilder(
|
|
48
|
+
returnType: 'ODataBatchRequestBuilder<DeSerializersT>',
|
|
49
|
+
statements: `return new ODataBatchRequestBuilder(
|
|
50
|
+
default${service.className}Path,
|
|
51
|
+
variadicArgumentToArray(first,rest)
|
|
52
|
+
);`,
|
|
50
53
|
overloads
|
|
51
54
|
};
|
|
52
55
|
}
|
|
@@ -55,7 +58,7 @@ exports.batchFunction = batchFunction;
|
|
|
55
58
|
* @internal
|
|
56
59
|
*/
|
|
57
60
|
function changesetFunction(service) {
|
|
58
|
-
const type = `Write${service.className}RequestBuilder
|
|
61
|
+
const type = `Write${service.className}RequestBuilder<DeSerializersT>`;
|
|
59
62
|
const docs = [
|
|
60
63
|
(0, typedoc_1.addLeadingNewline)((0, typedoc_1.getFunctionDoc)(`Change set constructor consists of write operations supported on the ${service.speakingModuleName}.`, {
|
|
61
64
|
params: [
|
|
@@ -75,24 +78,24 @@ function changesetFunction(service) {
|
|
|
75
78
|
{
|
|
76
79
|
kind: ts_morph_1.StructureKind.FunctionOverload,
|
|
77
80
|
parameters: [{ name: '...requests', type: asArray(type) }],
|
|
78
|
-
returnType:
|
|
81
|
+
returnType: 'BatchChangeSet<DeSerializersT>',
|
|
79
82
|
docs
|
|
80
83
|
},
|
|
81
84
|
{
|
|
82
85
|
kind: ts_morph_1.StructureKind.FunctionOverload,
|
|
83
86
|
parameters: [{ name: 'requests', type: asArray(type) }],
|
|
84
|
-
returnType:
|
|
87
|
+
returnType: 'BatchChangeSet<DeSerializersT>'
|
|
85
88
|
}
|
|
86
89
|
];
|
|
87
90
|
return {
|
|
88
91
|
kind: ts_morph_1.StructureKind.Function,
|
|
89
|
-
name: 'changeset',
|
|
92
|
+
name: 'changeset<DeSerializersT extends DeSerializers>',
|
|
90
93
|
isExported: true,
|
|
91
94
|
parameters: [
|
|
92
95
|
{ name: 'first', type: `undefined|${type}|${asArray(type)}` },
|
|
93
96
|
{ name: '...rest', type: asArray(type) }
|
|
94
97
|
],
|
|
95
|
-
returnType:
|
|
98
|
+
returnType: 'BatchChangeSet<DeSerializersT>',
|
|
96
99
|
statements: 'return new BatchChangeSet(variadicArgumentToArray(first,rest));',
|
|
97
100
|
overloads
|
|
98
101
|
};
|
|
@@ -102,6 +105,6 @@ function asArray(type) {
|
|
|
102
105
|
return `Array<${type}>`;
|
|
103
106
|
}
|
|
104
107
|
function getBatchParameterType(service) {
|
|
105
|
-
return `Read${service.className}RequestBuilder | BatchChangeSet<
|
|
108
|
+
return `Read${service.className}RequestBuilder<DeSerializersT> | BatchChangeSet<DeSerializersT>`;
|
|
106
109
|
}
|
|
107
110
|
//# sourceMappingURL=function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.js","sourceRoot":"","sources":["../../src/batch/function.ts"],"names":[],"mappings":";;;AAAA,uCAIkB;AAClB,wCAA+D;AAE/D,gCAAgC;AAEhC;;GAEG;AACH,SAAgB,aAAa,CAC3B,OAA2B;IAE3B,MAAM,IAAI,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAE5C,MAAM,IAAI,GAAG;QACX,IAAA,2BAAiB,EACf,IAAA,wBAAc,EACZ,iDAAiD,OAAO,CAAC,kBAAkB,GAAG,EAC9E;YACE,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,gDAAgD;oBACtD,WAAW,EAAE,2BAA2B;iBACzC;aACF;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,2BAA2B;gBACjC,WAAW,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AU,EAAE,gCAAgC;SAC7C;KACF,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,QAAQ;QAC5B,IAAI,EAAE,iDAAiD;QACvD,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE;YACV,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE;YAC7D,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE;SACzC;QACD,UAAU,EAAE,gCAAgC;QAC5C,UAAU,EACR,iEAAiE;QACnE,SAAS;KACV,CAAC;AACJ,CAAC;AArDD,8CAqDC;AAED,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,SAAS,IAAI,GAAG,CAAC;AAC1B,CAAC;AAED,SAAS,qBAAqB,CAAC,OAA2B;IACxD,OAAO,OAAO,OAAO,CAAC,SAAS,iEAAiE,CAAC;AACnG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/batch/imports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAiB,MAAM,UAAU,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,kBAAkB,GAC1B,0BAA0B,EAAE,
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/batch/imports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAiB,MAAM,UAAU,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,kBAAkB,GAC1B,0BAA0B,EAAE,CA0B9B"}
|
package/dist/batch/imports.js
CHANGED
|
@@ -12,10 +12,12 @@ function importBatchDeclarations(service) {
|
|
|
12
12
|
(0, imports_1.odataImportDeclaration)([
|
|
13
13
|
'CreateRequestBuilder',
|
|
14
14
|
'DeleteRequestBuilder',
|
|
15
|
+
'DeSerializers',
|
|
15
16
|
'GetAllRequestBuilder',
|
|
16
17
|
'GetByKeyRequestBuilder',
|
|
17
18
|
'ODataBatchRequestBuilder',
|
|
18
|
-
'UpdateRequestBuilder'
|
|
19
|
+
'UpdateRequestBuilder',
|
|
20
|
+
'BatchChangeSet'
|
|
19
21
|
], service.oDataVersion),
|
|
20
22
|
{
|
|
21
23
|
kind: ts_morph_1.StructureKind.ImportDeclaration,
|
|
@@ -26,11 +28,6 @@ function importBatchDeclarations(service) {
|
|
|
26
28
|
kind: ts_morph_1.StructureKind.ImportDeclaration,
|
|
27
29
|
moduleSpecifier: './index',
|
|
28
30
|
namedImports: getNamedImports(service)
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
kind: ts_morph_1.StructureKind.ImportDeclaration,
|
|
32
|
-
moduleSpecifier: '@sap-cloud-sdk/odata-common/internal',
|
|
33
|
-
namedImports: ['BatchChangeSet']
|
|
34
31
|
}
|
|
35
32
|
];
|
|
36
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.js","sourceRoot":"","sources":["../../src/batch/imports.ts"],"names":[],"mappings":";;;AAAA,uCAAqE;AACrE,wCAAoD;AAGpD,uCAAuC;AACvC;;GAEG;AACH,SAAgB,uBAAuB,CACrC,OAA2B;IAE3B,OAAO;QACL,IAAA,gCAAsB,EACpB;YACE,sBAAsB;YACtB,sBAAsB;YACtB,sBAAsB;YACtB,wBAAwB;YACxB,0BAA0B;YAC1B,sBAAsB;
|
|
1
|
+
{"version":3,"file":"imports.js","sourceRoot":"","sources":["../../src/batch/imports.ts"],"names":[],"mappings":";;;AAAA,uCAAqE;AACrE,wCAAoD;AAGpD,uCAAuC;AACvC;;GAEG;AACH,SAAgB,uBAAuB,CACrC,OAA2B;IAE3B,OAAO;QACL,IAAA,gCAAsB,EACpB;YACE,sBAAsB;YACtB,sBAAsB;YACtB,eAAe;YACf,sBAAsB;YACtB,wBAAwB;YACxB,0BAA0B;YAC1B,sBAAsB;YACtB,gBAAgB;SACjB,EACD,OAAO,CAAC,YAAY,CACrB;QACD;YACE,IAAI,EAAE,wBAAa,CAAC,iBAAiB;YACrC,eAAe,EAAE,qBAAqB;YACtC,YAAY,EAAE,CAAC,yBAAyB,CAAC;SAC1C;QACD;YACE,IAAI,EAAE,wBAAa,CAAC,iBAAiB;YACrC,eAAe,EAAE,SAAS;YAC1B,YAAY,EAAE,eAAe,CAAC,OAAO,CAAC;SACvC;KACF,CAAC;AACJ,CAAC;AA5BD,0DA4BC;AAED,SAAS,eAAe,CAAC,OAA2B;IAClD,OAAO,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAChD,CAAC"}
|
package/dist/batch/type.js
CHANGED
|
@@ -9,7 +9,7 @@ const ts_morph_1 = require("ts-morph");
|
|
|
9
9
|
function readRequestType(service) {
|
|
10
10
|
return {
|
|
11
11
|
kind: ts_morph_1.StructureKind.TypeAlias,
|
|
12
|
-
name: `Read${service.className}RequestBuilder
|
|
12
|
+
name: `Read${service.className}RequestBuilder<DeSerializersT extends DeSerializers>`,
|
|
13
13
|
isExported: true,
|
|
14
14
|
type: getReadRequestType(service)
|
|
15
15
|
};
|
|
@@ -21,7 +21,7 @@ exports.readRequestType = readRequestType;
|
|
|
21
21
|
function writeRequestType(service) {
|
|
22
22
|
return {
|
|
23
23
|
kind: ts_morph_1.StructureKind.TypeAlias,
|
|
24
|
-
name: `Write${service.className}RequestBuilder
|
|
24
|
+
name: `Write${service.className}RequestBuilder<DeSerializersT extends DeSerializers>`,
|
|
25
25
|
isExported: true,
|
|
26
26
|
type: getWriteRequestType(service)
|
|
27
27
|
};
|
|
@@ -29,12 +29,12 @@ function writeRequestType(service) {
|
|
|
29
29
|
exports.writeRequestType = writeRequestType;
|
|
30
30
|
function getWriteRequestType(service) {
|
|
31
31
|
return service.entities
|
|
32
|
-
.map(e => `CreateRequestBuilder<${e.className}> | UpdateRequestBuilder<${e.className}> | DeleteRequestBuilder<${e.className}>`)
|
|
32
|
+
.map(e => `CreateRequestBuilder<${e.className}, DeSerializersT> | UpdateRequestBuilder<${e.className}, DeSerializersT> | DeleteRequestBuilder<${e.className}, DeSerializersT>`)
|
|
33
33
|
.join(' | ');
|
|
34
34
|
}
|
|
35
35
|
function getReadRequestType(service) {
|
|
36
36
|
return Array.prototype
|
|
37
|
-
.concat(service.entities.map(e => `GetAllRequestBuilder<${e.className}>`), service.entities.map(e => `GetByKeyRequestBuilder<${e.className}>`))
|
|
37
|
+
.concat(service.entities.map(e => `GetAllRequestBuilder<${e.className}, DeSerializersT>`), service.entities.map(e => `GetByKeyRequestBuilder<${e.className}, DeSerializersT>`))
|
|
38
38
|
.join('|');
|
|
39
39
|
}
|
|
40
40
|
//# sourceMappingURL=type.js.map
|
package/dist/batch/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/batch/type.ts"],"names":[],"mappings":";;;AAAA,uCAAwE;AAExE,gCAAgC;AAEhC;;GAEG;AACH,SAAgB,eAAe,CAC7B,OAA2B;IAE3B,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,SAAS;QAC7B,IAAI,EAAE,OAAO,OAAO,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/batch/type.ts"],"names":[],"mappings":";;;AAAA,uCAAwE;AAExE,gCAAgC;AAEhC;;GAEG;AACH,SAAgB,eAAe,CAC7B,OAA2B;IAE3B,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,SAAS;QAC7B,IAAI,EAAE,OAAO,OAAO,CAAC,SAAS,sDAAsD;QACpF,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,kBAAkB,CAAC,OAAO,CAAC;KAClC,CAAC;AACJ,CAAC;AATD,0CASC;AACD;;GAEG;AACH,SAAgB,gBAAgB,CAC9B,OAA2B;IAE3B,OAAO;QACL,IAAI,EAAE,wBAAa,CAAC,SAAS;QAC7B,IAAI,EAAE,QAAQ,OAAO,CAAC,SAAS,sDAAsD;QACrF,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,mBAAmB,CAAC,OAAO,CAAC;KACnC,CAAC;AACJ,CAAC;AATD,4CASC;AAED,SAAS,mBAAmB,CAAC,OAA2B;IACtD,OAAO,OAAO,CAAC,QAAQ;SACpB,GAAG,CACF,CAAC,CAAC,EAAE,CACF,wBAAwB,CAAC,CAAC,SAAS,4CAA4C,CAAC,CAAC,SAAS,4CAA4C,CAAC,CAAC,SAAS,mBAAmB,CACvK;SACA,IAAI,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC;AAED,SAAS,kBAAkB,CAAC,OAA2B;IACrD,OAAO,KAAK,CAAC,SAAS;SACnB,MAAM,CACL,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,CAAC,CAAC,EAAE,CAAC,wBAAwB,CAAC,CAAC,SAAS,mBAAmB,CAC5D,EACD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,CAAC,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,SAAS,mBAAmB,CAC9D,CACF;SACA,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-type-class.d.ts","sourceRoot":"","sources":["../../src/complex-type/field-type-class.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EAI1B,MAAM,UAAU,CAAC;AAMlB,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3D;;GAEG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,cAAc,GAC1B,yBAAyB,
|
|
1
|
+
{"version":3,"file":"field-type-class.d.ts","sourceRoot":"","sources":["../../src/complex-type/field-type-class.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EAI1B,MAAM,UAAU,CAAC;AAMlB,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3D;;GAEG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,cAAc,GAC1B,yBAAyB,CA+C3B;AAsBD;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAsBxE"}
|
|
@@ -12,16 +12,16 @@ const typedoc_1 = require("../typedoc");
|
|
|
12
12
|
function fieldTypeClass(complexType) {
|
|
13
13
|
return {
|
|
14
14
|
kind: ts_morph_1.StructureKind.Class,
|
|
15
|
-
name: `${complexType.fieldType}<EntityT extends Entity, NullableT extends boolean = false, SelectableT extends boolean = false>`,
|
|
16
|
-
extends: `ComplexTypeField<EntityT, ${complexType.typeName}, NullableT, SelectableT>`,
|
|
15
|
+
name: `${complexType.fieldType}<EntityT extends Entity, DeSerializersT extends DeSerializers = DefaultDeSerializers, NullableT extends boolean = false, SelectableT extends boolean = false>`,
|
|
16
|
+
extends: `ComplexTypeField<EntityT, DeSerializersT, ${complexType.typeName}, NullableT, SelectableT>`,
|
|
17
17
|
isExported: true,
|
|
18
18
|
properties: [
|
|
19
19
|
{
|
|
20
20
|
kind: ts_morph_1.StructureKind.Property,
|
|
21
21
|
scope: ts_morph_1.Scope.Private,
|
|
22
22
|
name: '_fieldBuilder',
|
|
23
|
-
type: 'FieldBuilder<this>',
|
|
24
|
-
initializer: 'new FieldBuilder(this)'
|
|
23
|
+
type: 'FieldBuilder<this, DeSerializersT>',
|
|
24
|
+
initializer: 'new FieldBuilder(this, this.deSerializers)'
|
|
25
25
|
},
|
|
26
26
|
...properties(complexType)
|
|
27
27
|
],
|
|
@@ -37,6 +37,10 @@ function fieldTypeClass(complexType) {
|
|
|
37
37
|
name: 'fieldOf',
|
|
38
38
|
type: 'ConstructorOrField<EntityT>'
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
name: 'deSerializers',
|
|
42
|
+
type: 'DeSerializersT'
|
|
43
|
+
},
|
|
40
44
|
{
|
|
41
45
|
name: 'fieldOptions',
|
|
42
46
|
type: 'FieldOptions<NullableT, SelectableT>',
|
|
@@ -47,7 +51,7 @@ function fieldTypeClass(complexType) {
|
|
|
47
51
|
`${util_1.unixEOL}Creates an instance of ${complexType.fieldType}.${util_1.unixEOL}@param fieldName - Actual name of the field as used in the OData request.${util_1.unixEOL}@param fieldOf - Either the parent entity constructor of the parent complex type this field belongs to.`
|
|
48
52
|
],
|
|
49
53
|
statements: [
|
|
50
|
-
`super(fieldName, fieldOf, ${complexType.typeName}, fieldOptions);`
|
|
54
|
+
`super(fieldName, fieldOf, deSerializers, ${complexType.typeName}, fieldOptions);`
|
|
51
55
|
]
|
|
52
56
|
}
|
|
53
57
|
]
|