@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
|
@@ -1,23 +1,4 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -32,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
13
|
};
|
|
33
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
15
|
exports.EntityDefinitionsClient = void 0;
|
|
35
|
-
const
|
|
16
|
+
const http_status_codes_1 = require("http-status-codes");
|
|
36
17
|
const ta_json_1 = require("ta-json");
|
|
37
18
|
const entity_definition_cache_1 = require("../caches/entity-definition-cache");
|
|
38
19
|
const entity_definition_id_iterator_1 = require("../contracts/querying/entity-definition-id-iterator");
|
|
@@ -46,41 +27,43 @@ const entity_definition_resource_1 = require("../models/entity-definition-resour
|
|
|
46
27
|
const type_guards_1 = require("../type-guards");
|
|
47
28
|
const array_utilities_1 = require("../utilities/array-utilities");
|
|
48
29
|
const response_handler_1 = require("./response-handler");
|
|
30
|
+
const urijs_1 = __importDefault(require("urijs"));
|
|
31
|
+
const api_1 = require("../constants/api");
|
|
49
32
|
class EntityDefinitionsClient {
|
|
50
33
|
constructor(client) {
|
|
51
34
|
this._client = client;
|
|
52
35
|
this._cache = new entity_definition_cache_1.EntityDefinitionCache();
|
|
53
36
|
}
|
|
54
|
-
getAllCachedAsync() {
|
|
37
|
+
getAllCachedAsync(includeConditionalMembers = true, loadPermissions) {
|
|
55
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
let definitions = this._cache.getAll();
|
|
39
|
+
let definitions = this._cache.getAll(undefined, includeConditionalMembers, loadPermissions);
|
|
57
40
|
if (!definitions) {
|
|
58
|
-
definitions = yield this.getAllAsync();
|
|
41
|
+
definitions = yield this.getAllAsync(includeConditionalMembers, loadPermissions);
|
|
59
42
|
}
|
|
60
43
|
return definitions;
|
|
61
44
|
});
|
|
62
45
|
}
|
|
63
|
-
getAllAsync() {
|
|
46
|
+
getAllAsync(includeConditionalMembers = true, loadPermissions) {
|
|
64
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
const allEntityDefinitions = yield this.getAllBatchedAsync();
|
|
66
|
-
this._cache.loadAll(allEntityDefinitions);
|
|
48
|
+
const allEntityDefinitions = yield this.getAllBatchedAsync(includeConditionalMembers, loadPermissions);
|
|
49
|
+
this._cache.loadAll(allEntityDefinitions, undefined, undefined, includeConditionalMembers, loadPermissions);
|
|
67
50
|
return allEntityDefinitions;
|
|
68
51
|
});
|
|
69
52
|
}
|
|
70
|
-
getAsync(param) {
|
|
53
|
+
getAsync(param, includeConditionalMembers = true, loadPermissions) {
|
|
71
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
55
|
guard_1.default.notNullOrUndefined(param);
|
|
73
|
-
const link = yield this._client.linkHelper.definitionToLinkAsync(param,
|
|
56
|
+
const link = yield this._client.linkHelper.definitionToLinkAsync(param, includeConditionalMembers, loadPermissions);
|
|
74
57
|
return this.getDefinitionAsync(link);
|
|
75
58
|
});
|
|
76
59
|
}
|
|
77
|
-
getCachedAsync(param) {
|
|
60
|
+
getCachedAsync(param, includeConditionalMembers = true, loadPermissions) {
|
|
78
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
62
|
guard_1.default.notNullOrUndefined(param);
|
|
80
|
-
let definitionPromise = this._cache.getAsync(param);
|
|
63
|
+
let definitionPromise = this._cache.getAsync(param, includeConditionalMembers, loadPermissions);
|
|
81
64
|
if (!definitionPromise) {
|
|
82
|
-
definitionPromise = this.getAsync(param);
|
|
83
|
-
this._cache.loadAsync(param, definitionPromise);
|
|
65
|
+
definitionPromise = this.getAsync(param, includeConditionalMembers, loadPermissions);
|
|
66
|
+
this._cache.loadAsync(param, definitionPromise, includeConditionalMembers, loadPermissions);
|
|
84
67
|
}
|
|
85
68
|
return definitionPromise;
|
|
86
69
|
});
|
|
@@ -119,7 +102,7 @@ class EntityDefinitionsClient {
|
|
|
119
102
|
return definition && definition.id;
|
|
120
103
|
});
|
|
121
104
|
}
|
|
122
|
-
getManyAsync(param) {
|
|
105
|
+
getManyAsync(param, includeConditionalMembers = true, loadPermissions) {
|
|
123
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
107
|
guard_1.default.notNullOrUndefined(param);
|
|
125
108
|
if (param.length === 0) {
|
|
@@ -127,17 +110,17 @@ class EntityDefinitionsClient {
|
|
|
127
110
|
}
|
|
128
111
|
else if (type_guards_1.TypeGuards.isStringArray(param)) {
|
|
129
112
|
guard_1.default.arrayNoneNullOrEmptyString(param);
|
|
130
|
-
const linkFactory = (batch, batchSize
|
|
113
|
+
const linkFactory = (batch, batchSize) => this._client.linkHelper.definitionsToLinkAsync(batch, undefined, batchSize, includeConditionalMembers, undefined, loadPermissions);
|
|
131
114
|
return this.getDefinitionsBatchedAsync(param, linkFactory);
|
|
132
115
|
}
|
|
133
116
|
else {
|
|
134
117
|
guard_1.default.validIds(param);
|
|
135
|
-
const linkFactory = (batch, batchSize
|
|
118
|
+
const linkFactory = (batch, batchSize) => this._client.linkHelper.definitionsToLinkAsync(batch, undefined, batchSize, includeConditionalMembers);
|
|
136
119
|
return this.getDefinitionsBatchedAsync(param, linkFactory);
|
|
137
120
|
}
|
|
138
121
|
});
|
|
139
122
|
}
|
|
140
|
-
getManyCachedAsync(param) {
|
|
123
|
+
getManyCachedAsync(param, includeConditionalMembers = true, loadPermissions) {
|
|
141
124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
142
125
|
guard_1.default.notNullOrUndefined(param);
|
|
143
126
|
if (param.length === 0)
|
|
@@ -146,7 +129,7 @@ class EntityDefinitionsClient {
|
|
|
146
129
|
const stillToFetch = [];
|
|
147
130
|
const result = [];
|
|
148
131
|
for (const nameOrId of param) {
|
|
149
|
-
const definition = this._cache.
|
|
132
|
+
const definition = this._cache.getAsync(nameOrId, includeConditionalMembers, loadPermissions);
|
|
150
133
|
if (definition != null) {
|
|
151
134
|
result.push(definition);
|
|
152
135
|
}
|
|
@@ -156,10 +139,11 @@ class EntityDefinitionsClient {
|
|
|
156
139
|
}
|
|
157
140
|
if (stillToFetch != null && stillToFetch.length > 0) {
|
|
158
141
|
const set = new Set(stillToFetch);
|
|
159
|
-
const fetchedDefinitions = yield this.getManyAsync(shouldGetByName ? [...set] : [...set]);
|
|
142
|
+
const fetchedDefinitions = yield this.getManyAsync(shouldGetByName ? [...set] : [...set], includeConditionalMembers, loadPermissions);
|
|
160
143
|
result.push(...fetchedDefinitions);
|
|
161
144
|
}
|
|
162
|
-
|
|
145
|
+
const loadedResults = yield Promise.all(result);
|
|
146
|
+
return loadedResults.filter((definition) => definition != null);
|
|
163
147
|
});
|
|
164
148
|
}
|
|
165
149
|
getNamesAsync(ids) {
|
|
@@ -285,9 +269,9 @@ class EntityDefinitionsClient {
|
|
|
285
269
|
createEntityDefinitionIdIterator(pageSize) {
|
|
286
270
|
return new entity_definition_id_iterator_1.EntityDefinitionIdIterator(this._client, pageSize);
|
|
287
271
|
}
|
|
288
|
-
getDefinitionsSkipTake(skip, take) {
|
|
272
|
+
getDefinitionsSkipTake(skip, take, includeConditionalMembers = true, loadPermissions) {
|
|
289
273
|
return __awaiter(this, void 0, void 0, function* () {
|
|
290
|
-
const link = yield this._client.linkHelper.definitionsToLinkAsync(null, skip, take,
|
|
274
|
+
const link = yield this._client.linkHelper.definitionsToLinkAsync(null, skip, take, includeConditionalMembers, undefined, loadPermissions);
|
|
291
275
|
const response = yield this._client.raw.getAsync(link.href);
|
|
292
276
|
const collectionResource = ta_json_1.TaJson.deserialize(response.content, entity_definition_collection_resource_1.EntityDefinitionCollectionResource);
|
|
293
277
|
return collectionResource;
|
|
@@ -296,13 +280,14 @@ class EntityDefinitionsClient {
|
|
|
296
280
|
getDefinitionAsync(link) {
|
|
297
281
|
return __awaiter(this, void 0, void 0, function* () {
|
|
298
282
|
const response = yield this._client.raw.getAsync(link.href);
|
|
299
|
-
if (response.statusCode ===
|
|
283
|
+
if (response.statusCode === http_status_codes_1.StatusCodes.NOT_FOUND) {
|
|
300
284
|
return null;
|
|
301
285
|
}
|
|
302
286
|
const resource = ta_json_1.TaJson.deserialize(response.content, entity_definition_resource_1.EntityDefinitionResource);
|
|
303
287
|
const definition = yield this._client.entityDefinitionMapper.mapEntityDefinitionAsync(resource);
|
|
304
288
|
if (definition) {
|
|
305
|
-
|
|
289
|
+
const uri = new urijs_1.default(link.href);
|
|
290
|
+
this._cache.load(definition, uri.hasQuery(api_1.ENTITY_DEFINITIONS.includeConditionalMembers, true), uri.hasQuery(api_1.ENTITY_DEFINITIONS.loadPermissions, true));
|
|
306
291
|
}
|
|
307
292
|
return definition;
|
|
308
293
|
});
|
|
@@ -312,31 +297,46 @@ class EntityDefinitionsClient {
|
|
|
312
297
|
if (!definitionsToFetch || definitionsToFetch.length === 0) {
|
|
313
298
|
return [];
|
|
314
299
|
}
|
|
315
|
-
const resources = [];
|
|
316
300
|
// We need to batch this or the backend will refuse to respond.
|
|
317
|
-
const batches = array_utilities_1.chunk(definitionsToFetch, EntityDefinitionsClient._batchSize);
|
|
301
|
+
const batches = (0, array_utilities_1.chunk)(definitionsToFetch, EntityDefinitionsClient._batchSize);
|
|
302
|
+
const includeConditionalMembers = true;
|
|
303
|
+
const definitions = [];
|
|
318
304
|
for (const definitionBatch of batches) {
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
305
|
+
const batchResult = linkFactory(definitionBatch, EntityDefinitionsClient._batchSize, includeConditionalMembers)
|
|
306
|
+
.then(link => {
|
|
307
|
+
return this._client.raw.getAsync(link.href);
|
|
308
|
+
})
|
|
309
|
+
.then(response => {
|
|
310
|
+
response_handler_1.ResponseHandler.handleErrors(response);
|
|
311
|
+
const resource = ta_json_1.TaJson.deserialize(response.content, entity_definition_collection_resource_1.EntityDefinitionCollectionResource);
|
|
312
|
+
return resource.items;
|
|
313
|
+
});
|
|
314
|
+
// Map each definition key to its result and load into cache individually
|
|
315
|
+
for (const definitionKey of definitionBatch) {
|
|
316
|
+
const definition = batchResult
|
|
317
|
+
.then(result => {
|
|
318
|
+
var _a;
|
|
319
|
+
return (_a = result.find(definition => typeof definitionKey === "string"
|
|
320
|
+
? definition.name === definitionKey
|
|
321
|
+
: definition.id === definitionKey)) !== null && _a !== void 0 ? _a : null;
|
|
322
|
+
})
|
|
323
|
+
.then(resource => resource ? this._client.entityDefinitionMapper.mapEntityDefinitionAsync(resource) : null);
|
|
324
|
+
definitions.push(definition);
|
|
325
|
+
// Important this caching is done before any promise is resolved, to cache the load ASAP.
|
|
326
|
+
this._cache.loadAsync(definitionKey, definition, includeConditionalMembers);
|
|
327
|
+
}
|
|
328
328
|
}
|
|
329
|
-
return definitions;
|
|
329
|
+
return Promise.all(definitions).then(results => results.filter((result) => result != null));
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
|
-
getAllBatchedAsync() {
|
|
332
|
+
getAllBatchedAsync(includeConditionalMembers = true, loadPermissions) {
|
|
333
333
|
var _a, _b;
|
|
334
334
|
return __awaiter(this, void 0, void 0, function* () {
|
|
335
335
|
const resources = [];
|
|
336
336
|
let resource = null;
|
|
337
337
|
let skip = 0;
|
|
338
338
|
while (resource == null || resource.next) {
|
|
339
|
-
const link = (_a = resource === null || resource === void 0 ? void 0 : resource.next) !== null && _a !== void 0 ? _a : (yield this._client.linkHelper.definitionsLinkAsync(skip, EntityDefinitionsClient._batchSize,
|
|
339
|
+
const link = (_a = resource === null || resource === void 0 ? void 0 : resource.next) !== null && _a !== void 0 ? _a : (yield this._client.linkHelper.definitionsLinkAsync(skip, EntityDefinitionsClient._batchSize, includeConditionalMembers, undefined, loadPermissions));
|
|
340
340
|
const response = yield this._client.raw.getAsync(link.href);
|
|
341
341
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
342
342
|
resource = ta_json_1.TaJson.deserialize(response.content, entity_definition_collection_resource_1.EntityDefinitionCollectionResource);
|
|
@@ -353,3 +353,4 @@ class EntityDefinitionsClient {
|
|
|
353
353
|
}
|
|
354
354
|
exports.EntityDefinitionsClient = EntityDefinitionsClient;
|
|
355
355
|
EntityDefinitionsClient._batchSize = 25;
|
|
356
|
+
//# sourceMappingURL=entity-definitions-client.js.map
|
|
@@ -4,6 +4,7 @@ import OAuthRefreshTokenGrant from "../authentication/oauth-refreshtoken-grant";
|
|
|
4
4
|
import { MapStringTo } from "../base-types";
|
|
5
5
|
import { RequestMessage } from "./request-message";
|
|
6
6
|
import { ResponseMessage } from "./response-message";
|
|
7
|
+
export declare type CancelCallback = (cancel: (reason?: string) => void) => void;
|
|
7
8
|
export interface IInternalClient {
|
|
8
9
|
/**
|
|
9
10
|
* Authenticate with the remote server.
|
|
@@ -18,13 +19,22 @@ export interface IInternalClient {
|
|
|
18
19
|
/**
|
|
19
20
|
* Sends a request to the remote server and returns the server's response.
|
|
20
21
|
* @param requestGenerator - Function which returns a {@link RequestMessage}
|
|
22
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an axios {@link CancelToken} if provided
|
|
21
23
|
*/
|
|
22
|
-
sendAsync<T = unknown, K = unknown>(requestGenerator: () => RequestMessage<T
|
|
24
|
+
sendAsync<T = unknown, K = unknown>(requestGenerator: () => RequestMessage<T>, cancelCallback?: CancelCallback): Promise<ResponseMessage<K>>;
|
|
23
25
|
/**
|
|
24
26
|
* Set headers which will be send with every request.
|
|
25
27
|
* @param headers - The headers to send with every request
|
|
26
28
|
*/
|
|
27
29
|
setRequestHeaders(headers: MapStringTo<string>): void;
|
|
30
|
+
/**
|
|
31
|
+
* Sets the error response handler.
|
|
32
|
+
* @param onError - The callback function to handle the response error.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Only expected to work when authentication to the endpoint has been established without the use of an OAuth grant.
|
|
36
|
+
*/
|
|
37
|
+
setResponseErrorHandler(onError: (error: any) => Promise<any>): void;
|
|
28
38
|
}
|
|
29
39
|
export declare class InternalClient implements IInternalClient {
|
|
30
40
|
private _accessToken;
|
|
@@ -40,7 +50,12 @@ export declare class InternalClient implements IInternalClient {
|
|
|
40
50
|
constructor(baseUri: URI | string, oauthGrant?: OAuthPasswordGrant | OAuthRefreshTokenGrant);
|
|
41
51
|
authenticateAsync(): Promise<boolean>;
|
|
42
52
|
setRequestHeaders(headers: MapStringTo<string>): void;
|
|
53
|
+
/**
|
|
54
|
+
* Sets the provided error handler as an interceptor for the responses.
|
|
55
|
+
* @param onError - the callback that should be called on error.
|
|
56
|
+
*/
|
|
57
|
+
setResponseErrorHandler(onError: (error: any) => Promise<any>): void;
|
|
43
58
|
private send_onFulfilled;
|
|
44
59
|
private send_onRejected;
|
|
45
|
-
sendAsync<T = any, K = any>(requestGenerator: () => RequestMessage<T
|
|
60
|
+
sendAsync<T = any, K = any>(requestGenerator: () => RequestMessage<T>, cancelCallback?: CancelCallback): Promise<ResponseMessage<K>>;
|
|
46
61
|
}
|
|
@@ -37,7 +37,7 @@ class InternalClient {
|
|
|
37
37
|
guard_1.default.stringNotNullOrEmpty(baseUrl);
|
|
38
38
|
const createClientParameters = {
|
|
39
39
|
baseURL: baseUrl,
|
|
40
|
-
adapter: axios_extensions_1.throttleAdapterEnhancer(axios_extensions_1.cacheAdapterEnhancer(axios_1.default.defaults.adapter, { enabledByDefault: false })),
|
|
40
|
+
adapter: (0, axios_extensions_1.throttleAdapterEnhancer)((0, axios_extensions_1.cacheAdapterEnhancer)(axios_1.default.defaults.adapter, { enabledByDefault: false })),
|
|
41
41
|
};
|
|
42
42
|
// This setting should be added to the .env file for connecting to a server using a self signed certificate
|
|
43
43
|
if (typeof process !== "undefined" && process != null) {
|
|
@@ -86,7 +86,7 @@ class InternalClient {
|
|
|
86
86
|
this._accessToken = tokenInfo.accessToken;
|
|
87
87
|
this._refreshTokenGrant.refreshToken = tokenInfo.refreshToken;
|
|
88
88
|
error.response.config.headers["Authorization"] = "Bearer " + tokenInfo.accessToken;
|
|
89
|
-
return axios_1.default(error.response.config);
|
|
89
|
+
return (0, axios_1.default)(error.response.config);
|
|
90
90
|
})
|
|
91
91
|
.catch(error => {
|
|
92
92
|
this._isAuthenticated = false;
|
|
@@ -161,6 +161,16 @@ class InternalClient {
|
|
|
161
161
|
guard_1.default.notNullOrUndefined(headers);
|
|
162
162
|
this._requestHeaders = headers;
|
|
163
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Sets the provided error handler as an interceptor for the responses.
|
|
166
|
+
* @param onError - the callback that should be called on error.
|
|
167
|
+
*/
|
|
168
|
+
setResponseErrorHandler(onError) {
|
|
169
|
+
if (this.shouldAuthenticateWithOAuth) {
|
|
170
|
+
throw new invalid_operation_error_1.InvalidOperationError("Unable to set response error handler when authenticating via OAuth.");
|
|
171
|
+
}
|
|
172
|
+
this._client.interceptors.response.use(response => response, error => onError(error));
|
|
173
|
+
}
|
|
164
174
|
send_onFulfilled(requestMsg) {
|
|
165
175
|
return (response) => {
|
|
166
176
|
return response_message_1.ResponseMessage.build(response.status, response.headers, {
|
|
@@ -184,7 +194,7 @@ class InternalClient {
|
|
|
184
194
|
throw error;
|
|
185
195
|
}
|
|
186
196
|
}
|
|
187
|
-
sendAsync(requestGenerator) {
|
|
197
|
+
sendAsync(requestGenerator, cancelCallback) {
|
|
188
198
|
return __awaiter(this, void 0, void 0, function* () {
|
|
189
199
|
if (!this._isAuthenticated) {
|
|
190
200
|
throw new invalid_operation_error_1.InvalidOperationError("Client is not authenticated. Authenticate first.");
|
|
@@ -196,6 +206,9 @@ class InternalClient {
|
|
|
196
206
|
guard_1.default.stringNotNullOrEmpty(requestUrl);
|
|
197
207
|
const requestConfig = {};
|
|
198
208
|
requestConfig.headers = Object.assign(Object.assign({}, this._requestHeaders), requestMsg.requestHeaders);
|
|
209
|
+
if (cancelCallback) {
|
|
210
|
+
requestConfig.cancelToken = new axios_1.default.CancelToken(cancelCallback);
|
|
211
|
+
}
|
|
199
212
|
let result = response_message_1.ResponseMessage.build(0); // Not a valid status code, but we'll know it failed.
|
|
200
213
|
switch (requestMsg.method) {
|
|
201
214
|
case http_method_1.HttpMethod.DELETE:
|
|
@@ -249,3 +262,4 @@ class InternalClient {
|
|
|
249
262
|
}
|
|
250
263
|
}
|
|
251
264
|
exports.InternalClient = InternalClient;
|
|
265
|
+
//# sourceMappingURL=internal-client.js.map
|
|
@@ -2,48 +2,55 @@ import { NullableResultPromise } from "../base-types";
|
|
|
2
2
|
import { IOptionList } from "../contracts/base/option-lists/option-list";
|
|
3
3
|
import OptionListDescriptionResource from "../models/option-lists/option-list-description-resource";
|
|
4
4
|
import { IExtendedContentHubClient } from "./extended-client";
|
|
5
|
+
import { CancelCallback } from "./internal-client";
|
|
5
6
|
export interface IOptionListClient {
|
|
6
7
|
/**
|
|
7
8
|
* Gets the names of all option lists that exist.
|
|
9
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
8
10
|
*/
|
|
9
|
-
getAllNamesAsync(): Promise<Array<string>>;
|
|
11
|
+
getAllNamesAsync(cancelCallback?: CancelCallback): Promise<Array<string>>;
|
|
10
12
|
/**
|
|
11
13
|
* Gets an array of all options list descriptions.
|
|
14
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
12
15
|
*/
|
|
13
|
-
getAllDescriptionsAsync(): Promise<Array<OptionListDescriptionResource>>;
|
|
16
|
+
getAllDescriptionsAsync(cancelCallback?: CancelCallback): Promise<Array<OptionListDescriptionResource>>;
|
|
14
17
|
/**
|
|
15
18
|
* Gets the option list with the specified name.
|
|
16
19
|
*
|
|
17
20
|
* @param name - the option list name
|
|
21
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
18
22
|
*/
|
|
19
|
-
getAsync(name: string): NullableResultPromise<IOptionList>;
|
|
23
|
+
getAsync(name: string, cancelCallback?: CancelCallback): NullableResultPromise<IOptionList>;
|
|
20
24
|
/**
|
|
21
25
|
* Creates a new option list
|
|
22
26
|
*
|
|
23
27
|
* @param optionList - {@link IOptionList} - the option list instance
|
|
28
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
24
29
|
*/
|
|
25
|
-
createAsync(optionList: IOptionList): Promise<void>;
|
|
30
|
+
createAsync(optionList: IOptionList, cancelCallback?: CancelCallback): Promise<void>;
|
|
26
31
|
/**
|
|
27
32
|
* Update an existing option list
|
|
28
33
|
*
|
|
29
34
|
* @param optionList - {@link IOptionList} - the option list instance
|
|
35
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
30
36
|
*/
|
|
31
|
-
updateAsync(optionList: IOptionList): Promise<void>;
|
|
37
|
+
updateAsync(optionList: IOptionList, cancelCallback?: CancelCallback): Promise<void>;
|
|
32
38
|
/**
|
|
33
39
|
* Delete an existing option list
|
|
34
40
|
*
|
|
35
41
|
* @param name - the name of the option list
|
|
42
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
36
43
|
*/
|
|
37
|
-
deleteAsync(name: string): Promise<void>;
|
|
44
|
+
deleteAsync(name: string, cancelCallback?: CancelCallback): Promise<void>;
|
|
38
45
|
}
|
|
39
46
|
export declare class OptionListClient implements IOptionListClient {
|
|
40
47
|
private readonly _client;
|
|
41
48
|
private readonly _mapper;
|
|
42
49
|
constructor(client: IExtendedContentHubClient);
|
|
43
|
-
getAllNamesAsync(): Promise<Array<string>>;
|
|
44
|
-
getAllDescriptionsAsync(): Promise<Array<OptionListDescriptionResource>>;
|
|
45
|
-
getAsync(name: string): NullableResultPromise<IOptionList>;
|
|
46
|
-
createAsync(optionList: IOptionList): Promise<void>;
|
|
47
|
-
updateAsync(optionList: IOptionList): Promise<void>;
|
|
48
|
-
deleteAsync(name: string): Promise<void>;
|
|
50
|
+
getAllNamesAsync(cancelCallback?: CancelCallback): Promise<Array<string>>;
|
|
51
|
+
getAllDescriptionsAsync(cancelCallback?: CancelCallback): Promise<Array<OptionListDescriptionResource>>;
|
|
52
|
+
getAsync(name: string, cancelCallback?: CancelCallback): NullableResultPromise<IOptionList>;
|
|
53
|
+
createAsync(optionList: IOptionList, cancelCallback?: CancelCallback): Promise<void>;
|
|
54
|
+
updateAsync(optionList: IOptionList, cancelCallback?: CancelCallback): Promise<void>;
|
|
55
|
+
deleteAsync(name: string, cancelCallback?: CancelCallback): Promise<void>;
|
|
49
56
|
}
|
|
@@ -24,28 +24,28 @@ class OptionListClient {
|
|
|
24
24
|
this._client = client;
|
|
25
25
|
this._mapper = new option_list_mapper_1.OptionListMapper(client);
|
|
26
26
|
}
|
|
27
|
-
getAllNamesAsync() {
|
|
27
|
+
getAllNamesAsync(cancelCallback) {
|
|
28
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
29
|
const link = yield this._client.linkHelper.dataSourcesLinkAsync();
|
|
30
|
-
const response = yield this._client.raw.getAsync(link.href);
|
|
30
|
+
const response = yield this._client.raw.getAsync(link.href, undefined, cancelCallback);
|
|
31
31
|
const resource = ta_json_1.TaJson.deserialize(response.content, option_list_collection_resource_1.default);
|
|
32
32
|
const names = resource.items.map(item => item.name);
|
|
33
33
|
return names;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
getAllDescriptionsAsync() {
|
|
36
|
+
getAllDescriptionsAsync(cancelCallback) {
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
38
|
const link = yield this._client.linkHelper.dataSourcesLinkAsync();
|
|
39
|
-
const response = yield this._client.raw.getAsync(link.href);
|
|
39
|
+
const response = yield this._client.raw.getAsync(link.href, undefined, cancelCallback);
|
|
40
40
|
const resource = ta_json_1.TaJson.deserialize(response.content, option_list_collection_resource_1.default);
|
|
41
41
|
return resource.items;
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
getAsync(name) {
|
|
44
|
+
getAsync(name, cancelCallback) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
guard_1.default.stringNotNullOrEmpty(name);
|
|
47
47
|
const link = yield this._client.linkHelper.dataSourceToLinkAsync(name);
|
|
48
|
-
const response = yield this._client.raw.getAsync(link.href);
|
|
48
|
+
const response = yield this._client.raw.getAsync(link.href, undefined, cancelCallback);
|
|
49
49
|
if (response.statusCode === 404) {
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
@@ -55,31 +55,32 @@ class OptionListClient {
|
|
|
55
55
|
return optionList;
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
createAsync(optionList) {
|
|
58
|
+
createAsync(optionList, cancelCallback) {
|
|
59
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
60
|
guard_1.default.notNull(optionList, "optionList");
|
|
61
61
|
const resource = this._mapper.map(optionList);
|
|
62
62
|
const link = yield this._client.linkHelper.dataSourcesLinkAsync();
|
|
63
|
-
const response = yield this._client.raw.postAsync(link.href, ta_json_1.TaJson.serialize(resource));
|
|
63
|
+
const response = yield this._client.raw.postAsync(link.href, ta_json_1.TaJson.serialize(resource), undefined, cancelCallback);
|
|
64
64
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
updateAsync(optionList) {
|
|
67
|
+
updateAsync(optionList, cancelCallback) {
|
|
68
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
69
|
guard_1.default.notNull(optionList, "optionList");
|
|
70
70
|
const resource = this._mapper.map(optionList);
|
|
71
71
|
const link = yield this._client.linkHelper.dataSourceToLinkAsync(optionList.name);
|
|
72
|
-
const response = yield this._client.raw.putAsync(link.href, ta_json_1.TaJson.serialize(resource));
|
|
72
|
+
const response = yield this._client.raw.putAsync(link.href, ta_json_1.TaJson.serialize(resource), undefined, cancelCallback);
|
|
73
73
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
deleteAsync(name) {
|
|
76
|
+
deleteAsync(name, cancelCallback) {
|
|
77
77
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
78
|
guard_1.default.stringNotNullOrEmpty(name);
|
|
79
79
|
const link = yield this._client.linkHelper.dataSourceToLinkAsync(name);
|
|
80
|
-
const response = yield this._client.raw.deleteAsync(link.href);
|
|
80
|
+
const response = yield this._client.raw.deleteAsync(link.href, undefined, cancelCallback);
|
|
81
81
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
exports.OptionListClient = OptionListClient;
|
|
86
|
+
//# sourceMappingURL=option-list-client.js.map
|
|
@@ -1,36 +1,43 @@
|
|
|
1
1
|
import CultureInfo from "../culture-info";
|
|
2
2
|
import { PageResource } from "../models/pages/page-resource";
|
|
3
3
|
import { IExtendedContentHubClient } from "./extended-client";
|
|
4
|
+
import { CancelCallback } from "./internal-client";
|
|
4
5
|
export interface IPagesClient {
|
|
5
6
|
/**
|
|
6
7
|
* Get a page resource by identifier.
|
|
7
8
|
* @param identifier - The identifier of the page
|
|
8
9
|
* @param culture - A culture to load the page in
|
|
10
|
+
* @param entityId - The current entity id (Optional)
|
|
11
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
9
12
|
* @returns A promise resolving to a {@link PageResource}.
|
|
10
13
|
* @throws An error when the resource can't be found.
|
|
11
14
|
*/
|
|
12
|
-
getPageByIdentifierAsync(identifier: string, culture: CultureInfo): Promise<PageResource>;
|
|
15
|
+
getPageByIdentifierAsync(identifier: string, culture: CultureInfo, entityId?: number, cancelCallback?: CancelCallback): Promise<PageResource>;
|
|
13
16
|
/**
|
|
14
17
|
* Get a page resource by name.
|
|
15
18
|
* @param name - The name of the page
|
|
16
19
|
* @param culture - A culture to load the page in
|
|
20
|
+
* @param entityId - The current entity id (Optional)
|
|
21
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
17
22
|
* @returns A promise resolving to a {@link PageResource}.
|
|
18
23
|
* @throws An error when the resource can't be found.
|
|
19
24
|
*/
|
|
20
|
-
getPageByNameAsync(name: string, culture: CultureInfo): Promise<PageResource>;
|
|
25
|
+
getPageByNameAsync(name: string, culture: CultureInfo, entityId?: number, cancelCallback?: CancelCallback): Promise<PageResource>;
|
|
21
26
|
/**
|
|
22
27
|
* Get a page resource by id.
|
|
23
28
|
* @param id - The id of the page
|
|
24
29
|
* @param culture - A culture to load the page in
|
|
30
|
+
* @param entityId - The current entity id (Optional)
|
|
31
|
+
* @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided
|
|
25
32
|
* @returns A promise resolving to a {@link PageResource}.
|
|
26
33
|
* @throws An error when the resource can't be found.
|
|
27
34
|
*/
|
|
28
|
-
getPageByIdAsync(id: number, culture: CultureInfo): Promise<PageResource>;
|
|
35
|
+
getPageByIdAsync(id: number, culture: CultureInfo, entityId?: number, cancelCallback?: CancelCallback): Promise<PageResource>;
|
|
29
36
|
}
|
|
30
37
|
export declare class PagesClient implements IPagesClient {
|
|
31
38
|
private readonly _client;
|
|
32
39
|
constructor(client: IExtendedContentHubClient);
|
|
33
|
-
getPageByNameAsync(name: string, culture: CultureInfo): Promise<PageResource>;
|
|
34
|
-
getPageByIdentifierAsync(identifier: string, culture: CultureInfo): Promise<PageResource>;
|
|
35
|
-
getPageByIdAsync(id: number, culture: CultureInfo): Promise<PageResource>;
|
|
40
|
+
getPageByNameAsync(name: string, culture: CultureInfo, entityId?: number, cancelCallback?: CancelCallback): Promise<PageResource>;
|
|
41
|
+
getPageByIdentifierAsync(identifier: string, culture: CultureInfo, entityId?: number, cancelCallback?: CancelCallback): Promise<PageResource>;
|
|
42
|
+
getPageByIdAsync(id: number, culture: CultureInfo, entityId?: number, cancelCallback?: CancelCallback): Promise<PageResource>;
|
|
36
43
|
}
|
|
@@ -21,32 +21,33 @@ class PagesClient {
|
|
|
21
21
|
constructor(client) {
|
|
22
22
|
this._client = client;
|
|
23
23
|
}
|
|
24
|
-
getPageByNameAsync(name, culture) {
|
|
24
|
+
getPageByNameAsync(name, culture, entityId, cancelCallback) {
|
|
25
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
guard_1.default.stringNotNullOrEmpty(name);
|
|
27
27
|
guard_1.default.notNullOrUndefined(culture);
|
|
28
|
-
return this.getPageByIdentifierAsync(name, culture);
|
|
28
|
+
return this.getPageByIdentifierAsync(name, culture, entityId, cancelCallback);
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
getPageByIdentifierAsync(identifier, culture) {
|
|
31
|
+
getPageByIdentifierAsync(identifier, culture, entityId, cancelCallback) {
|
|
32
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
33
|
guard_1.default.stringNotNullOrEmpty(identifier);
|
|
34
34
|
guard_1.default.notNullOrUndefined(culture);
|
|
35
|
-
const link = yield this._client.linkHelper.pageResourceToLinkAsync(identifier, culture);
|
|
36
|
-
const response = yield this._client.raw.getAsync(link.href);
|
|
35
|
+
const link = yield this._client.linkHelper.pageResourceToLinkAsync(identifier, culture, entityId);
|
|
36
|
+
const response = yield this._client.raw.getAsync(link.href, undefined, cancelCallback);
|
|
37
37
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
38
38
|
return ta_json_1.TaJson.deserialize(response.content, page_resource_1.PageResource);
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
getPageByIdAsync(id, culture) {
|
|
41
|
+
getPageByIdAsync(id, culture, entityId, cancelCallback) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
guard_1.default.validId(id);
|
|
44
44
|
guard_1.default.notNullOrUndefined(culture);
|
|
45
|
-
const link = yield this._client.linkHelper.pageResourceToLinkAsync(id, culture);
|
|
46
|
-
const response = yield this._client.raw.getAsync(link.href);
|
|
45
|
+
const link = yield this._client.linkHelper.pageResourceToLinkAsync(id, culture, entityId);
|
|
46
|
+
const response = yield this._client.raw.getAsync(link.href, undefined, cancelCallback);
|
|
47
47
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
48
48
|
return ta_json_1.TaJson.deserialize(response.content, page_resource_1.PageResource);
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
exports.PagesClient = PagesClient;
|
|
53
|
+
//# sourceMappingURL=pages-client.js.map
|
|
@@ -1,23 +1,4 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -32,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
13
|
};
|
|
33
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
15
|
exports.PoliciesClient = void 0;
|
|
35
|
-
const
|
|
16
|
+
const http_status_codes_1 = require("http-status-codes");
|
|
36
17
|
const ta_json_1 = require("ta-json");
|
|
37
18
|
const error_messages_1 = __importDefault(require("../error-messages"));
|
|
38
19
|
const invalid_operation_error_1 = require("../errors/invalid-operation-error");
|
|
@@ -80,7 +61,7 @@ class PoliciesClient {
|
|
|
80
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
81
62
|
const link = yield this._client.linkHelper.policyToLinkAsync(id);
|
|
82
63
|
const response = yield this._client.raw.getAsync(link.href);
|
|
83
|
-
if (response.statusCode ===
|
|
64
|
+
if (response.statusCode === http_status_codes_1.StatusCodes.NOT_FOUND) {
|
|
84
65
|
return null;
|
|
85
66
|
}
|
|
86
67
|
response_handler_1.ResponseHandler.handleErrors(response);
|
|
@@ -90,3 +71,4 @@ class PoliciesClient {
|
|
|
90
71
|
}
|
|
91
72
|
}
|
|
92
73
|
exports.PoliciesClient = PoliciesClient;
|
|
74
|
+
//# sourceMappingURL=policies-client.js.map
|