@sitecore/sc-contenthub-webclient-sdk 1.1.1 → 1.2.1
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/README.md +35 -7
- package/dist/api/api-info-resource.js +9 -8
- package/dist/api/api-info.js +1 -0
- package/dist/api/api-resource.js +2 -1
- package/dist/api/api-routes-dictionary.js +1 -0
- package/dist/authentication/oauth-grant-base.js +5 -4
- package/dist/authentication/oauth-grant-type.js +1 -0
- package/dist/authentication/oauth-password-grant.js +5 -4
- package/dist/authentication/oauth-refreshtoken-grant.js +4 -3
- package/dist/authentication/token-info.js +6 -5
- package/dist/base-types.js +1 -0
- package/dist/caches/culture-cache.js +1 -0
- package/dist/caches/entity-definition-cache.d.ts +21 -7
- package/dist/caches/entity-definition-cache.js +38 -21
- package/dist/clients/aggregates-client.d.ts +27 -3
- package/dist/clients/aggregates-client.js +4 -3
- package/dist/clients/api-client.js +3 -2
- package/dist/clients/assets-client.d.ts +16 -0
- package/dist/clients/assets-client.js +43 -0
- package/dist/clients/commands-client.d.ts +7 -4
- package/dist/clients/commands-client.js +5 -4
- package/dist/clients/content-hub-client.d.ts +3 -0
- package/dist/clients/content-hub-client.js +3 -0
- package/dist/clients/culture-client.js +1 -0
- package/dist/clients/culture-loader.js +1 -0
- package/dist/clients/entities-client.d.ts +44 -29
- package/dist/clients/entities-client.js +44 -30
- package/dist/clients/entity-definitions-client.d.ts +55 -17
- package/dist/clients/entity-definitions-client.js +58 -57
- package/dist/clients/extended-client.js +1 -0
- package/dist/clients/internal-client.d.ts +17 -2
- package/dist/clients/internal-client.js +17 -3
- package/dist/clients/notifications-client.js +1 -0
- package/dist/clients/option-list-client.d.ts +19 -12
- package/dist/clients/option-list-client.js +13 -12
- package/dist/clients/pages-client.d.ts +13 -6
- package/dist/clients/pages-client.js +9 -8
- package/dist/clients/permissions-client.js +1 -0
- package/dist/clients/policies-client.js +3 -21
- package/dist/clients/querying-client.d.ts +58 -11
- package/dist/clients/querying-client.js +43 -8
- package/dist/clients/raw-client.d.ts +11 -18
- package/dist/clients/raw-client.js +11 -10
- package/dist/clients/request-message.js +1 -0
- package/dist/clients/response-handler.js +8 -26
- package/dist/clients/response-message.js +1 -0
- package/dist/clients/schema-querying.d.ts +4 -3
- package/dist/clients/schema-querying.js +6 -4
- package/dist/clients/search-client.d.ts +7 -4
- package/dist/clients/search-client.js +5 -4
- package/dist/clients/settings-client.d.ts +8 -0
- package/dist/clients/settings-client.js +13 -0
- package/dist/clients/upload-client.d.ts +5 -2
- package/dist/clients/upload-client.js +36 -17
- package/dist/clients/users-client.js +1 -0
- package/dist/clients/version-checker.js +2 -1
- package/dist/clients/web-content-hub-client.js +1 -0
- package/dist/constants/api.d.ts +26 -3
- package/dist/constants/api.js +28 -4
- package/dist/constants/defaults.js +2 -1
- package/dist/constants/definitions.d.ts +10 -0
- package/dist/constants/definitions.js +14 -1
- package/dist/constants/index.js +2 -1
- package/dist/constants/notifications.js +1 -0
- package/dist/contracts/base/culture-insensitive-property.js +1 -0
- package/dist/contracts/base/culture-sensitive-property.js +1 -0
- package/dist/contracts/base/data-type.js +1 -0
- package/dist/contracts/base/entity-base.d.ts +7 -0
- package/dist/contracts/base/entity-base.js +57 -32
- package/dist/contracts/base/entity-construction-args.js +1 -0
- package/dist/contracts/base/entity-definition.d.ts +5 -0
- package/dist/contracts/base/entity-definition.js +20 -18
- package/dist/contracts/base/entity.d.ts +30 -1
- package/dist/contracts/base/entity.js +4 -3
- package/dist/contracts/base/index.js +2 -1
- package/dist/contracts/base/json-content-type.js +1 -0
- package/dist/contracts/base/lazy-loading-manager.js +1 -0
- package/dist/contracts/base/member-condition.js +11 -10
- package/dist/contracts/base/member-definition-type.js +1 -0
- package/dist/contracts/base/member-definition.js +14 -13
- package/dist/contracts/base/member-group.js +12 -11
- package/dist/contracts/base/member.js +1 -0
- package/dist/contracts/base/option-lists/flat-option-list-value.js +1 -0
- package/dist/contracts/base/option-lists/flat-option-list.js +1 -0
- package/dist/contracts/base/option-lists/hierarchical-option-list.js +1 -0
- package/dist/contracts/base/option-lists/hierarchical-options-list-value.js +1 -0
- package/dist/contracts/base/option-lists/option-list-base.js +1 -0
- package/dist/contracts/base/option-lists/option-list-type.js +1 -0
- package/dist/contracts/base/option-lists/option-list-value-base.js +1 -0
- package/dist/contracts/base/option-lists/option-list-value.js +1 -0
- package/dist/contracts/base/option-lists/option-list.js +1 -0
- package/dist/contracts/base/property-definition.js +13 -12
- package/dist/contracts/base/property-definitions/boolean-property-definition.js +3 -2
- package/dist/contracts/base/property-definitions/datetime-property-definition.js +3 -2
- package/dist/contracts/base/property-definitions/datetimeoffset-property-definition.js +3 -2
- package/dist/contracts/base/property-definitions/decimal-property-definition.js +3 -2
- package/dist/contracts/base/property-definitions/index.js +2 -1
- package/dist/contracts/base/property-definitions/integer-property-definition.js +3 -2
- package/dist/contracts/base/property-definitions/json-property-definition.js +4 -3
- package/dist/contracts/base/property-definitions/long-property-definition.js +3 -2
- package/dist/contracts/base/property-definitions/string-property-definition.js +5 -4
- package/dist/contracts/base/property-manager.js +1 -0
- package/dist/contracts/base/property.js +1 -0
- package/dist/contracts/base/related-path.d.ts +1 -1
- package/dist/contracts/base/related-path.js +1 -0
- package/dist/contracts/base/relation-cardinality.js +1 -0
- package/dist/contracts/base/relation-container.js +5 -4
- package/dist/contracts/base/relation-definition.js +23 -22
- package/dist/contracts/base/relation-manager.d.ts +1 -1
- package/dist/contracts/base/relation-manager.js +6 -6
- package/dist/contracts/base/relation-role.js +1 -0
- package/dist/contracts/base/relation.d.ts +16 -3
- package/dist/contracts/base/relation.js +28 -3
- package/dist/contracts/base/relations/child-to-many-parents-relation.d.ts +4 -1
- package/dist/contracts/base/relations/child-to-many-parents-relation.js +33 -2
- package/dist/contracts/base/relations/child-to-one-parent-relation.d.ts +3 -1
- package/dist/contracts/base/relations/child-to-one-parent-relation.js +27 -2
- package/dist/contracts/base/relations/parent-to-many-children-relation.d.ts +4 -1
- package/dist/contracts/base/relations/parent-to-many-children-relation.js +33 -2
- package/dist/contracts/base/relations/parent-to-one-child-relation.d.ts +3 -1
- package/dist/contracts/base/relations/parent-to-one-child-relation.js +27 -2
- package/dist/contracts/base/relations/to-many-relation.d.ts +10 -0
- package/dist/contracts/base/relations/to-many-relation.js +1 -0
- package/dist/contracts/base/relations/to-one-relation.d.ts +5 -0
- package/dist/contracts/base/relations/to-one-relation.js +1 -0
- package/dist/contracts/base/rendition.js +1 -0
- package/dist/contracts/base/resource.js +1 -0
- package/dist/contracts/base/string-content-type.js +1 -0
- package/dist/contracts/base/typed-entity.js +1 -0
- package/dist/contracts/base/users.js +1 -0
- package/dist/contracts/base/view-mode.js +1 -0
- package/dist/contracts/content/asset.js +1 -0
- package/dist/contracts/content/final-life-cycle-status.js +1 -0
- package/dist/contracts/dirty-tracking/dirty-tracking.js +1 -0
- package/dist/contracts/notifications/mail-template.js +1 -0
- package/dist/contracts/policies/condition.js +1 -0
- package/dist/contracts/policies/member-policy.js +1 -0
- package/dist/contracts/policies/policy.js +1 -0
- package/dist/contracts/policies/rule-type.js +1 -0
- package/dist/contracts/policies/rule.js +1 -0
- package/dist/contracts/policies/user-group-policy.js +2 -0
- package/dist/contracts/policies/user-policy.js +2 -0
- package/dist/contracts/querying/culture-load-option.js +5 -4
- package/dist/contracts/querying/entity-definition-id-iterator.js +1 -0
- package/dist/contracts/querying/entity-definition-id-query-result.js +1 -0
- package/dist/contracts/querying/entity-definition-iterator.js +1 -0
- package/dist/contracts/querying/entity-definition-query-result.js +1 -0
- package/dist/contracts/querying/entity-iterator.js +1 -0
- package/dist/contracts/querying/entity-load-configuration-builder.js +1 -0
- package/dist/contracts/querying/entity-load-configuration.js +5 -4
- package/dist/contracts/querying/entity-load-option.js +9 -8
- package/dist/contracts/querying/entity-query-result.js +1 -0
- package/dist/contracts/querying/filters/comparison-operator.js +1 -0
- package/dist/contracts/querying/filters/composite-filter-operator.js +1 -0
- package/dist/contracts/querying/filters/composite-query-filter.js +7 -6
- package/dist/contracts/querying/filters/createdby-query-filter.js +4 -3
- package/dist/contracts/querying/filters/createdon-query-filter.js +7 -6
- package/dist/contracts/querying/filters/definition-query-filter.js +11 -10
- package/dist/contracts/querying/filters/filter-data-type.js +1 -0
- package/dist/contracts/querying/filters/filter-type.js +1 -0
- package/dist/contracts/querying/filters/id-query-filter.js +8 -7
- package/dist/contracts/querying/filters/identifier-query-filter.js +8 -7
- package/dist/contracts/querying/filters/index.js +2 -1
- package/dist/contracts/querying/filters/modifiedby-query-filter.js +4 -3
- package/dist/contracts/querying/filters/modifiedon-query-filter.js +7 -6
- package/dist/contracts/querying/filters/modules-query-filter.js +5 -4
- package/dist/contracts/querying/filters/not-query-filter.js +5 -4
- package/dist/contracts/querying/filters/property-query-filter.js +11 -10
- package/dist/contracts/querying/filters/query-filter.js +4 -3
- package/dist/contracts/querying/filters/relation-connection-type.js +1 -0
- package/dist/contracts/querying/filters/relation-query-filter.js +8 -7
- package/dist/contracts/querying/filters/secured-ancestors-query-filter.js +8 -7
- package/dist/contracts/querying/filters/user-query-filter.js +11 -10
- package/dist/contracts/querying/id-iterator.js +1 -0
- package/dist/contracts/querying/id-query-result.js +1 -0
- package/dist/contracts/querying/iterator.js +1 -0
- package/dist/contracts/querying/load-option.js +1 -0
- package/dist/contracts/querying/load-options.js +1 -0
- package/dist/contracts/querying/loading-query-iterator.js +1 -0
- package/dist/contracts/querying/member-load-option.js +1 -0
- package/dist/contracts/querying/minimal-schema.js +7 -6
- package/dist/contracts/querying/property-data.js +7 -6
- package/dist/contracts/querying/property-load-option.js +5 -4
- package/dist/contracts/querying/query-iterator.js +1 -0
- package/dist/contracts/querying/query-load-configuration.js +9 -8
- package/dist/contracts/querying/query-request.js +3 -2
- package/dist/contracts/querying/query-result-paging-manager.js +1 -0
- package/dist/contracts/querying/query-result.js +1 -0
- package/dist/contracts/querying/query-sort-order.js +1 -0
- package/dist/contracts/querying/query.js +8 -7
- package/dist/contracts/querying/relation-data.js +6 -5
- package/dist/contracts/querying/relation-load-option.js +5 -4
- package/dist/contracts/querying/relation-specification.js +5 -4
- package/dist/contracts/querying/schema-querying.js +1 -0
- package/dist/contracts/querying/scroll-request.js +5 -4
- package/dist/contracts/querying/skip-take-iterator-base.js +1 -0
- package/dist/contracts/querying/sort-field-type.js +1 -0
- package/dist/contracts/querying/sorting.js +6 -5
- package/dist/contracts/upload/upload-source.js +1 -0
- package/dist/contracts/users/user-group-combine-method.js +1 -0
- package/dist/contracts/users/user-group-configuration.js +7 -6
- package/dist/contracts/users/user-profile.js +1 -0
- package/dist/contracts/users/user.js +1 -0
- package/dist/converters/aggregated-entity-relations-converter.js +1 -0
- package/dist/converters/all-facet-values-children-converter.js +1 -0
- package/dist/converters/api-resource-converter.js +2 -0
- package/dist/converters/date-converter.js +1 -0
- package/dist/converters/file-version-converter.js +1 -0
- package/dist/converters/index.js +2 -1
- package/dist/converters/member-condition-converter.js +1 -0
- package/dist/converters/member-condition-resource-converter.js +1 -0
- package/dist/converters/minimal-schema-relation-cardinality-converter.js +1 -0
- package/dist/converters/page-resource-menus-converter.js +1 -0
- package/dist/converters/page-resource-zones-converter.js +1 -0
- package/dist/converters/relation-map-resource-converter.js +1 -0
- package/dist/converters/relation-resource-converter.js +1 -0
- package/dist/converters/renditions-converter.js +1 -0
- package/dist/converters/string-to-any-map-converter.js +1 -0
- package/dist/culture-info.js +1 -0
- package/dist/dirty-value-calculator.js +1 -0
- package/dist/entity-link.js +7 -6
- package/dist/error-messages.d.ts +0 -3
- package/dist/error-messages.js +1 -3
- package/dist/errors/argument-error.js +1 -0
- package/dist/errors/authentication-error.js +1 -0
- package/dist/errors/bad-request-error.js +1 -0
- package/dist/errors/forbidden-error.js +1 -0
- package/dist/errors/internal-error.js +1 -0
- package/dist/errors/invalid-operation-error.js +1 -0
- package/dist/errors/not-found-error.js +1 -0
- package/dist/errors/not-implemented-error.js +1 -0
- package/dist/errors/not-loaded-error.js +1 -0
- package/dist/errors/not-supported-error.js +1 -0
- package/dist/errors/schema-error.js +1 -0
- package/dist/errors/validation-error.js +1 -0
- package/dist/errors/validation-failure.js +1 -0
- package/dist/errors/web-api-error.js +1 -0
- package/dist/factories/entity-factory.js +2 -1
- package/dist/factories/option-list-factory.js +1 -0
- package/dist/factories/property-factory.js +3 -2
- package/dist/factories/relation-factory.js +5 -4
- package/dist/fileversion.js +1 -0
- package/dist/guard.d.ts +10 -10
- package/dist/guard.js +3 -0
- package/dist/http-method.js +1 -0
- package/dist/index.js +2 -1
- package/dist/link-helper.d.ts +40 -16
- package/dist/link-helper.js +82 -10
- package/dist/link.js +5 -4
- package/dist/logging/log-level.js +1 -0
- package/dist/logging/logger-base.js +1 -0
- package/dist/logging/logger.js +1 -0
- package/dist/logging/null-logger.js +3 -0
- package/dist/mappers/api-resource-mapper.js +1 -0
- package/dist/mappers/condition-mapper.js +1 -0
- package/dist/mappers/entity-copy-options-mapper.d.ts +6 -0
- package/dist/mappers/entity-copy-options-mapper.js +42 -0
- package/dist/mappers/entity-definition-mapper.js +7 -2
- package/dist/mappers/entity-mapper.js +14 -0
- package/dist/mappers/filter-operator-mapper.js +1 -0
- package/dist/mappers/final-life-cycle-status-mapper.js +3 -2
- package/dist/mappers/load-options-mapper.js +1 -0
- package/dist/mappers/mapping-utilities.js +1 -0
- package/dist/mappers/member-condition-mapper.js +3 -2
- package/dist/mappers/member-definition-mapper.js +4 -3
- package/dist/mappers/member-group-mapper.js +1 -0
- package/dist/mappers/member-security-mapper.js +1 -0
- package/dist/mappers/notification-mapper.js +1 -0
- package/dist/mappers/option-list-mapper.js +2 -1
- package/dist/mappers/policy-mapper.js +1 -0
- package/dist/mappers/property-mapper.js +2 -1
- package/dist/mappers/querying-mapper.js +1 -0
- package/dist/mappers/related-path-mapper.js +3 -2
- package/dist/mappers/relation-cardinality-mapper.js +1 -0
- package/dist/mappers/relation-mapper.js +8 -7
- package/dist/mappers/relation-role-mapper.js +3 -2
- package/dist/mappers/rendition-mapper.js +1 -0
- package/dist/mappers/rule-type-mapper.js +1 -0
- package/dist/mappers/rules-mapper.js +1 -0
- package/dist/mappers/typed-entity-creator.js +1 -0
- package/dist/models/aggregate-resources/aggregate-resource.d.ts +2 -1
- package/dist/models/aggregate-resources/aggregate-resource.js +12 -7
- package/dist/models/aggregate-resources/aggregated-entity-resource.js +5 -4
- package/dist/models/content/entity-copy-options-builder.d.ts +112 -0
- package/dist/models/content/entity-copy-options-builder.js +91 -0
- package/dist/models/content/entity-copy-options.d.ts +60 -0
- package/dist/models/content/entity-copy-options.js +14 -0
- package/dist/models/content/property-copy-method.d.ts +21 -0
- package/dist/models/content/property-copy-method.js +26 -0
- package/dist/models/content/property-copy-option.d.ts +34 -0
- package/dist/models/content/property-copy-option.js +12 -0
- package/dist/models/content/relation-copy-method.d.ts +21 -0
- package/dist/models/content/relation-copy-method.js +26 -0
- package/dist/models/content/relation-copy-option.d.ts +35 -0
- package/dist/models/content/relation-copy-option.js +12 -0
- package/dist/models/entity-copy-options-resource.d.ts +28 -0
- package/dist/models/entity-copy-options-resource.js +47 -0
- package/dist/models/entity-definition-collection-resource.js +4 -3
- package/dist/models/entity-definition-resource.d.ts +1 -1
- package/dist/models/entity-definition-resource.js +23 -21
- package/dist/models/entity-list-resource.js +4 -3
- package/dist/models/entity-path.d.ts +4 -0
- package/dist/models/entity-path.js +24 -0
- package/dist/models/entity-resource.d.ts +8 -0
- package/dist/models/entity-resource.js +70 -39
- package/dist/models/list-resource.js +10 -9
- package/dist/models/member-condition-resource.js +10 -9
- package/dist/models/member-definition-resource.js +16 -15
- package/dist/models/member-group-resource.js +13 -12
- package/dist/models/notifications/distribute-notification-resource.js +7 -6
- package/dist/models/notifications/mail-request-broadcast.js +1 -0
- package/dist/models/notifications/mail-request-by-id.js +1 -0
- package/dist/models/notifications/mail-request-by-username.js +1 -0
- package/dist/models/notifications/mail-request.js +1 -0
- package/dist/models/notifications/notification-level.js +1 -0
- package/dist/models/notifications/realtime-request-broadcast.js +1 -0
- package/dist/models/notifications/realtime-request-by-id.js +1 -0
- package/dist/models/notifications/realtime-request-by-username.js +1 -0
- package/dist/models/notifications/realtime-request.js +1 -0
- package/dist/models/notifications/request-by-id.js +1 -0
- package/dist/models/notifications/request-by-username.js +1 -0
- package/dist/models/notifications/validators/mail-validator.js +1 -0
- package/dist/models/notifications/validators/realtime-validator.js +1 -0
- package/dist/models/notifications/validators/request-by-id-validator.js +1 -0
- package/dist/models/notifications/validators/request-by-username-validator.js +1 -0
- package/dist/models/notifications/validators/validator-base.js +1 -0
- package/dist/models/option-lists/flat-option-list-value.js +1 -0
- package/dist/models/option-lists/hierarchical-options-list-value.js +1 -0
- package/dist/models/option-lists/option-list-collection-resource.js +5 -4
- package/dist/models/option-lists/option-list-description-resource.js +5 -4
- package/dist/models/option-lists/option-list-resource.js +12 -11
- package/dist/models/option-lists/option-list-value-resource.js +6 -5
- package/dist/models/pages/component-visualization.js +9 -8
- package/dist/models/pages/language-resource.js +7 -6
- package/dist/models/pages/menu-item.js +12 -11
- package/dist/models/pages/page-component-resource.js +18 -17
- package/dist/models/pages/page-resource.js +21 -20
- package/dist/models/pages/page-row-settings.js +26 -25
- package/dist/models/pages/portal-column-resource.js +5 -4
- package/dist/models/pages/portal-row-resource.js +5 -4
- package/dist/models/pages/portal-section-resource.js +5 -4
- package/dist/models/permissions-resource.js +4 -3
- package/dist/models/policies/condition-resource.js +6 -5
- package/dist/models/policies/member-policy-resource.js +6 -5
- package/dist/models/policies/policy-resource.js +16 -15
- package/dist/models/policies/rule-resource.js +12 -11
- package/dist/models/property-copy-option-resource.d.ts +19 -0
- package/dist/models/property-copy-option-resource.js +41 -0
- package/dist/models/property-definition-resource.js +35 -34
- package/dist/models/query-loading-resource.d.ts +5 -0
- package/dist/models/query-loading-resource.js +9 -3
- package/dist/models/query-result-resource.js +6 -5
- package/dist/models/relation-copy-option-resource.d.ts +20 -0
- package/dist/models/relation-copy-option-resource.js +41 -0
- package/dist/models/relation-definition-resource.js +23 -22
- package/dist/models/relation-map-resource.js +2 -1
- package/dist/models/relation-resource.js +13 -12
- package/dist/models/resource-containers/entity-definition-resource-container.js +1 -0
- package/dist/models/resource-containers/entity-resource-container.js +1 -0
- package/dist/models/resource.js +3 -2
- package/dist/models/search/aggregation-request-resource.js +13 -12
- package/dist/models/search/aggregation-response-resource.js +7 -6
- package/dist/models/search/all-facet-values-response.js +6 -5
- package/dist/models/search/all-facets-request.d.ts +3 -0
- package/dist/models/search/all-facets-request.js +17 -8
- package/dist/models/search/bucket-response-resource.js +8 -7
- package/dist/models/search/date-interval.js +1 -0
- package/dist/models/search/facet-response-resource.js +20 -19
- package/dist/models/search/field-filter-request-resource.js +14 -13
- package/dist/models/search/field-filter-response-resource.js +17 -16
- package/dist/models/search/field-filter-value-response-resource.js +5 -4
- package/dist/models/search/filter-operator.js +1 -0
- package/dist/models/search/full-text-response-resource.js +4 -3
- package/dist/models/search/group-category.js +6 -5
- package/dist/models/search/group-config.js +4 -3
- package/dist/models/search/group-item.js +7 -6
- package/dist/models/search/grouped-view-response-resource.js +12 -11
- package/dist/models/search/metric-option-request-resource.js +5 -4
- package/dist/models/search/metric-option-response-resource.js +5 -4
- package/dist/models/search/nested-relation-info.js +9 -8
- package/dist/models/search/requested-aggregation-type.js +1 -0
- package/dist/models/search/requested-filter-type.js +1 -0
- package/dist/models/search/search-group-request-resource.d.ts +1 -0
- package/dist/models/search/search-group-request-resource.js +8 -3
- package/dist/models/search/search-request.d.ts +2 -0
- package/dist/models/search/search-request.js +37 -28
- package/dist/models/search/search-response.js +24 -23
- package/dist/models/search/selection-pool-filter-resource.js +6 -5
- package/dist/models/search/sorting-request-resource.js +4 -3
- package/dist/models/search/sorting-response-resource.js +5 -4
- package/dist/models/search-document-resource.js +4 -3
- package/dist/models/set-password-request-resource.js +3 -2
- package/dist/models/setting-resource.d.ts +9 -0
- package/dist/models/setting-resource.js +40 -0
- package/dist/models/upload/array-buffer-upload-source.d.ts +8 -0
- package/dist/models/upload/array-buffer-upload-source.js +19 -15
- package/dist/models/upload/create-upload-response.js +5 -4
- package/dist/models/upload/http-upload-source.js +1 -0
- package/dist/models/upload/local-upload-source.js +2 -0
- package/dist/models/upload/upload-action.js +4 -3
- package/dist/models/upload/upload-configuration.js +4 -3
- package/dist/models/upload/upload-request-wrapper.js +8 -7
- package/dist/models/upload/upload-request.js +1 -0
- package/dist/models/user-entity-permissions-resource.js +13 -12
- package/dist/models/versionining/compatibility.js +1 -0
- package/dist/settings/fetch-setting.js +17 -16
- package/dist/settings/super-user-excluded-privileges.js +4 -3
- package/dist/settings/usage-rights-configuration.js +18 -17
- package/dist/type-guards.js +1 -0
- package/dist/utilities/array-utilities.js +1 -0
- package/package.json +20 -21
|
@@ -21,22 +21,22 @@ class CommandsClient {
|
|
|
21
21
|
guard_1.default.notNull(client);
|
|
22
22
|
this._client = client;
|
|
23
23
|
}
|
|
24
|
-
executeCommandRawAsync(namespace, command, args = null) {
|
|
24
|
+
executeCommandRawAsync(namespace, command, args = null, cancelCallback) {
|
|
25
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
guard_1.default.stringNotNullOrEmpty(namespace);
|
|
27
27
|
guard_1.default.stringNotNullOrEmpty(command);
|
|
28
28
|
const link = yield this._client.linkHelper.commandToLinkAsync(namespace, command);
|
|
29
29
|
const content = ta_json_1.TaJson.serialize(args !== null && args !== void 0 ? args : {});
|
|
30
|
-
const response = yield this._client.raw.postAsync(link.href, content);
|
|
30
|
+
const response = yield this._client.raw.postAsync(link.href, content, undefined, cancelCallback);
|
|
31
31
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
32
32
|
return response;
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
executeCommandAsync(namespace, command, args = null) {
|
|
35
|
+
executeCommandAsync(namespace, command, args = null, cancelCallback) {
|
|
36
36
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37
37
|
guard_1.default.stringNotNullOrEmpty(namespace);
|
|
38
38
|
guard_1.default.stringNotNullOrEmpty(command);
|
|
39
|
-
const response = yield this.executeCommandRawAsync(namespace, command, args);
|
|
39
|
+
const response = yield this.executeCommandRawAsync(namespace, command, args, cancelCallback);
|
|
40
40
|
let result = null;
|
|
41
41
|
if (response.content != null) {
|
|
42
42
|
result = response.content;
|
|
@@ -46,3 +46,4 @@ class CommandsClient {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
exports.CommandsClient = CommandsClient;
|
|
49
|
+
//# sourceMappingURL=commands-client.js.map
|
|
@@ -11,6 +11,7 @@ import { EntityDefinitionMapper } from "../mappers/entity-definition-mapper";
|
|
|
11
11
|
import { EntityMapper } from "../mappers/entity-mapper";
|
|
12
12
|
import { IAggregateClient } from "./aggregates-client";
|
|
13
13
|
import { IApiClient } from "./api-client";
|
|
14
|
+
import { IAssetsClient } from "./assets-client";
|
|
14
15
|
import { ICommandsClient } from "./commands-client";
|
|
15
16
|
import { ICultureClient } from "./culture-client";
|
|
16
17
|
import { IEntitiesClient } from "./entities-client";
|
|
@@ -36,6 +37,7 @@ export interface IContentHubClient {
|
|
|
36
37
|
logger: ILogger;
|
|
37
38
|
readonly api: IApiClient;
|
|
38
39
|
readonly aggregates: IAggregateClient;
|
|
40
|
+
readonly assets: IAssetsClient;
|
|
39
41
|
readonly commands: ICommandsClient;
|
|
40
42
|
readonly cultures: ICultureClient;
|
|
41
43
|
readonly entities: IEntitiesClient;
|
|
@@ -60,6 +62,7 @@ export declare class ContentHubClient implements IExtendedContentHubClient {
|
|
|
60
62
|
readonly internalClient: IInternalClient;
|
|
61
63
|
readonly api: IApiClient;
|
|
62
64
|
readonly aggregates: IAggregateClient;
|
|
65
|
+
readonly assets: IAssetsClient;
|
|
63
66
|
readonly commands: ICommandsClient;
|
|
64
67
|
readonly cultures: ICultureClient;
|
|
65
68
|
readonly entities: IEntitiesClient;
|
|
@@ -15,6 +15,7 @@ const entity_mapper_1 = require("../mappers/entity-mapper");
|
|
|
15
15
|
const typed_entity_creator_1 = require("../mappers/typed-entity-creator");
|
|
16
16
|
const aggregates_client_1 = require("./aggregates-client");
|
|
17
17
|
const api_client_1 = require("./api-client");
|
|
18
|
+
const assets_client_1 = require("./assets-client");
|
|
18
19
|
const commands_client_1 = require("./commands-client");
|
|
19
20
|
const culture_client_1 = require("./culture-client");
|
|
20
21
|
const culture_loader_1 = require("./culture-loader");
|
|
@@ -44,6 +45,7 @@ class ContentHubClient {
|
|
|
44
45
|
this.internalClient = new internal_client_1.InternalClient(baseUri, oauthGrant);
|
|
45
46
|
this.api = new api_client_1.ApiClient(this);
|
|
46
47
|
this.aggregates = new aggregates_client_1.AggregateClient(this);
|
|
48
|
+
this.assets = new assets_client_1.AssetsClient(this);
|
|
47
49
|
this.commands = new commands_client_1.CommandsClient(this);
|
|
48
50
|
this.entities = new entities_client_1.EntitiesClient(this);
|
|
49
51
|
this.entityDefinitions = new entity_definitions_client_1.EntityDefinitionsClient(this);
|
|
@@ -72,3 +74,4 @@ class ContentHubClient {
|
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
exports.ContentHubClient = ContentHubClient;
|
|
77
|
+
//# sourceMappingURL=content-hub-client.js.map
|
|
@@ -6,7 +6,9 @@ import { IEntityQueryResult } from "../contracts/querying/entity-query-result";
|
|
|
6
6
|
import { IIdIterator } from "../contracts/querying/id-iterator";
|
|
7
7
|
import { IIdQueryResult } from "../contracts/querying/id-query-result";
|
|
8
8
|
import { Sorting } from "../contracts/querying/sorting";
|
|
9
|
+
import { IEntityCopyOptions } from "../models/content/entity-copy-options";
|
|
9
10
|
import { IExtendedContentHubClient } from "./extended-client";
|
|
11
|
+
import { CancelCallback } from "./internal-client";
|
|
10
12
|
/**
|
|
11
13
|
* Interface for the client responsible for getting, saving and deleting entities.
|
|
12
14
|
*
|
|
@@ -18,23 +20,26 @@ export interface IEntitiesClient {
|
|
|
18
20
|
* Gets the {@link IEntity} instance with the specified `id`.
|
|
19
21
|
* @param id - The id of the entity to get
|
|
20
22
|
* @param loadConfiguration - The loading configuration for the entity
|
|
23
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
21
24
|
* @returns The entity or `null` when it was not found.
|
|
22
25
|
*/
|
|
23
|
-
getAsync(id: number, loadConfiguration?: Nullable<IEntityLoadConfiguration
|
|
26
|
+
getAsync(id: number, loadConfiguration?: Nullable<IEntityLoadConfiguration>, cancelCallback?: CancelCallback): NullableResultPromise<IEntity>;
|
|
24
27
|
/**
|
|
25
28
|
* Gets the {@link IEntity} instance with the specified `identifier`.
|
|
26
29
|
* @param identifier - The identifier of the entity to get
|
|
27
30
|
* @param loadConfiguration - The loading configuration for the entity
|
|
31
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
28
32
|
* @returns The entity or `null` when it was not found.
|
|
29
33
|
*/
|
|
30
|
-
getAsync(identifier: string, loadConfiguration?: Nullable<IEntityLoadConfiguration
|
|
34
|
+
getAsync(identifier: string, loadConfiguration?: Nullable<IEntityLoadConfiguration>, cancelCallback?: CancelCallback): NullableResultPromise<IEntity>;
|
|
31
35
|
/**
|
|
32
36
|
* Gets the {@link IEntity} instance with the specified `id` or `identifier`.
|
|
33
37
|
* @param param - The id or identifier of the entity to get
|
|
34
38
|
* @param loadConfiguration - The loading configuration for the entity
|
|
39
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
35
40
|
* @returns The entity or `null` when it was not found.
|
|
36
41
|
*/
|
|
37
|
-
getAsync(param: number | string, loadConfiguration?: Nullable<IEntityLoadConfiguration
|
|
42
|
+
getAsync(param: number | string, loadConfiguration?: Nullable<IEntityLoadConfiguration>, cancelCallback?: CancelCallback): NullableResultPromise<IEntity>;
|
|
38
43
|
/**
|
|
39
44
|
* Gets the {@link IEntity} instances with the specified `ids`.
|
|
40
45
|
*
|
|
@@ -44,9 +49,10 @@ export interface IEntitiesClient {
|
|
|
44
49
|
*
|
|
45
50
|
* @param ids - The ids of the entities to get
|
|
46
51
|
* @param loadConfiguration - The loading configuration for an entity
|
|
52
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
47
53
|
* @returns List of entities.
|
|
48
54
|
*/
|
|
49
|
-
getManyAsync(ids: Array<number>, loadConfiguration?: Nullable<IEntityLoadConfiguration
|
|
55
|
+
getManyAsync(ids: Array<number>, loadConfiguration?: Nullable<IEntityLoadConfiguration>, cancelCallback?: CancelCallback): Promise<Array<IEntity>>;
|
|
50
56
|
/**
|
|
51
57
|
* Gets the {@link IEntity} instances with the specified `identifiers`.
|
|
52
58
|
*
|
|
@@ -56,9 +62,10 @@ export interface IEntitiesClient {
|
|
|
56
62
|
*
|
|
57
63
|
* @param identifiers - The identifiers of the entities to get
|
|
58
64
|
* @param loadConfiguration - The loading configuration for an entity
|
|
65
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
59
66
|
* @returns List of entities.
|
|
60
67
|
*/
|
|
61
|
-
getManyAsync(identifiers: Array<string>, loadConfiguration?: Nullable<IEntityLoadConfiguration
|
|
68
|
+
getManyAsync(identifiers: Array<string>, loadConfiguration?: Nullable<IEntityLoadConfiguration>, cancelCallback?: CancelCallback): Promise<Array<IEntity>>;
|
|
62
69
|
/**
|
|
63
70
|
* Gets the {@link IEntity} instances with the specified `ids` or `identifiers`.
|
|
64
71
|
*
|
|
@@ -68,9 +75,10 @@ export interface IEntitiesClient {
|
|
|
68
75
|
*
|
|
69
76
|
* @param param - The ids or identifiers of the entities to get
|
|
70
77
|
* @param loadConfiguration - The loading configuration for an entity
|
|
78
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
71
79
|
* @returns List of entities.
|
|
72
80
|
*/
|
|
73
|
-
getManyAsync(param: Array<number> | Array<string>, loadConfiguration?: Nullable<IEntityLoadConfiguration
|
|
81
|
+
getManyAsync(param: Array<number> | Array<string>, loadConfiguration?: Nullable<IEntityLoadConfiguration>, cancelCallback?: CancelCallback): Promise<Array<IEntity>>;
|
|
74
82
|
/**
|
|
75
83
|
* Queries the {@link IEntity} instances for the specified `definitionName`.
|
|
76
84
|
*
|
|
@@ -79,18 +87,20 @@ export interface IEntitiesClient {
|
|
|
79
87
|
* @param skip - Skip the specified number of entities (optional)
|
|
80
88
|
* @param take - Take only the specified number of entities (optional, default: {@link ENTITIES.take})
|
|
81
89
|
* @param sorting - Sorting options
|
|
90
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
82
91
|
* @returns List of entities.
|
|
83
92
|
*/
|
|
84
|
-
getByDefinitionAsync(definitionName: string, loadConfiguration?: Nullable<IEntityLoadConfiguration>, skip?: number, take?: number, sorting?: Array<Sorting
|
|
93
|
+
getByDefinitionAsync(definitionName: string, loadConfiguration?: Nullable<IEntityLoadConfiguration>, skip?: number, take?: number, sorting?: Array<Sorting>, cancelCallback?: CancelCallback): Promise<IEntityQueryResult>;
|
|
85
94
|
/**
|
|
86
95
|
* Queries the {@link IEntity} ids for the specified `definitionName`.
|
|
87
96
|
*
|
|
88
97
|
* @param definitionName - The name of the definition to get entity ids for (case insensitive)
|
|
89
98
|
* @param skip - Skip the specified number of entities (optional)
|
|
90
99
|
* @param take - Take only the specified number of entities (optional, default: {@link ENTITIES.take})
|
|
100
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
91
101
|
* @returns List of entity ids.
|
|
92
102
|
*/
|
|
93
|
-
getIdsByDefinitionAsync(definitionName: string, skip?: number, take?: number): Promise<IIdQueryResult>;
|
|
103
|
+
getIdsByDefinitionAsync(definitionName: string, skip?: number, take?: number, cancelCallback?: CancelCallback): Promise<IIdQueryResult>;
|
|
94
104
|
/**
|
|
95
105
|
* Creates an {@link IEntityIterator} instance for the specified definition that returns instances.
|
|
96
106
|
* Results are sorted ascending on creation date.
|
|
@@ -117,15 +127,27 @@ export interface IEntitiesClient {
|
|
|
117
127
|
* fetched again.
|
|
118
128
|
*
|
|
119
129
|
* @param entity - Entity to save
|
|
130
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
120
131
|
* @returns The id of the entity.
|
|
121
132
|
*/
|
|
122
|
-
saveAsync(entity: IEntity): Promise<number>;
|
|
133
|
+
saveAsync(entity: IEntity, cancelCallback?: CancelCallback): Promise<number>;
|
|
123
134
|
/**
|
|
124
135
|
* Deletes the {@link IEntity} with specified id.
|
|
125
136
|
*
|
|
126
137
|
* @param entityId - The id of the entity to delete
|
|
138
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
127
139
|
*/
|
|
128
|
-
deleteAsync(entityId: number): Promise<void>;
|
|
140
|
+
deleteAsync(entityId: number, cancelCallback?: CancelCallback): Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* Copies an {@link IEntity} by id to a new or existing entity.
|
|
143
|
+
*
|
|
144
|
+
* @param entityId - The id of the entity to delete
|
|
145
|
+
* @param copyOptions - The copy options.
|
|
146
|
+
*
|
|
147
|
+
* @returns The id of the copied entity.
|
|
148
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
149
|
+
*/
|
|
150
|
+
copyAsync(entityId: number, copyOptions: IEntityCopyOptions, cancelCallback?: CancelCallback): Promise<number>;
|
|
129
151
|
}
|
|
130
152
|
/**
|
|
131
153
|
* The client responsible for getting, saving and deleting entities.
|
|
@@ -134,32 +156,21 @@ export declare class EntitiesClient implements IEntitiesClient {
|
|
|
134
156
|
private readonly _client;
|
|
135
157
|
constructor(client: IExtendedContentHubClient);
|
|
136
158
|
/**
|
|
137
|
-
*
|
|
138
|
-
* @param param - The id or identifier of the entity to get
|
|
139
|
-
* @param loadConfiguration - The loading configuration for the entity
|
|
140
|
-
* @returns The entity or `null` when it was not found.
|
|
159
|
+
* {@inheritDoc}
|
|
141
160
|
*/
|
|
142
|
-
getAsync(param: string | number, loadConfiguration?: Nullable<IEntityLoadConfiguration
|
|
161
|
+
getAsync(param: string | number, loadConfiguration?: Nullable<IEntityLoadConfiguration>, cancelCallback?: CancelCallback): NullableResultPromise<IEntity>;
|
|
143
162
|
/**
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* @remarks
|
|
147
|
-
* The returned list of entities can be empty or contain fewer items than the list of identifiers.
|
|
148
|
-
* The order of the entities in the returned list can be different than the order of the requested identifiers.
|
|
149
|
-
*
|
|
150
|
-
* @param param - The ids or identifiers of the entities to get
|
|
151
|
-
* @param loadConfiguration - The loading configuration for an entity
|
|
152
|
-
* @returns List of entities.
|
|
163
|
+
* {@inheritDoc}
|
|
153
164
|
*/
|
|
154
|
-
getManyAsync(param: Array<number> | Array<string>, loadConfiguration?: Nullable<IEntityLoadConfiguration
|
|
165
|
+
getManyAsync(param: Array<number> | Array<string>, loadConfiguration?: Nullable<IEntityLoadConfiguration>, cancelCallback?: CancelCallback): Promise<Array<IEntity>>;
|
|
155
166
|
/**
|
|
156
167
|
* {@inheritDoc}
|
|
157
168
|
*/
|
|
158
|
-
getByDefinitionAsync(definitionName: string, loadConfiguration?: Nullable<IEntityLoadConfiguration>, skip?: number, take?: number, sorting?: Array<Sorting
|
|
169
|
+
getByDefinitionAsync(definitionName: string, loadConfiguration?: Nullable<IEntityLoadConfiguration>, skip?: number, take?: number, sorting?: Array<Sorting>, cancelCallback?: CancelCallback): Promise<IEntityQueryResult>;
|
|
159
170
|
/**
|
|
160
171
|
* {@inheritDoc}
|
|
161
172
|
*/
|
|
162
|
-
getIdsByDefinitionAsync(definitionName: string, skip?: number, take?: number): Promise<IIdQueryResult>;
|
|
173
|
+
getIdsByDefinitionAsync(definitionName: string, skip?: number, take?: number, cancelCallback?: CancelCallback): Promise<IIdQueryResult>;
|
|
163
174
|
/**
|
|
164
175
|
* {@inheritDoc}
|
|
165
176
|
*/
|
|
@@ -171,11 +182,15 @@ export declare class EntitiesClient implements IEntitiesClient {
|
|
|
171
182
|
/**
|
|
172
183
|
* {@inheritDoc}
|
|
173
184
|
*/
|
|
174
|
-
saveAsync(entity: IEntity): Promise<number>;
|
|
185
|
+
saveAsync(entity: IEntity, cancelCallback?: CancelCallback): Promise<number>;
|
|
186
|
+
/**
|
|
187
|
+
* {@inheritDoc}
|
|
188
|
+
*/
|
|
189
|
+
deleteAsync(entityId: number, cancelCallback?: CancelCallback): Promise<void>;
|
|
175
190
|
/**
|
|
176
191
|
* {@inheritDoc}
|
|
177
192
|
*/
|
|
178
|
-
|
|
193
|
+
copyAsync(entityId: number, copyOptions: IEntityCopyOptions, cancelCallback?: CancelCallback): Promise<number>;
|
|
179
194
|
/**
|
|
180
195
|
* Creates the specified {@link IEntity} in the system.
|
|
181
196
|
*
|
|
@@ -26,6 +26,7 @@ const internal_error_1 = require("../errors/internal-error");
|
|
|
26
26
|
const web_api_error_1 = require("../errors/web-api-error");
|
|
27
27
|
const guard_1 = __importDefault(require("../guard"));
|
|
28
28
|
const link_1 = __importDefault(require("../link"));
|
|
29
|
+
const entity_copy_options_mapper_1 = require("../mappers/entity-copy-options-mapper");
|
|
29
30
|
const type_guards_1 = require("../type-guards");
|
|
30
31
|
const response_handler_1 = require("./response-handler");
|
|
31
32
|
/**
|
|
@@ -37,12 +38,9 @@ class EntitiesClient {
|
|
|
37
38
|
this._client = client;
|
|
38
39
|
}
|
|
39
40
|
/**
|
|
40
|
-
*
|
|
41
|
-
* @param param - The id or identifier of the entity to get
|
|
42
|
-
* @param loadConfiguration - The loading configuration for the entity
|
|
43
|
-
* @returns The entity or `null` when it was not found.
|
|
41
|
+
* {@inheritDoc}
|
|
44
42
|
*/
|
|
45
|
-
getAsync(param, loadConfiguration) {
|
|
43
|
+
getAsync(param, loadConfiguration, cancelCallback) {
|
|
46
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
45
|
let query;
|
|
48
46
|
if (typeof param === "string") {
|
|
@@ -63,23 +61,15 @@ class EntitiesClient {
|
|
|
63
61
|
}),
|
|
64
62
|
});
|
|
65
63
|
}
|
|
66
|
-
const result = yield this._client.querying.queryAsync(query, loadConfiguration || null);
|
|
64
|
+
const result = yield this._client.querying.queryAsync(query, loadConfiguration || null, cancelCallback);
|
|
67
65
|
const entity = EntitiesClient.single(result);
|
|
68
66
|
return entity;
|
|
69
67
|
});
|
|
70
68
|
}
|
|
71
69
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* @remarks
|
|
75
|
-
* The returned list of entities can be empty or contain fewer items than the list of identifiers.
|
|
76
|
-
* The order of the entities in the returned list can be different than the order of the requested identifiers.
|
|
77
|
-
*
|
|
78
|
-
* @param param - The ids or identifiers of the entities to get
|
|
79
|
-
* @param loadConfiguration - The loading configuration for an entity
|
|
80
|
-
* @returns List of entities.
|
|
70
|
+
* {@inheritDoc}
|
|
81
71
|
*/
|
|
82
|
-
getManyAsync(param, loadConfiguration) {
|
|
72
|
+
getManyAsync(param, loadConfiguration, cancelCallback) {
|
|
83
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
74
|
if (param == null || param.length === 0)
|
|
85
75
|
return [];
|
|
@@ -105,14 +95,14 @@ class EntitiesClient {
|
|
|
105
95
|
}),
|
|
106
96
|
});
|
|
107
97
|
}
|
|
108
|
-
const result = yield this._client.querying.queryAsync(query, loadConfiguration || null);
|
|
98
|
+
const result = yield this._client.querying.queryAsync(query, loadConfiguration || null, cancelCallback);
|
|
109
99
|
return result.items;
|
|
110
100
|
});
|
|
111
101
|
}
|
|
112
102
|
/**
|
|
113
103
|
* {@inheritDoc}
|
|
114
104
|
*/
|
|
115
|
-
getByDefinitionAsync(definitionName, loadConfiguration, skip = defaults_1.ENTITIES.skip, take = defaults_1.ENTITIES.take, sorting) {
|
|
105
|
+
getByDefinitionAsync(definitionName, loadConfiguration, skip = defaults_1.ENTITIES.skip, take = defaults_1.ENTITIES.take, sorting, cancelCallback) {
|
|
116
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
107
|
guard_1.default.stringNotNullOrEmpty(definitionName);
|
|
118
108
|
guard_1.default.notNegative(skip);
|
|
@@ -126,13 +116,13 @@ class EntitiesClient {
|
|
|
126
116
|
take: take,
|
|
127
117
|
sorting: sorting,
|
|
128
118
|
});
|
|
129
|
-
return this._client.querying.queryAsync(query, loadConfiguration);
|
|
119
|
+
return this._client.querying.queryAsync(query, loadConfiguration, cancelCallback);
|
|
130
120
|
});
|
|
131
121
|
}
|
|
132
122
|
/**
|
|
133
123
|
* {@inheritDoc}
|
|
134
124
|
*/
|
|
135
|
-
getIdsByDefinitionAsync(definitionName, skip, take) {
|
|
125
|
+
getIdsByDefinitionAsync(definitionName, skip, take, cancelCallback) {
|
|
136
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
137
127
|
guard_1.default.stringNotNullOrEmpty(definitionName);
|
|
138
128
|
if (skip != null)
|
|
@@ -146,8 +136,9 @@ class EntitiesClient {
|
|
|
146
136
|
}),
|
|
147
137
|
skip: skip,
|
|
148
138
|
take: take,
|
|
139
|
+
//TODO sorting on created on ascending?
|
|
149
140
|
});
|
|
150
|
-
const result = yield this._client.querying.queryIdsAsync(query);
|
|
141
|
+
const result = yield this._client.querying.queryIdsAsync(query, cancelCallback);
|
|
151
142
|
return result;
|
|
152
143
|
});
|
|
153
144
|
}
|
|
@@ -181,15 +172,15 @@ class EntitiesClient {
|
|
|
181
172
|
/**
|
|
182
173
|
* {@inheritDoc}
|
|
183
174
|
*/
|
|
184
|
-
saveAsync(entity) {
|
|
175
|
+
saveAsync(entity, cancelCallback) {
|
|
185
176
|
return __awaiter(this, void 0, void 0, function* () {
|
|
186
177
|
guard_1.default.notNullOrUndefined(entity);
|
|
187
178
|
let id;
|
|
188
179
|
if (entity.isNew) {
|
|
189
|
-
id = yield this.createEntityAsync(entity);
|
|
180
|
+
id = yield this.createEntityAsync(entity, cancelCallback);
|
|
190
181
|
}
|
|
191
182
|
else {
|
|
192
|
-
yield this.updateEntityAsync(entity);
|
|
183
|
+
yield this.updateEntityAsync(entity, cancelCallback);
|
|
193
184
|
id = entity.id;
|
|
194
185
|
}
|
|
195
186
|
entity.markClean();
|
|
@@ -199,12 +190,34 @@ class EntitiesClient {
|
|
|
199
190
|
/**
|
|
200
191
|
* {@inheritDoc}
|
|
201
192
|
*/
|
|
202
|
-
deleteAsync(entityId) {
|
|
193
|
+
deleteAsync(entityId, cancelCallback) {
|
|
203
194
|
return __awaiter(this, void 0, void 0, function* () {
|
|
204
195
|
guard_1.default.validId(entityId);
|
|
205
196
|
const link = yield this._client.linkHelper.entityToLinkAsync(entityId);
|
|
206
|
-
const response = yield this._client.raw.deleteAsync(link.href);
|
|
197
|
+
const response = yield this._client.raw.deleteAsync(link.href, undefined, cancelCallback);
|
|
198
|
+
response_handler_1.ResponseHandler.handleErrors(response);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* {@inheritDoc}
|
|
203
|
+
*/
|
|
204
|
+
copyAsync(entityId, copyOptions, cancelCallback) {
|
|
205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
guard_1.default.validId(entityId);
|
|
207
|
+
guard_1.default.notNull(copyOptions);
|
|
208
|
+
const link = yield this._client.linkHelper.copyEntityToLinkAsync(entityId);
|
|
209
|
+
const options = entity_copy_options_mapper_1.EntityCopyOptionsMapper.map(copyOptions);
|
|
210
|
+
const response = yield this._client.raw.postAsync(link.href, ta_json_1.TaJson.serialize(options), undefined, cancelCallback);
|
|
207
211
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
212
|
+
const href = response.responseHeaders[api_1.HEADERS.location];
|
|
213
|
+
if (!href) {
|
|
214
|
+
throw new web_api_error_1.WebApiError(error_messages_1.default.EntitiesClient.UnableToExtractLocationHeaderFromResponse, response.statusCode, response);
|
|
215
|
+
}
|
|
216
|
+
const id = yield this._client.linkHelper.idFromEntityAsync(new link_1.default(href));
|
|
217
|
+
if (id === null || id === 0) {
|
|
218
|
+
throw new internal_error_1.InternalError(error_messages_1.default.EntitiesClient.UnableToExtractEntityIdFromHeader);
|
|
219
|
+
}
|
|
220
|
+
return id;
|
|
208
221
|
});
|
|
209
222
|
}
|
|
210
223
|
/**
|
|
@@ -212,11 +225,11 @@ class EntitiesClient {
|
|
|
212
225
|
*
|
|
213
226
|
* @param entity - The entity to create/save in the system
|
|
214
227
|
*/
|
|
215
|
-
createEntityAsync(entity) {
|
|
228
|
+
createEntityAsync(entity, cancelCallback) {
|
|
216
229
|
return __awaiter(this, void 0, void 0, function* () {
|
|
217
230
|
const link = yield this._client.linkHelper.entitiesLinkAsync();
|
|
218
231
|
const resource = yield this._client.entityMapper.toResourceAsync(entity);
|
|
219
|
-
const response = yield this._client.raw.postAsync(link.href, ta_json_1.TaJson.serialize(resource));
|
|
232
|
+
const response = yield this._client.raw.postAsync(link.href, ta_json_1.TaJson.serialize(resource), undefined, cancelCallback);
|
|
220
233
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
221
234
|
const href = response.responseHeaders[api_1.HEADERS.location];
|
|
222
235
|
if (!href) {
|
|
@@ -234,7 +247,7 @@ class EntitiesClient {
|
|
|
234
247
|
*
|
|
235
248
|
* @param entity - The entity to update
|
|
236
249
|
*/
|
|
237
|
-
updateEntityAsync(entity) {
|
|
250
|
+
updateEntityAsync(entity, cancelCallback) {
|
|
238
251
|
return __awaiter(this, void 0, void 0, function* () {
|
|
239
252
|
// Check if the entity is loaded in only one culture to improve save performance.
|
|
240
253
|
let culture = null;
|
|
@@ -243,7 +256,7 @@ class EntitiesClient {
|
|
|
243
256
|
}
|
|
244
257
|
const link = yield this._client.linkHelper.entityToLinkAsync(entity.id, culture !== null && culture !== void 0 ? culture : undefined);
|
|
245
258
|
const resource = yield this._client.entityMapper.mapDirtiesToResourceAsync(entity);
|
|
246
|
-
const response = yield this._client.raw.putAsync(link.href, ta_json_1.TaJson.serialize(resource));
|
|
259
|
+
const response = yield this._client.raw.putAsync(link.href, ta_json_1.TaJson.serialize(resource), undefined, cancelCallback);
|
|
247
260
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
248
261
|
});
|
|
249
262
|
}
|
|
@@ -269,3 +282,4 @@ class EntitiesClient {
|
|
|
269
282
|
}
|
|
270
283
|
}
|
|
271
284
|
exports.EntitiesClient = EntitiesClient;
|
|
285
|
+
//# sourceMappingURL=entities-client.js.map
|
|
@@ -9,40 +9,78 @@ export interface IEntityDefinitionsClient {
|
|
|
9
9
|
/**
|
|
10
10
|
* Get the {@link IEntityDefinition} instance by the specified name.
|
|
11
11
|
* @param name - The name of the definition
|
|
12
|
+
* @param includeConditionalMembers - Include conditional members
|
|
13
|
+
* @param loadPermissions - Load permissions for the definition
|
|
12
14
|
* @returns Promise which resolves to an {@link IEntityDefinition} or null.
|
|
13
15
|
*/
|
|
14
|
-
getAsync(name: string): NullableResultPromise<IEntityDefinition>;
|
|
16
|
+
getAsync(name: string, includeConditionalMembers?: boolean, loadPermissions?: boolean): NullableResultPromise<IEntityDefinition>;
|
|
15
17
|
/**
|
|
16
18
|
* Get the {@link IEntityDefinition} instance by the specified id.
|
|
17
19
|
* @param id - The id of the definition
|
|
20
|
+
* @param includeConditionalMembers - Include conditional members
|
|
21
|
+
* @param loadPermissions - Load permissions for the definition
|
|
18
22
|
* @returns Promise which resolves to an {@link IEntityDefinition} or null.
|
|
19
23
|
*/
|
|
20
|
-
getAsync(id: number): NullableResultPromise<IEntityDefinition>;
|
|
24
|
+
getAsync(id: number, includeConditionalMembers?: boolean, loadPermissions?: boolean): NullableResultPromise<IEntityDefinition>;
|
|
21
25
|
/**
|
|
22
|
-
* Get all the {@link IEntityDefinition}s
|
|
26
|
+
* Get all the {@link IEntityDefinition}s.
|
|
27
|
+
* @param includeConditionalMembers - Include conditional members
|
|
28
|
+
* @param loadPermissions - Load permissions for the definitions
|
|
23
29
|
* @returns Promise which resolved to an array of {@link IEntityDefinition}s.
|
|
24
30
|
*/
|
|
25
|
-
getAllAsync(): Promise<Array<IEntityDefinition>>;
|
|
31
|
+
getAllAsync(includeConditionalMembers?: boolean, loadPermissions?: boolean): Promise<Array<IEntityDefinition>>;
|
|
26
32
|
/**
|
|
27
33
|
* Get all the {@link IEntityDefinition}s (cached).
|
|
34
|
+
* @param includeConditionalMembers - Include conditional members
|
|
35
|
+
* @param loadPermissions - Load permissions for the definitions
|
|
28
36
|
* @returns Promise which resolved to an array of {@link IEntityDefinition}s.
|
|
29
37
|
*/
|
|
30
|
-
getAllCachedAsync(): Promise<Array<IEntityDefinition>>;
|
|
38
|
+
getAllCachedAsync(includeConditionalMembers?: boolean, loadPermissions?: boolean): Promise<Array<IEntityDefinition>>;
|
|
31
39
|
/**
|
|
32
40
|
* Get the cached {@link IEntityDefinition} instance by the specified name.
|
|
33
41
|
* @param name - The name of the definition
|
|
42
|
+
* @param includeConditionalMembers - Include conditional members
|
|
43
|
+
* @param loadPermissions - Load permissions for the definition
|
|
34
44
|
* @returns Promise which resolves to an {@link IEntityDefinition} or null.
|
|
35
45
|
*/
|
|
36
|
-
getCachedAsync(name: string): NullableResultPromise<IEntityDefinition>;
|
|
37
|
-
getCachedAsync(id: number): NullableResultPromise<IEntityDefinition>;
|
|
46
|
+
getCachedAsync(name: string, includeConditionalMembers?: boolean, loadPermissions?: boolean): NullableResultPromise<IEntityDefinition>;
|
|
47
|
+
getCachedAsync(id: number, includeConditionalMembers?: boolean, loadPermissions?: boolean): NullableResultPromise<IEntityDefinition>;
|
|
38
48
|
getNameAsync(id: number): NullableResultPromise<string>;
|
|
39
49
|
getNameCachedAsync(id: number): NullableResultPromise<string>;
|
|
40
50
|
getIdAsync(name: string): NullableResultPromise<number>;
|
|
41
51
|
getIdCachedAsync(name: string): NullableResultPromise<number>;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Get multiple entity definitions.
|
|
54
|
+
* @param names - Names of the definitions to fetch
|
|
55
|
+
* @param includeConditionalMembers - Include conditional members
|
|
56
|
+
* @param loadPermissions - Load permissions for the definitions
|
|
57
|
+
* @returns A list of entity definitions.
|
|
58
|
+
*/
|
|
59
|
+
getManyAsync(names: Array<string>, includeConditionalMembers?: boolean, loadPermissions?: boolean): Promise<Array<IEntityDefinition>>;
|
|
60
|
+
/**
|
|
61
|
+
* Get multiple entity definitions.
|
|
62
|
+
* @param ids - The ids of the definitions to fetch
|
|
63
|
+
* @param includeConditionalMembers - Include conditional members
|
|
64
|
+
* @param loadPermissions - Load permissions for the definitions
|
|
65
|
+
* @returns A list of entity definitions.
|
|
66
|
+
*/
|
|
67
|
+
getManyAsync(ids: Array<number>, includeConditionalMembers?: boolean, loadPermissions?: boolean): Promise<Array<IEntityDefinition>>;
|
|
68
|
+
/**
|
|
69
|
+
* Get multiple entity definitions. Check the cache before making a request.
|
|
70
|
+
* @param names - Names of the definitions to fetch
|
|
71
|
+
* @param includeConditionalMembers - Include conditional members
|
|
72
|
+
* @param loadPermissions - Load permissions for the definitions
|
|
73
|
+
* @returns A list of entity definitions.
|
|
74
|
+
*/
|
|
75
|
+
getManyCachedAsync(names: Array<string>, includeConditionalMembers?: boolean, loadPermissions?: boolean): Promise<Array<IEntityDefinition>>;
|
|
76
|
+
/**
|
|
77
|
+
* Get multiple entity definitions. Check the cache before making a request.
|
|
78
|
+
* @param ids - The ids of the definitions to fetch
|
|
79
|
+
* @param includeConditionalMembers - Include conditional members
|
|
80
|
+
* @param loadPermissions - Load permissions for the definitions
|
|
81
|
+
* @returns A list of entity definitions.
|
|
82
|
+
*/
|
|
83
|
+
getManyCachedAsync(ids: Array<number>, includeConditionalMembers?: boolean, loadPermissions?: boolean): Promise<Array<IEntityDefinition>>;
|
|
46
84
|
getNamesAsync(ids: Array<number>): Promise<MapNumberTo<string>>;
|
|
47
85
|
getNamesCachedAsync(ids: Array<number>): Promise<MapNumberTo<string>>;
|
|
48
86
|
getIdsAsync(names: Array<string>): Promise<MapStringTo<number>>;
|
|
@@ -60,16 +98,16 @@ export declare class EntityDefinitionsClient implements IEntityDefinitionsClient
|
|
|
60
98
|
private readonly _client;
|
|
61
99
|
private readonly _cache;
|
|
62
100
|
constructor(client: IExtendedContentHubClient);
|
|
63
|
-
getAllCachedAsync(): Promise<Array<IEntityDefinition>>;
|
|
64
|
-
getAllAsync(): Promise<Array<IEntityDefinition>>;
|
|
65
|
-
getAsync(param: string | number): NullableResultPromise<IEntityDefinition>;
|
|
66
|
-
getCachedAsync(param: string | number): NullableResultPromise<IEntityDefinition>;
|
|
101
|
+
getAllCachedAsync(includeConditionalMembers?: boolean, loadPermissions?: boolean): Promise<Array<IEntityDefinition>>;
|
|
102
|
+
getAllAsync(includeConditionalMembers?: boolean, loadPermissions?: boolean): Promise<Array<IEntityDefinition>>;
|
|
103
|
+
getAsync(param: string | number, includeConditionalMembers?: boolean, loadPermissions?: boolean): NullableResultPromise<IEntityDefinition>;
|
|
104
|
+
getCachedAsync(param: string | number, includeConditionalMembers?: boolean, loadPermissions?: boolean): NullableResultPromise<IEntityDefinition>;
|
|
67
105
|
getNameAsync(id: number): NullableResultPromise<string>;
|
|
68
106
|
getNameCachedAsync(id: number): NullableResultPromise<string>;
|
|
69
107
|
getIdAsync(name: string): NullableResultPromise<number>;
|
|
70
108
|
getIdCachedAsync(name: string): NullableResultPromise<number>;
|
|
71
|
-
getManyAsync(param: Array<string> | Array<number
|
|
72
|
-
getManyCachedAsync(param: Array<string> | Array<number
|
|
109
|
+
getManyAsync(param: Array<string> | Array<number>, includeConditionalMembers?: boolean, loadPermissions?: boolean): Promise<Array<IEntityDefinition>>;
|
|
110
|
+
getManyCachedAsync(param: Array<string> | Array<number>, includeConditionalMembers?: boolean, loadPermissions?: boolean): Promise<Array<IEntityDefinition>>;
|
|
73
111
|
getNamesAsync(ids: Array<number>): Promise<MapNumberTo<string>>;
|
|
74
112
|
getNamesCachedAsync(ids: Array<number>): Promise<MapNumberTo<string>>;
|
|
75
113
|
getIdsAsync(names: Array<string>): Promise<MapStringTo<number>>;
|