@sitecore/sc-contenthub-webclient-sdk 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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.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 +1 -0
- 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
|
@@ -7,28 +7,75 @@ import { Query } from "../contracts/querying/query";
|
|
|
7
7
|
import { IQueryLoadConfiguration } from "../contracts/querying/query-load-configuration";
|
|
8
8
|
import { IContentHubClient } from "./content-hub-client";
|
|
9
9
|
import { IExtendedContentHubClient } from "./extended-client";
|
|
10
|
+
import { CancelCallback } from "./internal-client";
|
|
10
11
|
export interface IQueryingClient {
|
|
11
|
-
singleAsync(query: Query, loadConfiguration?: IEntityLoadConfiguration): NullableResultPromise<IEntity>;
|
|
12
|
-
singleIdAsync(query: Query): NullableResultPromise<number>;
|
|
13
|
-
queryAsync(query: Query): Promise<IEntityQueryResult>;
|
|
14
|
-
|
|
15
|
-
queryIdsAsync(query: Query): Promise<IIdQueryResult>;
|
|
12
|
+
singleAsync(query: Query, loadConfiguration?: IEntityLoadConfiguration, cancelCallback?: CancelCallback): NullableResultPromise<IEntity>;
|
|
13
|
+
singleIdAsync(query: Query, cancelCallback?: CancelCallback): NullableResultPromise<number>;
|
|
14
|
+
queryAsync(query: Query, loadConfiguration?: Nullable<IEntityLoadConfiguration>, cancelCallback?: CancelCallback): Promise<IEntityQueryResult>;
|
|
15
|
+
queryIdsAsync(query: Query, cancelCallback?: CancelCallback): Promise<IIdQueryResult>;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Contains functionality to query and scroll for entities.
|
|
19
|
+
*/
|
|
17
20
|
declare abstract class QueryingClientBase implements IQueryingClient {
|
|
18
21
|
protected readonly _client: IContentHubClient;
|
|
19
22
|
constructor(client: IContentHubClient);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Gets a single entity that matches the query.
|
|
25
|
+
*
|
|
26
|
+
* @param query - The query to execute
|
|
27
|
+
* @param loadConfiguration - The load configuration. If it is null, then {@link EntityLoadConfiguration#Default} will be used.
|
|
28
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
29
|
+
* @returns The entity that matches the query or null if there are no results.
|
|
30
|
+
*/
|
|
31
|
+
singleAsync(query: Query, loadConfiguration?: IEntityLoadConfiguration, cancelCallback?: CancelCallback): NullableResultPromise<IEntity>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets a the id of the entity that matches the query.
|
|
34
|
+
*
|
|
35
|
+
* @param query - The query to execute
|
|
36
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
37
|
+
* @returns The id of the entity that matches the query or null if there are no results.
|
|
38
|
+
*/
|
|
39
|
+
singleIdAsync(query: Query, cancelCallback?: CancelCallback): NullableResultPromise<number>;
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves entities matching the query.
|
|
42
|
+
*
|
|
43
|
+
* @param query - The query to execute.
|
|
44
|
+
* @param loadConfiguration - The load configuration. If it is null, then {@link EntityLoadConfiguration#Default} will be used.
|
|
45
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
46
|
+
*/
|
|
47
|
+
abstract queryAsync(query: Query, loadConfiguration?: Nullable<IEntityLoadConfiguration>, cancelCallback?: CancelCallback): Promise<IEntityQueryResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Retrieves the ids of entities matching the query.
|
|
50
|
+
*
|
|
51
|
+
* @param query - The query to execute.
|
|
52
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
53
|
+
*/
|
|
54
|
+
abstract queryIdsAsync(query: Query, cancelCallback?: CancelCallback): Promise<IIdQueryResult>;
|
|
24
55
|
protected resolveLoadConfiguration(query: Query, loadConfiguration?: IEntityLoadConfiguration): Nullable<IQueryLoadConfiguration>;
|
|
25
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Contains functionality to query and scroll for entities.
|
|
59
|
+
*/
|
|
26
60
|
export declare class QueryingClient extends QueryingClientBase {
|
|
27
61
|
private readonly _extendedClient;
|
|
28
62
|
private readonly _mapper;
|
|
29
63
|
private readonly _schemaQuerying;
|
|
30
64
|
constructor(client: IExtendedContentHubClient);
|
|
31
|
-
|
|
32
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Retrieves entities matching the query.
|
|
67
|
+
*
|
|
68
|
+
* @param query - The query to execute.
|
|
69
|
+
* @param loadConfiguration - The load configuration. If it is null, then {@link EntityLoadConfiguration#Default} will be used.
|
|
70
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
71
|
+
*/
|
|
72
|
+
queryAsync(query: Query, loadConfiguration?: Nullable<IEntityLoadConfiguration>, cancelCallback?: CancelCallback): Promise<IEntityQueryResult>;
|
|
73
|
+
/**
|
|
74
|
+
* Retrieves the ids of entities matching the query.
|
|
75
|
+
*
|
|
76
|
+
* @param query - The query to execute.
|
|
77
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
78
|
+
*/
|
|
79
|
+
queryIdsAsync(query: Query, cancelCallback?: CancelCallback): Promise<IIdQueryResult>;
|
|
33
80
|
}
|
|
34
81
|
export {};
|
|
@@ -20,15 +20,26 @@ const guard_1 = __importDefault(require("../guard"));
|
|
|
20
20
|
const load_options_mapper_1 = require("../mappers/load-options-mapper");
|
|
21
21
|
const querying_mapper_1 = require("../mappers/querying-mapper");
|
|
22
22
|
const schema_querying_1 = require("./schema-querying");
|
|
23
|
+
/**
|
|
24
|
+
* Contains functionality to query and scroll for entities.
|
|
25
|
+
*/
|
|
23
26
|
class QueryingClientBase {
|
|
24
27
|
constructor(client) {
|
|
25
28
|
guard_1.default.notNullOrUndefined(client);
|
|
26
29
|
this._client = client;
|
|
27
30
|
}
|
|
28
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Gets a single entity that matches the query.
|
|
33
|
+
*
|
|
34
|
+
* @param query - The query to execute
|
|
35
|
+
* @param loadConfiguration - The load configuration. If it is null, then {@link EntityLoadConfiguration#Default} will be used.
|
|
36
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
37
|
+
* @returns The entity that matches the query or null if there are no results.
|
|
38
|
+
*/
|
|
39
|
+
singleAsync(query, loadConfiguration, cancelCallback) {
|
|
29
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
41
|
guard_1.default.notNullOrUndefined(query);
|
|
31
|
-
const result = yield this.queryAsync(query, loadConfiguration);
|
|
42
|
+
const result = yield this.queryAsync(query, loadConfiguration, cancelCallback);
|
|
32
43
|
if (result.items.length === 0) {
|
|
33
44
|
return null;
|
|
34
45
|
}
|
|
@@ -38,10 +49,17 @@ class QueryingClientBase {
|
|
|
38
49
|
return result.items[0];
|
|
39
50
|
});
|
|
40
51
|
}
|
|
41
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Gets a the id of the entity that matches the query.
|
|
54
|
+
*
|
|
55
|
+
* @param query - The query to execute
|
|
56
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
57
|
+
* @returns The id of the entity that matches the query or null if there are no results.
|
|
58
|
+
*/
|
|
59
|
+
singleIdAsync(query, cancelCallback) {
|
|
42
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
61
|
guard_1.default.notNullOrUndefined(query);
|
|
44
|
-
const result = yield this.queryIdsAsync(query);
|
|
62
|
+
const result = yield this.queryIdsAsync(query, cancelCallback);
|
|
45
63
|
if (result.items.length === 0) {
|
|
46
64
|
return null;
|
|
47
65
|
}
|
|
@@ -63,6 +81,9 @@ class QueryingClientBase {
|
|
|
63
81
|
return queryLoadConfiguration;
|
|
64
82
|
}
|
|
65
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Contains functionality to query and scroll for entities.
|
|
86
|
+
*/
|
|
66
87
|
class QueryingClient extends QueryingClientBase {
|
|
67
88
|
constructor(client) {
|
|
68
89
|
super(client);
|
|
@@ -71,25 +92,39 @@ class QueryingClient extends QueryingClientBase {
|
|
|
71
92
|
this._schemaQuerying = new schema_querying_1.SchemaQuerying(client);
|
|
72
93
|
this._mapper = new querying_mapper_1.QueryingMapper(client);
|
|
73
94
|
}
|
|
74
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Retrieves entities matching the query.
|
|
97
|
+
*
|
|
98
|
+
* @param query - The query to execute.
|
|
99
|
+
* @param loadConfiguration - The load configuration. If it is null, then {@link EntityLoadConfiguration#Default} will be used.
|
|
100
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
101
|
+
*/
|
|
102
|
+
queryAsync(query, loadConfiguration, cancelCallback) {
|
|
75
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
104
|
guard_1.default.notNullOrUndefined(query, "query");
|
|
77
105
|
//TODO query.validate();
|
|
78
106
|
const queryLoadConfiguration = this.resolveLoadConfiguration(query, loadConfiguration || undefined);
|
|
79
|
-
const resource = yield this._schemaQuerying.queryWithSchemaAsync(query, queryLoadConfiguration);
|
|
107
|
+
const resource = yield this._schemaQuerying.queryWithSchemaAsync(query, queryLoadConfiguration, cancelCallback);
|
|
80
108
|
loadConfiguration = load_options_mapper_1.LoadOptionsMapper.toEntityLoadConfiguration(queryLoadConfiguration || undefined);
|
|
81
109
|
const result = yield this._mapper.mapEntityQueryResultAsync(resource, query, loadConfiguration);
|
|
82
110
|
return result;
|
|
83
111
|
});
|
|
84
112
|
}
|
|
85
|
-
|
|
113
|
+
/**
|
|
114
|
+
* Retrieves the ids of entities matching the query.
|
|
115
|
+
*
|
|
116
|
+
* @param query - The query to execute.
|
|
117
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
118
|
+
*/
|
|
119
|
+
queryIdsAsync(query, cancelCallback) {
|
|
86
120
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
121
|
guard_1.default.notNullOrUndefined(query, "query");
|
|
88
122
|
//TODO query.validate();
|
|
89
|
-
const resource = yield this._schemaQuerying.queryWithSchemaAsync(query, query_load_configuration_1.QueryLoadConfiguration.Ids);
|
|
123
|
+
const resource = yield this._schemaQuerying.queryWithSchemaAsync(query, query_load_configuration_1.QueryLoadConfiguration.Ids, cancelCallback);
|
|
90
124
|
const result = yield this._mapper.mapEntityIdQueryResultAsync(resource, query);
|
|
91
125
|
return result;
|
|
92
126
|
});
|
|
93
127
|
}
|
|
94
128
|
}
|
|
95
129
|
exports.QueryingClient = QueryingClient;
|
|
130
|
+
//# sourceMappingURL=querying-client.js.map
|
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
import URI from "urijs";
|
|
2
2
|
import { MapStringTo } from "../base-types";
|
|
3
3
|
import { IExtendedContentHubClient } from "./extended-client";
|
|
4
|
+
import { CancelCallback } from "./internal-client";
|
|
4
5
|
import { RequestMessage } from "./request-message";
|
|
5
6
|
import { ResponseMessage } from "./response-message";
|
|
6
7
|
export interface IRawClient {
|
|
7
|
-
getAsync<T>(uri: string, headers?: MapStringTo<string
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
postAsync<T, K>(uri: string | URI, content?: T, headers?: MapStringTo<string>): Promise<ResponseMessage<K>>;
|
|
13
|
-
putAsync<T, K>(uri: string, content?: T, headers?: MapStringTo<string>): Promise<ResponseMessage<K>>;
|
|
14
|
-
putAsync<T, K>(uri: URI, content?: T, headers?: MapStringTo<string>): Promise<ResponseMessage<K>>;
|
|
15
|
-
putAsync<T, K>(uri: string | URI, content?: T, headers?: MapStringTo<string>): Promise<ResponseMessage<K>>;
|
|
16
|
-
deleteAsync<T>(uri: string, headers?: MapStringTo<string>): Promise<ResponseMessage<T>>;
|
|
17
|
-
deleteAsync<T>(uri: URI, headers?: MapStringTo<string>): Promise<ResponseMessage<T>>;
|
|
18
|
-
deleteAsync<T>(uri: string | URI, headers?: MapStringTo<string>): Promise<ResponseMessage<T>>;
|
|
19
|
-
sendAsync<T, K>(messageFactory: () => RequestMessage): Promise<ResponseMessage<K>>;
|
|
8
|
+
getAsync<T>(uri: string | URI, headers?: MapStringTo<string>, cancelCallback?: CancelCallback): Promise<ResponseMessage<T>>;
|
|
9
|
+
postAsync<T, K>(uri: string | URI, content?: T, headers?: MapStringTo<string>, cancelCallback?: CancelCallback): Promise<ResponseMessage<K>>;
|
|
10
|
+
putAsync<T, K>(uri: string | URI, content?: T, headers?: MapStringTo<string>, cancelCallback?: CancelCallback): Promise<ResponseMessage<K>>;
|
|
11
|
+
deleteAsync<T>(uri: string | URI, headers?: MapStringTo<string>, cancelCallback?: CancelCallback): Promise<ResponseMessage<T>>;
|
|
12
|
+
sendAsync<T, K>(messageFactory: () => RequestMessage, cancelCallback?: CancelCallback): Promise<ResponseMessage<K>>;
|
|
20
13
|
}
|
|
21
14
|
export declare class RawClient implements IRawClient {
|
|
22
15
|
private readonly _client;
|
|
23
16
|
constructor(client: IExtendedContentHubClient);
|
|
24
|
-
getAsync<T = any>(uri: string | URI, headers?: MapStringTo<string
|
|
25
|
-
postAsync<T = any, K = any>(uri: string | URI, content: unknown, headers?: MapStringTo<string
|
|
26
|
-
putAsync<T = any, K = any>(uri: string | URI, content: unknown, headers?: MapStringTo<string
|
|
27
|
-
deleteAsync<T = any>(uri: string | URI, headers?: MapStringTo<string
|
|
28
|
-
sendAsync<T = any, K = any>(messageFactory: () => RequestMessage<T
|
|
17
|
+
getAsync<T = any>(uri: string | URI, headers?: MapStringTo<string>, cancelCallback?: CancelCallback): Promise<ResponseMessage<T>>;
|
|
18
|
+
postAsync<T = any, K = any>(uri: string | URI, content: unknown, headers?: MapStringTo<string>, cancelCallback?: CancelCallback): Promise<ResponseMessage<K>>;
|
|
19
|
+
putAsync<T = any, K = any>(uri: string | URI, content: unknown, headers?: MapStringTo<string>, cancelCallback?: CancelCallback): Promise<ResponseMessage<K>>;
|
|
20
|
+
deleteAsync<T = any>(uri: string | URI, headers?: MapStringTo<string>, cancelCallback?: CancelCallback): Promise<ResponseMessage<T>>;
|
|
21
|
+
sendAsync<T = any, K = any>(messageFactory: () => RequestMessage<T>, cancelCallback?: CancelCallback): Promise<ResponseMessage<K>>;
|
|
29
22
|
}
|
|
@@ -22,16 +22,16 @@ class RawClient {
|
|
|
22
22
|
guard_1.default.notNullOrUndefined(client);
|
|
23
23
|
this._client = client;
|
|
24
24
|
}
|
|
25
|
-
getAsync(uri, headers) {
|
|
25
|
+
getAsync(uri, headers, cancelCallback) {
|
|
26
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
27
|
return yield this._client.internalClient.sendAsync(() => new request_message_1.RequestMessage({
|
|
28
28
|
requestUri: uri,
|
|
29
29
|
method: http_method_1.HttpMethod.GET,
|
|
30
30
|
requestHeaders: headers,
|
|
31
|
-
}));
|
|
31
|
+
}), cancelCallback);
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
postAsync(uri, content, headers) {
|
|
34
|
+
postAsync(uri, content, headers, cancelCallback) {
|
|
35
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
36
|
if (!headers) {
|
|
37
37
|
headers = {
|
|
@@ -43,10 +43,10 @@ class RawClient {
|
|
|
43
43
|
method: http_method_1.HttpMethod.POST,
|
|
44
44
|
requestHeaders: headers,
|
|
45
45
|
content: content,
|
|
46
|
-
}));
|
|
46
|
+
}), cancelCallback);
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
putAsync(uri, content, headers) {
|
|
49
|
+
putAsync(uri, content, headers, cancelCallback) {
|
|
50
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
51
|
if (!headers) {
|
|
52
52
|
headers = {
|
|
@@ -58,23 +58,24 @@ class RawClient {
|
|
|
58
58
|
method: http_method_1.HttpMethod.PUT,
|
|
59
59
|
requestHeaders: headers,
|
|
60
60
|
content: content,
|
|
61
|
-
}));
|
|
61
|
+
}), cancelCallback);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
deleteAsync(uri, headers) {
|
|
64
|
+
deleteAsync(uri, headers, cancelCallback) {
|
|
65
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
66
|
return yield this._client.internalClient.sendAsync(() => new request_message_1.RequestMessage({
|
|
67
67
|
requestUri: uri,
|
|
68
68
|
method: http_method_1.HttpMethod.DELETE,
|
|
69
69
|
requestHeaders: headers,
|
|
70
|
-
}));
|
|
70
|
+
}), cancelCallback);
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
sendAsync(messageFactory) {
|
|
73
|
+
sendAsync(messageFactory, cancelCallback) {
|
|
74
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
75
|
guard_1.default.notNullOrUndefined(messageFactory);
|
|
76
|
-
return yield this._client.internalClient.sendAsync(messageFactory);
|
|
76
|
+
return yield this._client.internalClient.sendAsync(messageFactory, cancelCallback);
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
exports.RawClient = RawClient;
|
|
81
|
+
//# sourceMappingURL=raw-client.js.map
|
|
@@ -1,29 +1,10 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
4
|
};
|
|
24
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
6
|
exports.ResponseHandler = void 0;
|
|
26
|
-
const
|
|
7
|
+
const http_status_codes_1 = require("http-status-codes");
|
|
27
8
|
const argument_error_1 = require("../errors/argument-error");
|
|
28
9
|
const forbidden_error_1 = require("../errors/forbidden-error");
|
|
29
10
|
const not_found_error_1 = require("../errors/not-found-error");
|
|
@@ -45,7 +26,7 @@ class ResponseHandler {
|
|
|
45
26
|
if (responseMessage.isSuccessStatusCode) {
|
|
46
27
|
return;
|
|
47
28
|
}
|
|
48
|
-
if (responseMessage.statusCode ===
|
|
29
|
+
if (responseMessage.statusCode === http_status_codes_1.StatusCodes.BAD_REQUEST) {
|
|
49
30
|
ResponseHandler.handleBadRequest(responseMessage);
|
|
50
31
|
}
|
|
51
32
|
else {
|
|
@@ -65,7 +46,7 @@ class ResponseHandler {
|
|
|
65
46
|
if (responseMessage.isSuccessStatusCode) {
|
|
66
47
|
throw new argument_error_1.ArgumentError(`Can not process successful request (code: ${responseMessage.statusCode}).`);
|
|
67
48
|
}
|
|
68
|
-
if (responseMessage.statusCode !==
|
|
49
|
+
if (responseMessage.statusCode !== http_status_codes_1.StatusCodes.BAD_REQUEST) {
|
|
69
50
|
throw new argument_error_1.ArgumentError(`Can not process failed request with status code '${responseMessage.statusCode}'.`);
|
|
70
51
|
}
|
|
71
52
|
/* istanbul ignore if */
|
|
@@ -123,18 +104,18 @@ class ResponseHandler {
|
|
|
123
104
|
catch (ex) { }
|
|
124
105
|
}
|
|
125
106
|
message = message !== null && message !== void 0 ? message : responseMessage.content;
|
|
126
|
-
if (responseMessage.statusCode ===
|
|
107
|
+
if (responseMessage.statusCode === http_status_codes_1.StatusCodes.FORBIDDEN) {
|
|
127
108
|
throw new forbidden_error_1.ForbiddenError(message !== null && message !== void 0 ? message : "Insufficient privileges or resource in use.");
|
|
128
109
|
}
|
|
129
|
-
else if (responseMessage.statusCode ===
|
|
130
|
-
throw new not_found_error_1.NotFoundError(message
|
|
110
|
+
else if (responseMessage.statusCode === http_status_codes_1.StatusCodes.NOT_FOUND) {
|
|
111
|
+
throw new not_found_error_1.NotFoundError(message && message.length > 0 ? message : "Resource can not be found.", responseMessage);
|
|
131
112
|
}
|
|
132
113
|
else {
|
|
133
114
|
if (message != null) {
|
|
134
115
|
message =
|
|
135
116
|
`An error has occurred (${responseMessage.statusCode}${responseMessage.statusText != null ? ` - ${responseMessage.statusText}` : ""}).\n` + `Message: ${message}`;
|
|
136
117
|
}
|
|
137
|
-
else if (responseMessage.statusCode ===
|
|
118
|
+
else if (responseMessage.statusCode === http_status_codes_1.StatusCodes.CONFLICT) {
|
|
138
119
|
message = `Conflict in the parameter value or name (${responseMessage.statusCode}${responseMessage.statusText != null ? ` - ${responseMessage.statusText}` : ""})`;
|
|
139
120
|
}
|
|
140
121
|
else {
|
|
@@ -145,3 +126,4 @@ class ResponseHandler {
|
|
|
145
126
|
}
|
|
146
127
|
}
|
|
147
128
|
exports.ResponseHandler = ResponseHandler;
|
|
129
|
+
//# sourceMappingURL=response-handler.js.map
|
|
@@ -3,14 +3,15 @@ import { IQueryLoadConfiguration } from "../contracts/querying/query-load-config
|
|
|
3
3
|
import { ScrollRequest } from "../contracts/querying/scroll-request";
|
|
4
4
|
import { QueryResultResource } from "../models/query-result-resource";
|
|
5
5
|
import { IExtendedContentHubClient } from "./extended-client";
|
|
6
|
+
import { CancelCallback } from "./internal-client";
|
|
6
7
|
export interface ISchemaQuerying {
|
|
7
|
-
queryWithSchemaAsync(query: Query, loadConfiguration: IQueryLoadConfiguration): Promise<QueryResultResource>;
|
|
8
|
-
scrollWithSchemaAsync(scrollRequest: ScrollRequest): Promise<QueryResultResource>;
|
|
8
|
+
queryWithSchemaAsync(query: Query, loadConfiguration: IQueryLoadConfiguration, cancelCallback?: CancelCallback): Promise<QueryResultResource>;
|
|
9
|
+
scrollWithSchemaAsync(scrollRequest: ScrollRequest, cancelCallback?: CancelCallback): Promise<QueryResultResource>;
|
|
9
10
|
}
|
|
10
11
|
export declare class SchemaQuerying implements ISchemaQuerying {
|
|
11
12
|
private readonly _client;
|
|
12
13
|
constructor(client: IExtendedContentHubClient);
|
|
13
|
-
queryWithSchemaAsync(query: Query, loadConfiguration: IQueryLoadConfiguration): Promise<QueryResultResource>;
|
|
14
|
+
queryWithSchemaAsync(query: Query, loadConfiguration: IQueryLoadConfiguration, cancelCallback?: CancelCallback): Promise<QueryResultResource>;
|
|
14
15
|
scrollWithSchemaAsync(scrollRequest: ScrollRequest): Promise<QueryResultResource>;
|
|
15
16
|
private queryEndpointAsync;
|
|
16
17
|
}
|
|
@@ -26,7 +26,7 @@ class SchemaQuerying {
|
|
|
26
26
|
guard_1.default.notNullOrUndefined(client);
|
|
27
27
|
this._client = client;
|
|
28
28
|
}
|
|
29
|
-
queryWithSchemaAsync(query, loadConfiguration) {
|
|
29
|
+
queryWithSchemaAsync(query, loadConfiguration, cancelCallback) {
|
|
30
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
31
|
guard_1.default.notNullOrUndefined(query, "query");
|
|
32
32
|
guard_1.default.notNullOrUndefined(loadConfiguration, "loadConfiguration");
|
|
@@ -46,22 +46,23 @@ class SchemaQuerying {
|
|
|
46
46
|
query: query,
|
|
47
47
|
loadConfiguration: loadConfiguration,
|
|
48
48
|
});
|
|
49
|
-
const resource = yield this.queryEndpointAsync(uri, ta_json_1.TaJson.serialize(queryRequest));
|
|
49
|
+
const resource = yield this.queryEndpointAsync(uri, ta_json_1.TaJson.serialize(queryRequest), cancelCallback);
|
|
50
50
|
return resource;
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
53
54
|
scrollWithSchemaAsync(scrollRequest) {
|
|
54
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
56
|
throw new Error("Method not implemented."); //TODO
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
|
-
queryEndpointAsync(endpoint, content) {
|
|
59
|
+
queryEndpointAsync(endpoint, content, cancelCallback) {
|
|
59
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
61
|
const response = yield this._client.raw.postAsync(endpoint, content, {
|
|
61
62
|
[api_1.HEADERS.apiVersion]: "3",
|
|
62
63
|
[api_1.HEADERS.minimalSchema]: "true",
|
|
63
64
|
"Content-Type": "application/json",
|
|
64
|
-
});
|
|
65
|
+
}, cancelCallback);
|
|
65
66
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
66
67
|
const resource = ta_json_1.TaJson.deserialize(response.content, query_result_resource_1.QueryResultResource);
|
|
67
68
|
return resource;
|
|
@@ -69,3 +70,4 @@ class SchemaQuerying {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
exports.SchemaQuerying = SchemaQuerying;
|
|
73
|
+
//# sourceMappingURL=schema-querying.js.map
|
|
@@ -3,23 +3,26 @@ import { AllFacetsRequest } from "../models/search/all-facets-request";
|
|
|
3
3
|
import { SearchRequest } from "../models/search/search-request";
|
|
4
4
|
import { SearchResponse } from "../models/search/search-response";
|
|
5
5
|
import { IExtendedContentHubClient } from "./extended-client";
|
|
6
|
+
import { CancelCallback } from "./internal-client";
|
|
6
7
|
export interface ISearchClient {
|
|
7
8
|
/**
|
|
8
9
|
* Send a {@link SearchRequest}.
|
|
9
10
|
* @param searchRequest - The search request
|
|
11
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an axios {@link CancelToken} if provided
|
|
10
12
|
* @returns The search response.
|
|
11
13
|
*/
|
|
12
|
-
searchAsync(searchRequest: SearchRequest): Promise<SearchResponse>;
|
|
14
|
+
searchAsync(searchRequest: SearchRequest, cancelCallback?: CancelCallback): Promise<SearchResponse>;
|
|
13
15
|
/**
|
|
14
16
|
* Send a {@link AllFacetsRequest}.
|
|
15
17
|
* @param allFacetsRequest - The all facets search request
|
|
18
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an axios {@link CancelToken} if provided
|
|
16
19
|
* @returns The search response.
|
|
17
20
|
*/
|
|
18
|
-
allFacetsAsync(allFacetsRequest: AllFacetsRequest): Promise<AllFacetValuesResponse>;
|
|
21
|
+
allFacetsAsync(allFacetsRequest: AllFacetsRequest, cancelCallback?: CancelCallback): Promise<AllFacetValuesResponse>;
|
|
19
22
|
}
|
|
20
23
|
export declare class SearchClient implements ISearchClient {
|
|
21
24
|
private readonly _client;
|
|
22
25
|
constructor(client: IExtendedContentHubClient);
|
|
23
|
-
searchAsync(searchRequest: SearchRequest): Promise<SearchResponse>;
|
|
24
|
-
allFacetsAsync(allFacetsRequest: AllFacetsRequest): Promise<AllFacetValuesResponse>;
|
|
26
|
+
searchAsync(searchRequest: SearchRequest, cancelCallback?: CancelCallback): Promise<SearchResponse>;
|
|
27
|
+
allFacetsAsync(allFacetsRequest: AllFacetsRequest, cancelCallback?: CancelCallback): Promise<AllFacetValuesResponse>;
|
|
25
28
|
}
|
|
@@ -23,21 +23,21 @@ class SearchClient {
|
|
|
23
23
|
guard_1.default.notNullOrUndefined(client);
|
|
24
24
|
this._client = client;
|
|
25
25
|
}
|
|
26
|
-
searchAsync(searchRequest) {
|
|
26
|
+
searchAsync(searchRequest, cancelCallback) {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
guard_1.default.notNullOrUndefined(searchRequest);
|
|
29
29
|
const searchLink = yield this._client.linkHelper.searchLinkAsync();
|
|
30
|
-
const response = yield this._client.raw.postAsync(searchLink.href, ta_json_1.TaJson.serialize(searchRequest));
|
|
30
|
+
const response = yield this._client.raw.postAsync(searchLink.href, ta_json_1.TaJson.serialize(searchRequest), undefined, cancelCallback);
|
|
31
31
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
32
32
|
const searchResponse = ta_json_1.TaJson.deserialize(response.content, search_response_1.SearchResponse);
|
|
33
33
|
return searchResponse;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
allFacetsAsync(allFacetsRequest) {
|
|
36
|
+
allFacetsAsync(allFacetsRequest, cancelCallback) {
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
38
|
guard_1.default.notNullOrUndefined(allFacetsRequest);
|
|
39
39
|
const allFacetsLink = yield this._client.linkHelper.allFacetsAsync();
|
|
40
|
-
const response = yield this._client.raw.postAsync(allFacetsLink.href, ta_json_1.TaJson.serialize(allFacetsRequest));
|
|
40
|
+
const response = yield this._client.raw.postAsync(allFacetsLink.href, ta_json_1.TaJson.serialize(allFacetsRequest), undefined, cancelCallback);
|
|
41
41
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
42
42
|
const allFacetsResponse = ta_json_1.TaJson.deserialize(response.content, all_facet_values_response_1.AllFacetValuesResponse);
|
|
43
43
|
return allFacetsResponse;
|
|
@@ -45,3 +45,4 @@ class SearchClient {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
exports.SearchClient = SearchClient;
|
|
48
|
+
//# sourceMappingURL=search-client.js.map
|
|
@@ -2,6 +2,7 @@ import { Nullable, NullableResultPromise } from "../base-types";
|
|
|
2
2
|
import { IEntity } from "../contracts/base/entity";
|
|
3
3
|
import { IEntityLoadConfiguration } from "../contracts/querying/entity-load-configuration";
|
|
4
4
|
import { IExtendedContentHubClient } from "./extended-client";
|
|
5
|
+
import SettingResource from "../models/setting-resource";
|
|
5
6
|
/**
|
|
6
7
|
* Client for fetching setting and category entities.
|
|
7
8
|
*/
|
|
@@ -20,6 +21,12 @@ export interface ISettingsClient {
|
|
|
20
21
|
* @returns The setting with the specified name from the specified category or null if that setting doesn't exist.
|
|
21
22
|
*/
|
|
22
23
|
getSettingAsync(category: string, name: string, loadConfiguration?: Nullable<IEntityLoadConfiguration>): NullableResultPromise<IEntity>;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the setting value and schema for the desired setting name in the specified category.
|
|
26
|
+
* @param category - The category to get the setting from
|
|
27
|
+
* @param name - The name of the setting to get
|
|
28
|
+
*/
|
|
29
|
+
getSettingValueAndSchemaAsync(category: string, name: string): NullableResultPromise<SettingResource>;
|
|
23
30
|
/**
|
|
24
31
|
* Gets the settings for the specified category.
|
|
25
32
|
* @param category - The category to get the setting for
|
|
@@ -33,5 +40,6 @@ export declare class SettingsClient implements ISettingsClient {
|
|
|
33
40
|
constructor(client: IExtendedContentHubClient);
|
|
34
41
|
getCategoryIdAsync(name: string): NullableResultPromise<number>;
|
|
35
42
|
getSettingAsync(category: string, name: string, loadConfiguration?: Nullable<IEntityLoadConfiguration>): NullableResultPromise<IEntity>;
|
|
43
|
+
getSettingValueAndSchemaAsync(category: string, name: string): NullableResultPromise<SettingResource>;
|
|
36
44
|
getSettingsForCategoryAsync(category: string, loadConfiguration?: Nullable<IEntityLoadConfiguration>): Promise<Array<IEntity>>;
|
|
37
45
|
}
|
|
@@ -18,6 +18,7 @@ const filters_1 = require("../contracts/querying/filters");
|
|
|
18
18
|
const query_1 = require("../contracts/querying/query");
|
|
19
19
|
const invalid_operation_error_1 = require("../errors/invalid-operation-error");
|
|
20
20
|
const guard_1 = __importDefault(require("../guard"));
|
|
21
|
+
const response_handler_1 = require("../clients/response-handler");
|
|
21
22
|
class SettingsClient {
|
|
22
23
|
constructor(client) {
|
|
23
24
|
guard_1.default.notNull(client);
|
|
@@ -94,6 +95,17 @@ class SettingsClient {
|
|
|
94
95
|
return (_a = result.items[0]) !== null && _a !== void 0 ? _a : null;
|
|
95
96
|
});
|
|
96
97
|
}
|
|
98
|
+
getSettingValueAndSchemaAsync(category, name) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
guard_1.default.stringNotNullOrEmpty(category);
|
|
101
|
+
guard_1.default.stringNotNullOrEmpty(name);
|
|
102
|
+
const link = yield this._client.linkHelper.settingByNameLink(category, name);
|
|
103
|
+
// Get the setting
|
|
104
|
+
const result = yield this._client.raw.getAsync(link.href);
|
|
105
|
+
response_handler_1.ResponseHandler.handleErrors(result);
|
|
106
|
+
return result.content;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
97
109
|
getSettingsForCategoryAsync(category, loadConfiguration = null) {
|
|
98
110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
99
111
|
guard_1.default.stringNotNullOrEmpty(category);
|
|
@@ -124,3 +136,4 @@ class SettingsClient {
|
|
|
124
136
|
}
|
|
125
137
|
}
|
|
126
138
|
exports.SettingsClient = SettingsClient;
|
|
139
|
+
//# sourceMappingURL=settings-client.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UploadRequest } from "../models/upload/upload-request";
|
|
2
2
|
import { IExtendedContentHubClient } from "./extended-client";
|
|
3
|
+
import { CancelCallback } from "./internal-client";
|
|
3
4
|
import { ResponseMessage } from "./response-message";
|
|
4
5
|
/**
|
|
5
6
|
* Client for uploading files (packages).
|
|
@@ -10,12 +11,14 @@ export interface IUploadClient {
|
|
|
10
11
|
* @param request - Describes the file upload.
|
|
11
12
|
* @returns The response of the file upload request.
|
|
12
13
|
*/
|
|
13
|
-
uploadAsync(request: UploadRequest): Promise<ResponseMessage>;
|
|
14
|
+
uploadAsync(request: UploadRequest, cancelCallback?: CancelCallback): Promise<ResponseMessage>;
|
|
14
15
|
}
|
|
15
16
|
export declare class UploadClient implements IUploadClient {
|
|
16
17
|
private client;
|
|
17
18
|
constructor(client: IExtendedContentHubClient);
|
|
18
|
-
uploadAsync(request: UploadRequest): Promise<ResponseMessage>;
|
|
19
|
+
uploadAsync(request: UploadRequest, cancelCallback?: CancelCallback): Promise<ResponseMessage>;
|
|
19
20
|
private uploadFileAsync;
|
|
20
21
|
private uploadChunkAsync;
|
|
22
|
+
private prepareFormDataNode;
|
|
23
|
+
private prepareFormDataBrowser;
|
|
21
24
|
}
|