@sitecore/sc-contenthub-webclient-sdk 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -0
- package/dist/api/api-info-resource.d.ts +8 -0
- package/dist/api/api-info-resource.js +42 -0
- package/dist/api/api-info.d.ts +29 -0
- package/dist/api/api-info.js +14 -0
- package/dist/api/api-resource.d.ts +4 -0
- package/dist/api/api-resource.js +16 -0
- package/dist/api/api-routes-dictionary.d.ts +8 -0
- package/dist/api/api-routes-dictionary.js +10 -0
- package/dist/authentication/oauth-grant-base.d.ts +6 -0
- package/dist/authentication/oauth-grant-base.js +42 -0
- package/dist/authentication/oauth-grant-type.d.ts +4 -0
- package/dist/authentication/oauth-grant-type.js +8 -0
- package/dist/authentication/oauth-password-grant.d.ts +8 -0
- package/dist/authentication/oauth-password-grant.js +45 -0
- package/dist/authentication/oauth-refreshtoken-grant.d.ts +7 -0
- package/dist/authentication/oauth-refreshtoken-grant.js +39 -0
- package/dist/authentication/token-info.d.ts +6 -0
- package/dist/authentication/token-info.js +35 -0
- package/dist/base-types.d.ts +56 -0
- package/dist/base-types.js +32 -0
- package/dist/caches/culture-cache.d.ts +8 -0
- package/dist/caches/culture-cache.js +21 -0
- package/dist/caches/entity-definition-cache.d.ts +44 -0
- package/dist/caches/entity-definition-cache.js +96 -0
- package/dist/clients/api-client.d.ts +56 -0
- package/dist/clients/api-client.js +107 -0
- package/dist/clients/commands-client.d.ts +16 -0
- package/dist/clients/commands-client.js +40 -0
- package/dist/clients/content-hub-client.d.ts +75 -0
- package/dist/clients/content-hub-client.js +66 -0
- package/dist/clients/culture-client.d.ts +36 -0
- package/dist/clients/culture-client.js +43 -0
- package/dist/clients/culture-loader.d.ts +41 -0
- package/dist/clients/culture-loader.js +103 -0
- package/dist/clients/entities-client.d.ts +201 -0
- package/dist/clients/entities-client.js +271 -0
- package/dist/clients/entity-definitions-client.d.ts +87 -0
- package/dist/clients/entity-definitions-client.js +354 -0
- package/dist/clients/extended-client.d.ts +11 -0
- package/dist/clients/extended-client.js +2 -0
- package/dist/clients/internal-client.d.ts +46 -0
- package/dist/clients/internal-client.js +240 -0
- package/dist/clients/notifications-client.d.ts +35 -0
- package/dist/clients/notifications-client.js +128 -0
- package/dist/clients/option-list-client.d.ts +49 -0
- package/dist/clients/option-list-client.js +85 -0
- package/dist/clients/pages-client.d.ts +36 -0
- package/dist/clients/pages-client.js +52 -0
- package/dist/clients/policies-client.d.ts +47 -0
- package/dist/clients/policies-client.js +92 -0
- package/dist/clients/querying-client.d.ts +34 -0
- package/dist/clients/querying-client.js +95 -0
- package/dist/clients/raw-client.d.ts +29 -0
- package/dist/clients/raw-client.js +79 -0
- package/dist/clients/request-message.d.ts +25 -0
- package/dist/clients/request-message.js +12 -0
- package/dist/clients/response-handler.d.ts +30 -0
- package/dist/clients/response-handler.js +145 -0
- package/dist/clients/response-message.d.ts +45 -0
- package/dist/clients/response-message.js +34 -0
- package/dist/clients/schema-querying.d.ts +16 -0
- package/dist/clients/schema-querying.js +70 -0
- package/dist/clients/search-client.d.ts +16 -0
- package/dist/clients/search-client.js +36 -0
- package/dist/clients/settings-client.d.ts +37 -0
- package/dist/clients/settings-client.js +126 -0
- package/dist/clients/users-client.d.ts +150 -0
- package/dist/clients/users-client.js +317 -0
- package/dist/clients/web-content-hub-client.d.ts +13 -0
- package/dist/clients/web-content-hub-client.js +2 -0
- package/dist/constants/api.d.ts +130 -0
- package/dist/constants/api.js +133 -0
- package/dist/constants/defaults.d.ts +7 -0
- package/dist/constants/defaults.js +10 -0
- package/dist/constants/definitions.d.ts +62 -0
- package/dist/constants/definitions.js +88 -0
- package/dist/constants/index.d.ts +5 -0
- package/dist/constants/index.js +30 -0
- package/dist/constants/notifications.d.ts +7 -0
- package/dist/constants/notifications.js +10 -0
- package/dist/contracts/base/culture-insensitive-property.d.ts +28 -0
- package/dist/contracts/base/culture-insensitive-property.js +47 -0
- package/dist/contracts/base/culture-sensitive-property.d.ts +49 -0
- package/dist/contracts/base/culture-sensitive-property.js +113 -0
- package/dist/contracts/base/data-type.d.ts +18 -0
- package/dist/contracts/base/data-type.js +24 -0
- package/dist/contracts/base/entity-base.d.ts +65 -0
- package/dist/contracts/base/entity-base.js +362 -0
- package/dist/contracts/base/entity-construction-args.d.ts +15 -0
- package/dist/contracts/base/entity-construction-args.js +16 -0
- package/dist/contracts/base/entity-definition.d.ts +108 -0
- package/dist/contracts/base/entity-definition.js +126 -0
- package/dist/contracts/base/entity.d.ts +237 -0
- package/dist/contracts/base/entity.js +76 -0
- package/dist/contracts/base/index.d.ts +14 -0
- package/dist/contracts/base/index.js +26 -0
- package/dist/contracts/base/json-content-type.d.ts +9 -0
- package/dist/contracts/base/json-content-type.js +13 -0
- package/dist/contracts/base/lazy-loading-manager.d.ts +4 -0
- package/dist/contracts/base/lazy-loading-manager.js +17 -0
- package/dist/contracts/base/member-condition.d.ts +48 -0
- package/dist/contracts/base/member-condition.js +125 -0
- package/dist/contracts/base/member-definition-type.d.ts +13 -0
- package/dist/contracts/base/member-definition-type.js +17 -0
- package/dist/contracts/base/member-definition.d.ts +77 -0
- package/dist/contracts/base/member-definition.js +101 -0
- package/dist/contracts/base/member-group.d.ts +54 -0
- package/dist/contracts/base/member-group.js +61 -0
- package/dist/contracts/base/member.d.ts +32 -0
- package/dist/contracts/base/member.js +26 -0
- package/dist/contracts/base/option-lists/flat-option-list-value.d.ts +4 -0
- package/dist/contracts/base/option-lists/flat-option-list-value.js +9 -0
- package/dist/contracts/base/option-lists/flat-option-list.d.ts +9 -0
- package/dist/contracts/base/option-lists/flat-option-list.js +11 -0
- package/dist/contracts/base/option-lists/hierarchical-option-list.d.ts +9 -0
- package/dist/contracts/base/option-lists/hierarchical-option-list.js +11 -0
- package/dist/contracts/base/option-lists/hierarchical-options-list-value.d.ts +7 -0
- package/dist/contracts/base/option-lists/hierarchical-options-list-value.js +14 -0
- package/dist/contracts/base/option-lists/option-list-base.d.ts +23 -0
- package/dist/contracts/base/option-lists/option-list-base.js +33 -0
- package/dist/contracts/base/option-lists/option-list-type.d.ts +13 -0
- package/dist/contracts/base/option-lists/option-list-type.js +17 -0
- package/dist/contracts/base/option-lists/option-list-value-base.d.ts +7 -0
- package/dist/contracts/base/option-lists/option-list-value-base.js +14 -0
- package/dist/contracts/base/option-lists/option-list-value.d.ts +30 -0
- package/dist/contracts/base/option-lists/option-list-value.js +2 -0
- package/dist/contracts/base/option-lists/option-list.d.ts +40 -0
- package/dist/contracts/base/option-lists/option-list.js +2 -0
- package/dist/contracts/base/property-definition.d.ts +61 -0
- package/dist/contracts/base/property-definition.js +76 -0
- package/dist/contracts/base/property-definitions/boolean-property-definition.d.ts +7 -0
- package/dist/contracts/base/property-definitions/boolean-property-definition.js +33 -0
- package/dist/contracts/base/property-definitions/datetime-property-definition.d.ts +7 -0
- package/dist/contracts/base/property-definitions/datetime-property-definition.js +33 -0
- package/dist/contracts/base/property-definitions/datetimeoffset-property-definition.d.ts +7 -0
- package/dist/contracts/base/property-definitions/datetimeoffset-property-definition.js +33 -0
- package/dist/contracts/base/property-definitions/decimal-property-definition.d.ts +7 -0
- package/dist/contracts/base/property-definitions/decimal-property-definition.js +33 -0
- package/dist/contracts/base/property-definitions/index.d.ts +8 -0
- package/dist/contracts/base/property-definitions/index.js +20 -0
- package/dist/contracts/base/property-definitions/integer-property-definition.d.ts +7 -0
- package/dist/contracts/base/property-definitions/integer-property-definition.js +33 -0
- package/dist/contracts/base/property-definitions/json-property-definition.d.ts +10 -0
- package/dist/contracts/base/property-definitions/json-property-definition.js +38 -0
- package/dist/contracts/base/property-definitions/long-property-definition.d.ts +7 -0
- package/dist/contracts/base/property-definitions/long-property-definition.js +33 -0
- package/dist/contracts/base/property-definitions/string-property-definition.d.ts +33 -0
- package/dist/contracts/base/property-definitions/string-property-definition.js +55 -0
- package/dist/contracts/base/property-manager.d.ts +19 -0
- package/dist/contracts/base/property-manager.js +114 -0
- package/dist/contracts/base/property.d.ts +21 -0
- package/dist/contracts/base/property.js +30 -0
- package/dist/contracts/base/relation-cardinality.d.ts +19 -0
- package/dist/contracts/base/relation-cardinality.js +22 -0
- package/dist/contracts/base/relation-container.d.ts +40 -0
- package/dist/contracts/base/relation-container.js +118 -0
- package/dist/contracts/base/relation-definition.d.ts +123 -0
- package/dist/contracts/base/relation-definition.js +116 -0
- package/dist/contracts/base/relation-manager.d.ts +70 -0
- package/dist/contracts/base/relation-manager.js +197 -0
- package/dist/contracts/base/relation-role.d.ts +14 -0
- package/dist/contracts/base/relation-role.js +17 -0
- package/dist/contracts/base/relation.d.ts +74 -0
- package/dist/contracts/base/relation.js +40 -0
- package/dist/contracts/base/relations/child-to-many-parents-relation.d.ts +27 -0
- package/dist/contracts/base/relations/child-to-many-parents-relation.js +67 -0
- package/dist/contracts/base/relations/child-to-one-parent-relation.d.ts +26 -0
- package/dist/contracts/base/relations/child-to-one-parent-relation.js +74 -0
- package/dist/contracts/base/relations/parent-to-many-children-relation.d.ts +27 -0
- package/dist/contracts/base/relations/parent-to-many-children-relation.js +67 -0
- package/dist/contracts/base/relations/parent-to-one-child-relation.d.ts +29 -0
- package/dist/contracts/base/relations/parent-to-one-child-relation.js +74 -0
- package/dist/contracts/base/relations/to-many-relation.d.ts +16 -0
- package/dist/contracts/base/relations/to-many-relation.js +2 -0
- package/dist/contracts/base/relations/to-one-relation.d.ts +18 -0
- package/dist/contracts/base/relations/to-one-relation.js +2 -0
- package/dist/contracts/base/rendition.d.ts +14 -0
- package/dist/contracts/base/rendition.js +13 -0
- package/dist/contracts/base/resource.d.ts +21 -0
- package/dist/contracts/base/resource.js +2 -0
- package/dist/contracts/base/string-content-type.d.ts +21 -0
- package/dist/contracts/base/string-content-type.js +25 -0
- package/dist/contracts/base/typed-entity.d.ts +11 -0
- package/dist/contracts/base/typed-entity.js +2 -0
- package/dist/contracts/base/users.d.ts +0 -0
- package/dist/contracts/base/users.js +1 -0
- package/dist/contracts/base/view-mode.d.ts +4 -0
- package/dist/contracts/base/view-mode.js +8 -0
- package/dist/contracts/content/asset.d.ts +22 -0
- package/dist/contracts/content/asset.js +67 -0
- package/dist/contracts/content/final-life-cycle-status.d.ts +7 -0
- package/dist/contracts/content/final-life-cycle-status.js +11 -0
- package/dist/contracts/dirty-tracking/dirty-tracking.d.ts +10 -0
- package/dist/contracts/dirty-tracking/dirty-tracking.js +2 -0
- package/dist/contracts/notifications/mail-template.d.ts +44 -0
- package/dist/contracts/notifications/mail-template.js +2 -0
- package/dist/contracts/policies/condition.d.ts +16 -0
- package/dist/contracts/policies/condition.js +10 -0
- package/dist/contracts/policies/member-policy.d.ts +31 -0
- package/dist/contracts/policies/member-policy.js +12 -0
- package/dist/contracts/policies/policy.d.ts +19 -0
- package/dist/contracts/policies/policy.js +11 -0
- package/dist/contracts/policies/rule-type.d.ts +7 -0
- package/dist/contracts/policies/rule-type.js +11 -0
- package/dist/contracts/policies/rule.d.ts +58 -0
- package/dist/contracts/policies/rule.js +19 -0
- package/dist/contracts/policies/user-group-policy.d.ts +10 -0
- package/dist/contracts/policies/user-group-policy.js +17 -0
- package/dist/contracts/policies/user-policy.d.ts +10 -0
- package/dist/contracts/policies/user-policy.js +17 -0
- package/dist/contracts/querying/culture-load-option.d.ts +35 -0
- package/dist/contracts/querying/culture-load-option.js +69 -0
- package/dist/contracts/querying/entity-definition-id-iterator.d.ts +9 -0
- package/dist/contracts/querying/entity-definition-id-iterator.js +30 -0
- package/dist/contracts/querying/entity-definition-id-query-result.d.ts +10 -0
- package/dist/contracts/querying/entity-definition-id-query-result.js +22 -0
- package/dist/contracts/querying/entity-definition-iterator.d.ts +16 -0
- package/dist/contracts/querying/entity-definition-iterator.js +30 -0
- package/dist/contracts/querying/entity-definition-query-result.d.ts +21 -0
- package/dist/contracts/querying/entity-definition-query-result.js +22 -0
- package/dist/contracts/querying/entity-iterator.d.ts +13 -0
- package/dist/contracts/querying/entity-iterator.js +30 -0
- package/dist/contracts/querying/entity-load-configuration-builder.d.ts +76 -0
- package/dist/contracts/querying/entity-load-configuration-builder.js +101 -0
- package/dist/contracts/querying/entity-load-configuration.d.ts +51 -0
- package/dist/contracts/querying/entity-load-configuration.js +67 -0
- package/dist/contracts/querying/entity-load-option.d.ts +35 -0
- package/dist/contracts/querying/entity-load-option.js +94 -0
- package/dist/contracts/querying/entity-query-result.d.ts +23 -0
- package/dist/contracts/querying/entity-query-result.js +33 -0
- package/dist/contracts/querying/filters/comparison-operator.d.ts +11 -0
- package/dist/contracts/querying/filters/comparison-operator.js +15 -0
- package/dist/contracts/querying/filters/composite-filter-operator.d.ts +4 -0
- package/dist/contracts/querying/filters/composite-filter-operator.js +8 -0
- package/dist/contracts/querying/filters/composite-query-filter.d.ts +19 -0
- package/dist/contracts/querying/filters/composite-query-filter.js +49 -0
- package/dist/contracts/querying/filters/createdby-query-filter.d.ts +5 -0
- package/dist/contracts/querying/filters/createdby-query-filter.js +30 -0
- package/dist/contracts/querying/filters/createdon-query-filter.d.ts +19 -0
- package/dist/contracts/querying/filters/createdon-query-filter.js +45 -0
- package/dist/contracts/querying/filters/definition-query-filter.d.ts +34 -0
- package/dist/contracts/querying/filters/definition-query-filter.js +58 -0
- package/dist/contracts/querying/filters/filter-data-type.d.ts +11 -0
- package/dist/contracts/querying/filters/filter-data-type.js +15 -0
- package/dist/contracts/querying/filters/filter-type.d.ts +18 -0
- package/dist/contracts/querying/filters/filter-type.js +22 -0
- package/dist/contracts/querying/filters/id-query-filter.d.ts +25 -0
- package/dist/contracts/querying/filters/id-query-filter.js +49 -0
- package/dist/contracts/querying/filters/identifier-query-filter.d.ts +25 -0
- package/dist/contracts/querying/filters/identifier-query-filter.js +49 -0
- package/dist/contracts/querying/filters/index.d.ts +20 -0
- package/dist/contracts/querying/filters/index.js +32 -0
- package/dist/contracts/querying/filters/modifiedby-query-filter.d.ts +5 -0
- package/dist/contracts/querying/filters/modifiedby-query-filter.js +30 -0
- package/dist/contracts/querying/filters/modifiedon-query-filter.d.ts +19 -0
- package/dist/contracts/querying/filters/modifiedon-query-filter.js +45 -0
- package/dist/contracts/querying/filters/modules-query-filter.d.ts +14 -0
- package/dist/contracts/querying/filters/modules-query-filter.js +43 -0
- package/dist/contracts/querying/filters/not-query-filter.d.ts +14 -0
- package/dist/contracts/querying/filters/not-query-filter.js +39 -0
- package/dist/contracts/querying/filters/property-query-filter.d.ts +38 -0
- package/dist/contracts/querying/filters/property-query-filter.js +63 -0
- package/dist/contracts/querying/filters/query-filter.d.ts +10 -0
- package/dist/contracts/querying/filters/query-filter.js +28 -0
- package/dist/contracts/querying/filters/relation-connection-type.d.ts +15 -0
- package/dist/contracts/querying/filters/relation-connection-type.js +19 -0
- package/dist/contracts/querying/filters/relation-query-filter.d.ts +23 -0
- package/dist/contracts/querying/filters/relation-query-filter.js +48 -0
- package/dist/contracts/querying/filters/secured-ancestors-query-filter.d.ts +24 -0
- package/dist/contracts/querying/filters/secured-ancestors-query-filter.js +53 -0
- package/dist/contracts/querying/filters/user-query-filter.d.ts +37 -0
- package/dist/contracts/querying/filters/user-query-filter.js +61 -0
- package/dist/contracts/querying/id-iterator.d.ts +11 -0
- package/dist/contracts/querying/id-iterator.js +19 -0
- package/dist/contracts/querying/id-query-result.d.ts +17 -0
- package/dist/contracts/querying/id-query-result.js +24 -0
- package/dist/contracts/querying/iterator.d.ts +9 -0
- package/dist/contracts/querying/iterator.js +2 -0
- package/dist/contracts/querying/load-option.d.ts +4 -0
- package/dist/contracts/querying/load-option.js +2 -0
- package/dist/contracts/querying/load-options.d.ts +6 -0
- package/dist/contracts/querying/load-options.js +10 -0
- package/dist/contracts/querying/loading-query-iterator.d.ts +17 -0
- package/dist/contracts/querying/loading-query-iterator.js +57 -0
- package/dist/contracts/querying/member-load-option.d.ts +11 -0
- package/dist/contracts/querying/member-load-option.js +15 -0
- package/dist/contracts/querying/minimal-schema.d.ts +8 -0
- package/dist/contracts/querying/minimal-schema.js +48 -0
- package/dist/contracts/querying/property-data.d.ts +8 -0
- package/dist/contracts/querying/property-data.js +43 -0
- package/dist/contracts/querying/property-load-option.d.ts +30 -0
- package/dist/contracts/querying/property-load-option.js +70 -0
- package/dist/contracts/querying/query-iterator.d.ts +18 -0
- package/dist/contracts/querying/query-iterator.js +54 -0
- package/dist/contracts/querying/query-load-configuration.d.ts +39 -0
- package/dist/contracts/querying/query-load-configuration.js +86 -0
- package/dist/contracts/querying/query-request.d.ts +6 -0
- package/dist/contracts/querying/query-request.js +30 -0
- package/dist/contracts/querying/query-result-paging-manager.d.ts +9 -0
- package/dist/contracts/querying/query-result-paging-manager.js +22 -0
- package/dist/contracts/querying/query-result.d.ts +5 -0
- package/dist/contracts/querying/query-result.js +2 -0
- package/dist/contracts/querying/query-sort-order.d.ts +13 -0
- package/dist/contracts/querying/query-sort-order.js +17 -0
- package/dist/contracts/querying/query.d.ts +23 -0
- package/dist/contracts/querying/query.js +56 -0
- package/dist/contracts/querying/relation-data.d.ts +7 -0
- package/dist/contracts/querying/relation-data.js +38 -0
- package/dist/contracts/querying/relation-load-option.d.ts +31 -0
- package/dist/contracts/querying/relation-load-option.js +74 -0
- package/dist/contracts/querying/relation-specification.d.ts +33 -0
- package/dist/contracts/querying/relation-specification.js +52 -0
- package/dist/contracts/querying/schema-querying.d.ts +20 -0
- package/dist/contracts/querying/schema-querying.js +2 -0
- package/dist/contracts/querying/scroll-request.d.ts +7 -0
- package/dist/contracts/querying/scroll-request.js +33 -0
- package/dist/contracts/querying/skip-take-iterator-base.d.ts +14 -0
- package/dist/contracts/querying/skip-take-iterator-base.js +60 -0
- package/dist/contracts/querying/sort-field-type.d.ts +13 -0
- package/dist/contracts/querying/sort-field-type.js +17 -0
- package/dist/contracts/querying/sorting.d.ts +25 -0
- package/dist/contracts/querying/sorting.js +44 -0
- package/dist/contracts/users/user-group-combine-method.d.ts +4 -0
- package/dist/contracts/users/user-group-combine-method.js +8 -0
- package/dist/contracts/users/user-group-configuration.d.ts +11 -0
- package/dist/contracts/users/user-group-configuration.js +35 -0
- package/dist/contracts/users/user-profile.d.ts +4 -0
- package/dist/contracts/users/user-profile.js +2 -0
- package/dist/contracts/users/user.d.ts +24 -0
- package/dist/contracts/users/user.js +64 -0
- package/dist/converters/api-resource-converter.d.ts +16 -0
- package/dist/converters/api-resource-converter.js +45 -0
- package/dist/converters/file-version-converter.d.ts +22 -0
- package/dist/converters/file-version-converter.js +43 -0
- package/dist/converters/index.d.ts +6 -0
- package/dist/converters/index.js +18 -0
- package/dist/converters/member-condition-converter.d.ts +20 -0
- package/dist/converters/member-condition-converter.js +50 -0
- package/dist/converters/member-condition-resource-converter.d.ts +21 -0
- package/dist/converters/member-condition-resource-converter.js +53 -0
- package/dist/converters/minimal-schema-relation-cardinality-converter.d.ts +11 -0
- package/dist/converters/minimal-schema-relation-cardinality-converter.js +33 -0
- package/dist/converters/page-resource-menus-converter.d.ts +19 -0
- package/dist/converters/page-resource-menus-converter.js +45 -0
- package/dist/converters/page-resource-zones-converter.d.ts +19 -0
- package/dist/converters/page-resource-zones-converter.js +45 -0
- package/dist/converters/relation-map-resource-converter.d.ts +6 -0
- package/dist/converters/relation-map-resource-converter.js +38 -0
- package/dist/converters/relation-resource-converter.d.ts +22 -0
- package/dist/converters/relation-resource-converter.js +51 -0
- package/dist/converters/renditions-converter.d.ts +20 -0
- package/dist/converters/renditions-converter.js +44 -0
- package/dist/converters/string-to-any-map-converter.d.ts +20 -0
- package/dist/converters/string-to-any-map-converter.js +34 -0
- package/dist/culture-info.d.ts +5 -0
- package/dist/culture-info.js +7 -0
- package/dist/dirty-value-calculator.d.ts +7 -0
- package/dist/dirty-value-calculator.js +29 -0
- package/dist/entity-link.d.ts +8 -0
- package/dist/entity-link.js +40 -0
- package/dist/error-messages.d.ts +57 -0
- package/dist/error-messages.js +64 -0
- package/dist/errors/argument-error.d.ts +4 -0
- package/dist/errors/argument-error.js +11 -0
- package/dist/errors/authentication-error.d.ts +5 -0
- package/dist/errors/authentication-error.js +12 -0
- package/dist/errors/bad-request-error.d.ts +5 -0
- package/dist/errors/bad-request-error.js +11 -0
- package/dist/errors/forbidden-error.d.ts +4 -0
- package/dist/errors/forbidden-error.js +11 -0
- package/dist/errors/internal-error.d.ts +4 -0
- package/dist/errors/internal-error.js +11 -0
- package/dist/errors/invalid-operation-error.d.ts +4 -0
- package/dist/errors/invalid-operation-error.js +11 -0
- package/dist/errors/not-found-error.d.ts +5 -0
- package/dist/errors/not-found-error.js +11 -0
- package/dist/errors/not-implemented-error.d.ts +4 -0
- package/dist/errors/not-implemented-error.js +11 -0
- package/dist/errors/not-loaded-error.d.ts +4 -0
- package/dist/errors/not-loaded-error.js +11 -0
- package/dist/errors/not-supported-error.d.ts +4 -0
- package/dist/errors/not-supported-error.js +11 -0
- package/dist/errors/schema-error.d.ts +4 -0
- package/dist/errors/schema-error.js +11 -0
- package/dist/errors/validation-error.d.ts +6 -0
- package/dist/errors/validation-error.js +12 -0
- package/dist/errors/validation-failure.d.ts +7 -0
- package/dist/errors/validation-failure.js +14 -0
- package/dist/errors/web-api-error.d.ts +13 -0
- package/dist/errors/web-api-error.js +13 -0
- package/dist/factories/entity-factory.d.ts +38 -0
- package/dist/factories/entity-factory.js +76 -0
- package/dist/factories/option-list-factory.d.ts +26 -0
- package/dist/factories/option-list-factory.js +22 -0
- package/dist/factories/property-factory.d.ts +10 -0
- package/dist/factories/property-factory.js +54 -0
- package/dist/factories/relation-factory.d.ts +55 -0
- package/dist/factories/relation-factory.js +70 -0
- package/dist/fileversion.d.ts +78 -0
- package/dist/fileversion.js +144 -0
- package/dist/guard.d.ts +29 -0
- package/dist/guard.js +142 -0
- package/dist/http-method.d.ts +9 -0
- package/dist/http-method.js +13 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +22 -0
- package/dist/link-helper.d.ts +209 -0
- package/dist/link-helper.js +371 -0
- package/dist/link.d.ts +9 -0
- package/dist/link.js +78 -0
- package/dist/logging/log-level.d.ts +6 -0
- package/dist/logging/log-level.js +10 -0
- package/dist/logging/logger-base.d.ts +26 -0
- package/dist/logging/logger-base.js +98 -0
- package/dist/logging/logger.d.ts +16 -0
- package/dist/logging/logger.js +2 -0
- package/dist/logging/null-logger.d.ts +7 -0
- package/dist/logging/null-logger.js +13 -0
- package/dist/mappers/api-resource-mapper.d.ts +5 -0
- package/dist/mappers/api-resource-mapper.js +16 -0
- package/dist/mappers/condition-mapper.d.ts +36 -0
- package/dist/mappers/condition-mapper.js +112 -0
- package/dist/mappers/entity-definition-mapper.d.ts +13 -0
- package/dist/mappers/entity-definition-mapper.js +88 -0
- package/dist/mappers/entity-mapper.d.ts +19 -0
- package/dist/mappers/entity-mapper.js +134 -0
- package/dist/mappers/final-life-cycle-status-mapper.d.ts +6 -0
- package/dist/mappers/final-life-cycle-status-mapper.js +51 -0
- package/dist/mappers/load-options-mapper.d.ts +16 -0
- package/dist/mappers/load-options-mapper.js +100 -0
- package/dist/mappers/mapping-utilities.d.ts +7 -0
- package/dist/mappers/mapping-utilities.js +19 -0
- package/dist/mappers/member-condition-mapper.d.ts +12 -0
- package/dist/mappers/member-condition-mapper.js +119 -0
- package/dist/mappers/member-definition-mapper.d.ts +19 -0
- package/dist/mappers/member-definition-mapper.js +266 -0
- package/dist/mappers/member-group-mapper.d.ts +14 -0
- package/dist/mappers/member-group-mapper.js +95 -0
- package/dist/mappers/member-security-mapper.d.ts +34 -0
- package/dist/mappers/member-security-mapper.js +101 -0
- package/dist/mappers/notification-mapper.d.ts +5 -0
- package/dist/mappers/notification-mapper.js +17 -0
- package/dist/mappers/option-list-mapper.d.ts +18 -0
- package/dist/mappers/option-list-mapper.js +131 -0
- package/dist/mappers/policy-mapper.d.ts +29 -0
- package/dist/mappers/policy-mapper.js +124 -0
- package/dist/mappers/property-mapper.d.ts +21 -0
- package/dist/mappers/property-mapper.js +339 -0
- package/dist/mappers/querying-mapper.d.ts +16 -0
- package/dist/mappers/querying-mapper.js +96 -0
- package/dist/mappers/relation-cardinality-mapper.d.ts +5 -0
- package/dist/mappers/relation-cardinality-mapper.js +37 -0
- package/dist/mappers/relation-mapper.d.ts +16 -0
- package/dist/mappers/relation-mapper.js +202 -0
- package/dist/mappers/relation-role-mapper.d.ts +5 -0
- package/dist/mappers/relation-role-mapper.js +29 -0
- package/dist/mappers/rendition-mapper.d.ts +9 -0
- package/dist/mappers/rendition-mapper.js +34 -0
- package/dist/mappers/rule-type-mapper.d.ts +6 -0
- package/dist/mappers/rule-type-mapper.js +33 -0
- package/dist/mappers/rules-mapper.d.ts +35 -0
- package/dist/mappers/rules-mapper.js +123 -0
- package/dist/mappers/typed-entity-creator.d.ts +27 -0
- package/dist/mappers/typed-entity-creator.js +76 -0
- package/dist/models/entity-definition-collection-resource.d.ts +5 -0
- package/dist/models/entity-definition-collection-resource.js +26 -0
- package/dist/models/entity-definition-resource.d.ts +23 -0
- package/dist/models/entity-definition-resource.js +98 -0
- package/dist/models/entity-list-resource.d.ts +5 -0
- package/dist/models/entity-list-resource.js +26 -0
- package/dist/models/entity-resource.d.ts +36 -0
- package/dist/models/entity-resource.js +142 -0
- package/dist/models/list-resource.d.ts +13 -0
- package/dist/models/list-resource.js +50 -0
- package/dist/models/member-condition-resource.d.ts +32 -0
- package/dist/models/member-condition-resource.js +95 -0
- package/dist/models/member-definition-resource.d.ts +15 -0
- package/dist/models/member-definition-resource.js +71 -0
- package/dist/models/member-group-resource.d.ts +14 -0
- package/dist/models/member-group-resource.js +61 -0
- package/dist/models/notifications/distribute-notification-resource.d.ts +7 -0
- package/dist/models/notifications/distribute-notification-resource.js +37 -0
- package/dist/models/notifications/mail-request-broadcast.d.ts +7 -0
- package/dist/models/notifications/mail-request-broadcast.js +18 -0
- package/dist/models/notifications/mail-request-by-id.d.ts +9 -0
- package/dist/models/notifications/mail-request-by-id.js +28 -0
- package/dist/models/notifications/mail-request-by-username.d.ts +9 -0
- package/dist/models/notifications/mail-request-by-username.js +28 -0
- package/dist/models/notifications/mail-request.d.ts +26 -0
- package/dist/models/notifications/mail-request.js +12 -0
- package/dist/models/notifications/notification-level.d.ts +8 -0
- package/dist/models/notifications/notification-level.js +12 -0
- package/dist/models/notifications/realtime-request-broadcast.d.ts +7 -0
- package/dist/models/notifications/realtime-request-broadcast.js +18 -0
- package/dist/models/notifications/realtime-request-by-id.d.ts +9 -0
- package/dist/models/notifications/realtime-request-by-id.js +28 -0
- package/dist/models/notifications/realtime-request-by-username.d.ts +9 -0
- package/dist/models/notifications/realtime-request-by-username.js +28 -0
- package/dist/models/notifications/realtime-request.d.ts +60 -0
- package/dist/models/notifications/realtime-request.js +41 -0
- package/dist/models/notifications/request-by-id.d.ts +13 -0
- package/dist/models/notifications/request-by-id.js +2 -0
- package/dist/models/notifications/request-by-username.d.ts +13 -0
- package/dist/models/notifications/request-by-username.js +2 -0
- package/dist/models/notifications/validators/mail-validator.d.ts +6 -0
- package/dist/models/notifications/validators/mail-validator.js +23 -0
- package/dist/models/notifications/validators/realtime-validator.d.ts +5 -0
- package/dist/models/notifications/validators/realtime-validator.js +14 -0
- package/dist/models/notifications/validators/request-by-id-validator.d.ts +6 -0
- package/dist/models/notifications/validators/request-by-id-validator.js +31 -0
- package/dist/models/notifications/validators/request-by-username-validator.d.ts +6 -0
- package/dist/models/notifications/validators/request-by-username-validator.js +31 -0
- package/dist/models/notifications/validators/validator-base.d.ts +6 -0
- package/dist/models/notifications/validators/validator-base.js +16 -0
- package/dist/models/option-lists/flat-option-list-value.d.ts +4 -0
- package/dist/models/option-lists/flat-option-list-value.js +9 -0
- package/dist/models/option-lists/hierarchical-options-list-value.d.ts +7 -0
- package/dist/models/option-lists/hierarchical-options-list-value.js +14 -0
- package/dist/models/option-lists/option-list-collection-resource.d.ts +6 -0
- package/dist/models/option-lists/option-list-collection-resource.js +32 -0
- package/dist/models/option-lists/option-list-description-resource.d.ts +5 -0
- package/dist/models/option-lists/option-list-description-resource.js +31 -0
- package/dist/models/option-lists/option-list-resource.d.ts +16 -0
- package/dist/models/option-lists/option-list-resource.js +62 -0
- package/dist/models/option-lists/option-list-value-resource.d.ts +6 -0
- package/dist/models/option-lists/option-list-value-resource.js +32 -0
- package/dist/models/pages/component-visualization.d.ts +10 -0
- package/dist/models/pages/component-visualization.js +54 -0
- package/dist/models/pages/language-resource.d.ts +10 -0
- package/dist/models/pages/language-resource.js +47 -0
- package/dist/models/pages/menu-item.d.ts +12 -0
- package/dist/models/pages/menu-item.js +66 -0
- package/dist/models/pages/page-component-resource.d.ts +20 -0
- package/dist/models/pages/page-component-resource.js +87 -0
- package/dist/models/pages/page-resource.d.ts +23 -0
- package/dist/models/pages/page-resource.js +100 -0
- package/dist/models/pages/page-row-settings.d.ts +27 -0
- package/dist/models/pages/page-row-settings.js +119 -0
- package/dist/models/pages/portal-column-resource.d.ts +6 -0
- package/dist/models/pages/portal-column-resource.js +37 -0
- package/dist/models/pages/portal-row-resource.d.ts +7 -0
- package/dist/models/pages/portal-row-resource.js +38 -0
- package/dist/models/pages/portal-section-resource.d.ts +6 -0
- package/dist/models/pages/portal-section-resource.js +37 -0
- package/dist/models/permissions-resource.d.ts +4 -0
- package/dist/models/permissions-resource.js +28 -0
- package/dist/models/policies/condition-resource.d.ts +21 -0
- package/dist/models/policies/condition-resource.js +53 -0
- package/dist/models/policies/member-policy-resource.d.ts +8 -0
- package/dist/models/policies/member-policy-resource.js +43 -0
- package/dist/models/policies/policy-resource.d.ts +50 -0
- package/dist/models/policies/policy-resource.js +89 -0
- package/dist/models/policies/rule-resource.d.ts +49 -0
- package/dist/models/policies/rule-resource.js +78 -0
- package/dist/models/property-definition-resource.d.ts +45 -0
- package/dist/models/property-definition-resource.js +198 -0
- package/dist/models/query-loading-resource.d.ts +4 -0
- package/dist/models/query-loading-resource.js +28 -0
- package/dist/models/query-result-resource.d.ts +9 -0
- package/dist/models/query-result-resource.js +34 -0
- package/dist/models/relation-definition-resource.d.ts +29 -0
- package/dist/models/relation-definition-resource.js +115 -0
- package/dist/models/relation-map-resource.d.ts +6 -0
- package/dist/models/relation-map-resource.js +16 -0
- package/dist/models/relation-resource.d.ts +21 -0
- package/dist/models/relation-resource.js +93 -0
- package/dist/models/resource-containers/entity-definition-resource-container.d.ts +8 -0
- package/dist/models/resource-containers/entity-definition-resource-container.js +2 -0
- package/dist/models/resource-containers/entity-resource-container.d.ts +8 -0
- package/dist/models/resource-containers/entity-resource-container.js +2 -0
- package/dist/models/resource.d.ts +4 -0
- package/dist/models/resource.js +26 -0
- package/dist/models/search/aggregation-request-resource.d.ts +16 -0
- package/dist/models/search/aggregation-request-resource.js +72 -0
- package/dist/models/search/aggregation-response-resource.d.ts +8 -0
- package/dist/models/search/aggregation-response-resource.js +41 -0
- package/dist/models/search/bucket-response-resource.d.ts +8 -0
- package/dist/models/search/bucket-response-resource.js +46 -0
- package/dist/models/search/date-interval.d.ts +10 -0
- package/dist/models/search/date-interval.js +14 -0
- package/dist/models/search/facet-response-resource.d.ts +20 -0
- package/dist/models/search/facet-response-resource.js +98 -0
- package/dist/models/search/field-filter-request-resource.d.ts +16 -0
- package/dist/models/search/field-filter-request-resource.js +76 -0
- package/dist/models/search/field-filter-response-resource.d.ts +17 -0
- package/dist/models/search/field-filter-response-resource.js +84 -0
- package/dist/models/search/field-filter-value-response-resource.d.ts +6 -0
- package/dist/models/search/field-filter-value-response-resource.js +31 -0
- package/dist/models/search/filter-operator.d.ts +86 -0
- package/dist/models/search/filter-operator.js +90 -0
- package/dist/models/search/full-text-response-resource.d.ts +4 -0
- package/dist/models/search/full-text-response-resource.js +27 -0
- package/dist/models/search/group-category.d.ts +6 -0
- package/dist/models/search/group-category.js +35 -0
- package/dist/models/search/group-config.d.ts +4 -0
- package/dist/models/search/group-config.js +27 -0
- package/dist/models/search/group-item.d.ts +10 -0
- package/dist/models/search/group-item.js +44 -0
- package/dist/models/search/grouped-view-response-resource.d.ts +15 -0
- package/dist/models/search/grouped-view-response-resource.js +65 -0
- package/dist/models/search/metric-option-request-resource.d.ts +7 -0
- package/dist/models/search/metric-option-request-resource.js +37 -0
- package/dist/models/search/metric-option-response-resource.d.ts +5 -0
- package/dist/models/search/metric-option-response-resource.js +31 -0
- package/dist/models/search/nested-relation-info.d.ts +11 -0
- package/dist/models/search/nested-relation-info.js +96 -0
- package/dist/models/search/requested-aggregation-type.d.ts +5 -0
- package/dist/models/search/requested-aggregation-type.js +9 -0
- package/dist/models/search/requested-filter-type.d.ts +6 -0
- package/dist/models/search/requested-filter-type.js +10 -0
- package/dist/models/search/search-group-request-resource.d.ts +5 -0
- package/dist/models/search/search-group-request-resource.js +31 -0
- package/dist/models/search/search-request.d.ts +41 -0
- package/dist/models/search/search-request.js +131 -0
- package/dist/models/search/search-response.d.ts +36 -0
- package/dist/models/search/search-response.js +123 -0
- package/dist/models/search/selection-pool-filter-resource.d.ts +7 -0
- package/dist/models/search/selection-pool-filter-resource.js +38 -0
- package/dist/models/search/sorting-request-resource.d.ts +5 -0
- package/dist/models/search/sorting-request-resource.js +32 -0
- package/dist/models/search/sorting-response-resource.d.ts +6 -0
- package/dist/models/search/sorting-response-resource.js +34 -0
- package/dist/models/search-document-resource.d.ts +7 -0
- package/dist/models/search-document-resource.js +33 -0
- package/dist/models/set-password-request-resource.d.ts +5 -0
- package/dist/models/set-password-request-resource.js +31 -0
- package/dist/settings/fetch-setting.d.ts +12 -0
- package/dist/settings/fetch-setting.js +61 -0
- package/dist/settings/super-user-excluded-privileges.d.ts +3 -0
- package/dist/settings/super-user-excluded-privileges.js +27 -0
- package/dist/settings/usage-rights-configuration.d.ts +24 -0
- package/dist/settings/usage-rights-configuration.js +90 -0
- package/dist/type-guards.d.ts +20 -0
- package/dist/type-guards.js +28 -0
- package/package.json +78 -0
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LinkHelper = void 0;
|
|
16
|
+
const URITemplate_1 = __importDefault(require("urijs/src/URITemplate"));
|
|
17
|
+
const constants_1 = require("./constants");
|
|
18
|
+
const api_1 = require("./constants/api");
|
|
19
|
+
const argument_error_1 = require("./errors/argument-error");
|
|
20
|
+
const guard_1 = __importDefault(require("./guard"));
|
|
21
|
+
const link_1 = __importDefault(require("./link"));
|
|
22
|
+
const type_guards_1 = require("./type-guards");
|
|
23
|
+
class LinkHelper {
|
|
24
|
+
constructor(client) {
|
|
25
|
+
guard_1.default.notNullOrUndefined(client);
|
|
26
|
+
this._client = client;
|
|
27
|
+
}
|
|
28
|
+
//#region Datasources
|
|
29
|
+
nameFromDataSourceAsync(link) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
if (link == null)
|
|
32
|
+
return null;
|
|
33
|
+
const variable = yield this.getVariableValueAsync(link, api_1.DATA_SOURCE_BY_NAME.templateName, api_1.DATA_SOURCE_BY_NAME.name);
|
|
34
|
+
return variable || null;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
dataSourceToLinkAsync(name) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
guard_1.default.stringNotNullOrEmpty(name);
|
|
40
|
+
return this.bindAsync(api_1.DATA_SOURCE_BY_NAME.templateName, { [api_1.DATA_SOURCE_BY_NAME.name]: name });
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
dataSourcesLinkAsync() {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const routes = yield this._client.api.getApiRoutesAsync();
|
|
46
|
+
return routes[api_1.DATA_SOURCES.templateName];
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region Definitions
|
|
51
|
+
nameFromDefinitionAsync(link) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
if (!link)
|
|
54
|
+
return null;
|
|
55
|
+
const variable = yield this.getVariableValueAsync(link, api_1.ENTITY_DEFINITION_BY_NAME.templateName, api_1.ENTITY_DEFINITION_BY_NAME.name);
|
|
56
|
+
return variable || null;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
namesFromDefinitionsAsync(links) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
if (!links)
|
|
62
|
+
return [];
|
|
63
|
+
const result = [];
|
|
64
|
+
links.forEach((link) => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
result.push(yield this.nameFromDefinitionAsync(link));
|
|
66
|
+
}));
|
|
67
|
+
return result;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
definitionToLinkAsync(param, includeConditionalMembers) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
guard_1.default.notNullOrUndefined(param);
|
|
73
|
+
if (typeof param === "string") {
|
|
74
|
+
guard_1.default.stringNotNullOrEmpty(param);
|
|
75
|
+
const variables = {
|
|
76
|
+
[api_1.ENTITY_DEFINITION_BY_NAME.name]: param,
|
|
77
|
+
};
|
|
78
|
+
if (includeConditionalMembers != null) {
|
|
79
|
+
variables[api_1.ENTITY_DEFINITION_BY_NAME.includeConditionalMembers] = includeConditionalMembers.toString();
|
|
80
|
+
}
|
|
81
|
+
return this.bindAsync(api_1.ENTITY_DEFINITION_BY_NAME.templateName, variables);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
guard_1.default.validId(param);
|
|
85
|
+
const variables = {
|
|
86
|
+
[api_1.ENTITY_DEFINITION_BY_ID.id]: param.toString(),
|
|
87
|
+
};
|
|
88
|
+
if (includeConditionalMembers != null) {
|
|
89
|
+
variables[api_1.ENTITY_DEFINITION_BY_ID.includeConditionalMembers] = includeConditionalMembers.toString();
|
|
90
|
+
}
|
|
91
|
+
return this.bindAsync(api_1.ENTITY_DEFINITION_BY_ID.templateName, variables);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
definitionToLinkV2Async(name, includeConditionalMembers) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
guard_1.default.stringNotNullOrEmpty(name);
|
|
98
|
+
const variables = {
|
|
99
|
+
[api_1.ENTITY_DEFINITION_BY_NAME_V2.name]: name,
|
|
100
|
+
};
|
|
101
|
+
if (includeConditionalMembers != null) {
|
|
102
|
+
variables[api_1.ENTITY_DEFINITION_BY_NAME_V2.includeConditionalMembers] = includeConditionalMembers.toString();
|
|
103
|
+
}
|
|
104
|
+
return this.bindAsync(api_1.ENTITY_DEFINITION_BY_NAME_V2.templateName, variables);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
definitionsToLinkAsync(values, skip, take, includeConditionalMembers, viewMode) {
|
|
108
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
109
|
+
const variables = LinkHelper.applyEntityDefinitionVariables(skip, take, includeConditionalMembers, viewMode);
|
|
110
|
+
if (values == null && arguments.length === 1) {
|
|
111
|
+
throw new argument_error_1.ArgumentError("Missing function arguments.");
|
|
112
|
+
}
|
|
113
|
+
if (values) {
|
|
114
|
+
guard_1.default.arrayNotEmpty(values);
|
|
115
|
+
if (type_guards_1.TypeGuards.isStringArray(values)) {
|
|
116
|
+
variables[api_1.ENTITY_DEFINITIONS.definitionsToLoadByName] = values.join();
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
variables[api_1.ENTITY_DEFINITIONS.definitionsToLoadById] = values.join();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return this.bindAsync(api_1.ENTITY_DEFINITIONS.templateName, variables);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
definitionsLinkAsync(skip, take, includeConditionalMembers) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
const variables = LinkHelper.applyEntityDefinitionVariables(skip, take, includeConditionalMembers);
|
|
128
|
+
return this.bindAsync(api_1.ENTITY_DEFINITIONS.templateName, variables);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region Entities
|
|
133
|
+
idFromEntityAsync(link) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
if (!link)
|
|
136
|
+
return null;
|
|
137
|
+
const variable = yield this.getVariableValueAsync(link, api_1.ENTITY_BY_ID.templateName, api_1.ENTITY_BY_ID.id);
|
|
138
|
+
if (!variable)
|
|
139
|
+
return null;
|
|
140
|
+
guard_1.default.parsableInteger(variable);
|
|
141
|
+
return parseInt(variable);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
idsFromEntitiesAsync(links) {
|
|
145
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
if (!links || links.length === 0)
|
|
147
|
+
return [];
|
|
148
|
+
const list = [];
|
|
149
|
+
for (const link of links) {
|
|
150
|
+
const id = yield this.idFromEntityAsync(link);
|
|
151
|
+
if (id != null && id !== 0) {
|
|
152
|
+
list.push(id);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return list;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
entityToLinkAsync(param, culture) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
guard_1.default.notNullOrUndefined(param);
|
|
161
|
+
if (typeof param === "string") {
|
|
162
|
+
guard_1.default.stringNotNullOrEmpty(param);
|
|
163
|
+
return this.bindAsync(api_1.ENTITY_BY_IDENTIFIER.templateName, {
|
|
164
|
+
[api_1.ENTITY_BY_IDENTIFIER.identifier]: param,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
guard_1.default.validId(param);
|
|
169
|
+
const variables = {
|
|
170
|
+
[api_1.ENTITY_BY_ID.id]: param.toString(),
|
|
171
|
+
};
|
|
172
|
+
if (culture != null) {
|
|
173
|
+
variables[api_1.ENTITY_BY_ID.culture] = culture;
|
|
174
|
+
}
|
|
175
|
+
return this.bindAsync(api_1.ENTITY_BY_ID.templateName, variables);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
entitiesToLinksAsync(ids) {
|
|
180
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
if (!ids || ids.length === 0)
|
|
182
|
+
return [];
|
|
183
|
+
guard_1.default.validIds(ids);
|
|
184
|
+
const list = [];
|
|
185
|
+
for (const id of ids) {
|
|
186
|
+
const link = yield this.entityToLinkAsync(id);
|
|
187
|
+
if (link) {
|
|
188
|
+
list.push(link);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return list;
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
identifierFromEntityAsync(link) {
|
|
195
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
+
if (!link)
|
|
197
|
+
return null;
|
|
198
|
+
return this.getVariableValueAsync(link, api_1.ENTITY_BY_IDENTIFIER.templateName, api_1.ENTITY_BY_IDENTIFIER.identifier);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
entitiesLinkAsync() {
|
|
202
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
+
const routes = yield this._client.api.getApiRoutesAsync();
|
|
204
|
+
return routes[api_1.ENTITIES.templateName];
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
permissionsForEntityToLinkAsync(id) {
|
|
208
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
209
|
+
guard_1.default.validId(id);
|
|
210
|
+
return this.bindAsync(api_1.PERMISSIONS_FOR_ENTITY.templateName, api_1.PERMISSIONS_FOR_ENTITY.id, id.toString());
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region Passwords
|
|
215
|
+
setUserPasswordToLinkAsync(userId) {
|
|
216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
guard_1.default.validId(userId);
|
|
218
|
+
return this.bindAsync(api_1.SET_USER_PASSWORD.templateName, api_1.SET_USER_PASSWORD.userId, userId.toString());
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
resetPasswordToLinkAsync(userId) {
|
|
222
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
223
|
+
guard_1.default.validId(userId);
|
|
224
|
+
return this.bindAsync(api_1.RESET_PASSWORD.templateName, api_1.RESET_PASSWORD.userId, userId.toString());
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region Policy
|
|
229
|
+
policyToLinkAsync(id) {
|
|
230
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
231
|
+
guard_1.default.validId(id);
|
|
232
|
+
return this.bindAsync(constants_1.API.POLICY_BY_ID.templateName, constants_1.API.POLICY_BY_ID.id, id.toString());
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
idFromPolicyAsync(link) {
|
|
236
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
+
if (link == null) {
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
const variable = yield this.getVariableValueAsync(link, constants_1.API.POLICY_BY_ID.templateName, constants_1.API.POLICY_BY_ID.id);
|
|
241
|
+
guard_1.default.parsableInteger(variable);
|
|
242
|
+
return parseInt(variable);
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region Commands
|
|
247
|
+
commandToLinkAsync(namespace, command) {
|
|
248
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
249
|
+
guard_1.default.stringNotNullOrEmpty(namespace);
|
|
250
|
+
guard_1.default.stringNotNullOrEmpty(command);
|
|
251
|
+
const variables = {
|
|
252
|
+
[constants_1.API.COMMANDS.folder]: namespace,
|
|
253
|
+
[constants_1.API.COMMANDS.command]: command,
|
|
254
|
+
};
|
|
255
|
+
const res = yield this.bindAsync(constants_1.API.COMMANDS.templateName, variables);
|
|
256
|
+
return res;
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region Mails
|
|
261
|
+
sendConfirmationMailToLinkAsync(userId) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
guard_1.default.validId(userId);
|
|
264
|
+
return this.bindAsync(api_1.SEND_CONFIRMATION_MAIL.templateName, api_1.SEND_CONFIRMATION_MAIL.userId, userId.toString());
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
sendNotificationToLinkAsync(notificationType) {
|
|
268
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
269
|
+
guard_1.default.stringNotNullOrEmpty(notificationType);
|
|
270
|
+
const task = this.bindAsync(api_1.SEND_NOTIFICATION.templateName, api_1.SEND_NOTIFICATION.type, notificationType);
|
|
271
|
+
return task;
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region Aggregates
|
|
276
|
+
aggregateToLinkAsync(aggregateName, entityId, culture, loadPermissions) {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
guard_1.default.stringNotNullOrEmpty(aggregateName);
|
|
279
|
+
guard_1.default.validId(entityId);
|
|
280
|
+
const variables = {
|
|
281
|
+
[constants_1.API.AGGREGATES.name]: aggregateName,
|
|
282
|
+
[constants_1.API.AGGREGATES.id]: entityId.toString(),
|
|
283
|
+
};
|
|
284
|
+
if (culture) {
|
|
285
|
+
variables[constants_1.API.AGGREGATES.culture] = culture;
|
|
286
|
+
}
|
|
287
|
+
if (loadPermissions != undefined) {
|
|
288
|
+
variables[constants_1.API.AGGREGATES.loadPermissions] = loadPermissions.toString();
|
|
289
|
+
}
|
|
290
|
+
const aggregateLink = this.bindAsync(api_1.AGGREGATES.templateName, variables);
|
|
291
|
+
return aggregateLink;
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region PageResource
|
|
296
|
+
pageResourceToLinkAsync(page, culture) {
|
|
297
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
298
|
+
guard_1.default.stringNotNullOrEmpty(culture);
|
|
299
|
+
guard_1.default.notNullOrUndefined(page);
|
|
300
|
+
const variables = { [constants_1.API.PAGE_BY_IDENTIFIER.culture]: culture };
|
|
301
|
+
let templateName = "";
|
|
302
|
+
if (typeof page === "string") {
|
|
303
|
+
guard_1.default.stringNotNullOrEmpty(page);
|
|
304
|
+
variables[constants_1.API.PAGE_BY_IDENTIFIER.identifier] = page;
|
|
305
|
+
templateName = constants_1.API.PAGE_BY_IDENTIFIER.templateName;
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
guard_1.default.validId(page);
|
|
309
|
+
variables[constants_1.API.PAGE_BY_ID.id] = page.toString();
|
|
310
|
+
templateName = constants_1.API.PAGE_BY_ID.templateName;
|
|
311
|
+
}
|
|
312
|
+
const pageLink = this.bindAsync(templateName, variables);
|
|
313
|
+
return pageLink;
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
//#endregion
|
|
317
|
+
//#region Search
|
|
318
|
+
searchLinkAsync() {
|
|
319
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
320
|
+
const routes = yield this._client.api.getApiRoutesAsync();
|
|
321
|
+
return routes[api_1.SEARCH.templateName];
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
//#endregion
|
|
325
|
+
getVariableValueAsync(link, templateName, variable) {
|
|
326
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
327
|
+
const routes = yield this._client.api.getApiRoutesAsync();
|
|
328
|
+
const value = link.getVariableValue(routes[templateName], variable);
|
|
329
|
+
return value;
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
bindAsync(templateName, value, argument) {
|
|
333
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
334
|
+
let values = {};
|
|
335
|
+
if (typeof value === "string") {
|
|
336
|
+
guard_1.default.stringNotNullOrEmpty(value);
|
|
337
|
+
guard_1.default.notNullOrUndefined(argument);
|
|
338
|
+
values[value] = argument;
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
values = value;
|
|
342
|
+
}
|
|
343
|
+
const routes = yield this._client.api.getApiRoutesAsync();
|
|
344
|
+
const link = routes[templateName];
|
|
345
|
+
if (!link.templated) {
|
|
346
|
+
return new link_1.default(link.href);
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
const template = new URITemplate_1.default(link.href);
|
|
350
|
+
return new link_1.default(template.expand(values));
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
static applyEntityDefinitionVariables(skip, take, includeConditionalMembers, viewMode) {
|
|
355
|
+
const variables = {};
|
|
356
|
+
if (skip != null && skip !== 0) {
|
|
357
|
+
variables[api_1.ENTITY_DEFINITIONS.skip] = skip.toString();
|
|
358
|
+
}
|
|
359
|
+
if (take != null) {
|
|
360
|
+
variables[api_1.ENTITY_DEFINITIONS.take] = take.toString();
|
|
361
|
+
}
|
|
362
|
+
if (includeConditionalMembers != null) {
|
|
363
|
+
variables[api_1.ENTITY_DEFINITIONS.includeConditionalMembers] = includeConditionalMembers.toString();
|
|
364
|
+
}
|
|
365
|
+
if (viewMode != null) {
|
|
366
|
+
variables[api_1.ENTITY_DEFINITIONS.viewMode] = viewMode;
|
|
367
|
+
}
|
|
368
|
+
return variables;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
exports.LinkHelper = LinkHelper;
|
package/dist/link.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import URI = require("urijs");
|
|
2
|
+
export default class Link {
|
|
3
|
+
href: string;
|
|
4
|
+
title: string;
|
|
5
|
+
templated: boolean;
|
|
6
|
+
constructor(uri: string | URI, title?: string, templated?: boolean);
|
|
7
|
+
getVariableValue(template: Link, variable: string): string;
|
|
8
|
+
static copyFrom(source: Link): Link;
|
|
9
|
+
}
|
package/dist/link.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
var Link_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
const URI = require("urijs");
|
|
17
|
+
const ta_json_1 = require("ta-json");
|
|
18
|
+
const guard_1 = __importDefault(require("./guard"));
|
|
19
|
+
let Link = Link_1 = class Link {
|
|
20
|
+
constructor(uri, title, templated) {
|
|
21
|
+
this.templated = false;
|
|
22
|
+
if (typeof uri === "string") {
|
|
23
|
+
this.href = uri;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.href = uri.href();
|
|
27
|
+
}
|
|
28
|
+
if (title) {
|
|
29
|
+
this.title = title;
|
|
30
|
+
}
|
|
31
|
+
this.templated = !!templated;
|
|
32
|
+
}
|
|
33
|
+
getVariableValue(template, variable) {
|
|
34
|
+
guard_1.default.notNullOrUndefined(template);
|
|
35
|
+
guard_1.default.stringNotNullOrEmpty(variable);
|
|
36
|
+
guard_1.default.stringNotNullOrEmpty(this.href);
|
|
37
|
+
const templateUri = new URI(template.href);
|
|
38
|
+
const currentUri = new URI(this.href);
|
|
39
|
+
const index = templateUri
|
|
40
|
+
.path()
|
|
41
|
+
.split("/")
|
|
42
|
+
.findIndex(item => item.startsWith(`{${variable}}`));
|
|
43
|
+
if (index) {
|
|
44
|
+
return decodeURIComponent(currentUri.path().split("/")[index]);
|
|
45
|
+
}
|
|
46
|
+
let queryRegexStr = `\?|,${variable.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")},|$`;
|
|
47
|
+
let queryRegex = new RegExp(queryRegexStr);
|
|
48
|
+
if (queryRegex.test(templateUri.query())) {
|
|
49
|
+
queryRegexStr = `(?:^|&)${variable.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")}=([^#&]+)(?:[#&]?|$)`;
|
|
50
|
+
queryRegex = new RegExp(queryRegexStr);
|
|
51
|
+
const matches = queryRegex.exec(currentUri.query());
|
|
52
|
+
if (matches) {
|
|
53
|
+
return decodeURIComponent(matches[1]);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
throw `Variable '${variable}' not found in template '${template.href}'.`;
|
|
57
|
+
}
|
|
58
|
+
static copyFrom(source) {
|
|
59
|
+
return new Link_1(source.href, source.title, source.templated);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
__decorate([
|
|
63
|
+
ta_json_1.JsonProperty("href"),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], Link.prototype, "href", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
ta_json_1.JsonProperty("title"),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], Link.prototype, "title", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
ta_json_1.JsonProperty("templated"),
|
|
72
|
+
__metadata("design:type", Boolean)
|
|
73
|
+
], Link.prototype, "templated", void 0);
|
|
74
|
+
Link = Link_1 = __decorate([
|
|
75
|
+
ta_json_1.JsonObject(),
|
|
76
|
+
__metadata("design:paramtypes", [Object, String, Boolean])
|
|
77
|
+
], Link);
|
|
78
|
+
exports.default = Link;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogLevel = void 0;
|
|
4
|
+
var LogLevel;
|
|
5
|
+
(function (LogLevel) {
|
|
6
|
+
LogLevel[LogLevel["Debug"] = 0] = "Debug";
|
|
7
|
+
LogLevel[LogLevel["Info"] = 1] = "Info";
|
|
8
|
+
LogLevel[LogLevel["Warn"] = 2] = "Warn";
|
|
9
|
+
LogLevel[LogLevel["Error"] = 3] = "Error";
|
|
10
|
+
})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LogLevel } from "./log-level";
|
|
2
|
+
import { ILogger } from "./logger";
|
|
3
|
+
export default abstract class LoggerBase implements ILogger {
|
|
4
|
+
minimumLogLevel: LogLevel;
|
|
5
|
+
get isDebugEnabled(): boolean;
|
|
6
|
+
get isInfoEnabled(): boolean;
|
|
7
|
+
get isWarnEnabled(): boolean;
|
|
8
|
+
get isErrorEnabled(): boolean;
|
|
9
|
+
debug(message: (() => string) | string): void;
|
|
10
|
+
debugAsync(message: () => Promise<string>): Promise<void>;
|
|
11
|
+
info(message: (() => string) | string): void;
|
|
12
|
+
infoAsync(message: () => Promise<string>): Promise<void>;
|
|
13
|
+
warn(message: (() => string) | string): void;
|
|
14
|
+
warnAsync(message: () => Promise<string>): Promise<void>;
|
|
15
|
+
error(message: (() => string) | string, error?: Error): void;
|
|
16
|
+
errorAsync(message: () => Promise<string>, error?: Error): Promise<void>;
|
|
17
|
+
abstract logDebug(message: string): void;
|
|
18
|
+
abstract logInfo(message: string): void;
|
|
19
|
+
abstract logWarn(message: string): void;
|
|
20
|
+
abstract logError(message: string, error?: Error): void;
|
|
21
|
+
abstract logError(error: Error): void;
|
|
22
|
+
private handleDebugMessage;
|
|
23
|
+
private handleInfoMessage;
|
|
24
|
+
private handleWarnMessage;
|
|
25
|
+
private handleErrorMessage;
|
|
26
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const log_level_1 = require("./log-level");
|
|
13
|
+
class LoggerBase {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.minimumLogLevel = log_level_1.LogLevel.Info;
|
|
16
|
+
}
|
|
17
|
+
get isDebugEnabled() {
|
|
18
|
+
return this.minimumLogLevel <= log_level_1.LogLevel.Debug;
|
|
19
|
+
}
|
|
20
|
+
get isInfoEnabled() {
|
|
21
|
+
return this.minimumLogLevel <= log_level_1.LogLevel.Info;
|
|
22
|
+
}
|
|
23
|
+
get isWarnEnabled() {
|
|
24
|
+
return this.minimumLogLevel <= log_level_1.LogLevel.Warn;
|
|
25
|
+
}
|
|
26
|
+
get isErrorEnabled() {
|
|
27
|
+
return this.minimumLogLevel <= log_level_1.LogLevel.Error;
|
|
28
|
+
}
|
|
29
|
+
debug(message) {
|
|
30
|
+
if (this.isDebugEnabled) {
|
|
31
|
+
this.handleDebugMessage(typeof message === "function" ? message() : message);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
debugAsync(message) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
if (this.isDebugEnabled) {
|
|
37
|
+
const msg = yield message();
|
|
38
|
+
this.handleDebugMessage(msg);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
info(message) {
|
|
43
|
+
if (this.isInfoEnabled) {
|
|
44
|
+
this.handleInfoMessage(typeof message === "function" ? message() : message);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
infoAsync(message) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
if (this.isInfoEnabled) {
|
|
50
|
+
const msg = yield message();
|
|
51
|
+
this.handleInfoMessage(msg);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
warn(message) {
|
|
56
|
+
if (this.isWarnEnabled) {
|
|
57
|
+
this.handleWarnMessage(typeof message === "function" ? message() : message);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
warnAsync(message) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
if (this.isWarnEnabled) {
|
|
63
|
+
const msg = yield message();
|
|
64
|
+
this.handleWarnMessage(msg);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
error(message, error) {
|
|
69
|
+
if (this.isErrorEnabled) {
|
|
70
|
+
this.handleErrorMessage(typeof message === "function" ? message() : message, error);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
errorAsync(message, error) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
if (this.isErrorEnabled) {
|
|
76
|
+
const msg = yield message();
|
|
77
|
+
this.handleErrorMessage(msg, error);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
handleDebugMessage(message) {
|
|
82
|
+
//TODO Fire event?
|
|
83
|
+
this.logDebug(message);
|
|
84
|
+
}
|
|
85
|
+
handleInfoMessage(message) {
|
|
86
|
+
//TODO Fire event?
|
|
87
|
+
this.logInfo(message);
|
|
88
|
+
}
|
|
89
|
+
handleWarnMessage(message) {
|
|
90
|
+
//TODO Fire event?
|
|
91
|
+
this.logWarn(message);
|
|
92
|
+
}
|
|
93
|
+
handleErrorMessage(message, error) {
|
|
94
|
+
//TODO Fire event?
|
|
95
|
+
this.logError(message, error);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.default = LoggerBase;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LogLevel } from "./log-level";
|
|
2
|
+
export interface ILogger {
|
|
3
|
+
readonly isDebugEnabled: boolean;
|
|
4
|
+
readonly isInfoEnabled: boolean;
|
|
5
|
+
readonly isWarnEnabled: boolean;
|
|
6
|
+
readonly isErrorEnabled: boolean;
|
|
7
|
+
minimumLogLevel: LogLevel;
|
|
8
|
+
debug(message: (() => string) | string): void;
|
|
9
|
+
debugAsync(message: () => Promise<string>): Promise<void>;
|
|
10
|
+
info(message: (() => string) | string): void;
|
|
11
|
+
infoAsync(message: () => Promise<string>): Promise<void>;
|
|
12
|
+
warn(message: (() => string) | string): void;
|
|
13
|
+
warnAsync(message: () => Promise<string>): Promise<void>;
|
|
14
|
+
error(message: (() => string) | string, error?: Error): void;
|
|
15
|
+
errorAsync(message: () => Promise<string>, error?: Error): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const logger_base_1 = __importDefault(require("./logger-base"));
|
|
7
|
+
class NullLogger extends logger_base_1.default {
|
|
8
|
+
logDebug(message) { }
|
|
9
|
+
logInfo(message) { }
|
|
10
|
+
logWarn(message) { }
|
|
11
|
+
logError(message, error) { }
|
|
12
|
+
}
|
|
13
|
+
exports.default = NullLogger;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiResourceMapper = void 0;
|
|
4
|
+
const api_info_1 = require("../api/api-info");
|
|
5
|
+
const api_routes_dictionary_1 = require("../api/api-routes-dictionary");
|
|
6
|
+
class ApiResourceMapper {
|
|
7
|
+
static map(resource) {
|
|
8
|
+
const apiRoutes = new api_routes_dictionary_1.ApiRoutesDictionary();
|
|
9
|
+
for (const [key, value] of Object.entries(resource.routes)) {
|
|
10
|
+
apiRoutes[key] = value;
|
|
11
|
+
}
|
|
12
|
+
const apiInfo = new api_info_1.ApiInfo(resource.fileVersion, resource.minimumSdkVersion, apiRoutes);
|
|
13
|
+
return apiInfo;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ApiResourceMapper = ApiResourceMapper;
|