@sap/cds 7.9.2 → 8.0.3
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/CHANGELOG.md +139 -3656
- package/_i18n/i18n_en_US_saptrc.properties +113 -0
- package/_i18n/i18n_zh_CN.properties +7 -4
- package/app/index.css +129 -0
- package/app/index.html +16 -64
- package/app/index.js +14 -9
- package/bin/args.js +34 -0
- package/bin/serve.js +18 -24
- package/bin/test.js +97 -0
- package/common.cds +5 -12
- package/eslint.config.mjs +133 -0
- package/lib/auth/basic-auth.js +16 -20
- package/lib/auth/dummy-auth.js +1 -1
- package/lib/auth/ias-auth.js +12 -30
- package/lib/auth/index.js +1 -14
- package/lib/auth/jwt-auth.js +14 -30
- package/lib/compile/cds-compile.js +1 -2
- package/lib/compile/cdsc.js +21 -26
- package/lib/compile/etc/_localized.js +1 -6
- package/lib/compile/etc/csv.js +1 -1
- package/lib/compile/etc/properties.js +1 -1
- package/lib/compile/for/java.js +1 -1
- package/lib/compile/for/lean_drafts.js +4 -6
- package/lib/compile/for/nodejs.js +1 -1
- package/lib/compile/parse.js +4 -0
- package/lib/compile/resolve.js +4 -4
- package/lib/compile/to/edm-files.js +16 -23
- package/lib/compile/to/hana.js +27 -0
- package/lib/compile/to/json.js +1 -1
- package/lib/compile/to/sql.js +5 -1
- package/lib/compile/to/srvinfo.js +1 -1
- package/lib/compile/to/yaml.js +3 -3
- package/lib/dbs/cds-deploy.js +4 -2
- package/lib/env/cds-env.js +10 -14
- package/lib/env/cds-requires.js +29 -13
- package/lib/env/defaults.js +46 -16
- package/lib/env/plugins.js +1 -1
- package/lib/env/schemas/cds-rc.js +8 -4
- package/lib/env/schemas/index.js +7 -7
- package/lib/env/serviceBindings.js +1 -1
- package/lib/index.js +12 -10
- package/lib/lazy.js +1 -1
- package/lib/linked/classes.js +36 -8
- package/lib/linked/entities.js +2 -10
- package/lib/linked/models.js +2 -1
- package/lib/linked/validate.js +292 -0
- package/lib/log/cds-error.js +0 -6
- package/lib/log/cds-log.js +3 -3
- package/lib/log/format/json.js +1 -1
- package/lib/log/service/index.js +0 -1
- package/lib/plugins.js +3 -3
- package/lib/ql/Query.js +2 -10
- package/lib/ql/SELECT.js +1 -1
- package/lib/ql/Whereable.js +3 -2
- package/lib/req/cds-context.js +14 -25
- package/lib/req/context.js +23 -25
- package/lib/req/request.js +1 -34
- package/lib/req/user.js +47 -35
- package/lib/srv/bindings.js +1 -1
- package/lib/srv/cds-connect.js +4 -4
- package/lib/srv/cds-serve.js +2 -2
- package/lib/srv/factory.js +1 -1
- package/lib/srv/middlewares/cds-context.js +11 -22
- package/lib/srv/middlewares/ctx-model.js +2 -3
- package/lib/srv/middlewares/errors.js +41 -8
- package/lib/srv/middlewares/index.js +3 -3
- package/lib/srv/middlewares/trace.js +0 -2
- package/lib/srv/protocols/hcql.js +15 -10
- package/lib/srv/protocols/http.js +44 -49
- package/lib/srv/protocols/index.js +1 -23
- package/lib/srv/protocols/odata-v4.js +12 -74
- package/lib/srv/protocols/rest.js +1 -13
- package/lib/srv/srv-api.js +0 -20
- package/lib/srv/srv-dispatch.js +3 -2
- package/lib/srv/srv-handlers.js +22 -11
- package/lib/srv/srv-methods.js +2 -2
- package/lib/srv/srv-models.js +3 -36
- package/lib/test/expect.js +343 -0
- package/lib/test/index.js +2 -0
- package/lib/test/reporter.js +176 -0
- package/lib/utils/axios.js +10 -9
- package/lib/utils/cds-test.js +86 -37
- package/lib/utils/cds-utils.js +54 -7
- package/lib/utils/check-version.js +0 -4
- package/lib/utils/colors.js +49 -0
- package/lib/utils/data.js +5 -4
- package/libx/_runtime/cds-services/adapter/odata-v4/OData.js +2 -7
- package/libx/_runtime/cds-services/adapter/odata-v4/ODataRequest.js +3 -30
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/error.js +6 -12
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/metadata.js +1 -3
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/read.js +0 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/request.js +4 -7
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/update.js +12 -6
- package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/ExpressionToCQN.js +2 -4
- package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/applyToCQN.js +1 -0
- package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/expandToCQN.js +1 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/index.js +0 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/readToCQN.js +1 -3
- package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/utils.js +1 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-commons/edm/AbstractEdmStructuredType.js +1 -2
- package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/deserializer/ResourceJsonDeserializer.js +5 -0
- package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/serializer/ContextURLFactory.js +1 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/utils/data.js +9 -43
- package/libx/_runtime/cds-services/adapter/odata-v4/utils/metaInfo.js +0 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/utils/readAfterWrite.js +8 -3
- package/libx/_runtime/cds-services/adapter/odata-v4/utils/request.js +4 -2
- package/libx/_runtime/cds-services/adapter/odata-v4/utils/result.js +1 -3
- package/libx/_runtime/cds-services/util/assert.js +1 -1
- package/libx/_runtime/cds.js +10 -3
- package/libx/_runtime/common/Service.js +12 -32
- package/libx/_runtime/common/aspects/any.js +1 -0
- package/libx/_runtime/common/code-ext/execute.js +1 -1
- package/libx/_runtime/common/code-ext/worker.js +0 -1
- package/libx/_runtime/common/composition/data.js +0 -1
- package/libx/_runtime/common/composition/delete.js +0 -1
- package/libx/_runtime/common/composition/insert.js +2 -2
- package/libx/_runtime/common/composition/tree.js +0 -1
- package/libx/_runtime/common/composition/update.js +3 -3
- package/libx/_runtime/common/error/frontend.js +21 -12
- package/libx/_runtime/common/error/log.js +36 -0
- package/libx/_runtime/common/error/utils.js +2 -5
- package/libx/_runtime/common/generic/auth/autoexpose.js +18 -17
- package/libx/_runtime/common/generic/auth/expand.js +1 -1
- package/libx/_runtime/common/generic/auth/readOnly.js +1 -2
- package/libx/_runtime/common/generic/auth/restrict.js +23 -42
- package/libx/_runtime/common/generic/auth/restrictions.js +2 -7
- package/libx/_runtime/common/generic/auth/utils.js +91 -88
- package/libx/_runtime/common/generic/crud.js +6 -5
- package/libx/_runtime/common/generic/etag.js +7 -12
- package/libx/_runtime/common/generic/input.js +70 -68
- package/libx/_runtime/common/generic/paging.js +1 -0
- package/libx/_runtime/common/generic/sorting.js +1 -0
- package/libx/_runtime/common/generic/temporal.js +8 -2
- package/libx/_runtime/common/i18n/index.js +1 -1
- package/libx/_runtime/common/i18n/messages.properties +3 -1
- package/libx/_runtime/common/utils/binary.js +8 -2
- package/libx/_runtime/common/utils/compareJson.js +5 -1
- package/libx/_runtime/common/utils/copy.js +6 -11
- package/libx/_runtime/common/utils/cqn2cqn4sql.js +16 -14
- package/libx/_runtime/common/utils/differ.js +3 -6
- package/libx/_runtime/common/utils/keys.js +77 -18
- package/libx/_runtime/common/utils/postProcess.js +12 -15
- package/libx/_runtime/common/utils/propagateForeignKeys.js +0 -1
- package/libx/_runtime/common/utils/resolveView.js +2 -3
- package/libx/_runtime/common/utils/restrictions.js +45 -17
- package/libx/_runtime/common/utils/rewriteAsterisks.js +1 -8
- package/libx/_runtime/common/utils/stream.js +3 -16
- package/libx/_runtime/common/utils/streamProp.js +8 -18
- package/libx/_runtime/common/utils/structured.js +1 -1
- package/libx/_runtime/common/utils/ucsn.js +0 -2
- package/libx/_runtime/db/Service.js +0 -72
- package/libx/_runtime/db/data-conversion/post-processing.js +0 -1
- package/libx/_runtime/db/expand/expandCQNToJoin.js +9 -9
- package/libx/_runtime/db/expand/rawToExpanded.js +0 -8
- package/libx/_runtime/db/generic/input.js +3 -8
- package/libx/_runtime/db/generic/rewrite.js +27 -4
- package/libx/_runtime/db/query/read.js +2 -2
- package/libx/_runtime/db/sql-builder/ExpressionBuilder.js +0 -1
- package/libx/_runtime/db/sql-builder/InsertBuilder.js +1 -1
- package/libx/_runtime/db/utils/columns.js +2 -6
- package/libx/_runtime/fiori/lean-draft.js +138 -56
- package/libx/_runtime/hana/Service.js +0 -1
- package/libx/_runtime/hana/driver.js +1 -1
- package/libx/_runtime/hana/dynatrace.js +1 -2
- package/libx/_runtime/hana/pool.js +11 -21
- package/libx/_runtime/hana/streaming.js +0 -1
- package/libx/_runtime/messaging/common-utils/AMQPClient.js +0 -1
- package/libx/_runtime/messaging/common-utils/authorizedRequest.js +1 -1
- package/libx/_runtime/messaging/common-utils/normalizeIncomingMessage.js +1 -1
- package/libx/_runtime/messaging/enterprise-messaging-utils/getTenantInfo.js +1 -1
- package/libx/_runtime/messaging/enterprise-messaging-utils/registerEndpoints.js +19 -33
- package/libx/_runtime/messaging/event-broker.js +0 -12
- package/libx/_runtime/messaging/file-based.js +3 -3
- package/libx/_runtime/messaging/http-utils/token.js +1 -1
- package/libx/_runtime/messaging/kafka.js +2 -2
- package/libx/_runtime/messaging/redis-messaging.js +0 -1
- package/libx/_runtime/remote/Service.js +25 -25
- package/libx/_runtime/remote/utils/client.js +4 -5
- package/libx/_runtime/remote/utils/cloudSdkProvider.js +0 -3
- package/libx/_runtime/remote/utils/data.js +0 -1
- package/libx/_runtime/sqlite/Service.js +1 -2
- package/libx/_runtime/ucl/Service.js +37 -78
- package/libx/common/assert/index.js +22 -21
- package/libx/common/assert/type-relaxed.js +39 -0
- package/libx/common/assert/utils.js +3 -2
- package/libx/common/assert/validation.js +3 -8
- package/libx/common/utils/index.js +5 -0
- package/libx/common/utils/path.js +51 -0
- package/libx/odata/ODataAdapter.js +126 -0
- package/libx/odata/index.js +15 -2
- package/libx/odata/middleware/batch.js +261 -72
- package/libx/odata/middleware/body-parser.js +33 -0
- package/libx/odata/middleware/create.js +44 -59
- package/libx/odata/middleware/delete.js +23 -12
- package/libx/odata/middleware/error.js +30 -6
- package/libx/odata/middleware/metadata.js +38 -26
- package/libx/odata/middleware/operation.js +93 -69
- package/libx/odata/middleware/parse.js +6 -8
- package/libx/odata/middleware/read.js +117 -93
- package/libx/odata/middleware/service-document.js +22 -19
- package/libx/odata/middleware/stream.js +54 -56
- package/libx/odata/middleware/update.js +79 -87
- package/libx/odata/parse/afterburner.js +191 -175
- package/libx/odata/parse/cqn2odata.js +8 -8
- package/libx/odata/parse/grammar.peggy +27 -20
- package/libx/odata/parse/multipartToJson.js +17 -9
- package/libx/odata/parse/parser.js +1 -1
- package/libx/odata/utils/etag.js +14 -6
- package/libx/odata/utils/index.js +84 -12
- package/libx/odata/utils/metadata.js +161 -0
- package/libx/odata/utils/postProcess.js +89 -0
- package/libx/odata/utils/readAfterWrite.js +134 -17
- package/libx/odata/utils/result.js +36 -142
- package/libx/outbox/index.js +5 -4
- package/libx/rest/RestAdapter.js +115 -182
- package/libx/rest/middleware/create.js +28 -24
- package/libx/rest/middleware/delete.js +7 -10
- package/libx/rest/middleware/error.js +19 -16
- package/libx/rest/middleware/operation.js +48 -41
- package/libx/rest/middleware/parse.js +128 -126
- package/libx/rest/middleware/read.js +20 -27
- package/libx/rest/middleware/update.js +26 -31
- package/package.json +16 -12
- package/server.js +4 -2
- package/tasks/enterprise-messaging-deploy.js +1 -1
- package/apis/cds.d.ts +0 -3
- package/apis/core.d.ts +0 -21
- package/apis/cqn.d.ts +0 -18
- package/apis/csn.d.ts +0 -21
- package/apis/events.d.ts +0 -18
- package/apis/internal/inference.d.ts +0 -18
- package/apis/linked.d.ts +0 -18
- package/apis/log.d.ts +0 -20
- package/apis/models.d.ts +0 -18
- package/apis/ql.d.ts +0 -18
- package/apis/reflect.d.ts +0 -32
- package/apis/server.d.ts +0 -18
- package/apis/services.d.ts +0 -22
- package/bin/cds-serve.js +0 -56
- package/lib/compile/to/gql.js +0 -15
- package/lib/srv/protocols/_legacy.js +0 -44
- package/lib/utils/jest.js +0 -43
- package/libx/_runtime/auth/index.js +0 -193
- package/libx/_runtime/auth/strategies/JWT.js +0 -37
- package/libx/_runtime/auth/strategies/basic.js +0 -20
- package/libx/_runtime/auth/strategies/dummy.js +0 -14
- package/libx/_runtime/auth/strategies/ias-auth.js +0 -1
- package/libx/_runtime/auth/strategies/mock.js +0 -77
- package/libx/_runtime/auth/strategies/xssecUtils.js +0 -93
- package/libx/_runtime/auth/strategies/xsuaa.js +0 -38
- package/libx/_runtime/common/perf/index.js +0 -19
- package/libx/_runtime/common/utils/ensureIEEE754.js +0 -29
- package/libx/_runtime/fiori/draft.js +0 -2
- package/libx/_runtime/fiori/generic/activate.js +0 -190
- package/libx/_runtime/fiori/generic/before.js +0 -201
- package/libx/_runtime/fiori/generic/cancel.js +0 -19
- package/libx/_runtime/fiori/generic/delete.js +0 -21
- package/libx/_runtime/fiori/generic/edit.js +0 -157
- package/libx/_runtime/fiori/generic/index.js +0 -25
- package/libx/_runtime/fiori/generic/new.js +0 -82
- package/libx/_runtime/fiori/generic/patch.js +0 -101
- package/libx/_runtime/fiori/generic/prepare.js +0 -57
- package/libx/_runtime/fiori/generic/read.js +0 -1340
- package/libx/_runtime/fiori/generic/readOverDraft.js +0 -146
- package/libx/_runtime/fiori/utils/csn.js +0 -13
- package/libx/_runtime/fiori/utils/delete.js +0 -114
- package/libx/_runtime/fiori/utils/handler.js +0 -264
- package/libx/_runtime/fiori/utils/lockInfo.js +0 -27
- package/libx/_runtime/fiori/utils/req.js +0 -23
- package/libx/_runtime/fiori/utils/stream.js +0 -36
- package/libx/_runtime/fiori/utils/where.js +0 -254
- package/libx/_runtime/index.js +0 -22
- package/libx/odata/utils/handler.js +0 -120
- package/libx/odata/utils/metaInfo.js +0 -410
- package/libx/odata/utils/path.js +0 -75
- package/libx/rest/RestRequest.js +0 -32
- package/libx/rest/index.js +0 -3
- package/libx/rest/readme.md +0 -1
- /package/libx/common/assert/{type.js → type-strict.js} +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#Text Types
|
|
2
|
+
#
|
|
3
|
+
#XACT: Text with explicit importance for accessibility.
|
|
4
|
+
#XBUT: Button
|
|
5
|
+
#XCKL: Checkbox
|
|
6
|
+
#XFLD: Field label
|
|
7
|
+
#XLNK: Hyperlink
|
|
8
|
+
#XMIT: Menu item (Menu item, either top-level like "File" or lower-level like "Save as...")
|
|
9
|
+
#XMSG: Message
|
|
10
|
+
#XRBL: Radio button
|
|
11
|
+
#XSEL: Selection (Values in a drop-down list, or a status. For example: "In Process", "Shipped" or "Open".)
|
|
12
|
+
#XTIT: Title (or heading) of a non-actionable user interface element like a column, wizard, or screen area.
|
|
13
|
+
#XTOL: Explanatory text for an UI element, such as a tooltip, input help.
|
|
14
|
+
#YINS: Instruction for a user, for example, a permanent text on a screen that introduces a group of fields.
|
|
15
|
+
#----------------------------------------------------------------------------------------------------------------------
|
|
16
|
+
#For text elements that are not supposed to be translated, use the text type NOTR
|
|
17
|
+
#----------------------------------------------------------------------------------------------------------------------
|
|
18
|
+
#Recommended pattern
|
|
19
|
+
#
|
|
20
|
+
#<TextType>:<AdditionalContextInformation>
|
|
21
|
+
#If there is a maximum length restriction, please indicate as shown below.
|
|
22
|
+
#<TextType>,<MaximumLength>:<AdditionalContextInformation>
|
|
23
|
+
#----------------------------------------------------------------------------------------------------------------------
|
|
24
|
+
# This is the resource bundle for foundation
|
|
25
|
+
# __ldi.translation.uuid=dd6c5800-b108-11e8-be90-bd1cf6ac87fb
|
|
26
|
+
#----------------------------------------------------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
#XTIT: Created By (Answer to: "Which user has created a certain entity?")
|
|
29
|
+
CreatedBy=Bx7yxWg0AHyeOti1YDOOXw_Created By
|
|
30
|
+
|
|
31
|
+
#XTIT: Created On (Answer to: "When has a certain entity been created?")
|
|
32
|
+
CreatedAt=CJxeZDpLHdREwzDQeluRuA_Created On
|
|
33
|
+
|
|
34
|
+
#XTIT: Changed By (Answer to: "Which user has changed a certain entity?")
|
|
35
|
+
ChangedBy=y0d7F56RLGVZiTV7YHU7Iw_Changed By
|
|
36
|
+
|
|
37
|
+
#XTIT: Changed On (Answer to: "When has a certain entity been changed?")
|
|
38
|
+
ChangedAt=8v5EfaWMYC2dmCGnaCSSUA_Changed On
|
|
39
|
+
|
|
40
|
+
#XTIT: Currency
|
|
41
|
+
Currency=bNSEwGmQtXNxy/Qh310iSQ_Currency
|
|
42
|
+
|
|
43
|
+
#XTIT: Currency Code
|
|
44
|
+
CurrencyCode=3cKgP4qz+IsDHtETO3InVQ_Currency Code
|
|
45
|
+
|
|
46
|
+
#XTIT: Currency Code Description
|
|
47
|
+
CurrencyCode.Description=N1K4iJe5n+tnvMRTgtP24w_A currency code as specified in ISO 4217
|
|
48
|
+
|
|
49
|
+
#XTIT: Currency Symbol
|
|
50
|
+
CurrencySymbol=ICns/nlRq2+/URxMXV+T8g_Currency Symbol
|
|
51
|
+
|
|
52
|
+
#XTIT: Currency Minor Unit Fractions (Answer to: "How many fractions has a currency's minor unit?", e.g. "0" or "2")
|
|
53
|
+
CurrencyMinorUnit=0S6MF8n74OoGrKEYI1LO+Q_Currency Minor Unit Fractions
|
|
54
|
+
|
|
55
|
+
#XTIT: Country/Region
|
|
56
|
+
Country=AbsSu8Y0n1nvBQMk+UaLfw_Country/Region
|
|
57
|
+
|
|
58
|
+
#XTIT: Country/Region Code
|
|
59
|
+
CountryCode=IgAotY/RI8UnAUTEtFNGkw_Country/Region Code
|
|
60
|
+
|
|
61
|
+
#XTIT: Country/Region Code Description
|
|
62
|
+
CountryCode.Description=dkCbzc6I8aK8glGoJdGKfg_A country/region code as specified in ISO 3166-1
|
|
63
|
+
|
|
64
|
+
#XTIT: Language
|
|
65
|
+
Language=gFWTYTeLWksYL6uD/TAgFA_Language
|
|
66
|
+
|
|
67
|
+
#XTIT: Language Code
|
|
68
|
+
LanguageCode=NhI8Yd8pNFS7omWQsk5aJw_Language Code
|
|
69
|
+
|
|
70
|
+
#XTIT: Language Code Description
|
|
71
|
+
LanguageCode.Description=E/M7wAVsS7H/AhkTdqcvtg_A language code as specified in ISO 639-1
|
|
72
|
+
|
|
73
|
+
#XTIT Time zone code
|
|
74
|
+
TimeZoneCode=Y0KTpmsmzoysYLT6jDQEkQ_Time Zone Code
|
|
75
|
+
|
|
76
|
+
#XTIT: User Identifier
|
|
77
|
+
UserID=cjI0FCsEZ2aD8ERc6G/xZw_User ID
|
|
78
|
+
|
|
79
|
+
#XTIT: Any kind of name
|
|
80
|
+
Name=xOqOj8rcOinN3ZBO0WdWjA_Name
|
|
81
|
+
|
|
82
|
+
#XTIT: Any kind of description
|
|
83
|
+
Description=VGpOoz5siT25o1W0WDiHGw_Description
|
|
84
|
+
|
|
85
|
+
#XTOL: A user's unique Indentifier
|
|
86
|
+
UserID.Description=t9D7CV474t7qx3yqxKwwVw_A user's unique ID
|
|
87
|
+
|
|
88
|
+
#XTIT: Admin data for a draft document
|
|
89
|
+
Draft_DraftAdministrativeData=LsxY+0o1fWbFeMrxNNIRvg_Draft Administrative Data
|
|
90
|
+
|
|
91
|
+
#XTIT: Technical ID of a draft document
|
|
92
|
+
Draft_DraftUUID=Y5OedvjtpZGSeRwWXI4alQ_Draft (Technical ID)
|
|
93
|
+
|
|
94
|
+
#XTIT: Creation time of a draft
|
|
95
|
+
Draft_CreationDateTime=Y2ttcgWpNQmB69F6w8jYmw_Draft Created On
|
|
96
|
+
|
|
97
|
+
#XTIT: User created the draft
|
|
98
|
+
Draft_CreatedByUser=fVPXdEA4PQ/ruI+1ZC6lzg_Draft Created By
|
|
99
|
+
|
|
100
|
+
#XTIT: The current user (me) created the draft
|
|
101
|
+
Draft_DraftIsCreatedByMe=Oi4B0zRRBAKoN6wuBWyQPA_Draft Created By Me
|
|
102
|
+
|
|
103
|
+
#XTIT: Time a draft was last changed on
|
|
104
|
+
Draft_LastChangeDateTime=3ZVPB34hJDc38V1GIGr6cw_Draft Last Changed On
|
|
105
|
+
|
|
106
|
+
#XTIT: User that changed the draft last
|
|
107
|
+
Draft_LastChangedByUser=X7I4n0+rc50bDozET507FA_Draft Last Changed By
|
|
108
|
+
|
|
109
|
+
#XTIT: User that is working on the draft
|
|
110
|
+
Draft_InProcessByUser=/MEKNHLAPlLRsGiFC1PeOA_Draft In Process By
|
|
111
|
+
|
|
112
|
+
#XTIT: The current user (me) is working on the draft
|
|
113
|
+
Draft_DraftIsProcessedByMe=zZGCPf/2uR37cfpgf1znGA_Draft In Process By Me
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
#----------------------------------------------------------------------------------------------------------------------
|
|
27
27
|
|
|
28
28
|
#XTIT: Created By (Answer to: "Which user has created a certain entity?")
|
|
29
|
-
CreatedBy=\u521B\u5EFA\
|
|
29
|
+
CreatedBy=\u521B\u5EFA\u4EBA
|
|
30
30
|
|
|
31
31
|
#XTIT: Created On (Answer to: "When has a certain entity been created?")
|
|
32
32
|
CreatedAt=\u521B\u5EFA\u65E5\u671F
|
|
33
33
|
|
|
34
34
|
#XTIT: Changed By (Answer to: "Which user has changed a certain entity?")
|
|
35
|
-
ChangedBy=\u66F4\u6539\
|
|
35
|
+
ChangedBy=\u66F4\u6539\u4EBA
|
|
36
36
|
|
|
37
37
|
#XTIT: Changed On (Answer to: "When has a certain entity been changed?")
|
|
38
38
|
ChangedAt=\u66F4\u6539\u65E5\u671F
|
|
@@ -70,6 +70,9 @@ LanguageCode=\u8BED\u8A00\u4EE3\u7801
|
|
|
70
70
|
#XTIT: Language Code Description
|
|
71
71
|
LanguageCode.Description=ISO 639-1 \u6307\u5B9A\u7684\u8BED\u8A00\u4EE3\u7801
|
|
72
72
|
|
|
73
|
+
#XTIT Time zone code
|
|
74
|
+
TimeZoneCode=\u65F6\u533A\u4EE3\u7801
|
|
75
|
+
|
|
73
76
|
#XTIT: User Identifier
|
|
74
77
|
UserID=\u7528\u6237\u6807\u8BC6
|
|
75
78
|
|
|
@@ -101,10 +104,10 @@ Draft_DraftIsCreatedByMe=\u8349\u7A3F\u7531\u6211\u521B\u5EFA
|
|
|
101
104
|
Draft_LastChangeDateTime=\u8349\u7A3F\u4E0A\u6B21\u66F4\u6539\u65E5\u671F
|
|
102
105
|
|
|
103
106
|
#XTIT: User that changed the draft last
|
|
104
|
-
Draft_LastChangedByUser=\u8349\u7A3F\u4E0A\u6B21\u66F4\u6539\
|
|
107
|
+
Draft_LastChangedByUser=\u8349\u7A3F\u4E0A\u6B21\u66F4\u6539\u4EBA
|
|
105
108
|
|
|
106
109
|
#XTIT: User that is working on the draft
|
|
107
|
-
Draft_InProcessByUser=\u6B63\u5728\u5904\u7406\u8349\u7A3F\
|
|
110
|
+
Draft_InProcessByUser=\u6B63\u5728\u5904\u7406\u8349\u7A3F\u4EBA
|
|
108
111
|
|
|
109
112
|
#XTIT: The current user (me) is working on the draft
|
|
110
113
|
Draft_DraftIsProcessedByMe=\u8349\u7A3F\u6B63\u5728\u7531\u6211\u5904\u7406
|
package/app/index.css
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
body {
|
|
2
|
+
font-family: Avenir Next, sans-serif;
|
|
3
|
+
background: #f8fbff;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
body #welcome {
|
|
7
|
+
margin: 30px auto 50px;
|
|
8
|
+
padding: 0 30px;
|
|
9
|
+
max-width: 900px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
body #welcome h1, #welcome h3, #welcome h2, #welcome p {
|
|
13
|
+
margin: 20px 0;
|
|
14
|
+
color: #47637d;
|
|
15
|
+
font-weight: 400;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
body #welcome h3.header {
|
|
19
|
+
margin: 20px 0 0 0;
|
|
20
|
+
background-color: #537492;
|
|
21
|
+
color: white;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
body #welcome h3 a {
|
|
25
|
+
color: inherit;
|
|
26
|
+
font-weight: 500;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
body #welcome h3 a span {
|
|
30
|
+
padding: 5px 15px;
|
|
31
|
+
font-weight: 300;
|
|
32
|
+
transition: all 0.2s ease-in;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body #welcome h3 a:first-child span {
|
|
36
|
+
display: inline-block;
|
|
37
|
+
padding: 5px 15px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
body #welcome h3 a span:hover {
|
|
41
|
+
color: #92b2d0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
body #welcome ul {
|
|
45
|
+
margin: 0;
|
|
46
|
+
background: #91adc5;
|
|
47
|
+
list-style-type: none;
|
|
48
|
+
padding-inline-start: 20px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body #welcome li {
|
|
52
|
+
display: inline-grid;
|
|
53
|
+
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
|
|
54
|
+
width: 100%;
|
|
55
|
+
margin-bottom: 1px;
|
|
56
|
+
background-color: #d0e9ff;
|
|
57
|
+
padding: 0;
|
|
58
|
+
/*
|
|
59
|
+
-moz-transition: background color 0.2s ease-in;
|
|
60
|
+
-webkit-transition: background 0.2s ease-in;
|
|
61
|
+
-o-transition: background 0.2s ease-in;
|
|
62
|
+
/* Standard */
|
|
63
|
+
transition: all 0.1s ease-in;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
body #welcome ul li div:not(:first-child) a {
|
|
67
|
+
font-weight: 300;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
body #welcome a {
|
|
71
|
+
text-decoration: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
body #welcome li a, body #welcome li > span {
|
|
75
|
+
padding: 4px 10px;
|
|
76
|
+
font-weight: 500;
|
|
77
|
+
color: #1d5985;
|
|
78
|
+
transition: all 0.1s ease-in;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
body #welcome li a span:hover {
|
|
82
|
+
color: #f0faff;
|
|
83
|
+
background-color: #a7c8e1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
body #welcome .preview {
|
|
87
|
+
font-size: small;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
footer {
|
|
91
|
+
border-top: .5px solid;
|
|
92
|
+
margin-top: 44px;
|
|
93
|
+
padding-top: 22px;
|
|
94
|
+
width: 400px;
|
|
95
|
+
font-size: 90%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media (prefers-color-scheme: dark) {
|
|
99
|
+
body { background: #0a2138; }
|
|
100
|
+
|
|
101
|
+
body #welcome h1, #welcome h3, #welcome h2, #welcome p {
|
|
102
|
+
color: #a6c1d9;
|
|
103
|
+
}
|
|
104
|
+
body #welcome h3 a {
|
|
105
|
+
color: #e2efff;
|
|
106
|
+
}
|
|
107
|
+
body #welcome ul {
|
|
108
|
+
background: #7894ad;
|
|
109
|
+
}
|
|
110
|
+
body #welcome li {
|
|
111
|
+
background-color: #506d88;
|
|
112
|
+
}
|
|
113
|
+
body #welcome li a, body #welcome li:hover div:not(:first-child) a, body #welcome li > span {
|
|
114
|
+
color: #d0e4f2;
|
|
115
|
+
}
|
|
116
|
+
body #welcome li a:hover {
|
|
117
|
+
color: white;
|
|
118
|
+
background-color: #7894ad;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
body #welcome h3.header {
|
|
122
|
+
background-color: #304c65;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
footer {
|
|
126
|
+
border-top: .5px solid #456;
|
|
127
|
+
color: #567;
|
|
128
|
+
}
|
|
129
|
+
}
|
package/app/index.html
CHANGED
|
@@ -4,77 +4,29 @@
|
|
|
4
4
|
<title>{{package}}</title>
|
|
5
5
|
<meta name="color-scheme" content="dark light">
|
|
6
6
|
<style>
|
|
7
|
-
|
|
8
|
-
font-family: Avenir Next, sans-serif;
|
|
9
|
-
margin: 44px;
|
|
10
|
-
line-height: 1.5em;
|
|
11
|
-
}
|
|
12
|
-
h1 {
|
|
13
|
-
margin-bottom: 0
|
|
14
|
-
}
|
|
15
|
-
h1 + .subtitle {
|
|
16
|
-
margin: .2em;
|
|
17
|
-
font-weight: 300;
|
|
18
|
-
}
|
|
19
|
-
h1, h2, h3 {
|
|
20
|
-
font-weight: 400;
|
|
21
|
-
}
|
|
22
|
-
h1, a {
|
|
23
|
-
text-decoration: none;
|
|
24
|
-
}
|
|
25
|
-
a.preview {
|
|
26
|
-
font-size: 90%;
|
|
27
|
-
}
|
|
28
|
-
footer {
|
|
29
|
-
border-top: .5px solid;
|
|
30
|
-
margin-top: 44px;
|
|
31
|
-
padding-top: 22px;
|
|
32
|
-
width: 400px;
|
|
33
|
-
font-size: 90%;
|
|
34
|
-
}
|
|
35
|
-
@media (prefers-color-scheme: dark) {
|
|
36
|
-
body {
|
|
37
|
-
background:#001119;
|
|
38
|
-
color: #789;
|
|
39
|
-
}
|
|
40
|
-
h1 + .subtitle {
|
|
41
|
-
color:#fb0;
|
|
42
|
-
}
|
|
43
|
-
h1, a {
|
|
44
|
-
color:#fb0;
|
|
45
|
-
}
|
|
46
|
-
h2, h3 {
|
|
47
|
-
color:#89a;
|
|
48
|
-
}
|
|
49
|
-
a.preview {
|
|
50
|
-
color: #678;
|
|
51
|
-
}
|
|
52
|
-
footer {
|
|
53
|
-
border-top: .5px solid #456;
|
|
54
|
-
color: #567;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
7
|
+
{{style}}
|
|
57
8
|
</style>
|
|
58
9
|
</head>
|
|
59
10
|
<body>
|
|
11
|
+
<div id="welcome">
|
|
12
|
+
<h1> Welcome to <i>@sap/cds</i> Server </h1>
|
|
13
|
+
<p class="subtitle"> Serving {{package}} </p>
|
|
60
14
|
|
|
61
|
-
|
|
62
|
-
<p class="subtitle"> Serving {{package}} </p>
|
|
15
|
+
<p> These are the paths currently served:</p>
|
|
63
16
|
|
|
64
|
-
|
|
17
|
+
<h2> Web Applications: </h2>
|
|
18
|
+
<ul>
|
|
19
|
+
{{apps}}
|
|
20
|
+
</ul>
|
|
65
21
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
{{apps}}
|
|
69
|
-
</ul>
|
|
22
|
+
<h2> Service Endpoints: </h2>
|
|
23
|
+
{{services}}
|
|
70
24
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
You can replace it with a custom <code>./{{app}}/index.html</code>.
|
|
77
|
-
</footer>
|
|
25
|
+
<footer>
|
|
26
|
+
This is an automatically generated page. <br>
|
|
27
|
+
You can replace it with a custom <code>./{{app}}/index.html</code>.
|
|
28
|
+
</footer>
|
|
29
|
+
</div>
|
|
78
30
|
|
|
79
31
|
</body>
|
|
80
32
|
</html>
|
package/app/index.js
CHANGED
|
@@ -2,17 +2,19 @@ const cds = require('../lib')
|
|
|
2
2
|
const { find, path, fs } = cds.utils
|
|
3
3
|
|
|
4
4
|
const odata = endpoint => endpoint.kind.startsWith('odata')
|
|
5
|
-
const metadata = endpoint => odata(endpoint) ?
|
|
5
|
+
const metadata = endpoint => odata(endpoint) ? `<span>/</span> <a href="${endpoint.path}/$metadata"><span>$metadata</span></a>` : ``
|
|
6
6
|
const asHtmlId = s => s.replace(/[.:/$&?@]/g, '_').toLowerCase()
|
|
7
7
|
|
|
8
8
|
module.exports = { get html(){
|
|
9
9
|
|
|
10
|
+
let css = fs.readFileSync(path.join(__dirname,'index.css'),'utf-8')
|
|
10
11
|
let html = fs.readFileSync(path.join(__dirname,'index.html'),'utf-8')
|
|
11
12
|
// .replace ('{{subtitle}}', 'Version ' + cds.version)
|
|
12
13
|
.replace (/{{package}}/g, _project())
|
|
13
14
|
.replace (/{{app}}/g, cds.env.folders.app.replace(/*trailing slash*/ /\/$/, ''))
|
|
15
|
+
.replace ('{{style}}', css)
|
|
14
16
|
.replace ('{{apps}}', _app_links().map(
|
|
15
|
-
html => `\n<li><a href="${html}">/${html.replace(/^\//,'').replace('/index.html','')}</a></li>`
|
|
17
|
+
html => `\n<li><a href="${html}"><span>/${html.replace(/^\//,'').replace('/index.html','')}</span></a></li>`
|
|
16
18
|
).join('\n') || '— none —'
|
|
17
19
|
)
|
|
18
20
|
.replace ('{{services}}', cds.service.providers
|
|
@@ -20,13 +22,16 @@ module.exports = { get html(){
|
|
|
20
22
|
.flatMap(srv => srv.endpoints.map(endpoint => ({srv, endpoint})))
|
|
21
23
|
.map (({srv, endpoint}) => `
|
|
22
24
|
<div id="${asHtmlId(srv.name)}-${endpoint.kind}">
|
|
23
|
-
<h3>
|
|
24
|
-
<a href="${endpoint.path}">${endpoint.path}</a>${metadata(endpoint)} ${_moreLinks(srv, endpoint)}
|
|
25
|
+
<h3 class="header">
|
|
26
|
+
<a href="${endpoint.path}"><span>${endpoint.path}</span></a>${metadata(endpoint)} ${_moreLinks(srv, endpoint, undefined, false)}
|
|
25
27
|
</h3>
|
|
26
28
|
<ul>${_entities_in(srv).map (e => {
|
|
27
29
|
return `
|
|
28
30
|
<li id="${asHtmlId(srv.name)}-${endpoint.kind}-${asHtmlId(e)}">
|
|
29
|
-
<
|
|
31
|
+
<div>
|
|
32
|
+
<a href="${endpoint.path}/${e.replace(/\./g, '_')}"><span>${e}</span></a>
|
|
33
|
+
</div>
|
|
34
|
+
${_moreLinks(srv, endpoint, e)}
|
|
30
35
|
</li>`}).join('')}
|
|
31
36
|
</ul>
|
|
32
37
|
</div>
|
|
@@ -58,12 +63,12 @@ function _entities_in (service) {
|
|
|
58
63
|
return exposed
|
|
59
64
|
}
|
|
60
65
|
|
|
61
|
-
function _moreLinks (srv, endpoint, entity) {
|
|
66
|
+
function _moreLinks (srv, endpoint, entity, div=true) {
|
|
62
67
|
return (srv.$linkProviders || [])
|
|
63
68
|
.map (linkProv => linkProv(entity, endpoint))
|
|
64
69
|
.filter (l => l?.href && l?.name)
|
|
65
|
-
.sort ((l1, l2) => l1.name.localeCompare(l2.name))
|
|
66
|
-
.map (l =>
|
|
70
|
+
// .sort ((l1, l2) => l1.name.localeCompare(l2.name))
|
|
71
|
+
.map (l => `${div?'<div>':'<span>'}<a href="${l.href}"><span class="preview" title="${l.title||l.name}">${l.name}</span></a>${div?'</div>':'</span>'}`)
|
|
67
72
|
.join (' ')
|
|
68
73
|
}
|
|
69
74
|
|
|
@@ -72,7 +77,7 @@ function _project(){
|
|
|
72
77
|
try {
|
|
73
78
|
const pj = require(cwd+'/package.json')
|
|
74
79
|
return `${pj.name} ${pj.version}`
|
|
75
|
-
} catch
|
|
80
|
+
} catch {
|
|
76
81
|
return `${cwd}`
|
|
77
82
|
}
|
|
78
83
|
}
|
package/bin/args.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// TODO replace w/ common arg parser from node
|
|
2
|
+
module.exports = function _args4 (task, argv) {
|
|
3
|
+
|
|
4
|
+
const { options:o=[], flags:f=[], shortcuts:s=[] } = task
|
|
5
|
+
const _global = /^--(profile|production|sql|odata|build-.*|cdsc-.*|odata-.*|folders-.*)$/
|
|
6
|
+
const _flags = { '--production':true }
|
|
7
|
+
const options = {}, args = []
|
|
8
|
+
let k,a, env = null
|
|
9
|
+
|
|
10
|
+
if (argv.length) for (let i=0; i < argv.length; ++i) {
|
|
11
|
+
if ((a = argv[i])[0] !== '-') args.push(a)
|
|
12
|
+
else if ((k = s.indexOf(a)) >= 0) k < o.length ? add(o[k],argv[++i]) : add(f[k-o.length])
|
|
13
|
+
else if ((k = o.indexOf(a)) >= 0) add(o[k],argv[++i])
|
|
14
|
+
else if ((k = f.indexOf(a)) >= 0) add(f[k])
|
|
15
|
+
else if (_global.test(a)) add_global(a, _flags[a] || argv[++i])
|
|
16
|
+
else throw 'Invalid option: '+ a
|
|
17
|
+
}
|
|
18
|
+
// consistent production setting for NODE_ENV and CDS_ENV
|
|
19
|
+
if (process.env.NODE_ENV !== 'production') { if (process.env.CDS_ENV?.split(',').includes('production')) process.env.NODE_ENV = 'production' }
|
|
20
|
+
else process.env.CDS_ENV = Array.from(new Set([...process.env.CDS_ENV?.split(',') ?? [], 'production']))
|
|
21
|
+
|
|
22
|
+
function add (k,v) { options[k.slice(2)] = v || true }
|
|
23
|
+
function add_global (k,v='') {
|
|
24
|
+
if (k === '--production') return process.env.CDS_ENV = Array.from(new Set([...process.env.CDS_ENV?.split(',') ?? [], 'production']))
|
|
25
|
+
if (k === '--profile') return process.env.CDS_ENV = Array.from(new Set([...process.env.CDS_ENV?.split(',') ?? [], ...v.split(',')]))
|
|
26
|
+
if (k === '--odata') v = { flavor:v }
|
|
27
|
+
let e=env || (env={}), path = k.slice(2).split('-')
|
|
28
|
+
while (path.length > 1) { let p = path.shift(); e = e[p]||(e[p]={}) }
|
|
29
|
+
add (k, e[path[0]] = v)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (env) global.cds?.env.add (env)
|
|
33
|
+
return [ args, options ]
|
|
34
|
+
}
|
package/bin/serve.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
module.exports = exports = Object.assign ( serve, {
|
|
2
3
|
options: [
|
|
3
4
|
'--service', '--from', '--to', '--at', '--with',
|
|
4
5
|
'--port',
|
|
@@ -128,7 +129,9 @@ module.exports = Object.assign ( serve, {
|
|
|
128
129
|
|
|
129
130
|
|
|
130
131
|
const cds = require('../lib'), { exists, isfile, local, path, _redacted } = cds.utils
|
|
131
|
-
const COLORS =
|
|
132
|
+
const COLORS = process.stdout.isTTY && !process.env.NO_COLOR || process.env.FORCE_COLOR
|
|
133
|
+
|
|
134
|
+
/* eslint-disable no-console */
|
|
132
135
|
|
|
133
136
|
// provisional loggers, see _prepare_logging
|
|
134
137
|
let log = console.log
|
|
@@ -162,7 +165,7 @@ async function serve (all=[], o={}) {
|
|
|
162
165
|
TRACE?.time('total startup time'.padEnd(22))
|
|
163
166
|
if (TRACE) {
|
|
164
167
|
TRACE?.time('require express'.padEnd(22))
|
|
165
|
-
require('express')
|
|
168
|
+
require('express')
|
|
166
169
|
TRACE?.timeEnd('require express'.padEnd(22))
|
|
167
170
|
}
|
|
168
171
|
|
|
@@ -300,25 +303,6 @@ function _prepare_logging () { // NOSONAR
|
|
|
300
303
|
// print config deprecation warnings
|
|
301
304
|
if (cds.env.features.deprecated !== 'off') {
|
|
302
305
|
cds.once ('listening', () => {
|
|
303
|
-
// Remove with cds^8
|
|
304
|
-
if (cds.env.drafts?.cancellationTimeout)
|
|
305
|
-
cds.utils.deprecated({
|
|
306
|
-
old: 'cds.drafts.cancellationTimeout',
|
|
307
|
-
use: 'cds.fiori.draft_lock_timeout with adapted value'
|
|
308
|
-
})
|
|
309
|
-
|
|
310
|
-
// Remove with cds^8
|
|
311
|
-
if (!cds.env.fiori.lean_draft)
|
|
312
|
-
cds.utils.deprecated({ old: 'cds.fiori.lean_draft' })
|
|
313
|
-
|
|
314
|
-
// Remove with cds^8
|
|
315
|
-
if (!cds.requires.middlewares)
|
|
316
|
-
cds.utils.deprecated({ old: 'cds.requires.middlewares' })
|
|
317
|
-
|
|
318
|
-
// Remove with cds^8
|
|
319
|
-
if (cds.env.features.serve_on_root)
|
|
320
|
-
cds.utils.deprecated({ old: 'cds.features.serve_on_root', use: '@path annotation or adapt your consumers' })
|
|
321
|
-
|
|
322
306
|
// Remove with cds^8
|
|
323
307
|
if (cds.env.features.stream_compat)
|
|
324
308
|
cds.utils.deprecated({ old: 'cds.features.stream_compat' })
|
|
@@ -341,7 +325,7 @@ function _chdir_to (project) {
|
|
|
341
325
|
// try using the given project as a node package name, e.g. '@capire/bookshop'
|
|
342
326
|
try { cds.root = path.dirname (require.resolve(project+'/package.json')) }
|
|
343
327
|
// both failed
|
|
344
|
-
catch
|
|
328
|
+
catch { cds.error `No such folder or package: '${process.cwd()}' -> '${project}'` }
|
|
345
329
|
}
|
|
346
330
|
|
|
347
331
|
|
|
@@ -382,4 +366,14 @@ WARNING: Package '@sap/cds' was loaded from different installations:`,
|
|
|
382
366
|
-----------------------------------------------------------------------
|
|
383
367
|
`)
|
|
384
368
|
|
|
385
|
-
|
|
369
|
+
|
|
370
|
+
exports.exec = function cds_serve (...argv) {
|
|
371
|
+
try {
|
|
372
|
+
const [ args, options ] = require('./args') (serve, argv)
|
|
373
|
+
return serve (args, options)
|
|
374
|
+
} catch (e) {
|
|
375
|
+
console.error(e) // eslint-disable-line no-console
|
|
376
|
+
process.exitCode = 1
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
if (!module.parent) exports.exec (...process.argv.slice(2))
|
package/bin/test.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
module.exports = Object.assign ( test, {
|
|
4
|
+
options: [
|
|
5
|
+
'--files',
|
|
6
|
+
'--include',
|
|
7
|
+
'--exclude',
|
|
8
|
+
'--pattern',
|
|
9
|
+
'--skip',
|
|
10
|
+
],
|
|
11
|
+
flags: [
|
|
12
|
+
'--verbose',
|
|
13
|
+
'--unmute',
|
|
14
|
+
'--silent',
|
|
15
|
+
'--quiet',
|
|
16
|
+
'--list',
|
|
17
|
+
'--recent',
|
|
18
|
+
'--passed',
|
|
19
|
+
'--failed',
|
|
20
|
+
],
|
|
21
|
+
shortcuts: [ '-f', '-i', '-x', '-p', null, '-v', '-u', '-s', '-q', '-l' ],
|
|
22
|
+
help: `
|
|
23
|
+
`})
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
/* eslint-disable no-console */
|
|
27
|
+
const { DIMMED, RESET } = require('../lib/utils/colors')
|
|
28
|
+
|
|
29
|
+
async function test (argv,o) {
|
|
30
|
+
const _recent = require('os').userInfo().homedir + '/.cds-test-recent.json'
|
|
31
|
+
const recent = require('fs').existsSync(_recent) ? require(_recent) : {}
|
|
32
|
+
if (!o.recent) {
|
|
33
|
+
o.files = await find (argv, o, recent)
|
|
34
|
+
} else {
|
|
35
|
+
Object.assign (o,recent.options)
|
|
36
|
+
console.log ('\nchest',...o.argv)
|
|
37
|
+
}
|
|
38
|
+
if (o.list) return list (o.files)
|
|
39
|
+
if (o.skip) process.env._chest_skip = o.skip
|
|
40
|
+
if (o.files.length > 1) console.log(DIMMED,`\nRunning ${o.files.length} test suite${o.files.length > 1 ? 's' : ''}...`, RESET)
|
|
41
|
+
const test = require('node:test').run({ ...o, concurrency:true })
|
|
42
|
+
require('../lib/test/reporter')(test, test.options = o)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
async function find (argv,o,recent) {
|
|
47
|
+
|
|
48
|
+
// pre-process options
|
|
49
|
+
const { pattern = '.spec.js,.test.js', include, exclude = '_out' } = o,
|
|
50
|
+
patterns = pattern?.split(',') || [],
|
|
51
|
+
includes = include?.split(',') || [],
|
|
52
|
+
excludes = exclude?.split(',') || []
|
|
53
|
+
|
|
54
|
+
// return recent results if --passed or --failed is used
|
|
55
|
+
if (o.passed) return recent.passed
|
|
56
|
+
if (o.failed) return recent.failed
|
|
57
|
+
|
|
58
|
+
// check if argv is a list of files or directories
|
|
59
|
+
const {lstat} = require('fs').promises, files=[], roots=[]
|
|
60
|
+
await Promise.all (argv.map (async x => {
|
|
61
|
+
let ls = await lstat(x).catch(()=>{})
|
|
62
|
+
if (!ls) return includes.push(x)
|
|
63
|
+
if (ls.isDirectory()) return roots.push(x.replace(/\/$/,''))
|
|
64
|
+
if (ls.isFile()) return files.push(x)
|
|
65
|
+
else return includes.push(x)
|
|
66
|
+
}))
|
|
67
|
+
if (files.length && !roots.length && !includes.length) return files //> all files resolved
|
|
68
|
+
|
|
69
|
+
// Prepare UNIX find command to fetch matching files
|
|
70
|
+
let find = `find ${roots.join(' ')||'.'} -type f`
|
|
71
|
+
if (patterns.length) find += ` \\( ${ patterns.map (p=>`-name "${p.replace(/^([^*])/,'*$1')}"`).join(' -o ') } \\)`
|
|
72
|
+
if (includes.length) find += ` \\( ${ includes.map (p=>`-regex .*${p.replace(/\./g,'\\\\.')}.*`).join(' -o ') } \\)`
|
|
73
|
+
if (excludes.length) find += ` \\( ${ excludes.map (x=>`! -regex .*${x.replace(/\./g,'\\\\.')}.*`).join(' ') } \\)`
|
|
74
|
+
|
|
75
|
+
// Execute find command and return list of files
|
|
76
|
+
const exec = require('node:util') .promisify (require('node:child_process').exec)
|
|
77
|
+
const { stdout } = await exec (find)
|
|
78
|
+
return files.concat (stdout.split('\n').slice(0, -1).sort())
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
function list (files) {
|
|
83
|
+
const { relative } = require('node:path'), cwd = process.cwd()
|
|
84
|
+
console.log()
|
|
85
|
+
console.log(`Found ${files.length} test file${files.length > 1 ? 's' : ''}:`, DIMMED, '\n')
|
|
86
|
+
for (let f of files) console.log(' ', relative(cwd, f))
|
|
87
|
+
console.log(RESET)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
if (!module.parent) try {
|
|
92
|
+
const [ argv, options ] = require('./args') (test, process.argv.slice(2))
|
|
93
|
+
test (argv, options)
|
|
94
|
+
} catch (err) {
|
|
95
|
+
console.error(err) // eslint-disable-line no-console
|
|
96
|
+
process.exitCode = 1
|
|
97
|
+
}
|
package/common.cds
CHANGED
|
@@ -137,13 +137,6 @@ aspect temporal {
|
|
|
137
137
|
type User : String(255);
|
|
138
138
|
|
|
139
139
|
|
|
140
|
-
/**
|
|
141
|
-
* Aspects for extensible entities.
|
|
142
|
-
*/
|
|
143
|
-
aspect extensible {
|
|
144
|
-
@cds.api.ignore extensions__ : String
|
|
145
|
-
};
|
|
146
|
-
|
|
147
140
|
//---------------------------------------------------------------------------
|
|
148
141
|
// Annotations for Fiori UIs...
|
|
149
142
|
|
|
@@ -151,10 +144,10 @@ annotate sap.common.CodeList with @UI.Identification : [{Value:name}];
|
|
|
151
144
|
annotate sap.common.CodeList with @cds.odata.valuelist;
|
|
152
145
|
|
|
153
146
|
annotate managed with {
|
|
154
|
-
createdAt @UI.HiddenFilter;
|
|
155
|
-
createdBy @UI.HiddenFilter;
|
|
156
|
-
modifiedAt @UI.HiddenFilter;
|
|
157
|
-
modifiedBy @UI.HiddenFilter;
|
|
147
|
+
createdAt @UI.HiddenFilter @UI.ExcludeFromNavigationContext;
|
|
148
|
+
createdBy @UI.HiddenFilter @UI.ExcludeFromNavigationContext;
|
|
149
|
+
modifiedAt @UI.HiddenFilter @UI.ExcludeFromNavigationContext;
|
|
150
|
+
modifiedBy @UI.HiddenFilter @UI.ExcludeFromNavigationContext;
|
|
158
151
|
}
|
|
159
152
|
|
|
160
153
|
annotate managed with {
|
|
@@ -209,4 +202,4 @@ annotate managed with {
|
|
|
209
202
|
modifiedBy @readonly;
|
|
210
203
|
}
|
|
211
204
|
|
|
212
|
-
//---------------------------------------------------------------------------
|
|
205
|
+
//---------------------------------------------------------------------------
|