@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,339 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
31
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
|
+
};
|
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
exports.PropertyMapper = void 0;
|
|
35
|
+
const moment_1 = __importDefault(require("moment"));
|
|
36
|
+
const culture_insensitive_property_1 = require("../contracts/base/culture-insensitive-property");
|
|
37
|
+
const culture_sensitive_property_1 = require("../contracts/base/culture-sensitive-property");
|
|
38
|
+
const data_type_1 = __importStar(require("../contracts/base/data-type"));
|
|
39
|
+
const minimal_schema_1 = require("../contracts/querying/minimal-schema");
|
|
40
|
+
const property_data_1 = require("../contracts/querying/property-data");
|
|
41
|
+
const guard_1 = __importDefault(require("../guard"));
|
|
42
|
+
class PropertyMapper {
|
|
43
|
+
constructor(client) {
|
|
44
|
+
guard_1.default.notNullOrUndefined(client);
|
|
45
|
+
this._client = client;
|
|
46
|
+
}
|
|
47
|
+
mapPropertiesAsync(resource, loadedCultures, schema) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
if (resource == null || resource.properties == null || Object.keys(resource.properties).length === 0) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
// If no minimal schema is available, build it from the definition.
|
|
53
|
+
if (schema == null) {
|
|
54
|
+
const definitionName = yield this._client.linkHelper.nameFromDefinitionAsync(resource.entityDefinition);
|
|
55
|
+
if (definitionName == null) {
|
|
56
|
+
throw new Error(`Could not resolve definition name from entity resource.`);
|
|
57
|
+
}
|
|
58
|
+
const definition = yield this._client.entityDefinitions.getCachedAsync(definitionName);
|
|
59
|
+
if (definition == null) {
|
|
60
|
+
throw new Error(`Could not load definition with name '${definitionName}.`);
|
|
61
|
+
}
|
|
62
|
+
schema = new minimal_schema_1.MinimalSchema(definitionName);
|
|
63
|
+
const loadedProperties = Object.keys(resource.properties);
|
|
64
|
+
schema.properties = definition
|
|
65
|
+
.getPropertyDefinitions()
|
|
66
|
+
.filter(propertyDefinition => loadedProperties.includes(propertyDefinition.name))
|
|
67
|
+
.map(propertyDefinition => {
|
|
68
|
+
let hasDataSource = false;
|
|
69
|
+
if (propertyDefinition.type === data_type_1.default.String) {
|
|
70
|
+
const stringPropertyDef = propertyDefinition;
|
|
71
|
+
hasDataSource = !!(stringPropertyDef.dataSourceName && stringPropertyDef.dataSourceName.length > 0);
|
|
72
|
+
}
|
|
73
|
+
return new property_data_1.PropertyData({
|
|
74
|
+
name: propertyDefinition.name,
|
|
75
|
+
isMultiValue: propertyDefinition.isMultiValue,
|
|
76
|
+
isMultilingual: propertyDefinition.isMultiLanguage,
|
|
77
|
+
hasDataSource: hasDataSource,
|
|
78
|
+
dataType: data_type_1.default[propertyDefinition.type],
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const list = [];
|
|
83
|
+
for (const definition of schema.properties) {
|
|
84
|
+
const prop = this.mapProperty(resource, loadedCultures, definition);
|
|
85
|
+
list.push(prop);
|
|
86
|
+
}
|
|
87
|
+
return list;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
mapProperty(resource, loadedCultures, definition) {
|
|
91
|
+
const name = definition.name;
|
|
92
|
+
const typeInfo = PropertyMapper.getType(definition);
|
|
93
|
+
const propertyValue = resource.properties[name];
|
|
94
|
+
let property;
|
|
95
|
+
if (definition.hasDataSource) {
|
|
96
|
+
property = PropertyMapper.mapDataSource(definition, name, typeInfo, propertyValue);
|
|
97
|
+
}
|
|
98
|
+
else if (definition.isMultilingual) {
|
|
99
|
+
property = PropertyMapper.mapMultilingualProperty(loadedCultures, name, typeInfo, propertyValue);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
let value;
|
|
103
|
+
if (definition.isMultiValue) {
|
|
104
|
+
value = PropertyMapper.convertValue(typeInfo.type, true, propertyValue);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
value = PropertyMapper.convertValue(typeInfo.type, false, propertyValue);
|
|
108
|
+
}
|
|
109
|
+
property = new culture_insensitive_property_1.CultureInsensitiveProperty(name, typeInfo, value);
|
|
110
|
+
}
|
|
111
|
+
return property;
|
|
112
|
+
}
|
|
113
|
+
static mapMultilingualProperty(loadedCultures, name, typeInfo, propertyValue) {
|
|
114
|
+
const values = {};
|
|
115
|
+
for (const culture of Object.keys(propertyValue)) {
|
|
116
|
+
let value;
|
|
117
|
+
if (typeInfo.isArray) {
|
|
118
|
+
value = this.convertValue(typeInfo.type, true, propertyValue[culture]);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
value = this.convertValue(typeInfo.type, false, propertyValue[culture]);
|
|
122
|
+
}
|
|
123
|
+
values[culture] = value;
|
|
124
|
+
}
|
|
125
|
+
const prop = new culture_sensitive_property_1.CultureSensitiveProperty(name, typeInfo, loadedCultures, values);
|
|
126
|
+
return prop;
|
|
127
|
+
}
|
|
128
|
+
//#region SDK to Base
|
|
129
|
+
// mapProperties
|
|
130
|
+
static mapToPropertyResources(entity) {
|
|
131
|
+
guard_1.default.notNullOrUndefined(entity);
|
|
132
|
+
const dict = {};
|
|
133
|
+
for (const property of entity.properties) {
|
|
134
|
+
const mappedProp = this.mapToPropertyData(property);
|
|
135
|
+
dict[mappedProp.key] = mappedProp.value;
|
|
136
|
+
}
|
|
137
|
+
return dict;
|
|
138
|
+
}
|
|
139
|
+
static mapDirtyProperties(entity) {
|
|
140
|
+
guard_1.default.notNullOrUndefined(entity);
|
|
141
|
+
const result = {};
|
|
142
|
+
const dirtyProperties = entity.properties.filter(property => property.isDirty);
|
|
143
|
+
for (const property of dirtyProperties) {
|
|
144
|
+
const mappedProp = this.mapToPropertyData(property);
|
|
145
|
+
result[mappedProp.key] = mappedProp.value;
|
|
146
|
+
}
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
// mapProperty
|
|
150
|
+
static mapToPropertyData(property) {
|
|
151
|
+
let propertyData;
|
|
152
|
+
if (property instanceof culture_sensitive_property_1.CultureSensitiveProperty) {
|
|
153
|
+
const values = property.getValues();
|
|
154
|
+
propertyData = { key: property.name, value: values };
|
|
155
|
+
}
|
|
156
|
+
else if (property instanceof culture_insensitive_property_1.CultureInsensitiveProperty) {
|
|
157
|
+
const value = property.getValue();
|
|
158
|
+
propertyData = { key: property.name, value: value };
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
throw new Error(`Property of type ${property.dataType} is not supported.`);
|
|
162
|
+
}
|
|
163
|
+
return propertyData;
|
|
164
|
+
}
|
|
165
|
+
//#endregion
|
|
166
|
+
static getType(data) {
|
|
167
|
+
let type;
|
|
168
|
+
switch (data.dataType) {
|
|
169
|
+
case "Boolean":
|
|
170
|
+
type = data_type_1.default.Boolean;
|
|
171
|
+
break;
|
|
172
|
+
case "Decimal":
|
|
173
|
+
type = data_type_1.default.Decimal;
|
|
174
|
+
break;
|
|
175
|
+
case "Int32":
|
|
176
|
+
case data_type_1.default[data_type_1.default.Integer]:
|
|
177
|
+
type = data_type_1.default.Integer;
|
|
178
|
+
break;
|
|
179
|
+
case "Int64":
|
|
180
|
+
case data_type_1.default[data_type_1.default.Long]:
|
|
181
|
+
type = data_type_1.default.Long;
|
|
182
|
+
break;
|
|
183
|
+
case "DateTime":
|
|
184
|
+
type = data_type_1.default.DateTime;
|
|
185
|
+
break;
|
|
186
|
+
case "DateTimeOffset":
|
|
187
|
+
type = data_type_1.default.DateTimeOffset;
|
|
188
|
+
break;
|
|
189
|
+
case "String":
|
|
190
|
+
type = data_type_1.default.String;
|
|
191
|
+
break;
|
|
192
|
+
case "JToken":
|
|
193
|
+
case data_type_1.default[data_type_1.default.Json]:
|
|
194
|
+
type = data_type_1.default.Json;
|
|
195
|
+
break;
|
|
196
|
+
default:
|
|
197
|
+
throw new Error("Unsupported value type.");
|
|
198
|
+
}
|
|
199
|
+
return new data_type_1.TypeInfo(type, data.isMultiValue);
|
|
200
|
+
}
|
|
201
|
+
static convertValue(type, isArray, value) {
|
|
202
|
+
let result;
|
|
203
|
+
if (value == null) {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
if (isArray) {
|
|
207
|
+
if (value == null) {
|
|
208
|
+
return [];
|
|
209
|
+
}
|
|
210
|
+
else if (value instanceof Array) {
|
|
211
|
+
return value.map(item => this.convertValue(type, false, item));
|
|
212
|
+
}
|
|
213
|
+
else if (typeof value === "string") {
|
|
214
|
+
// If it's a string, we might be able to parse it.
|
|
215
|
+
try {
|
|
216
|
+
const parsedValue = JSON.parse(value);
|
|
217
|
+
if (parsedValue instanceof Array) {
|
|
218
|
+
return parsedValue.map(item => this.convertValue(type, false, item));
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
value = parsedValue;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
catch (ex) {
|
|
225
|
+
// If parsing fails, simply use the string.
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
// else {
|
|
229
|
+
// return null; //TODO: Throw error?
|
|
230
|
+
// }
|
|
231
|
+
}
|
|
232
|
+
switch (type) {
|
|
233
|
+
case data_type_1.default.String:
|
|
234
|
+
result = String(value); // typeof value === "string" ? value : `${value}`;
|
|
235
|
+
break;
|
|
236
|
+
case data_type_1.default.Boolean:
|
|
237
|
+
result = typeof value === "string" ? value === "true" : !!value;
|
|
238
|
+
break;
|
|
239
|
+
case data_type_1.default.Integer:
|
|
240
|
+
case data_type_1.default.Long: {
|
|
241
|
+
const number = parseInt(value, 10);
|
|
242
|
+
if (Number.isNaN(number)) {
|
|
243
|
+
result = null; //TODO: Use regex /^[-+]?[0-9]*$/ and throw error?
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
result = number;
|
|
247
|
+
}
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
case data_type_1.default.Decimal: {
|
|
251
|
+
const number = parseFloat(value);
|
|
252
|
+
if (Number.isNaN(number)) {
|
|
253
|
+
result = null; //TODO: Use regex /^[-+]?\b[0-9]*\.?[0-9]*$/ and throw error?
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
result = number;
|
|
257
|
+
}
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
case data_type_1.default.Json: {
|
|
261
|
+
// Valid JSON values: string, number, boolean, null, array or JSON-object
|
|
262
|
+
if (value == null) {
|
|
263
|
+
result = null;
|
|
264
|
+
}
|
|
265
|
+
else if (typeof value === "object") {
|
|
266
|
+
// Covers JSON-object and array
|
|
267
|
+
result = JSON.parse(JSON.stringify(value));
|
|
268
|
+
}
|
|
269
|
+
else if (typeof value === "string") {
|
|
270
|
+
try {
|
|
271
|
+
// When we have a string, it might be a serialized object we can parse.
|
|
272
|
+
result = JSON.parse(value);
|
|
273
|
+
}
|
|
274
|
+
catch (ex) {
|
|
275
|
+
// Not a valid JSON-object, so return the string value as-is.
|
|
276
|
+
result = value;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
// We might be dealing with a boolean, number or null.
|
|
281
|
+
result = value;
|
|
282
|
+
}
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
case data_type_1.default.DateTime: {
|
|
286
|
+
const date = moment_1.default(value);
|
|
287
|
+
if (!date.isValid()) {
|
|
288
|
+
return null; //TODO: Throw error?
|
|
289
|
+
}
|
|
290
|
+
result = date;
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
case data_type_1.default.DateTimeOffset: {
|
|
294
|
+
const date = moment_1.default.parseZone(value);
|
|
295
|
+
if (!date.isValid()) {
|
|
296
|
+
return null; //TODO: Throw error?
|
|
297
|
+
}
|
|
298
|
+
result = date;
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return result;
|
|
303
|
+
}
|
|
304
|
+
static mapDataSource(definition, name, typeInfo, propertyValue) {
|
|
305
|
+
if (propertyValue == null) {
|
|
306
|
+
const prop = new culture_insensitive_property_1.CultureInsensitiveProperty(name, typeInfo, null);
|
|
307
|
+
return prop;
|
|
308
|
+
}
|
|
309
|
+
if (definition.isMultiValue) {
|
|
310
|
+
const array = propertyValue instanceof Array
|
|
311
|
+
? propertyValue
|
|
312
|
+
: typeof propertyValue === "string"
|
|
313
|
+
? JSON.parse(propertyValue)
|
|
314
|
+
: null;
|
|
315
|
+
const list = [];
|
|
316
|
+
for (const token of array) {
|
|
317
|
+
const value = this.mapDataSourceValue(token);
|
|
318
|
+
if (value != null) {
|
|
319
|
+
list.push(value);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
const prop = new culture_insensitive_property_1.CultureInsensitiveProperty(name, typeInfo, [...list]);
|
|
323
|
+
return prop;
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
const value = this.mapDataSourceValue(propertyValue);
|
|
327
|
+
const prop = new culture_insensitive_property_1.CultureInsensitiveProperty(name, typeInfo, value);
|
|
328
|
+
return prop;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
static mapDataSourceValue(dataSourceValue) {
|
|
332
|
+
if (dataSourceValue == null) {
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
const identifier = dataSourceValue["identifier"];
|
|
336
|
+
return identifier;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
exports.PropertyMapper = PropertyMapper;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NullableResultPromise } from "../base-types";
|
|
2
|
+
import { IExtendedContentHubClient } from "../clients/extended-client";
|
|
3
|
+
import { IEntityLoadConfiguration } from "../contracts/querying/entity-load-configuration";
|
|
4
|
+
import { IEntityQueryResult } from "../contracts/querying/entity-query-result";
|
|
5
|
+
import { IIdQueryResult } from "../contracts/querying/id-query-result";
|
|
6
|
+
import { Query } from "../contracts/querying/query";
|
|
7
|
+
import { QueryResultResource } from "../models/query-result-resource";
|
|
8
|
+
export declare class QueryingMapper {
|
|
9
|
+
private readonly _client;
|
|
10
|
+
constructor(client: IExtendedContentHubClient);
|
|
11
|
+
mapEntityQueryResultAsync(resource: QueryResultResource, query: Query, loadConfiguration: IEntityLoadConfiguration): NullableResultPromise<IEntityQueryResult>;
|
|
12
|
+
mapEntityIdQueryResultAsync(resource: QueryResultResource, query: Query): NullableResultPromise<IIdQueryResult>;
|
|
13
|
+
private static getMinimalSchemas;
|
|
14
|
+
private getEntitiesAsync;
|
|
15
|
+
private getEntityIdsAsync;
|
|
16
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.QueryingMapper = void 0;
|
|
16
|
+
const ta_json_1 = require("ta-json");
|
|
17
|
+
const api_1 = require("../constants/api");
|
|
18
|
+
const entity_query_result_1 = require("../contracts/querying/entity-query-result");
|
|
19
|
+
const id_query_result_1 = require("../contracts/querying/id-query-result");
|
|
20
|
+
const minimal_schema_1 = require("../contracts/querying/minimal-schema");
|
|
21
|
+
const guard_1 = __importDefault(require("../guard"));
|
|
22
|
+
class QueryingMapper {
|
|
23
|
+
constructor(client) {
|
|
24
|
+
guard_1.default.notNullOrUndefined(client);
|
|
25
|
+
this._client = client;
|
|
26
|
+
}
|
|
27
|
+
mapEntityQueryResultAsync(resource, query, loadConfiguration) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
if (resource == null)
|
|
30
|
+
return null;
|
|
31
|
+
guard_1.default.notNullOrUndefined(query, "query");
|
|
32
|
+
const entities = yield this.getEntitiesAsync(resource);
|
|
33
|
+
const total = resource.totalItems || 0;
|
|
34
|
+
const skip = query.skip || 0;
|
|
35
|
+
const result = new entity_query_result_1.EntityQueryResult(this._client, query, loadConfiguration, entities, total, skip);
|
|
36
|
+
return result;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
mapEntityIdQueryResultAsync(resource, query) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
if (resource == null)
|
|
42
|
+
return null;
|
|
43
|
+
guard_1.default.notNullOrUndefined(query, "query");
|
|
44
|
+
const ids = yield this.getEntityIdsAsync(resource);
|
|
45
|
+
const total = resource.totalItems || 0;
|
|
46
|
+
const skip = query.skip || 0;
|
|
47
|
+
const result = new id_query_result_1.EntityIdQueryResult(this._client, query, ids, total, skip);
|
|
48
|
+
return result;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// async mapEntityScrollResultAsync(resource: QueryResultResource, offset: number): Promise<IEntityScrollResult> {
|
|
52
|
+
// throw "Not implemented";
|
|
53
|
+
// }
|
|
54
|
+
// async mapEntityIdScrollResultAsync(resource: QueryResultResource, offset: number): Promise<IIdScrollResult> {
|
|
55
|
+
// throw "Not implemented";
|
|
56
|
+
// }
|
|
57
|
+
static getMinimalSchemas(resource) {
|
|
58
|
+
const map = {};
|
|
59
|
+
const minimalSchema = resource.minimalSchemaList || resource[api_1.EXTENSION_DATA_KEYS.minimalSchema];
|
|
60
|
+
if (minimalSchema == null) {
|
|
61
|
+
return map;
|
|
62
|
+
}
|
|
63
|
+
const schemaTokens = (minimalSchema instanceof Array
|
|
64
|
+
? minimalSchema
|
|
65
|
+
: typeof minimalSchema === "string"
|
|
66
|
+
? JSON.parse(minimalSchema)
|
|
67
|
+
: []);
|
|
68
|
+
for (const token of schemaTokens) {
|
|
69
|
+
const schema = ta_json_1.TaJson.deserialize(token, minimal_schema_1.MinimalSchema);
|
|
70
|
+
map[schema.definitionName] = schema;
|
|
71
|
+
}
|
|
72
|
+
return map;
|
|
73
|
+
}
|
|
74
|
+
getEntitiesAsync(resource) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
if (!resource.items || !resource.items.length) {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
const schemasMap = QueryingMapper.getMinimalSchemas(resource);
|
|
80
|
+
const resources = resource.items.map(item => item.entity);
|
|
81
|
+
const entities = yield this._client.entityMapper.mapEntitiesAsync(resources, schemasMap);
|
|
82
|
+
return entities;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
getEntityIdsAsync(resource) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
if (!resource.items || !resource.items.length) {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
const links = resource.items.map(item => item.link);
|
|
91
|
+
const ids = yield this._client.linkHelper.idsFromEntitiesAsync(links);
|
|
92
|
+
return ids;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.QueryingMapper = QueryingMapper;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RelationCardinality, RelationCardinalityType } from "../contracts/base/relation-cardinality";
|
|
2
|
+
export declare class RelationCardinalityMapper {
|
|
3
|
+
static mapToEnumValue(value: RelationCardinalityType | string): RelationCardinality;
|
|
4
|
+
static mapToType(value: RelationCardinality | string): RelationCardinalityType;
|
|
5
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelationCardinalityMapper = void 0;
|
|
4
|
+
const relation_cardinality_1 = require("../contracts/base/relation-cardinality");
|
|
5
|
+
class RelationCardinalityMapper {
|
|
6
|
+
static mapToEnumValue(value) {
|
|
7
|
+
if (value === "ManyToMany") {
|
|
8
|
+
return relation_cardinality_1.RelationCardinality.ManyToMany;
|
|
9
|
+
}
|
|
10
|
+
else if (value === "OneToMany") {
|
|
11
|
+
return relation_cardinality_1.RelationCardinality.OneToMany;
|
|
12
|
+
}
|
|
13
|
+
else if (value === "OneToOne") {
|
|
14
|
+
return relation_cardinality_1.RelationCardinality.OneToOne;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
throw Error(`Can't map '${value}' to enum value.`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
static mapToType(value) {
|
|
21
|
+
if (value === relation_cardinality_1.RelationCardinality.ManyToMany || value === relation_cardinality_1.RelationCardinality[relation_cardinality_1.RelationCardinality.ManyToMany]) {
|
|
22
|
+
return "ManyToMany";
|
|
23
|
+
}
|
|
24
|
+
else if (value === relation_cardinality_1.RelationCardinality.OneToMany ||
|
|
25
|
+
value === relation_cardinality_1.RelationCardinality[relation_cardinality_1.RelationCardinality.OneToMany]) {
|
|
26
|
+
return "OneToMany";
|
|
27
|
+
}
|
|
28
|
+
else if (value === relation_cardinality_1.RelationCardinality.OneToOne ||
|
|
29
|
+
value === relation_cardinality_1.RelationCardinality[relation_cardinality_1.RelationCardinality.OneToOne]) {
|
|
30
|
+
return "OneToOne";
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
throw Error(`Can't map '${value} to type.`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.RelationCardinalityMapper = RelationCardinalityMapper;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MapStringTo } from "../base-types";
|
|
2
|
+
import { IExtendedContentHubClient } from "../clients/extended-client";
|
|
3
|
+
import { IEntity } from "../contracts/base/entity";
|
|
4
|
+
import { IRelation } from "../contracts/base/relation";
|
|
5
|
+
import { MinimalSchema } from "../contracts/querying/minimal-schema";
|
|
6
|
+
import { EntityResource } from "../models/entity-resource";
|
|
7
|
+
import { RelationResource } from "../models/relation-resource";
|
|
8
|
+
export declare class RelationMapper {
|
|
9
|
+
private readonly _client;
|
|
10
|
+
constructor(client: IExtendedContentHubClient);
|
|
11
|
+
mapRelationsAsync(resource: EntityResource, schema?: MinimalSchema): Promise<Array<IRelation>>;
|
|
12
|
+
mapToRelationResourcesAsync(entity: IEntity): Promise<MapStringTo<RelationResource>>;
|
|
13
|
+
mapRelationToResourceAsync(relation: IRelation): Promise<RelationResource>;
|
|
14
|
+
mapDirtyRelationsAsync(entity: IEntity): Promise<MapStringTo<RelationResource>>;
|
|
15
|
+
private mapRelationsToResourcesAsync;
|
|
16
|
+
}
|