@sitecore/sc-contenthub-webclient-sdk 0.9.7
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/LICENSE +24 -0
- package/dist/api/api-info-resource.d.ts +8 -0
- package/dist/api/api-info-resource.js +42 -0
- package/dist/api/api-info.d.ts +29 -0
- package/dist/api/api-info.js +14 -0
- package/dist/api/api-resource.d.ts +4 -0
- package/dist/api/api-resource.js +16 -0
- package/dist/api/api-routes-dictionary.d.ts +8 -0
- package/dist/api/api-routes-dictionary.js +10 -0
- package/dist/authentication/oauth-grant-base.d.ts +6 -0
- package/dist/authentication/oauth-grant-base.js +42 -0
- package/dist/authentication/oauth-grant-type.d.ts +4 -0
- package/dist/authentication/oauth-grant-type.js +8 -0
- package/dist/authentication/oauth-password-grant.d.ts +8 -0
- package/dist/authentication/oauth-password-grant.js +45 -0
- package/dist/authentication/oauth-refreshtoken-grant.d.ts +7 -0
- package/dist/authentication/oauth-refreshtoken-grant.js +39 -0
- package/dist/authentication/token-info.d.ts +6 -0
- package/dist/authentication/token-info.js +35 -0
- package/dist/base-types.d.ts +56 -0
- package/dist/base-types.js +32 -0
- package/dist/caches/culture-cache.d.ts +8 -0
- package/dist/caches/culture-cache.js +21 -0
- package/dist/caches/entity-definition-cache.d.ts +44 -0
- package/dist/caches/entity-definition-cache.js +96 -0
- package/dist/clients/api-client.d.ts +56 -0
- package/dist/clients/api-client.js +107 -0
- package/dist/clients/commands-client.d.ts +16 -0
- package/dist/clients/commands-client.js +40 -0
- package/dist/clients/content-hub-client.d.ts +75 -0
- package/dist/clients/content-hub-client.js +66 -0
- package/dist/clients/culture-client.d.ts +36 -0
- package/dist/clients/culture-client.js +43 -0
- package/dist/clients/culture-loader.d.ts +41 -0
- package/dist/clients/culture-loader.js +103 -0
- package/dist/clients/entities-client.d.ts +201 -0
- package/dist/clients/entities-client.js +271 -0
- package/dist/clients/entity-definitions-client.d.ts +87 -0
- package/dist/clients/entity-definitions-client.js +354 -0
- package/dist/clients/extended-client.d.ts +11 -0
- package/dist/clients/extended-client.js +2 -0
- package/dist/clients/internal-client.d.ts +46 -0
- package/dist/clients/internal-client.js +240 -0
- package/dist/clients/notifications-client.d.ts +35 -0
- package/dist/clients/notifications-client.js +128 -0
- package/dist/clients/option-list-client.d.ts +49 -0
- package/dist/clients/option-list-client.js +85 -0
- package/dist/clients/pages-client.d.ts +36 -0
- package/dist/clients/pages-client.js +52 -0
- package/dist/clients/policies-client.d.ts +47 -0
- package/dist/clients/policies-client.js +92 -0
- package/dist/clients/querying-client.d.ts +34 -0
- package/dist/clients/querying-client.js +95 -0
- package/dist/clients/raw-client.d.ts +29 -0
- package/dist/clients/raw-client.js +79 -0
- package/dist/clients/request-message.d.ts +25 -0
- package/dist/clients/request-message.js +12 -0
- package/dist/clients/response-handler.d.ts +30 -0
- package/dist/clients/response-handler.js +145 -0
- package/dist/clients/response-message.d.ts +45 -0
- package/dist/clients/response-message.js +34 -0
- package/dist/clients/schema-querying.d.ts +16 -0
- package/dist/clients/schema-querying.js +70 -0
- package/dist/clients/search-client.d.ts +16 -0
- package/dist/clients/search-client.js +36 -0
- package/dist/clients/settings-client.d.ts +37 -0
- package/dist/clients/settings-client.js +126 -0
- package/dist/clients/users-client.d.ts +150 -0
- package/dist/clients/users-client.js +317 -0
- package/dist/clients/web-content-hub-client.d.ts +13 -0
- package/dist/clients/web-content-hub-client.js +2 -0
- package/dist/constants/api.d.ts +130 -0
- package/dist/constants/api.js +133 -0
- package/dist/constants/defaults.d.ts +7 -0
- package/dist/constants/defaults.js +10 -0
- package/dist/constants/definitions.d.ts +62 -0
- package/dist/constants/definitions.js +88 -0
- package/dist/constants/index.d.ts +5 -0
- package/dist/constants/index.js +30 -0
- package/dist/constants/notifications.d.ts +7 -0
- package/dist/constants/notifications.js +10 -0
- package/dist/contracts/base/culture-insensitive-property.d.ts +28 -0
- package/dist/contracts/base/culture-insensitive-property.js +47 -0
- package/dist/contracts/base/culture-sensitive-property.d.ts +49 -0
- package/dist/contracts/base/culture-sensitive-property.js +113 -0
- package/dist/contracts/base/data-type.d.ts +18 -0
- package/dist/contracts/base/data-type.js +24 -0
- package/dist/contracts/base/entity-base.d.ts +65 -0
- package/dist/contracts/base/entity-base.js +362 -0
- package/dist/contracts/base/entity-construction-args.d.ts +15 -0
- package/dist/contracts/base/entity-construction-args.js +16 -0
- package/dist/contracts/base/entity-definition.d.ts +108 -0
- package/dist/contracts/base/entity-definition.js +126 -0
- package/dist/contracts/base/entity.d.ts +237 -0
- package/dist/contracts/base/entity.js +76 -0
- package/dist/contracts/base/index.d.ts +14 -0
- package/dist/contracts/base/index.js +26 -0
- package/dist/contracts/base/json-content-type.d.ts +9 -0
- package/dist/contracts/base/json-content-type.js +13 -0
- package/dist/contracts/base/lazy-loading-manager.d.ts +4 -0
- package/dist/contracts/base/lazy-loading-manager.js +17 -0
- package/dist/contracts/base/member-condition.d.ts +48 -0
- package/dist/contracts/base/member-condition.js +125 -0
- package/dist/contracts/base/member-definition-type.d.ts +13 -0
- package/dist/contracts/base/member-definition-type.js +17 -0
- package/dist/contracts/base/member-definition.d.ts +77 -0
- package/dist/contracts/base/member-definition.js +101 -0
- package/dist/contracts/base/member-group.d.ts +54 -0
- package/dist/contracts/base/member-group.js +61 -0
- package/dist/contracts/base/member.d.ts +32 -0
- package/dist/contracts/base/member.js +26 -0
- package/dist/contracts/base/option-lists/flat-option-list-value.d.ts +4 -0
- package/dist/contracts/base/option-lists/flat-option-list-value.js +9 -0
- package/dist/contracts/base/option-lists/flat-option-list.d.ts +9 -0
- package/dist/contracts/base/option-lists/flat-option-list.js +11 -0
- package/dist/contracts/base/option-lists/hierarchical-option-list.d.ts +9 -0
- package/dist/contracts/base/option-lists/hierarchical-option-list.js +11 -0
- package/dist/contracts/base/option-lists/hierarchical-options-list-value.d.ts +7 -0
- package/dist/contracts/base/option-lists/hierarchical-options-list-value.js +14 -0
- package/dist/contracts/base/option-lists/option-list-base.d.ts +23 -0
- package/dist/contracts/base/option-lists/option-list-base.js +33 -0
- package/dist/contracts/base/option-lists/option-list-type.d.ts +13 -0
- package/dist/contracts/base/option-lists/option-list-type.js +17 -0
- package/dist/contracts/base/option-lists/option-list-value-base.d.ts +7 -0
- package/dist/contracts/base/option-lists/option-list-value-base.js +14 -0
- package/dist/contracts/base/option-lists/option-list-value.d.ts +30 -0
- package/dist/contracts/base/option-lists/option-list-value.js +2 -0
- package/dist/contracts/base/option-lists/option-list.d.ts +40 -0
- package/dist/contracts/base/option-lists/option-list.js +2 -0
- package/dist/contracts/base/property-definition.d.ts +61 -0
- package/dist/contracts/base/property-definition.js +76 -0
- package/dist/contracts/base/property-definitions/boolean-property-definition.d.ts +7 -0
- package/dist/contracts/base/property-definitions/boolean-property-definition.js +33 -0
- package/dist/contracts/base/property-definitions/datetime-property-definition.d.ts +7 -0
- package/dist/contracts/base/property-definitions/datetime-property-definition.js +33 -0
- package/dist/contracts/base/property-definitions/datetimeoffset-property-definition.d.ts +7 -0
- package/dist/contracts/base/property-definitions/datetimeoffset-property-definition.js +33 -0
- package/dist/contracts/base/property-definitions/decimal-property-definition.d.ts +7 -0
- package/dist/contracts/base/property-definitions/decimal-property-definition.js +33 -0
- package/dist/contracts/base/property-definitions/index.d.ts +8 -0
- package/dist/contracts/base/property-definitions/index.js +20 -0
- package/dist/contracts/base/property-definitions/integer-property-definition.d.ts +7 -0
- package/dist/contracts/base/property-definitions/integer-property-definition.js +33 -0
- package/dist/contracts/base/property-definitions/json-property-definition.d.ts +10 -0
- package/dist/contracts/base/property-definitions/json-property-definition.js +38 -0
- package/dist/contracts/base/property-definitions/long-property-definition.d.ts +7 -0
- package/dist/contracts/base/property-definitions/long-property-definition.js +33 -0
- package/dist/contracts/base/property-definitions/string-property-definition.d.ts +33 -0
- package/dist/contracts/base/property-definitions/string-property-definition.js +55 -0
- package/dist/contracts/base/property-manager.d.ts +19 -0
- package/dist/contracts/base/property-manager.js +114 -0
- package/dist/contracts/base/property.d.ts +21 -0
- package/dist/contracts/base/property.js +30 -0
- package/dist/contracts/base/relation-cardinality.d.ts +19 -0
- package/dist/contracts/base/relation-cardinality.js +22 -0
- package/dist/contracts/base/relation-container.d.ts +40 -0
- package/dist/contracts/base/relation-container.js +118 -0
- package/dist/contracts/base/relation-definition.d.ts +123 -0
- package/dist/contracts/base/relation-definition.js +116 -0
- package/dist/contracts/base/relation-manager.d.ts +70 -0
- package/dist/contracts/base/relation-manager.js +197 -0
- package/dist/contracts/base/relation-role.d.ts +14 -0
- package/dist/contracts/base/relation-role.js +17 -0
- package/dist/contracts/base/relation.d.ts +74 -0
- package/dist/contracts/base/relation.js +40 -0
- package/dist/contracts/base/relations/child-to-many-parents-relation.d.ts +27 -0
- package/dist/contracts/base/relations/child-to-many-parents-relation.js +67 -0
- package/dist/contracts/base/relations/child-to-one-parent-relation.d.ts +26 -0
- package/dist/contracts/base/relations/child-to-one-parent-relation.js +74 -0
- package/dist/contracts/base/relations/parent-to-many-children-relation.d.ts +27 -0
- package/dist/contracts/base/relations/parent-to-many-children-relation.js +67 -0
- package/dist/contracts/base/relations/parent-to-one-child-relation.d.ts +29 -0
- package/dist/contracts/base/relations/parent-to-one-child-relation.js +74 -0
- package/dist/contracts/base/relations/to-many-relation.d.ts +16 -0
- package/dist/contracts/base/relations/to-many-relation.js +2 -0
- package/dist/contracts/base/relations/to-one-relation.d.ts +18 -0
- package/dist/contracts/base/relations/to-one-relation.js +2 -0
- package/dist/contracts/base/rendition.d.ts +14 -0
- package/dist/contracts/base/rendition.js +13 -0
- package/dist/contracts/base/resource.d.ts +21 -0
- package/dist/contracts/base/resource.js +2 -0
- package/dist/contracts/base/string-content-type.d.ts +21 -0
- package/dist/contracts/base/string-content-type.js +25 -0
- package/dist/contracts/base/typed-entity.d.ts +11 -0
- package/dist/contracts/base/typed-entity.js +2 -0
- package/dist/contracts/base/users.d.ts +0 -0
- package/dist/contracts/base/users.js +1 -0
- package/dist/contracts/base/view-mode.d.ts +4 -0
- package/dist/contracts/base/view-mode.js +8 -0
- package/dist/contracts/content/asset.d.ts +22 -0
- package/dist/contracts/content/asset.js +67 -0
- package/dist/contracts/content/final-life-cycle-status.d.ts +7 -0
- package/dist/contracts/content/final-life-cycle-status.js +11 -0
- package/dist/contracts/dirty-tracking/dirty-tracking.d.ts +10 -0
- package/dist/contracts/dirty-tracking/dirty-tracking.js +2 -0
- package/dist/contracts/notifications/mail-template.d.ts +44 -0
- package/dist/contracts/notifications/mail-template.js +2 -0
- package/dist/contracts/policies/condition.d.ts +16 -0
- package/dist/contracts/policies/condition.js +10 -0
- package/dist/contracts/policies/member-policy.d.ts +31 -0
- package/dist/contracts/policies/member-policy.js +12 -0
- package/dist/contracts/policies/policy.d.ts +19 -0
- package/dist/contracts/policies/policy.js +11 -0
- package/dist/contracts/policies/rule-type.d.ts +7 -0
- package/dist/contracts/policies/rule-type.js +11 -0
- package/dist/contracts/policies/rule.d.ts +58 -0
- package/dist/contracts/policies/rule.js +19 -0
- package/dist/contracts/policies/user-group-policy.d.ts +10 -0
- package/dist/contracts/policies/user-group-policy.js +17 -0
- package/dist/contracts/policies/user-policy.d.ts +10 -0
- package/dist/contracts/policies/user-policy.js +17 -0
- package/dist/contracts/querying/culture-load-option.d.ts +35 -0
- package/dist/contracts/querying/culture-load-option.js +69 -0
- package/dist/contracts/querying/entity-definition-id-iterator.d.ts +9 -0
- package/dist/contracts/querying/entity-definition-id-iterator.js +30 -0
- package/dist/contracts/querying/entity-definition-id-query-result.d.ts +10 -0
- package/dist/contracts/querying/entity-definition-id-query-result.js +22 -0
- package/dist/contracts/querying/entity-definition-iterator.d.ts +16 -0
- package/dist/contracts/querying/entity-definition-iterator.js +30 -0
- package/dist/contracts/querying/entity-definition-query-result.d.ts +21 -0
- package/dist/contracts/querying/entity-definition-query-result.js +22 -0
- package/dist/contracts/querying/entity-iterator.d.ts +13 -0
- package/dist/contracts/querying/entity-iterator.js +30 -0
- package/dist/contracts/querying/entity-load-configuration-builder.d.ts +76 -0
- package/dist/contracts/querying/entity-load-configuration-builder.js +101 -0
- package/dist/contracts/querying/entity-load-configuration.d.ts +51 -0
- package/dist/contracts/querying/entity-load-configuration.js +67 -0
- package/dist/contracts/querying/entity-load-option.d.ts +35 -0
- package/dist/contracts/querying/entity-load-option.js +94 -0
- package/dist/contracts/querying/entity-query-result.d.ts +23 -0
- package/dist/contracts/querying/entity-query-result.js +33 -0
- package/dist/contracts/querying/filters/comparison-operator.d.ts +11 -0
- package/dist/contracts/querying/filters/comparison-operator.js +15 -0
- package/dist/contracts/querying/filters/composite-filter-operator.d.ts +4 -0
- package/dist/contracts/querying/filters/composite-filter-operator.js +8 -0
- package/dist/contracts/querying/filters/composite-query-filter.d.ts +19 -0
- package/dist/contracts/querying/filters/composite-query-filter.js +49 -0
- package/dist/contracts/querying/filters/createdby-query-filter.d.ts +5 -0
- package/dist/contracts/querying/filters/createdby-query-filter.js +30 -0
- package/dist/contracts/querying/filters/createdon-query-filter.d.ts +19 -0
- package/dist/contracts/querying/filters/createdon-query-filter.js +45 -0
- package/dist/contracts/querying/filters/definition-query-filter.d.ts +34 -0
- package/dist/contracts/querying/filters/definition-query-filter.js +58 -0
- package/dist/contracts/querying/filters/filter-data-type.d.ts +11 -0
- package/dist/contracts/querying/filters/filter-data-type.js +15 -0
- package/dist/contracts/querying/filters/filter-type.d.ts +18 -0
- package/dist/contracts/querying/filters/filter-type.js +22 -0
- package/dist/contracts/querying/filters/id-query-filter.d.ts +25 -0
- package/dist/contracts/querying/filters/id-query-filter.js +49 -0
- package/dist/contracts/querying/filters/identifier-query-filter.d.ts +25 -0
- package/dist/contracts/querying/filters/identifier-query-filter.js +49 -0
- package/dist/contracts/querying/filters/index.d.ts +20 -0
- package/dist/contracts/querying/filters/index.js +32 -0
- package/dist/contracts/querying/filters/modifiedby-query-filter.d.ts +5 -0
- package/dist/contracts/querying/filters/modifiedby-query-filter.js +30 -0
- package/dist/contracts/querying/filters/modifiedon-query-filter.d.ts +19 -0
- package/dist/contracts/querying/filters/modifiedon-query-filter.js +45 -0
- package/dist/contracts/querying/filters/modules-query-filter.d.ts +14 -0
- package/dist/contracts/querying/filters/modules-query-filter.js +43 -0
- package/dist/contracts/querying/filters/not-query-filter.d.ts +14 -0
- package/dist/contracts/querying/filters/not-query-filter.js +39 -0
- package/dist/contracts/querying/filters/property-query-filter.d.ts +38 -0
- package/dist/contracts/querying/filters/property-query-filter.js +63 -0
- package/dist/contracts/querying/filters/query-filter.d.ts +10 -0
- package/dist/contracts/querying/filters/query-filter.js +28 -0
- package/dist/contracts/querying/filters/relation-connection-type.d.ts +15 -0
- package/dist/contracts/querying/filters/relation-connection-type.js +19 -0
- package/dist/contracts/querying/filters/relation-query-filter.d.ts +23 -0
- package/dist/contracts/querying/filters/relation-query-filter.js +48 -0
- package/dist/contracts/querying/filters/secured-ancestors-query-filter.d.ts +24 -0
- package/dist/contracts/querying/filters/secured-ancestors-query-filter.js +53 -0
- package/dist/contracts/querying/filters/user-query-filter.d.ts +37 -0
- package/dist/contracts/querying/filters/user-query-filter.js +61 -0
- package/dist/contracts/querying/id-iterator.d.ts +11 -0
- package/dist/contracts/querying/id-iterator.js +19 -0
- package/dist/contracts/querying/id-query-result.d.ts +17 -0
- package/dist/contracts/querying/id-query-result.js +24 -0
- package/dist/contracts/querying/iterator.d.ts +9 -0
- package/dist/contracts/querying/iterator.js +2 -0
- package/dist/contracts/querying/load-option.d.ts +4 -0
- package/dist/contracts/querying/load-option.js +2 -0
- package/dist/contracts/querying/load-options.d.ts +6 -0
- package/dist/contracts/querying/load-options.js +10 -0
- package/dist/contracts/querying/loading-query-iterator.d.ts +17 -0
- package/dist/contracts/querying/loading-query-iterator.js +57 -0
- package/dist/contracts/querying/member-load-option.d.ts +11 -0
- package/dist/contracts/querying/member-load-option.js +15 -0
- package/dist/contracts/querying/minimal-schema.d.ts +8 -0
- package/dist/contracts/querying/minimal-schema.js +48 -0
- package/dist/contracts/querying/property-data.d.ts +8 -0
- package/dist/contracts/querying/property-data.js +43 -0
- package/dist/contracts/querying/property-load-option.d.ts +30 -0
- package/dist/contracts/querying/property-load-option.js +70 -0
- package/dist/contracts/querying/query-iterator.d.ts +18 -0
- package/dist/contracts/querying/query-iterator.js +54 -0
- package/dist/contracts/querying/query-load-configuration.d.ts +39 -0
- package/dist/contracts/querying/query-load-configuration.js +86 -0
- package/dist/contracts/querying/query-request.d.ts +6 -0
- package/dist/contracts/querying/query-request.js +30 -0
- package/dist/contracts/querying/query-result-paging-manager.d.ts +9 -0
- package/dist/contracts/querying/query-result-paging-manager.js +22 -0
- package/dist/contracts/querying/query-result.d.ts +5 -0
- package/dist/contracts/querying/query-result.js +2 -0
- package/dist/contracts/querying/query-sort-order.d.ts +13 -0
- package/dist/contracts/querying/query-sort-order.js +17 -0
- package/dist/contracts/querying/query.d.ts +23 -0
- package/dist/contracts/querying/query.js +56 -0
- package/dist/contracts/querying/relation-data.d.ts +7 -0
- package/dist/contracts/querying/relation-data.js +38 -0
- package/dist/contracts/querying/relation-load-option.d.ts +31 -0
- package/dist/contracts/querying/relation-load-option.js +74 -0
- package/dist/contracts/querying/relation-specification.d.ts +33 -0
- package/dist/contracts/querying/relation-specification.js +52 -0
- package/dist/contracts/querying/schema-querying.d.ts +20 -0
- package/dist/contracts/querying/schema-querying.js +2 -0
- package/dist/contracts/querying/scroll-request.d.ts +7 -0
- package/dist/contracts/querying/scroll-request.js +33 -0
- package/dist/contracts/querying/skip-take-iterator-base.d.ts +14 -0
- package/dist/contracts/querying/skip-take-iterator-base.js +60 -0
- package/dist/contracts/querying/sort-field-type.d.ts +13 -0
- package/dist/contracts/querying/sort-field-type.js +17 -0
- package/dist/contracts/querying/sorting.d.ts +25 -0
- package/dist/contracts/querying/sorting.js +44 -0
- package/dist/contracts/users/user-group-combine-method.d.ts +4 -0
- package/dist/contracts/users/user-group-combine-method.js +8 -0
- package/dist/contracts/users/user-group-configuration.d.ts +11 -0
- package/dist/contracts/users/user-group-configuration.js +35 -0
- package/dist/contracts/users/user-profile.d.ts +4 -0
- package/dist/contracts/users/user-profile.js +2 -0
- package/dist/contracts/users/user.d.ts +24 -0
- package/dist/contracts/users/user.js +64 -0
- package/dist/converters/api-resource-converter.d.ts +16 -0
- package/dist/converters/api-resource-converter.js +45 -0
- package/dist/converters/file-version-converter.d.ts +22 -0
- package/dist/converters/file-version-converter.js +43 -0
- package/dist/converters/index.d.ts +6 -0
- package/dist/converters/index.js +18 -0
- package/dist/converters/member-condition-converter.d.ts +20 -0
- package/dist/converters/member-condition-converter.js +50 -0
- package/dist/converters/member-condition-resource-converter.d.ts +21 -0
- package/dist/converters/member-condition-resource-converter.js +53 -0
- package/dist/converters/minimal-schema-relation-cardinality-converter.d.ts +11 -0
- package/dist/converters/minimal-schema-relation-cardinality-converter.js +33 -0
- package/dist/converters/page-resource-menus-converter.d.ts +19 -0
- package/dist/converters/page-resource-menus-converter.js +45 -0
- package/dist/converters/page-resource-zones-converter.d.ts +19 -0
- package/dist/converters/page-resource-zones-converter.js +45 -0
- package/dist/converters/relation-map-resource-converter.d.ts +6 -0
- package/dist/converters/relation-map-resource-converter.js +38 -0
- package/dist/converters/relation-resource-converter.d.ts +22 -0
- package/dist/converters/relation-resource-converter.js +51 -0
- package/dist/converters/renditions-converter.d.ts +20 -0
- package/dist/converters/renditions-converter.js +44 -0
- package/dist/converters/string-to-any-map-converter.d.ts +20 -0
- package/dist/converters/string-to-any-map-converter.js +34 -0
- package/dist/culture-info.d.ts +5 -0
- package/dist/culture-info.js +7 -0
- package/dist/dirty-value-calculator.d.ts +7 -0
- package/dist/dirty-value-calculator.js +29 -0
- package/dist/entity-link.d.ts +8 -0
- package/dist/entity-link.js +40 -0
- package/dist/error-messages.d.ts +57 -0
- package/dist/error-messages.js +64 -0
- package/dist/errors/argument-error.d.ts +4 -0
- package/dist/errors/argument-error.js +11 -0
- package/dist/errors/authentication-error.d.ts +5 -0
- package/dist/errors/authentication-error.js +12 -0
- package/dist/errors/bad-request-error.d.ts +5 -0
- package/dist/errors/bad-request-error.js +11 -0
- package/dist/errors/forbidden-error.d.ts +4 -0
- package/dist/errors/forbidden-error.js +11 -0
- package/dist/errors/internal-error.d.ts +4 -0
- package/dist/errors/internal-error.js +11 -0
- package/dist/errors/invalid-operation-error.d.ts +4 -0
- package/dist/errors/invalid-operation-error.js +11 -0
- package/dist/errors/not-found-error.d.ts +5 -0
- package/dist/errors/not-found-error.js +11 -0
- package/dist/errors/not-implemented-error.d.ts +4 -0
- package/dist/errors/not-implemented-error.js +11 -0
- package/dist/errors/not-loaded-error.d.ts +4 -0
- package/dist/errors/not-loaded-error.js +11 -0
- package/dist/errors/not-supported-error.d.ts +4 -0
- package/dist/errors/not-supported-error.js +11 -0
- package/dist/errors/schema-error.d.ts +4 -0
- package/dist/errors/schema-error.js +11 -0
- package/dist/errors/validation-error.d.ts +6 -0
- package/dist/errors/validation-error.js +12 -0
- package/dist/errors/validation-failure.d.ts +7 -0
- package/dist/errors/validation-failure.js +14 -0
- package/dist/errors/web-api-error.d.ts +13 -0
- package/dist/errors/web-api-error.js +13 -0
- package/dist/factories/entity-factory.d.ts +38 -0
- package/dist/factories/entity-factory.js +76 -0
- package/dist/factories/option-list-factory.d.ts +26 -0
- package/dist/factories/option-list-factory.js +22 -0
- package/dist/factories/property-factory.d.ts +10 -0
- package/dist/factories/property-factory.js +54 -0
- package/dist/factories/relation-factory.d.ts +55 -0
- package/dist/factories/relation-factory.js +70 -0
- package/dist/fileversion.d.ts +78 -0
- package/dist/fileversion.js +144 -0
- package/dist/guard.d.ts +29 -0
- package/dist/guard.js +142 -0
- package/dist/http-method.d.ts +9 -0
- package/dist/http-method.js +13 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +22 -0
- package/dist/link-helper.d.ts +209 -0
- package/dist/link-helper.js +371 -0
- package/dist/link.d.ts +9 -0
- package/dist/link.js +78 -0
- package/dist/logging/log-level.d.ts +6 -0
- package/dist/logging/log-level.js +10 -0
- package/dist/logging/logger-base.d.ts +26 -0
- package/dist/logging/logger-base.js +98 -0
- package/dist/logging/logger.d.ts +16 -0
- package/dist/logging/logger.js +2 -0
- package/dist/logging/null-logger.d.ts +7 -0
- package/dist/logging/null-logger.js +13 -0
- package/dist/mappers/api-resource-mapper.d.ts +5 -0
- package/dist/mappers/api-resource-mapper.js +16 -0
- package/dist/mappers/condition-mapper.d.ts +36 -0
- package/dist/mappers/condition-mapper.js +112 -0
- package/dist/mappers/entity-definition-mapper.d.ts +13 -0
- package/dist/mappers/entity-definition-mapper.js +88 -0
- package/dist/mappers/entity-mapper.d.ts +19 -0
- package/dist/mappers/entity-mapper.js +134 -0
- package/dist/mappers/final-life-cycle-status-mapper.d.ts +6 -0
- package/dist/mappers/final-life-cycle-status-mapper.js +51 -0
- package/dist/mappers/load-options-mapper.d.ts +16 -0
- package/dist/mappers/load-options-mapper.js +100 -0
- package/dist/mappers/mapping-utilities.d.ts +7 -0
- package/dist/mappers/mapping-utilities.js +19 -0
- package/dist/mappers/member-condition-mapper.d.ts +12 -0
- package/dist/mappers/member-condition-mapper.js +119 -0
- package/dist/mappers/member-definition-mapper.d.ts +19 -0
- package/dist/mappers/member-definition-mapper.js +266 -0
- package/dist/mappers/member-group-mapper.d.ts +14 -0
- package/dist/mappers/member-group-mapper.js +95 -0
- package/dist/mappers/member-security-mapper.d.ts +34 -0
- package/dist/mappers/member-security-mapper.js +101 -0
- package/dist/mappers/notification-mapper.d.ts +5 -0
- package/dist/mappers/notification-mapper.js +17 -0
- package/dist/mappers/option-list-mapper.d.ts +18 -0
- package/dist/mappers/option-list-mapper.js +131 -0
- package/dist/mappers/policy-mapper.d.ts +29 -0
- package/dist/mappers/policy-mapper.js +124 -0
- package/dist/mappers/property-mapper.d.ts +21 -0
- package/dist/mappers/property-mapper.js +339 -0
- package/dist/mappers/querying-mapper.d.ts +16 -0
- package/dist/mappers/querying-mapper.js +96 -0
- package/dist/mappers/relation-cardinality-mapper.d.ts +5 -0
- package/dist/mappers/relation-cardinality-mapper.js +37 -0
- package/dist/mappers/relation-mapper.d.ts +16 -0
- package/dist/mappers/relation-mapper.js +202 -0
- package/dist/mappers/relation-role-mapper.d.ts +5 -0
- package/dist/mappers/relation-role-mapper.js +29 -0
- package/dist/mappers/rendition-mapper.d.ts +9 -0
- package/dist/mappers/rendition-mapper.js +34 -0
- package/dist/mappers/rule-type-mapper.d.ts +6 -0
- package/dist/mappers/rule-type-mapper.js +33 -0
- package/dist/mappers/rules-mapper.d.ts +35 -0
- package/dist/mappers/rules-mapper.js +123 -0
- package/dist/mappers/typed-entity-creator.d.ts +27 -0
- package/dist/mappers/typed-entity-creator.js +76 -0
- package/dist/models/entity-definition-collection-resource.d.ts +5 -0
- package/dist/models/entity-definition-collection-resource.js +26 -0
- package/dist/models/entity-definition-resource.d.ts +23 -0
- package/dist/models/entity-definition-resource.js +98 -0
- package/dist/models/entity-list-resource.d.ts +5 -0
- package/dist/models/entity-list-resource.js +26 -0
- package/dist/models/entity-resource.d.ts +36 -0
- package/dist/models/entity-resource.js +142 -0
- package/dist/models/list-resource.d.ts +13 -0
- package/dist/models/list-resource.js +50 -0
- package/dist/models/member-condition-resource.d.ts +32 -0
- package/dist/models/member-condition-resource.js +95 -0
- package/dist/models/member-definition-resource.d.ts +15 -0
- package/dist/models/member-definition-resource.js +71 -0
- package/dist/models/member-group-resource.d.ts +14 -0
- package/dist/models/member-group-resource.js +61 -0
- package/dist/models/notifications/distribute-notification-resource.d.ts +7 -0
- package/dist/models/notifications/distribute-notification-resource.js +37 -0
- package/dist/models/notifications/mail-request-broadcast.d.ts +7 -0
- package/dist/models/notifications/mail-request-broadcast.js +18 -0
- package/dist/models/notifications/mail-request-by-id.d.ts +9 -0
- package/dist/models/notifications/mail-request-by-id.js +28 -0
- package/dist/models/notifications/mail-request-by-username.d.ts +9 -0
- package/dist/models/notifications/mail-request-by-username.js +28 -0
- package/dist/models/notifications/mail-request.d.ts +26 -0
- package/dist/models/notifications/mail-request.js +12 -0
- package/dist/models/notifications/notification-level.d.ts +8 -0
- package/dist/models/notifications/notification-level.js +12 -0
- package/dist/models/notifications/realtime-request-broadcast.d.ts +7 -0
- package/dist/models/notifications/realtime-request-broadcast.js +18 -0
- package/dist/models/notifications/realtime-request-by-id.d.ts +9 -0
- package/dist/models/notifications/realtime-request-by-id.js +28 -0
- package/dist/models/notifications/realtime-request-by-username.d.ts +9 -0
- package/dist/models/notifications/realtime-request-by-username.js +28 -0
- package/dist/models/notifications/realtime-request.d.ts +60 -0
- package/dist/models/notifications/realtime-request.js +41 -0
- package/dist/models/notifications/request-by-id.d.ts +13 -0
- package/dist/models/notifications/request-by-id.js +2 -0
- package/dist/models/notifications/request-by-username.d.ts +13 -0
- package/dist/models/notifications/request-by-username.js +2 -0
- package/dist/models/notifications/validators/mail-validator.d.ts +6 -0
- package/dist/models/notifications/validators/mail-validator.js +23 -0
- package/dist/models/notifications/validators/realtime-validator.d.ts +5 -0
- package/dist/models/notifications/validators/realtime-validator.js +14 -0
- package/dist/models/notifications/validators/request-by-id-validator.d.ts +6 -0
- package/dist/models/notifications/validators/request-by-id-validator.js +31 -0
- package/dist/models/notifications/validators/request-by-username-validator.d.ts +6 -0
- package/dist/models/notifications/validators/request-by-username-validator.js +31 -0
- package/dist/models/notifications/validators/validator-base.d.ts +6 -0
- package/dist/models/notifications/validators/validator-base.js +16 -0
- package/dist/models/option-lists/flat-option-list-value.d.ts +4 -0
- package/dist/models/option-lists/flat-option-list-value.js +9 -0
- package/dist/models/option-lists/hierarchical-options-list-value.d.ts +7 -0
- package/dist/models/option-lists/hierarchical-options-list-value.js +14 -0
- package/dist/models/option-lists/option-list-collection-resource.d.ts +6 -0
- package/dist/models/option-lists/option-list-collection-resource.js +32 -0
- package/dist/models/option-lists/option-list-description-resource.d.ts +5 -0
- package/dist/models/option-lists/option-list-description-resource.js +31 -0
- package/dist/models/option-lists/option-list-resource.d.ts +16 -0
- package/dist/models/option-lists/option-list-resource.js +62 -0
- package/dist/models/option-lists/option-list-value-resource.d.ts +6 -0
- package/dist/models/option-lists/option-list-value-resource.js +32 -0
- package/dist/models/pages/component-visualization.d.ts +10 -0
- package/dist/models/pages/component-visualization.js +54 -0
- package/dist/models/pages/language-resource.d.ts +10 -0
- package/dist/models/pages/language-resource.js +47 -0
- package/dist/models/pages/menu-item.d.ts +12 -0
- package/dist/models/pages/menu-item.js +66 -0
- package/dist/models/pages/page-component-resource.d.ts +20 -0
- package/dist/models/pages/page-component-resource.js +87 -0
- package/dist/models/pages/page-resource.d.ts +23 -0
- package/dist/models/pages/page-resource.js +100 -0
- package/dist/models/pages/page-row-settings.d.ts +27 -0
- package/dist/models/pages/page-row-settings.js +119 -0
- package/dist/models/pages/portal-column-resource.d.ts +6 -0
- package/dist/models/pages/portal-column-resource.js +37 -0
- package/dist/models/pages/portal-row-resource.d.ts +7 -0
- package/dist/models/pages/portal-row-resource.js +38 -0
- package/dist/models/pages/portal-section-resource.d.ts +6 -0
- package/dist/models/pages/portal-section-resource.js +37 -0
- package/dist/models/permissions-resource.d.ts +4 -0
- package/dist/models/permissions-resource.js +28 -0
- package/dist/models/policies/condition-resource.d.ts +21 -0
- package/dist/models/policies/condition-resource.js +53 -0
- package/dist/models/policies/member-policy-resource.d.ts +8 -0
- package/dist/models/policies/member-policy-resource.js +43 -0
- package/dist/models/policies/policy-resource.d.ts +50 -0
- package/dist/models/policies/policy-resource.js +89 -0
- package/dist/models/policies/rule-resource.d.ts +49 -0
- package/dist/models/policies/rule-resource.js +78 -0
- package/dist/models/property-definition-resource.d.ts +45 -0
- package/dist/models/property-definition-resource.js +198 -0
- package/dist/models/query-loading-resource.d.ts +4 -0
- package/dist/models/query-loading-resource.js +28 -0
- package/dist/models/query-result-resource.d.ts +9 -0
- package/dist/models/query-result-resource.js +34 -0
- package/dist/models/relation-definition-resource.d.ts +29 -0
- package/dist/models/relation-definition-resource.js +115 -0
- package/dist/models/relation-map-resource.d.ts +6 -0
- package/dist/models/relation-map-resource.js +16 -0
- package/dist/models/relation-resource.d.ts +21 -0
- package/dist/models/relation-resource.js +93 -0
- package/dist/models/resource-containers/entity-definition-resource-container.d.ts +8 -0
- package/dist/models/resource-containers/entity-definition-resource-container.js +2 -0
- package/dist/models/resource-containers/entity-resource-container.d.ts +8 -0
- package/dist/models/resource-containers/entity-resource-container.js +2 -0
- package/dist/models/resource.d.ts +4 -0
- package/dist/models/resource.js +26 -0
- package/dist/models/search/aggregation-request-resource.d.ts +16 -0
- package/dist/models/search/aggregation-request-resource.js +72 -0
- package/dist/models/search/aggregation-response-resource.d.ts +8 -0
- package/dist/models/search/aggregation-response-resource.js +41 -0
- package/dist/models/search/bucket-response-resource.d.ts +8 -0
- package/dist/models/search/bucket-response-resource.js +46 -0
- package/dist/models/search/date-interval.d.ts +10 -0
- package/dist/models/search/date-interval.js +14 -0
- package/dist/models/search/facet-response-resource.d.ts +20 -0
- package/dist/models/search/facet-response-resource.js +98 -0
- package/dist/models/search/field-filter-request-resource.d.ts +16 -0
- package/dist/models/search/field-filter-request-resource.js +76 -0
- package/dist/models/search/field-filter-response-resource.d.ts +17 -0
- package/dist/models/search/field-filter-response-resource.js +84 -0
- package/dist/models/search/field-filter-value-response-resource.d.ts +6 -0
- package/dist/models/search/field-filter-value-response-resource.js +31 -0
- package/dist/models/search/filter-operator.d.ts +86 -0
- package/dist/models/search/filter-operator.js +90 -0
- package/dist/models/search/full-text-response-resource.d.ts +4 -0
- package/dist/models/search/full-text-response-resource.js +27 -0
- package/dist/models/search/group-category.d.ts +6 -0
- package/dist/models/search/group-category.js +35 -0
- package/dist/models/search/group-config.d.ts +4 -0
- package/dist/models/search/group-config.js +27 -0
- package/dist/models/search/group-item.d.ts +10 -0
- package/dist/models/search/group-item.js +44 -0
- package/dist/models/search/grouped-view-response-resource.d.ts +15 -0
- package/dist/models/search/grouped-view-response-resource.js +65 -0
- package/dist/models/search/metric-option-request-resource.d.ts +7 -0
- package/dist/models/search/metric-option-request-resource.js +37 -0
- package/dist/models/search/metric-option-response-resource.d.ts +5 -0
- package/dist/models/search/metric-option-response-resource.js +31 -0
- package/dist/models/search/nested-relation-info.d.ts +11 -0
- package/dist/models/search/nested-relation-info.js +96 -0
- package/dist/models/search/requested-aggregation-type.d.ts +5 -0
- package/dist/models/search/requested-aggregation-type.js +9 -0
- package/dist/models/search/requested-filter-type.d.ts +6 -0
- package/dist/models/search/requested-filter-type.js +10 -0
- package/dist/models/search/search-group-request-resource.d.ts +5 -0
- package/dist/models/search/search-group-request-resource.js +31 -0
- package/dist/models/search/search-request.d.ts +41 -0
- package/dist/models/search/search-request.js +131 -0
- package/dist/models/search/search-response.d.ts +36 -0
- package/dist/models/search/search-response.js +123 -0
- package/dist/models/search/selection-pool-filter-resource.d.ts +7 -0
- package/dist/models/search/selection-pool-filter-resource.js +38 -0
- package/dist/models/search/sorting-request-resource.d.ts +5 -0
- package/dist/models/search/sorting-request-resource.js +32 -0
- package/dist/models/search/sorting-response-resource.d.ts +6 -0
- package/dist/models/search/sorting-response-resource.js +34 -0
- package/dist/models/search-document-resource.d.ts +7 -0
- package/dist/models/search-document-resource.js +33 -0
- package/dist/models/set-password-request-resource.d.ts +5 -0
- package/dist/models/set-password-request-resource.js +31 -0
- package/dist/settings/fetch-setting.d.ts +12 -0
- package/dist/settings/fetch-setting.js +61 -0
- package/dist/settings/super-user-excluded-privileges.d.ts +3 -0
- package/dist/settings/super-user-excluded-privileges.js +27 -0
- package/dist/settings/usage-rights-configuration.d.ts +24 -0
- package/dist/settings/usage-rights-configuration.js +90 -0
- package/dist/type-guards.d.ts +20 -0
- package/dist/type-guards.js +28 -0
- package/package.json +78 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CultureSensitiveProperty = void 0;
|
|
7
|
+
const dirty_value_calculator_1 = __importDefault(require("../../dirty-value-calculator"));
|
|
8
|
+
const guard_1 = __importDefault(require("../../guard"));
|
|
9
|
+
const property_1 = require("./property");
|
|
10
|
+
class CultureSensitiveProperty extends property_1.PropertyBase {
|
|
11
|
+
constructor(name, typeInfo, loadedCultures, values) {
|
|
12
|
+
super(name, typeInfo);
|
|
13
|
+
this._dirtyValueCalculators = {};
|
|
14
|
+
guard_1.default.arrayNotEmpty(loadedCultures);
|
|
15
|
+
loadedCultures.forEach(guard_1.default.notInvariantCulture);
|
|
16
|
+
this.isMultiLanguage = true;
|
|
17
|
+
this._values = {};
|
|
18
|
+
this._loadedCultures = [...new Set(loadedCultures)];
|
|
19
|
+
if (values !== undefined) {
|
|
20
|
+
guard_1.default.notNull(values);
|
|
21
|
+
Object.keys(values).forEach((culture) => {
|
|
22
|
+
this._values[culture] = values[culture]; //? Deep copy?
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
get isDirty() {
|
|
27
|
+
if (!this.isTracking) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
for (const cultureString in this._values) {
|
|
31
|
+
const culture = cultureString;
|
|
32
|
+
const value = this._values[culture];
|
|
33
|
+
const isDirty = this._dirtyValueCalculators[culture].isDirty(value);
|
|
34
|
+
if (isDirty) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
getTypeName() {
|
|
41
|
+
return this.constructor.name;
|
|
42
|
+
}
|
|
43
|
+
getValue(culture) {
|
|
44
|
+
this.cultureMustBeLoaded(culture);
|
|
45
|
+
if (this._values[culture] != null) {
|
|
46
|
+
return this._values[culture]; //? Add 'casting' wrapper
|
|
47
|
+
}
|
|
48
|
+
return null; //? Allow undefined?
|
|
49
|
+
}
|
|
50
|
+
getValues(cultures) {
|
|
51
|
+
if (cultures !== undefined) {
|
|
52
|
+
guard_1.default.arrayNotEmpty(cultures);
|
|
53
|
+
this.culturesMustBeLoaded(cultures);
|
|
54
|
+
return cultures.reduce((values, culture) => {
|
|
55
|
+
values[culture] = this._values[culture]; //? Add 'casting' wrapper?
|
|
56
|
+
return values;
|
|
57
|
+
}, {});
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return this._loadedCultures.reduce((values, culture) => {
|
|
61
|
+
values[culture] = this._values[culture]; //? Add 'casting' wrapper?
|
|
62
|
+
return values;
|
|
63
|
+
}, {});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
getCultures() {
|
|
67
|
+
return Object.keys(this._values);
|
|
68
|
+
}
|
|
69
|
+
setValue(culture, value) {
|
|
70
|
+
guard_1.default.notInvariantCulture(culture);
|
|
71
|
+
this.cultureMustBeLoaded(culture);
|
|
72
|
+
this._values[culture] = value;
|
|
73
|
+
}
|
|
74
|
+
startTracking() {
|
|
75
|
+
if (this.isTracking) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
this.isTracking = true;
|
|
79
|
+
for (const culture of this._loadedCultures) {
|
|
80
|
+
const dirtyValueCalculator = new dirty_value_calculator_1.default();
|
|
81
|
+
dirtyValueCalculator.setOriginalValue(this._values[culture]);
|
|
82
|
+
this._dirtyValueCalculators[culture] = dirtyValueCalculator;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
markClean() {
|
|
86
|
+
if (!this.isTracking) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
for (const culture of this._loadedCultures) {
|
|
90
|
+
this._dirtyValueCalculators[culture].setOriginalValue(this._values[culture]);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
getDirtyCultures() {
|
|
94
|
+
if (!this.isTracking) {
|
|
95
|
+
throw new Error("Can't get dirty cultures when not tracking changes.");
|
|
96
|
+
}
|
|
97
|
+
return this._loadedCultures.reduce((dirtyCultures, culture) => {
|
|
98
|
+
if (this._dirtyValueCalculators[culture].isDirty(this._values[culture])) {
|
|
99
|
+
dirtyCultures.push(culture);
|
|
100
|
+
}
|
|
101
|
+
return dirtyCultures;
|
|
102
|
+
}, []);
|
|
103
|
+
}
|
|
104
|
+
cultureMustBeLoaded(culture) {
|
|
105
|
+
if (!this._loadedCultures.includes(culture)) {
|
|
106
|
+
throw new Error(`Culture ${culture} was not loaded.`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
culturesMustBeLoaded(cultures) {
|
|
110
|
+
cultures.forEach(culture => this.cultureMustBeLoaded(culture));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.CultureSensitiveProperty = CultureSensitiveProperty;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Moment } from "moment";
|
|
2
|
+
import { JsonValue, MapCultureTo, Nullable, UnionKeyToValue } from "../../base-types";
|
|
3
|
+
declare type DataType = "Relation" | "String" | "Integer" | "Long" | "Decimal" | "Boolean" | "DateTime" | "DateTimeOffset" | "Json";
|
|
4
|
+
declare type PropertyDataType = Exclude<DataType, "Relation">;
|
|
5
|
+
declare type RelationDataType = Exclude<DataType, PropertyDataType>;
|
|
6
|
+
declare const PropertyDataType: UnionKeyToValue<PropertyDataType>;
|
|
7
|
+
declare const DataType: UnionKeyToValue<DataType>;
|
|
8
|
+
export { PropertyDataType, RelationDataType };
|
|
9
|
+
export declare class TypeInfo<T extends PropertyDataType | unknown = PropertyDataType, B extends boolean = boolean> {
|
|
10
|
+
name: string;
|
|
11
|
+
type: T;
|
|
12
|
+
readonly isArray: B;
|
|
13
|
+
constructor(type_: T, isArray?: B);
|
|
14
|
+
}
|
|
15
|
+
export declare type PropertyValue<T extends PropertyDataType | unknown = unknown, B extends boolean = false> = B extends true ? Nullable<Array<Type<T>>> : Nullable<Type<T>>;
|
|
16
|
+
export declare type PropertyValuePerCulture<T extends PropertyDataType | unknown = unknown, B extends boolean = false> = MapCultureTo<PropertyValue<T, B>>;
|
|
17
|
+
export declare type Type<T extends PropertyDataType | unknown> = T extends "String" ? string : T extends "Integer" ? number : T extends "Long" ? number : T extends "Decimal" ? number : T extends "Boolean" ? boolean : T extends "DateTime" ? Date | Moment : T extends "DateTimeOffset" ? Date | Moment : T extends "Json" ? JsonValue : T extends unknown ? unknown : never;
|
|
18
|
+
export default DataType;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeInfo = exports.PropertyDataType = void 0;
|
|
4
|
+
const PropertyDataType = {
|
|
5
|
+
String: "String",
|
|
6
|
+
Integer: "Integer",
|
|
7
|
+
Long: "Long",
|
|
8
|
+
Decimal: "Decimal",
|
|
9
|
+
Boolean: "Boolean",
|
|
10
|
+
DateTime: "DateTime",
|
|
11
|
+
DateTimeOffset: "DateTimeOffset",
|
|
12
|
+
Json: "Json",
|
|
13
|
+
};
|
|
14
|
+
exports.PropertyDataType = PropertyDataType;
|
|
15
|
+
const DataType = Object.assign(Object.assign({}, PropertyDataType), { Relation: "Relation" });
|
|
16
|
+
class TypeInfo {
|
|
17
|
+
constructor(type_, isArray) {
|
|
18
|
+
this.name = type_;
|
|
19
|
+
this.type = type_;
|
|
20
|
+
this.isArray = !!isArray;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.TypeInfo = TypeInfo;
|
|
24
|
+
exports.default = DataType;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { MapStringTo, Nullable, NullableResultPromise } from "../../base-types";
|
|
2
|
+
import { IContentHubClient } from "../../clients/content-hub-client";
|
|
3
|
+
import CultureInfo from "../../culture-info";
|
|
4
|
+
import { MemberLoadOption } from "../querying/member-load-option";
|
|
5
|
+
import { IPropertyLoadOption } from "../querying/property-load-option";
|
|
6
|
+
import { IRelationLoadOption } from "../querying/relation-load-option";
|
|
7
|
+
import { PropertyDataType, PropertyValue } from "./data-type";
|
|
8
|
+
import { IEntity } from "./entity";
|
|
9
|
+
import { EntityConstructionArgs } from "./entity-construction-args";
|
|
10
|
+
import { IEntityDefinition } from "./entity-definition";
|
|
11
|
+
import { IMember } from "./member";
|
|
12
|
+
import { IProperty } from "./property";
|
|
13
|
+
import { PropertyManager } from "./property-manager";
|
|
14
|
+
import { IRelation, RelationType } from "./relation";
|
|
15
|
+
import { RelationManager } from "./relation-manager";
|
|
16
|
+
import { RelationRole } from "./relation-role";
|
|
17
|
+
import { IRendition } from "./rendition";
|
|
18
|
+
export declare abstract class EntityBase implements IEntity {
|
|
19
|
+
protected readonly _client: IContentHubClient;
|
|
20
|
+
protected readonly _members: MapStringTo<IMember>;
|
|
21
|
+
protected readonly _propertyManager: PropertyManager;
|
|
22
|
+
protected readonly _relationManager: RelationManager;
|
|
23
|
+
id?: number;
|
|
24
|
+
identifier: Nullable<string>;
|
|
25
|
+
definitionName: string;
|
|
26
|
+
readonly lockedBy: Nullable<number>;
|
|
27
|
+
readonly lockedOn: Nullable<Date>;
|
|
28
|
+
isRootTaxonomyItem: boolean;
|
|
29
|
+
isPathRoot: boolean;
|
|
30
|
+
inheritsSecurity: boolean;
|
|
31
|
+
isSystemOwned: boolean;
|
|
32
|
+
version: number;
|
|
33
|
+
cultures: Array<CultureInfo>;
|
|
34
|
+
protected _properties: Array<IProperty>;
|
|
35
|
+
get properties(): ReadonlyArray<IProperty>;
|
|
36
|
+
protected _relations: Array<IRelation>;
|
|
37
|
+
get relations(): ReadonlyArray<IRelation>;
|
|
38
|
+
readonly createdOn?: Date;
|
|
39
|
+
readonly createdBy?: number;
|
|
40
|
+
readonly modifiedOn?: Date;
|
|
41
|
+
readonly modifiedBy?: number;
|
|
42
|
+
isTracking: boolean;
|
|
43
|
+
get canDoLazyLoading(): boolean;
|
|
44
|
+
get isDirty(): boolean;
|
|
45
|
+
get isNew(): boolean;
|
|
46
|
+
abstract get renditions(): Array<IRendition>;
|
|
47
|
+
constructor(client: IContentHubClient, args: EntityConstructionArgs);
|
|
48
|
+
private isProperty;
|
|
49
|
+
getProperty<T extends IProperty = IProperty>(name: string): Nullable<T>;
|
|
50
|
+
getPropertyAsync<T extends IProperty = IProperty>(name: string, loadOption?: MemberLoadOption): NullableResultPromise<T>;
|
|
51
|
+
getPropertyValue<T extends PropertyDataType | unknown = unknown, B extends boolean = false>(name: string, culture?: CultureInfo): PropertyValue<T, B>;
|
|
52
|
+
getPropertyValueAsync<T extends PropertyDataType | unknown = unknown, B extends boolean = false>(name: string, loadOption?: MemberLoadOption, culture?: CultureInfo): NullableResultPromise<PropertyValue<T, B>>;
|
|
53
|
+
setPropertyValue<T extends PropertyDataType, B extends boolean = false>(name: string, value: PropertyValue<T, B>, culture?: CultureInfo): void;
|
|
54
|
+
getRelation(name: string, role?: RelationRole, _returnNull?: boolean): Nullable<RelationType>;
|
|
55
|
+
getRelationAsync(name: string, role?: RelationRole | undefined, loadOption?: MemberLoadOption | undefined): NullableResultPromise<RelationType>;
|
|
56
|
+
loadPropertiesAsync(propertyLoadOption: IPropertyLoadOption): Promise<boolean>;
|
|
57
|
+
loadRelationsAsync(relationLoadOption: IRelationLoadOption): Promise<boolean>;
|
|
58
|
+
loadMembersAsync(propertyLoadOption: IPropertyLoadOption, relationLoadOption: IRelationLoadOption): Promise<boolean>;
|
|
59
|
+
getEntityDefinitionAsync(): Promise<IEntityDefinition>;
|
|
60
|
+
abstract getRendition(name: string): Nullable<IRendition>;
|
|
61
|
+
abstract getPermissionsAsync(): Promise<Array<string>>;
|
|
62
|
+
startTracking(): void;
|
|
63
|
+
markClean(): void;
|
|
64
|
+
private getDirtyTrackingMembers;
|
|
65
|
+
}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.EntityBase = void 0;
|
|
25
|
+
const string_format_1 = __importDefault(require("string-format"));
|
|
26
|
+
const ta_json_1 = require("ta-json");
|
|
27
|
+
const error_messages_1 = __importDefault(require("../../error-messages"));
|
|
28
|
+
const argument_error_1 = require("../../errors/argument-error");
|
|
29
|
+
const not_loaded_error_1 = require("../../errors/not-loaded-error");
|
|
30
|
+
const schema_error_1 = require("../../errors/schema-error");
|
|
31
|
+
const guard_1 = __importDefault(require("../../guard"));
|
|
32
|
+
const culture_load_option_1 = require("../querying/culture-load-option");
|
|
33
|
+
const entity_load_configuration_1 = require("../querying/entity-load-configuration");
|
|
34
|
+
const member_load_option_1 = require("../querying/member-load-option");
|
|
35
|
+
const entity_construction_args_1 = require("./entity-construction-args");
|
|
36
|
+
const member_definition_type_1 = require("./member-definition-type");
|
|
37
|
+
const property_1 = require("./property");
|
|
38
|
+
const property_manager_1 = require("./property-manager");
|
|
39
|
+
const relation_1 = require("./relation");
|
|
40
|
+
const relation_manager_1 = require("./relation-manager");
|
|
41
|
+
let EntityBase = class EntityBase {
|
|
42
|
+
constructor(client, args) {
|
|
43
|
+
this._members = {};
|
|
44
|
+
guard_1.default.notNullOrUndefined(client);
|
|
45
|
+
guard_1.default.notNullOrUndefined(args);
|
|
46
|
+
guard_1.default.arrayNoneNullOrInvariantCulture(args.cultures);
|
|
47
|
+
guard_1.default.arrayNoneNullOrUndefined(args.properties);
|
|
48
|
+
guard_1.default.arrayNoneNullOrUndefined(args.relations);
|
|
49
|
+
this._client = client;
|
|
50
|
+
this.definitionName = args.definitionName;
|
|
51
|
+
this.id = args.id || undefined;
|
|
52
|
+
this.identifier = args.identifier;
|
|
53
|
+
this.cultures = args.cultures;
|
|
54
|
+
this._propertyManager = new property_manager_1.PropertyManager(client, args.properties, this);
|
|
55
|
+
this._relationManager = new relation_manager_1.RelationManager(client, args.relations, this);
|
|
56
|
+
}
|
|
57
|
+
get properties() {
|
|
58
|
+
return this._propertyManager.getProperties();
|
|
59
|
+
}
|
|
60
|
+
get relations() {
|
|
61
|
+
return this._relationManager.getRelations();
|
|
62
|
+
}
|
|
63
|
+
get canDoLazyLoading() {
|
|
64
|
+
return !this.isNew && !!this.id;
|
|
65
|
+
}
|
|
66
|
+
get isDirty() {
|
|
67
|
+
if (!this.isTracking) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
for (const dirtyTracker of this.getDirtyTrackingMembers()) {
|
|
71
|
+
if (dirtyTracker.isDirty) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
get isNew() {
|
|
78
|
+
return !this.id || this.id <= 0;
|
|
79
|
+
}
|
|
80
|
+
isProperty(member) {
|
|
81
|
+
return member && member.definitionType === member_definition_type_1.MemberDefinitionType.Property;
|
|
82
|
+
}
|
|
83
|
+
getProperty(name) {
|
|
84
|
+
guard_1.default.stringNotNullOrEmpty(name);
|
|
85
|
+
const property = this._propertyManager.getProperty(name);
|
|
86
|
+
if (property == null) {
|
|
87
|
+
const errorMessage = string_format_1.default(error_messages_1.default.Entity.PropertyNotFound, name, this.id, this.definitionName);
|
|
88
|
+
throw new not_loaded_error_1.NotLoadedError(errorMessage);
|
|
89
|
+
}
|
|
90
|
+
return property;
|
|
91
|
+
}
|
|
92
|
+
getPropertyAsync(name, loadOption = member_load_option_1.MemberLoadOption.LazyLoading) {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
guard_1.default.stringNotNullOrEmpty(name);
|
|
95
|
+
guard_1.default.notNullOrUndefined(loadOption);
|
|
96
|
+
let property = this._propertyManager.getProperty(name);
|
|
97
|
+
if (property == null && loadOption == member_load_option_1.MemberLoadOption.LazyLoading) {
|
|
98
|
+
property = yield this._propertyManager.loadPropertyAsync(name);
|
|
99
|
+
if (property == null) {
|
|
100
|
+
const errorMessage = string_format_1.default(error_messages_1.default.Entity.PropertyDoesNotExist, name, this.definitionName);
|
|
101
|
+
throw new schema_error_1.SchemaError(errorMessage);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (property == null) {
|
|
105
|
+
const errorMessage = string_format_1.default(error_messages_1.default.Entity.PropertyNotFound, name, this.id, this.definitionName);
|
|
106
|
+
throw new schema_error_1.SchemaError(errorMessage);
|
|
107
|
+
}
|
|
108
|
+
return property;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
getPropertyValue(name, culture) {
|
|
112
|
+
guard_1.default.stringNotNullOrEmpty(name);
|
|
113
|
+
const property = this.getProperty(name);
|
|
114
|
+
if (property == null) {
|
|
115
|
+
const errorMessage = string_format_1.default(error_messages_1.default.Entity.PropertyNotFound, name, this.id, this.definitionName);
|
|
116
|
+
throw new not_loaded_error_1.NotLoadedError(errorMessage);
|
|
117
|
+
}
|
|
118
|
+
else if (property.isMultiLanguage && culture == null) {
|
|
119
|
+
throw new argument_error_1.ArgumentError(error_messages_1.default.Entity.CultureRequired);
|
|
120
|
+
}
|
|
121
|
+
else if (culture != null && !property.isMultiLanguage) {
|
|
122
|
+
throw new argument_error_1.ArgumentError(error_messages_1.default.Entity.CultureNotSupported);
|
|
123
|
+
}
|
|
124
|
+
if (property.isMultiLanguage) {
|
|
125
|
+
const cultureSensitiveProp = property;
|
|
126
|
+
return cultureSensitiveProp.getValue(culture);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
const cultureInsensitiveProp = property;
|
|
130
|
+
return cultureInsensitiveProp.getValue();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
getPropertyValueAsync(name, loadOption = member_load_option_1.MemberLoadOption.LazyLoading, culture) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
guard_1.default.stringNotNullOrEmpty(name);
|
|
136
|
+
guard_1.default.notNullOrUndefined(loadOption);
|
|
137
|
+
const property = yield this.getPropertyAsync(name, loadOption);
|
|
138
|
+
if (property == null) {
|
|
139
|
+
const errorMessage = string_format_1.default(error_messages_1.default.Entity.PropertyDoesNotExist, name, this.definitionName);
|
|
140
|
+
throw new schema_error_1.SchemaError(errorMessage);
|
|
141
|
+
}
|
|
142
|
+
else if (property.isMultiLanguage && culture == null) {
|
|
143
|
+
throw new argument_error_1.ArgumentError(error_messages_1.default.Entity.CultureRequired);
|
|
144
|
+
}
|
|
145
|
+
else if (culture != null && !property.isMultiLanguage) {
|
|
146
|
+
throw new argument_error_1.ArgumentError(error_messages_1.default.Entity.CultureNotSupported);
|
|
147
|
+
}
|
|
148
|
+
if (property.isMultiLanguage) {
|
|
149
|
+
const cultureSensitiveProp = property;
|
|
150
|
+
return cultureSensitiveProp.getValue(culture);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
const cultureInsensitiveProp = property;
|
|
154
|
+
return cultureInsensitiveProp.getValue();
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
setPropertyValue(name, value, culture) {
|
|
159
|
+
guard_1.default.stringNotNullOrEmpty(name);
|
|
160
|
+
const property = this._propertyManager.getProperty(name);
|
|
161
|
+
if (property == null) {
|
|
162
|
+
const errorMessage = string_format_1.default(error_messages_1.default.Entity.PropertyNotFound, name, this.id, this.definitionName);
|
|
163
|
+
throw new not_loaded_error_1.NotLoadedError(errorMessage);
|
|
164
|
+
}
|
|
165
|
+
else if (property.isMultiLanguage && culture == null) {
|
|
166
|
+
throw new argument_error_1.ArgumentError(error_messages_1.default.Entity.CultureRequired);
|
|
167
|
+
}
|
|
168
|
+
else if (culture != null && !property.isMultiLanguage) {
|
|
169
|
+
throw new argument_error_1.ArgumentError(error_messages_1.default.Entity.CultureRequired);
|
|
170
|
+
}
|
|
171
|
+
if (property.isMultiLanguage) {
|
|
172
|
+
property.setValue(culture, value);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
property.setValue(value);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
getRelation(name, role, _returnNull = false) {
|
|
179
|
+
guard_1.default.stringNotNullOrEmpty(name);
|
|
180
|
+
const relation = this._relationManager.getRelation(name, role);
|
|
181
|
+
if (relation == null) {
|
|
182
|
+
if (_returnNull) {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
const errorMessage = string_format_1.default(error_messages_1.default.Entity.RelationNotFound, name, this.id, this.definitionName);
|
|
186
|
+
throw new not_loaded_error_1.NotLoadedError(errorMessage);
|
|
187
|
+
}
|
|
188
|
+
else if (relation_1.RelationBase.isChildToManyParentsRelation(relation)) {
|
|
189
|
+
return relation;
|
|
190
|
+
}
|
|
191
|
+
else if (relation_1.RelationBase.isChildToOneParentRelation(relation)) {
|
|
192
|
+
return relation;
|
|
193
|
+
}
|
|
194
|
+
else if (relation_1.RelationBase.isParentToManyChildrenRelation(relation)) {
|
|
195
|
+
return relation;
|
|
196
|
+
}
|
|
197
|
+
else if (relation_1.RelationBase.isParentToOneChildRelation(relation)) {
|
|
198
|
+
return relation;
|
|
199
|
+
}
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
getRelationAsync(name, role, loadOption) {
|
|
203
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
204
|
+
guard_1.default.stringNotNullOrEmpty(name);
|
|
205
|
+
const relation = this.getRelation(name, role, true);
|
|
206
|
+
if (relation == null && loadOption == member_load_option_1.MemberLoadOption.LazyLoading) {
|
|
207
|
+
{
|
|
208
|
+
// Scoped to be able to redefine relation as type RelationType does not match IRelation. //TODO generics?
|
|
209
|
+
const relation = yield this._relationManager.loadRelationAsync(name, role);
|
|
210
|
+
if (relation == null) {
|
|
211
|
+
const errorMessage = string_format_1.default(error_messages_1.default.Entity.RelationDoesNotExist, name, this.definitionName);
|
|
212
|
+
throw new schema_error_1.SchemaError(errorMessage);
|
|
213
|
+
}
|
|
214
|
+
if (relation_1.RelationBase.isChildToManyParentsRelation(relation)) {
|
|
215
|
+
return relation;
|
|
216
|
+
}
|
|
217
|
+
else if (relation_1.RelationBase.isChildToOneParentRelation(relation)) {
|
|
218
|
+
return relation;
|
|
219
|
+
}
|
|
220
|
+
else if (relation_1.RelationBase.isParentToManyChildrenRelation(relation)) {
|
|
221
|
+
return relation;
|
|
222
|
+
}
|
|
223
|
+
else if (relation_1.RelationBase.isParentToOneChildRelation(relation)) {
|
|
224
|
+
return relation;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return relation;
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
loadPropertiesAsync(propertyLoadOption) {
|
|
232
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
233
|
+
if (!this.canDoLazyLoading || propertyLoadOption == null) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
return this._propertyManager.loadPropertiesAsync(propertyLoadOption);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
loadRelationsAsync(relationLoadOption) {
|
|
240
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
241
|
+
if (!this.canDoLazyLoading || relationLoadOption == null) {
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
return this._relationManager.loadRelationsAsync(relationLoadOption);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
loadMembersAsync(propertyLoadOption, relationLoadOption) {
|
|
248
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
249
|
+
if (!this.canDoLazyLoading) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
const hasMissingProperties = this._propertyManager.hasMissingProperties(propertyLoadOption);
|
|
253
|
+
const hasMissingRelations = this._relationManager.hasMissingRelations(relationLoadOption);
|
|
254
|
+
if (!hasMissingProperties && !hasMissingRelations) {
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
const cultureLoadOption = new culture_load_option_1.CultureLoadOption([...this.cultures]);
|
|
258
|
+
const loadConfiguration = new entity_load_configuration_1.EntityLoadConfiguration(cultureLoadOption, propertyLoadOption, relationLoadOption);
|
|
259
|
+
const tempEntity = yield this._client.entities.getAsync(this.id, loadConfiguration);
|
|
260
|
+
// Import missing members
|
|
261
|
+
this._propertyManager.importMissingProperties(tempEntity);
|
|
262
|
+
this._relationManager.importMissingRelations(tempEntity);
|
|
263
|
+
return true;
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
getEntityDefinitionAsync() {
|
|
267
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
268
|
+
return (yield this._client.entityDefinitions.getCachedAsync(this.definitionName));
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
startTracking() {
|
|
272
|
+
if (this.isTracking)
|
|
273
|
+
return;
|
|
274
|
+
this.isTracking = true;
|
|
275
|
+
for (const member of this.getDirtyTrackingMembers()) {
|
|
276
|
+
member.startTracking();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
markClean() {
|
|
280
|
+
for (const member of this.getDirtyTrackingMembers()) {
|
|
281
|
+
member.markClean();
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
getDirtyTrackingMembers() {
|
|
285
|
+
const properties = this._propertyManager.getProperties();
|
|
286
|
+
const relations = this._relationManager.getRelations();
|
|
287
|
+
const list = [...properties, ...relations];
|
|
288
|
+
return list;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
__decorate([
|
|
292
|
+
ta_json_1.JsonProperty("id"),
|
|
293
|
+
__metadata("design:type", Number)
|
|
294
|
+
], EntityBase.prototype, "id", void 0);
|
|
295
|
+
__decorate([
|
|
296
|
+
ta_json_1.JsonProperty("identifier"),
|
|
297
|
+
__metadata("design:type", Object)
|
|
298
|
+
], EntityBase.prototype, "identifier", void 0);
|
|
299
|
+
__decorate([
|
|
300
|
+
ta_json_1.JsonProperty("locked_by"),
|
|
301
|
+
__metadata("design:type", Object)
|
|
302
|
+
], EntityBase.prototype, "lockedBy", void 0);
|
|
303
|
+
__decorate([
|
|
304
|
+
ta_json_1.JsonProperty("locked_on"),
|
|
305
|
+
__metadata("design:type", Object)
|
|
306
|
+
], EntityBase.prototype, "lockedOn", void 0);
|
|
307
|
+
__decorate([
|
|
308
|
+
ta_json_1.JsonProperty("is_root_taxonomy_item"),
|
|
309
|
+
__metadata("design:type", Boolean)
|
|
310
|
+
], EntityBase.prototype, "isRootTaxonomyItem", void 0);
|
|
311
|
+
__decorate([
|
|
312
|
+
ta_json_1.JsonProperty("is_path_root"),
|
|
313
|
+
__metadata("design:type", Boolean)
|
|
314
|
+
], EntityBase.prototype, "isPathRoot", void 0);
|
|
315
|
+
__decorate([
|
|
316
|
+
ta_json_1.JsonProperty("inherits_security"),
|
|
317
|
+
__metadata("design:type", Boolean)
|
|
318
|
+
], EntityBase.prototype, "inheritsSecurity", void 0);
|
|
319
|
+
__decorate([
|
|
320
|
+
ta_json_1.JsonProperty("is_system_owned"),
|
|
321
|
+
__metadata("design:type", Boolean)
|
|
322
|
+
], EntityBase.prototype, "isSystemOwned", void 0);
|
|
323
|
+
__decorate([
|
|
324
|
+
ta_json_1.JsonProperty("version"),
|
|
325
|
+
__metadata("design:type", Number)
|
|
326
|
+
], EntityBase.prototype, "version", void 0);
|
|
327
|
+
__decorate([
|
|
328
|
+
ta_json_1.JsonProperty("cultures"),
|
|
329
|
+
ta_json_1.JsonElementType(String),
|
|
330
|
+
__metadata("design:type", Array)
|
|
331
|
+
], EntityBase.prototype, "cultures", void 0);
|
|
332
|
+
__decorate([
|
|
333
|
+
ta_json_1.JsonProperty("properties"),
|
|
334
|
+
ta_json_1.JsonElementType(property_1.PropertyBase),
|
|
335
|
+
__metadata("design:type", Array)
|
|
336
|
+
], EntityBase.prototype, "_properties", void 0);
|
|
337
|
+
__decorate([
|
|
338
|
+
ta_json_1.JsonProperty("relations"),
|
|
339
|
+
ta_json_1.JsonElementType(relation_1.RelationBase),
|
|
340
|
+
__metadata("design:type", Array)
|
|
341
|
+
], EntityBase.prototype, "_relations", void 0);
|
|
342
|
+
__decorate([
|
|
343
|
+
ta_json_1.JsonProperty("created_on"),
|
|
344
|
+
__metadata("design:type", Date)
|
|
345
|
+
], EntityBase.prototype, "createdOn", void 0);
|
|
346
|
+
__decorate([
|
|
347
|
+
ta_json_1.JsonProperty("created_by"),
|
|
348
|
+
__metadata("design:type", Number)
|
|
349
|
+
], EntityBase.prototype, "createdBy", void 0);
|
|
350
|
+
__decorate([
|
|
351
|
+
ta_json_1.JsonProperty("modified_on"),
|
|
352
|
+
__metadata("design:type", Date)
|
|
353
|
+
], EntityBase.prototype, "modifiedOn", void 0);
|
|
354
|
+
__decorate([
|
|
355
|
+
ta_json_1.JsonProperty("modified_by"),
|
|
356
|
+
__metadata("design:type", Number)
|
|
357
|
+
], EntityBase.prototype, "modifiedBy", void 0);
|
|
358
|
+
EntityBase = __decorate([
|
|
359
|
+
ta_json_1.JsonObject(),
|
|
360
|
+
__metadata("design:paramtypes", [Object, entity_construction_args_1.EntityConstructionArgs])
|
|
361
|
+
], EntityBase);
|
|
362
|
+
exports.EntityBase = EntityBase;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Nullable } from "../../base-types";
|
|
2
|
+
import CultureInfo from "../../culture-info";
|
|
3
|
+
import { IProperty } from "./property";
|
|
4
|
+
import { IRelation } from "./relation";
|
|
5
|
+
import { IRendition } from "./rendition";
|
|
6
|
+
export declare class EntityConstructionArgs {
|
|
7
|
+
definitionName: string;
|
|
8
|
+
id?: Nullable<number>;
|
|
9
|
+
identifier: Nullable<string>;
|
|
10
|
+
properties: Array<IProperty>;
|
|
11
|
+
relations: Array<IRelation>;
|
|
12
|
+
cultures: Array<CultureInfo>;
|
|
13
|
+
renditions: Array<IRendition>;
|
|
14
|
+
constructor(definitionName: string, init?: Omit<Partial<EntityConstructionArgs>, "definitionName">);
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityConstructionArgs = void 0;
|
|
4
|
+
class EntityConstructionArgs {
|
|
5
|
+
constructor(definitionName, init) {
|
|
6
|
+
this.id = null;
|
|
7
|
+
this.identifier = null;
|
|
8
|
+
this.properties = [];
|
|
9
|
+
this.relations = [];
|
|
10
|
+
this.cultures = [];
|
|
11
|
+
this.renditions = [];
|
|
12
|
+
this.definitionName = definitionName;
|
|
13
|
+
Object.assign(this, init);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.EntityConstructionArgs = EntityConstructionArgs;
|