@resolution/confluence-api-client 0.7.12 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +208 -213
- package/README.md +4 -4
- package/lib/openapi/core/CommonHttpClient.d.ts +46 -17
- package/lib/openapi/core/CommonHttpClient.js +175 -232
- package/lib/openapi/core/CommonHttpClient.js.map +1 -1
- package/lib/openapi/core/CommonHttpService.d.ts +1 -1
- package/lib/openapi/core/CommonHttpService.js.map +1 -1
- package/lib/openapi/core/CommonValidationSchemaStorage.d.ts +4 -4
- package/lib/openapi/core/CommonValidationSchemaStorage.js +2 -4
- package/lib/openapi/core/CommonValidationSchemaStorage.js.map +1 -1
- package/lib/openapi/v1/BaseConfluenceApiV1Client.d.ts +4 -4
- package/lib/openapi/v1/BaseConfluenceApiV1Client.js +38 -0
- package/lib/openapi/v1/BaseConfluenceApiV1Client.js.map +1 -1
- package/lib/openapi/v1/models/audit.d.ts +2 -2
- package/lib/openapi/v1/models/audit.js +31 -90
- package/lib/openapi/v1/models/audit.js.map +1 -1
- package/lib/openapi/v1/models/common.d.ts +2 -4
- package/lib/openapi/v1/models/common.js +188 -464
- package/lib/openapi/v1/models/common.js.map +1 -1
- package/lib/openapi/v1/models/content.d.ts +2 -2
- package/lib/openapi/v1/models/content.js +205 -491
- package/lib/openapi/v1/models/content.js.map +1 -1
- package/lib/openapi/v1/models/contentAttachments.d.ts +1 -1
- package/lib/openapi/v1/models/contentAttachments.js +8 -19
- package/lib/openapi/v1/models/contentAttachments.js.map +1 -1
- package/lib/openapi/v1/models/contentBody.d.ts +2 -2
- package/lib/openapi/v1/models/contentBody.js +20 -59
- package/lib/openapi/v1/models/contentBody.js.map +1 -1
- package/lib/openapi/v1/models/contentChildrenAndDescendants.d.ts +4 -2
- package/lib/openapi/v1/models/contentChildrenAndDescendants.js +17 -40
- package/lib/openapi/v1/models/contentChildrenAndDescendants.js.map +1 -1
- package/lib/openapi/v1/models/contentLabels.d.ts +1 -1
- package/lib/openapi/v1/models/contentLabels.js +2 -7
- package/lib/openapi/v1/models/contentLabels.js.map +1 -1
- package/lib/openapi/v1/models/contentMacroBody.d.ts +1 -1
- package/lib/openapi/v1/models/contentMacroBody.js +4 -10
- package/lib/openapi/v1/models/contentMacroBody.js.map +1 -1
- package/lib/openapi/v1/models/contentPermissions.d.ts +2 -2
- package/lib/openapi/v1/models/contentPermissions.js +10 -22
- package/lib/openapi/v1/models/contentPermissions.js.map +1 -1
- package/lib/openapi/v1/models/contentProperties.d.ts +1 -1
- package/lib/openapi/v1/models/contentProperties.js +25 -71
- package/lib/openapi/v1/models/contentProperties.js.map +1 -1
- package/lib/openapi/v1/models/contentRestrictions.d.ts +2 -2
- package/lib/openapi/v1/models/contentRestrictions.js +17 -57
- package/lib/openapi/v1/models/contentRestrictions.js.map +1 -1
- package/lib/openapi/v1/models/contentStates.d.ts +1 -20
- package/lib/openapi/v1/models/contentStates.js +15 -55
- package/lib/openapi/v1/models/contentStates.js.map +1 -1
- package/lib/openapi/v1/models/contentVersions.d.ts +2 -2
- package/lib/openapi/v1/models/contentVersions.js +9 -20
- package/lib/openapi/v1/models/contentVersions.js.map +1 -1
- package/lib/openapi/v1/models/contentWatches.d.ts +2 -2
- package/lib/openapi/v1/models/contentWatches.js +21 -46
- package/lib/openapi/v1/models/contentWatches.js.map +1 -1
- package/lib/openapi/v1/models/dynamicModules.d.ts +33 -27
- package/lib/openapi/v1/models/dynamicModules.js +6 -15
- package/lib/openapi/v1/models/dynamicModules.js.map +1 -1
- package/lib/openapi/v1/models/group.d.ts +1 -1
- package/lib/openapi/v1/models/group.js +6 -15
- package/lib/openapi/v1/models/group.js.map +1 -1
- package/lib/openapi/v1/models/inlineTasks.d.ts +1 -1
- package/lib/openapi/v1/models/inlineTasks.js +10 -22
- package/lib/openapi/v1/models/inlineTasks.js.map +1 -1
- package/lib/openapi/v1/models/labelInfo.d.ts +1 -1
- package/lib/openapi/v1/models/labelInfo.js +11 -27
- package/lib/openapi/v1/models/labelInfo.js.map +1 -1
- package/lib/openapi/v1/models/longRunningTask.d.ts +2 -2
- package/lib/openapi/v1/models/longRunningTask.js +20 -42
- package/lib/openapi/v1/models/longRunningTask.js.map +1 -1
- package/lib/openapi/v1/models/relation.d.ts +2 -2
- package/lib/openapi/v1/models/relation.js +16 -45
- package/lib/openapi/v1/models/relation.js.map +1 -1
- package/lib/openapi/v1/models/search.d.ts +2 -2
- package/lib/openapi/v1/models/search.js +15 -34
- package/lib/openapi/v1/models/search.js.map +1 -1
- package/lib/openapi/v1/models/settings.d.ts +2 -2
- package/lib/openapi/v1/models/settings.js +13 -29
- package/lib/openapi/v1/models/settings.js.map +1 -1
- package/lib/openapi/v1/models/space.d.ts +2 -2
- package/lib/openapi/v1/models/space.js +31 -69
- package/lib/openapi/v1/models/space.js.map +1 -1
- package/lib/openapi/v1/models/spacePermissions.d.ts +1 -1
- package/lib/openapi/v1/models/spacePermissions.js +23 -86
- package/lib/openapi/v1/models/spacePermissions.js.map +1 -1
- package/lib/openapi/v1/models/spaceProperties.d.ts +2 -2
- package/lib/openapi/v1/models/spaceProperties.js +26 -71
- package/lib/openapi/v1/models/spaceProperties.js.map +1 -1
- package/lib/openapi/v1/models/spaceSettings.d.ts +1 -1
- package/lib/openapi/v1/models/spaceSettings.js +3 -9
- package/lib/openapi/v1/models/spaceSettings.js.map +1 -1
- package/lib/openapi/v1/models/template.d.ts +2 -2
- package/lib/openapi/v1/models/template.js +45 -103
- package/lib/openapi/v1/models/template.js.map +1 -1
- package/lib/openapi/v1/models/themes.d.ts +1 -1
- package/lib/openapi/v1/models/themes.js +10 -22
- package/lib/openapi/v1/models/themes.js.map +1 -1
- package/lib/openapi/v1/models/userProperties.d.ts +1 -1
- package/lib/openapi/v1/models/userProperties.js +16 -33
- package/lib/openapi/v1/models/userProperties.js.map +1 -1
- package/lib/openapi/v1/models/users.d.ts +2 -2
- package/lib/openapi/v1/models/users.js +25 -57
- package/lib/openapi/v1/models/users.js.map +1 -1
- package/lib/openapi/v1/services/AnalyticsService.d.ts +2 -2
- package/lib/openapi/v1/services/AnalyticsService.js +29 -47
- package/lib/openapi/v1/services/AnalyticsService.js.map +1 -1
- package/lib/openapi/v1/services/AuditService.d.ts +6 -6
- package/lib/openapi/v1/services/AuditService.js +67 -109
- package/lib/openapi/v1/services/AuditService.js.map +1 -1
- package/lib/openapi/v1/services/ContentAttachmentsService.d.ts +7 -7
- package/lib/openapi/v1/services/ContentAttachmentsService.js +72 -109
- package/lib/openapi/v1/services/ContentAttachmentsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentBodyService.d.ts +7 -7
- package/lib/openapi/v1/services/ContentBodyService.js +67 -105
- package/lib/openapi/v1/services/ContentBodyService.js.map +1 -1
- package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.d.ts +15 -15
- package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.js +110 -160
- package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentCommentsService.d.ts +4 -4
- package/lib/openapi/v1/services/ContentCommentsService.js +19 -26
- package/lib/openapi/v1/services/ContentCommentsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentLabelsService.d.ts +4 -4
- package/lib/openapi/v1/services/ContentLabelsService.js +36 -54
- package/lib/openapi/v1/services/ContentLabelsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentMacroBodyService.d.ts +4 -4
- package/lib/openapi/v1/services/ContentMacroBodyService.js +43 -67
- package/lib/openapi/v1/services/ContentMacroBodyService.js.map +1 -1
- package/lib/openapi/v1/services/ContentPermissionsService.d.ts +1 -1
- package/lib/openapi/v1/services/ContentPermissionsService.js +14 -23
- package/lib/openapi/v1/services/ContentPermissionsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentPropertiesService.d.ts +7 -7
- package/lib/openapi/v1/services/ContentPropertiesService.js +73 -112
- package/lib/openapi/v1/services/ContentPropertiesService.js.map +1 -1
- package/lib/openapi/v1/services/ContentRestrictionsService.d.ts +13 -13
- package/lib/openapi/v1/services/ContentRestrictionsService.js +127 -184
- package/lib/openapi/v1/services/ContentRestrictionsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentService.d.ts +18 -18
- package/lib/openapi/v1/services/ContentService.js +143 -211
- package/lib/openapi/v1/services/ContentService.js.map +1 -1
- package/lib/openapi/v1/services/ContentStatesService.d.ts +13 -56
- package/lib/openapi/v1/services/ContentStatesService.js +99 -246
- package/lib/openapi/v1/services/ContentStatesService.js.map +1 -1
- package/lib/openapi/v1/services/ContentVersionsService.d.ts +4 -4
- package/lib/openapi/v1/services/ContentVersionsService.js +53 -79
- package/lib/openapi/v1/services/ContentVersionsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentWatchesService.d.ts +13 -13
- package/lib/openapi/v1/services/ContentWatchesService.js +113 -169
- package/lib/openapi/v1/services/ContentWatchesService.js.map +1 -1
- package/lib/openapi/v1/services/DynamicModulesService.d.ts +2 -2
- package/lib/openapi/v1/services/DynamicModulesService.js +24 -37
- package/lib/openapi/v1/services/DynamicModulesService.js.map +1 -1
- package/lib/openapi/v1/services/ExperimentalService.d.ts +5 -5
- package/lib/openapi/v1/services/ExperimentalService.js +42 -65
- package/lib/openapi/v1/services/ExperimentalService.js.map +1 -1
- package/lib/openapi/v1/services/GroupService.d.ts +10 -10
- package/lib/openapi/v1/services/GroupService.js +76 -117
- package/lib/openapi/v1/services/GroupService.js.map +1 -1
- package/lib/openapi/v1/services/InlineTasksService.d.ts +4 -4
- package/lib/openapi/v1/services/InlineTasksService.js +36 -59
- package/lib/openapi/v1/services/InlineTasksService.js.map +1 -1
- package/lib/openapi/v1/services/LabelInfoService.d.ts +1 -1
- package/lib/openapi/v1/services/LabelInfoService.js +12 -19
- package/lib/openapi/v1/services/LabelInfoService.js.map +1 -1
- package/lib/openapi/v1/services/LongRunningTaskService.d.ts +2 -2
- package/lib/openapi/v1/services/LongRunningTaskService.js +24 -40
- package/lib/openapi/v1/services/LongRunningTaskService.js.map +1 -1
- package/lib/openapi/v1/services/RelationService.d.ts +38 -18
- package/lib/openapi/v1/services/RelationService.js +64 -94
- package/lib/openapi/v1/services/RelationService.js.map +1 -1
- package/lib/openapi/v1/services/SearchService.d.ts +5 -5
- package/lib/openapi/v1/services/SearchService.js +32 -46
- package/lib/openapi/v1/services/SearchService.js.map +1 -1
- package/lib/openapi/v1/services/SettingsService.d.ts +6 -6
- package/lib/openapi/v1/services/SettingsService.js +61 -98
- package/lib/openapi/v1/services/SettingsService.js.map +1 -1
- package/lib/openapi/v1/services/SpacePermissionsService.d.ts +4 -4
- package/lib/openapi/v1/services/SpacePermissionsService.js +25 -38
- package/lib/openapi/v1/services/SpacePermissionsService.js.map +1 -1
- package/lib/openapi/v1/services/SpacePropertiesService.d.ts +7 -7
- package/lib/openapi/v1/services/SpacePropertiesService.js +73 -112
- package/lib/openapi/v1/services/SpacePropertiesService.js.map +1 -1
- package/lib/openapi/v1/services/SpaceService.d.ts +15 -15
- package/lib/openapi/v1/services/SpaceService.js +114 -175
- package/lib/openapi/v1/services/SpaceService.js.map +1 -1
- package/lib/openapi/v1/services/SpaceSettingsService.d.ts +2 -2
- package/lib/openapi/v1/services/SpaceSettingsService.js +24 -38
- package/lib/openapi/v1/services/SpaceSettingsService.js.map +1 -1
- package/lib/openapi/v1/services/TemplateService.d.ts +7 -7
- package/lib/openapi/v1/services/TemplateService.js +67 -104
- package/lib/openapi/v1/services/TemplateService.js.map +1 -1
- package/lib/openapi/v1/services/ThemesService.d.ts +5 -5
- package/lib/openapi/v1/services/ThemesService.js +61 -101
- package/lib/openapi/v1/services/ThemesService.js.map +1 -1
- package/lib/openapi/v1/services/UserPropertiesService.d.ts +6 -6
- package/lib/openapi/v1/services/UserPropertiesService.js +42 -64
- package/lib/openapi/v1/services/UserPropertiesService.js.map +1 -1
- package/lib/openapi/v1/services/UsersService.d.ts +9 -9
- package/lib/openapi/v1/services/UsersService.js +94 -146
- package/lib/openapi/v1/services/UsersService.js.map +1 -1
- package/lib/openapi/v1/validationSchemaStorage.d.ts +2 -2
- package/lib/openapi/v1/validationSchemaStorage.js +12 -22
- package/lib/openapi/v1/validationSchemaStorage.js.map +1 -1
- package/lib/openapi/v2/BaseConfluenceApiV2Client.d.ts +1 -1
- package/lib/openapi/v2/BaseConfluenceApiV2Client.js +3 -1
- package/lib/openapi/v2/BaseConfluenceApiV2Client.js.map +1 -1
- package/lib/openapi/v2/models/ancestors.d.ts +1 -1
- package/lib/openapi/v2/models/ancestors.js +4 -12
- package/lib/openapi/v2/models/ancestors.js.map +1 -1
- package/lib/openapi/v2/models/attachment.d.ts +2 -2
- package/lib/openapi/v2/models/attachment.js +26 -71
- package/lib/openapi/v2/models/attachment.js.map +1 -1
- package/lib/openapi/v2/models/blogPost.d.ts +2 -2
- package/lib/openapi/v2/models/blogPost.js +37 -102
- package/lib/openapi/v2/models/blogPost.js.map +1 -1
- package/lib/openapi/v2/models/children.d.ts +1 -1
- package/lib/openapi/v2/models/children.js +9 -24
- package/lib/openapi/v2/models/children.js.map +1 -1
- package/lib/openapi/v2/models/classificationLevel.d.ts +1 -1
- package/lib/openapi/v2/models/classificationLevel.js +6 -32
- package/lib/openapi/v2/models/classificationLevel.js.map +1 -1
- package/lib/openapi/v2/models/comment.d.ts +2 -2
- package/lib/openapi/v2/models/comment.js +107 -272
- package/lib/openapi/v2/models/comment.js.map +1 -1
- package/lib/openapi/v2/models/common.d.ts +1 -1
- package/lib/openapi/v2/models/common.js +84 -214
- package/lib/openapi/v2/models/common.js.map +1 -1
- package/lib/openapi/v2/models/content.d.ts +1 -1
- package/lib/openapi/v2/models/content.js +3 -21
- package/lib/openapi/v2/models/content.js.map +1 -1
- package/lib/openapi/v2/models/contentProperties.d.ts +1 -1
- package/lib/openapi/v2/models/contentProperties.js +8 -20
- package/lib/openapi/v2/models/contentProperties.js.map +1 -1
- package/lib/openapi/v2/models/customContent.d.ts +2 -2
- package/lib/openapi/v2/models/customContent.js +43 -121
- package/lib/openapi/v2/models/customContent.js.map +1 -1
- package/lib/openapi/v2/models/dataPolicies.d.ts +1 -1
- package/lib/openapi/v2/models/dataPolicies.js +11 -25
- package/lib/openapi/v2/models/dataPolicies.js.map +1 -1
- package/lib/openapi/v2/models/database.d.ts +1 -1
- package/lib/openapi/v2/models/database.js +8 -19
- package/lib/openapi/v2/models/database.js.map +1 -1
- package/lib/openapi/v2/models/eap.d.ts +1 -1
- package/lib/openapi/v2/models/eap.js +0 -3
- package/lib/openapi/v2/models/eap.js.map +1 -1
- package/lib/openapi/v2/models/folder.d.ts +1 -1
- package/lib/openapi/v2/models/folder.js +8 -19
- package/lib/openapi/v2/models/folder.js.map +1 -1
- package/lib/openapi/v2/models/operation.d.ts +1 -1
- package/lib/openapi/v2/models/operation.js +4 -12
- package/lib/openapi/v2/models/operation.js.map +1 -1
- package/lib/openapi/v2/models/page.d.ts +2 -2
- package/lib/openapi/v2/models/page.js +36 -101
- package/lib/openapi/v2/models/page.js.map +1 -1
- package/lib/openapi/v2/models/smartLink.d.ts +1 -1
- package/lib/openapi/v2/models/smartLink.js +8 -19
- package/lib/openapi/v2/models/smartLink.js.map +1 -1
- package/lib/openapi/v2/models/space.d.ts +2 -2
- package/lib/openapi/v2/models/space.js +21 -57
- package/lib/openapi/v2/models/space.js.map +1 -1
- package/lib/openapi/v2/models/spaceProperties.d.ts +1 -1
- package/lib/openapi/v2/models/spaceProperties.js +8 -20
- package/lib/openapi/v2/models/spaceProperties.js.map +1 -1
- package/lib/openapi/v2/models/task.d.ts +1 -1
- package/lib/openapi/v2/models/task.js +7 -16
- package/lib/openapi/v2/models/task.js.map +1 -1
- package/lib/openapi/v2/models/user.d.ts +1 -1
- package/lib/openapi/v2/models/user.js +7 -20
- package/lib/openapi/v2/models/user.js.map +1 -1
- package/lib/openapi/v2/models/version.d.ts +1 -1
- package/lib/openapi/v2/models/version.js +22 -46
- package/lib/openapi/v2/models/version.js.map +1 -1
- package/lib/openapi/v2/models/whiteboard.d.ts +1 -1
- package/lib/openapi/v2/models/whiteboard.js +8 -19
- package/lib/openapi/v2/models/whiteboard.js.map +1 -1
- package/lib/openapi/v2/services/AncestorsService.d.ts +5 -5
- package/lib/openapi/v2/services/AncestorsService.js +73 -133
- package/lib/openapi/v2/services/AncestorsService.js.map +1 -1
- package/lib/openapi/v2/services/AttachmentService.d.ts +8 -8
- package/lib/openapi/v2/services/AttachmentService.js +98 -180
- package/lib/openapi/v2/services/AttachmentService.js.map +1 -1
- package/lib/openapi/v2/services/BlogPostService.d.ts +9 -9
- package/lib/openapi/v2/services/BlogPostService.js +100 -180
- package/lib/openapi/v2/services/BlogPostService.js.map +1 -1
- package/lib/openapi/v2/services/ChildrenService.d.ts +2 -2
- package/lib/openapi/v2/services/ChildrenService.js +32 -61
- package/lib/openapi/v2/services/ChildrenService.js.map +1 -1
- package/lib/openapi/v2/services/ClassificationLevelService.d.ts +15 -15
- package/lib/openapi/v2/services/ClassificationLevelService.js +127 -191
- package/lib/openapi/v2/services/ClassificationLevelService.js.map +1 -1
- package/lib/openapi/v2/services/CommentService.d.ts +20 -20
- package/lib/openapi/v2/services/CommentService.js +250 -454
- package/lib/openapi/v2/services/CommentService.js.map +1 -1
- package/lib/openapi/v2/services/ContentPropertiesService.d.ts +46 -46
- package/lib/openapi/v2/services/ContentPropertiesService.js +496 -820
- package/lib/openapi/v2/services/ContentPropertiesService.js.map +1 -1
- package/lib/openapi/v2/services/ContentService.d.ts +1 -1
- package/lib/openapi/v2/services/ContentService.js +12 -19
- package/lib/openapi/v2/services/ContentService.js.map +1 -1
- package/lib/openapi/v2/services/CustomContentService.d.ts +14 -11
- package/lib/openapi/v2/services/CustomContentService.js +114 -207
- package/lib/openapi/v2/services/CustomContentService.js.map +1 -1
- package/lib/openapi/v2/services/DataPoliciesService.d.ts +2 -2
- package/lib/openapi/v2/services/DataPoliciesService.js +25 -48
- package/lib/openapi/v2/services/DataPoliciesService.js.map +1 -1
- package/lib/openapi/v2/services/DatabaseService.d.ts +3 -3
- package/lib/openapi/v2/services/DatabaseService.js +37 -63
- package/lib/openapi/v2/services/DatabaseService.js.map +1 -1
- package/lib/openapi/v2/services/EapService.d.ts +7 -7
- package/lib/openapi/v2/services/EapService.js +89 -165
- package/lib/openapi/v2/services/EapService.js.map +1 -1
- package/lib/openapi/v2/services/FolderService.d.ts +3 -3
- package/lib/openapi/v2/services/FolderService.js +36 -62
- package/lib/openapi/v2/services/FolderService.js.map +1 -1
- package/lib/openapi/v2/services/LabelService.d.ts +7 -7
- package/lib/openapi/v2/services/LabelService.js +105 -196
- package/lib/openapi/v2/services/LabelService.js.map +1 -1
- package/lib/openapi/v2/services/LikeService.d.ts +8 -8
- package/lib/openapi/v2/services/LikeService.js +109 -189
- package/lib/openapi/v2/services/LikeService.js.map +1 -1
- package/lib/openapi/v2/services/OperationService.d.ts +11 -11
- package/lib/openapi/v2/services/OperationService.js +122 -199
- package/lib/openapi/v2/services/OperationService.js.map +1 -1
- package/lib/openapi/v2/services/PageService.d.ts +9 -9
- package/lib/openapi/v2/services/PageService.js +100 -180
- package/lib/openapi/v2/services/PageService.js.map +1 -1
- package/lib/openapi/v2/services/SmartLinkService.d.ts +3 -3
- package/lib/openapi/v2/services/SmartLinkService.js +36 -62
- package/lib/openapi/v2/services/SmartLinkService.js.map +1 -1
- package/lib/openapi/v2/services/SpacePermissionsService.d.ts +3 -3
- package/lib/openapi/v2/services/SpacePermissionsService.js +30 -56
- package/lib/openapi/v2/services/SpacePermissionsService.js.map +1 -1
- package/lib/openapi/v2/services/SpacePropertiesService.d.ts +6 -6
- package/lib/openapi/v2/services/SpacePropertiesService.js +56 -92
- package/lib/openapi/v2/services/SpacePropertiesService.js.map +1 -1
- package/lib/openapi/v2/services/SpaceRolesService.d.ts +5 -5
- package/lib/openapi/v2/services/SpaceRolesService.js +60 -111
- package/lib/openapi/v2/services/SpaceRolesService.js.map +1 -1
- package/lib/openapi/v2/services/SpaceService.d.ts +4 -4
- package/lib/openapi/v2/services/SpaceService.js +47 -87
- package/lib/openapi/v2/services/SpaceService.js.map +1 -1
- package/lib/openapi/v2/services/TaskService.d.ts +4 -4
- package/lib/openapi/v2/services/TaskService.js +40 -68
- package/lib/openapi/v2/services/TaskService.js.map +1 -1
- package/lib/openapi/v2/services/UserService.d.ts +3 -3
- package/lib/openapi/v2/services/UserService.js +33 -58
- package/lib/openapi/v2/services/UserService.js.map +1 -1
- package/lib/openapi/v2/services/VersionService.d.ts +14 -14
- package/lib/openapi/v2/services/VersionService.js +158 -281
- package/lib/openapi/v2/services/VersionService.js.map +1 -1
- package/lib/openapi/v2/services/WhiteboardService.d.ts +3 -3
- package/lib/openapi/v2/services/WhiteboardService.js +37 -63
- package/lib/openapi/v2/services/WhiteboardService.js.map +1 -1
- package/lib/openapi/v2/validationSchemaStorage.d.ts +2 -2
- package/lib/openapi/v2/validationSchemaStorage.js +12 -22
- package/lib/openapi/v2/validationSchemaStorage.js.map +1 -1
- package/package.json +5 -4
|
@@ -25,7 +25,7 @@ exports.CommonHttpClient = exports.createClientWithServices = exports.discardRes
|
|
|
25
25
|
class CommonHttpClientError extends Error {
|
|
26
26
|
constructor(url, request, response, options, message) {
|
|
27
27
|
super(message);
|
|
28
|
-
this.name =
|
|
28
|
+
this.name = 'OpenApiClientError';
|
|
29
29
|
this.url = url;
|
|
30
30
|
this.request = request;
|
|
31
31
|
this.response = response;
|
|
@@ -58,59 +58,59 @@ function convertResponseBody(body, destType) {
|
|
|
58
58
|
if (body.type === destType) {
|
|
59
59
|
return body;
|
|
60
60
|
}
|
|
61
|
-
if (body.type ===
|
|
61
|
+
if (body.type === 'json') {
|
|
62
62
|
const blob = new Blob([JSON.stringify(body.data)]);
|
|
63
|
-
if (destType ===
|
|
63
|
+
if (destType === 'blob') {
|
|
64
64
|
return {
|
|
65
|
-
type:
|
|
66
|
-
data: blob
|
|
65
|
+
type: 'blob',
|
|
66
|
+
data: blob
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
else if (destType ===
|
|
69
|
+
else if (destType === 'readableStream') {
|
|
70
70
|
return {
|
|
71
|
-
type:
|
|
72
|
-
data: blob.stream()
|
|
71
|
+
type: 'readableStream',
|
|
72
|
+
data: blob.stream()
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
|
-
throw new Error(
|
|
76
|
+
throw new Error('Invalid destination type.');
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
if (body.type ===
|
|
80
|
-
if (destType ===
|
|
79
|
+
if (body.type === 'blob') {
|
|
80
|
+
if (destType === 'json') {
|
|
81
81
|
return {
|
|
82
|
-
type:
|
|
83
|
-
data: JSON.parse(yield body.data.text())
|
|
82
|
+
type: 'json',
|
|
83
|
+
data: JSON.parse(yield body.data.text())
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
else if (destType ===
|
|
86
|
+
else if (destType === 'readableStream') {
|
|
87
87
|
return {
|
|
88
|
-
type:
|
|
89
|
-
data: body.data.stream()
|
|
88
|
+
type: 'readableStream',
|
|
89
|
+
data: body.data.stream()
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
else {
|
|
93
|
-
throw new Error(
|
|
93
|
+
throw new Error('Invalid destination type.');
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
if (body.type ===
|
|
97
|
-
if (destType ===
|
|
96
|
+
if (body.type === 'readableStream') {
|
|
97
|
+
if (destType === 'json') {
|
|
98
98
|
return {
|
|
99
|
-
type:
|
|
100
|
-
data: JSON.parse(yield (yield readableStreamToBlob(body.data)).text())
|
|
99
|
+
type: 'json',
|
|
100
|
+
data: JSON.parse(yield (yield readableStreamToBlob(body.data)).text())
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
else if (destType ===
|
|
103
|
+
else if (destType === 'blob') {
|
|
104
104
|
return {
|
|
105
|
-
type:
|
|
106
|
-
data: yield readableStreamToBlob(body.data)
|
|
105
|
+
type: 'blob',
|
|
106
|
+
data: yield readableStreamToBlob(body.data)
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
else {
|
|
110
|
-
throw new Error(
|
|
110
|
+
throw new Error('Invalid destination type.');
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
throw new Error(
|
|
113
|
+
throw new Error('Invalid response body type.');
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
function checkReponseMediaType(response, mediaType) {
|
|
@@ -129,13 +129,13 @@ function asCreatedResponse(...keys) {
|
|
|
129
129
|
if (response.status === 201) {
|
|
130
130
|
return {
|
|
131
131
|
created: true,
|
|
132
|
-
[keyCreated]: response.body
|
|
132
|
+
[keyCreated]: response.body
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
else {
|
|
136
136
|
return {
|
|
137
137
|
created: false,
|
|
138
|
-
[keyOther]: response.body
|
|
138
|
+
[keyOther]: response.body
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
};
|
|
@@ -152,9 +152,7 @@ function createClientWithServices(services, options) {
|
|
|
152
152
|
const extension = {};
|
|
153
153
|
for (const serviceName in services) {
|
|
154
154
|
if (Object.prototype.hasOwnProperty.call(services, serviceName)) {
|
|
155
|
-
extension[serviceName
|
|
156
|
-
.replace(/[^\b]Service$/, "")
|
|
157
|
-
.replace(/^\w/, (s) => s.toLowerCase())] = new services[serviceName](client.getClient());
|
|
155
|
+
extension[serviceName.replace(/[^\b]Service$/, '').replace(/^\w/, s => s.toLowerCase())] = new services[serviceName](client.getClient());
|
|
158
156
|
}
|
|
159
157
|
}
|
|
160
158
|
return Object.assign(client, extension);
|
|
@@ -164,277 +162,212 @@ function getErrorMessage(e) {
|
|
|
164
162
|
return e instanceof Error ? e.message : String(e);
|
|
165
163
|
}
|
|
166
164
|
function parameterHasValue(value) {
|
|
167
|
-
return
|
|
168
|
-
value !== undefined &&
|
|
169
|
-
(!Array.isArray(value) || value.length > 0) &&
|
|
170
|
-
(typeof value !== "object" || Object.keys(value).length > 0));
|
|
165
|
+
return value !== null && value !== undefined && (!Array.isArray(value) || value.length > 0) && (typeof value !== 'object' || Object.keys(value).length > 0);
|
|
171
166
|
}
|
|
172
|
-
function parameterFormattedParameterToString({ pairs, pairSeparator =
|
|
173
|
-
return pairs
|
|
174
|
-
.map(({ key, value }) => key !== undefined ? `${key}${keyValueSeparator}${value}` : value)
|
|
175
|
-
.join(pairSeparator);
|
|
167
|
+
function parameterFormattedParameterToString({ pairs, pairSeparator = '', keyValueSeparator = '' }) {
|
|
168
|
+
return pairs.map(({ key, value }) => key !== undefined ? `${key}${keyValueSeparator}${value}` : value).join(pairSeparator);
|
|
176
169
|
}
|
|
177
170
|
const formatParameter = {
|
|
178
171
|
simple(_key, value, explode) {
|
|
179
172
|
if (!parameterHasValue(value)) {
|
|
180
173
|
return {
|
|
181
|
-
pairs: []
|
|
174
|
+
pairs: []
|
|
182
175
|
};
|
|
183
176
|
}
|
|
184
177
|
if (Array.isArray(value)) {
|
|
185
178
|
return {
|
|
186
|
-
pairs: [
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
},
|
|
190
|
-
],
|
|
179
|
+
pairs: [{
|
|
180
|
+
value: value.join(',')
|
|
181
|
+
}]
|
|
191
182
|
};
|
|
192
183
|
}
|
|
193
|
-
if (typeof value ===
|
|
184
|
+
if (typeof value === 'object' && value !== null) {
|
|
194
185
|
return {
|
|
195
|
-
pairs: [
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
.map(([key, val]) => `${key}${explode ? "=" : ","}${val}`)
|
|
199
|
-
.join(","),
|
|
200
|
-
},
|
|
201
|
-
],
|
|
186
|
+
pairs: [{
|
|
187
|
+
value: Object.entries(value).map(([key, val]) => `${key}${explode ? '=' : ','}${val}`).join(',')
|
|
188
|
+
}]
|
|
202
189
|
};
|
|
203
190
|
}
|
|
204
191
|
return {
|
|
205
|
-
pairs: [
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
},
|
|
209
|
-
],
|
|
192
|
+
pairs: [{
|
|
193
|
+
value: String(value)
|
|
194
|
+
}]
|
|
210
195
|
};
|
|
211
196
|
},
|
|
212
197
|
label(_key, value, explode) {
|
|
213
198
|
if (!parameterHasValue(value)) {
|
|
214
199
|
return {
|
|
215
|
-
pairs: [
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
},
|
|
219
|
-
],
|
|
200
|
+
pairs: [{
|
|
201
|
+
value: '.'
|
|
202
|
+
}]
|
|
220
203
|
};
|
|
221
204
|
}
|
|
222
205
|
if (Array.isArray(value)) {
|
|
223
206
|
return {
|
|
224
|
-
pairs: [
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
},
|
|
228
|
-
],
|
|
207
|
+
pairs: [{
|
|
208
|
+
value: '.' + value.join('.')
|
|
209
|
+
}]
|
|
229
210
|
};
|
|
230
211
|
}
|
|
231
|
-
if (typeof value ===
|
|
212
|
+
if (typeof value === 'object' && value !== null) {
|
|
232
213
|
return {
|
|
233
|
-
pairs: [
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
.map(([key, val]) => `.${key}${explode ? "=" : "."}${val}`)
|
|
237
|
-
.join(""),
|
|
238
|
-
},
|
|
239
|
-
],
|
|
214
|
+
pairs: [{
|
|
215
|
+
value: Object.entries(value).map(([key, val]) => `.${key}${explode ? '=' : '.'}${val}`).join('')
|
|
216
|
+
}]
|
|
240
217
|
};
|
|
241
218
|
}
|
|
242
219
|
return {
|
|
243
|
-
pairs: [
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
},
|
|
247
|
-
],
|
|
220
|
+
pairs: [{
|
|
221
|
+
value: '.' + String(value)
|
|
222
|
+
}]
|
|
248
223
|
};
|
|
249
224
|
},
|
|
250
225
|
matrix(key, value, explode) {
|
|
251
226
|
if (!parameterHasValue(value)) {
|
|
252
227
|
return {
|
|
253
|
-
pairs: [
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
},
|
|
257
|
-
],
|
|
228
|
+
pairs: [{
|
|
229
|
+
value: `;${key}`
|
|
230
|
+
}]
|
|
258
231
|
};
|
|
259
232
|
}
|
|
260
233
|
if (Array.isArray(value)) {
|
|
261
234
|
return {
|
|
262
|
-
pairs: [
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
? value.map((val) => `;${key}=${val}`).join("")
|
|
266
|
-
: `;${key}=${value.join(",")}`,
|
|
267
|
-
},
|
|
268
|
-
],
|
|
235
|
+
pairs: [{
|
|
236
|
+
value: explode ? value.map(val => `;${key}=${val}`).join('') : `;${key}=${value.join(',')}`
|
|
237
|
+
}]
|
|
269
238
|
};
|
|
270
239
|
}
|
|
271
|
-
if (typeof value ===
|
|
240
|
+
if (typeof value === 'object') {
|
|
272
241
|
return {
|
|
273
|
-
pairs: [
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
? Object.entries(value)
|
|
277
|
-
.map(([subKey, subValue]) => `;${subKey}=${subValue}`)
|
|
278
|
-
.join("")
|
|
279
|
-
: `;${key}=${Object.entries(value)
|
|
280
|
-
.map(([subKey, subValue]) => `${subKey},${subValue}`)
|
|
281
|
-
.join(",")}`,
|
|
282
|
-
},
|
|
283
|
-
],
|
|
242
|
+
pairs: [{
|
|
243
|
+
value: explode ? Object.entries(value).map(([subKey, subValue]) => `;${subKey}=${subValue}`).join('') : `;${key}=${Object.entries(value).map(([subKey, subValue]) => `${subKey},${subValue}`).join(',')}`
|
|
244
|
+
}]
|
|
284
245
|
};
|
|
285
246
|
}
|
|
286
247
|
return {
|
|
287
|
-
pairs: [
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
},
|
|
291
|
-
],
|
|
248
|
+
pairs: [{
|
|
249
|
+
value: `;${key}=${String(value)}`
|
|
250
|
+
}]
|
|
292
251
|
};
|
|
293
252
|
},
|
|
294
253
|
form(key, value, explode) {
|
|
295
254
|
if (!parameterHasValue(value)) {
|
|
296
255
|
return {
|
|
297
|
-
pairs: []
|
|
256
|
+
pairs: []
|
|
298
257
|
};
|
|
299
258
|
}
|
|
300
259
|
if (Array.isArray(value)) {
|
|
301
260
|
return {
|
|
302
|
-
pairs: explode
|
|
303
|
-
|
|
261
|
+
pairs: explode ? value.map(val => ({
|
|
262
|
+
key,
|
|
263
|
+
value: String(val)
|
|
264
|
+
})) : [{
|
|
304
265
|
key,
|
|
305
|
-
value:
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
key,
|
|
310
|
-
value: value.join(","),
|
|
311
|
-
},
|
|
312
|
-
],
|
|
313
|
-
pairSeparator: "&",
|
|
314
|
-
keyValueSeparator: "=",
|
|
266
|
+
value: value.join(',')
|
|
267
|
+
}],
|
|
268
|
+
pairSeparator: '&',
|
|
269
|
+
keyValueSeparator: '='
|
|
315
270
|
};
|
|
316
271
|
}
|
|
317
|
-
if (typeof value ===
|
|
272
|
+
if (typeof value === 'object') {
|
|
318
273
|
return {
|
|
319
|
-
pairs: explode
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
.map(([subKey, subValue]) => `${subKey},${subValue}`)
|
|
329
|
-
.join(","),
|
|
330
|
-
},
|
|
331
|
-
],
|
|
332
|
-
pairSeparator: "&",
|
|
333
|
-
keyValueSeparator: "=",
|
|
274
|
+
pairs: explode ? Object.entries(value).map(([subKey, subValue]) => ({
|
|
275
|
+
key: subKey,
|
|
276
|
+
value: String(subValue)
|
|
277
|
+
})) : [{
|
|
278
|
+
key,
|
|
279
|
+
value: Object.entries(value).map(([subKey, subValue]) => `${subKey},${subValue}`).join(',')
|
|
280
|
+
}],
|
|
281
|
+
pairSeparator: '&',
|
|
282
|
+
keyValueSeparator: '='
|
|
334
283
|
};
|
|
335
284
|
}
|
|
336
285
|
return {
|
|
337
|
-
pairs: [
|
|
338
|
-
{
|
|
286
|
+
pairs: [{
|
|
339
287
|
key,
|
|
340
|
-
value: String(value)
|
|
341
|
-
}
|
|
342
|
-
],
|
|
288
|
+
value: String(value)
|
|
289
|
+
}]
|
|
343
290
|
};
|
|
344
291
|
},
|
|
345
292
|
spaceDelimited(key, value) {
|
|
346
293
|
if (!parameterHasValue(value)) {
|
|
347
294
|
return {
|
|
348
|
-
pairs: []
|
|
295
|
+
pairs: []
|
|
349
296
|
};
|
|
350
297
|
}
|
|
351
298
|
if (Array.isArray(value)) {
|
|
352
299
|
return {
|
|
353
|
-
pairs: [
|
|
354
|
-
{
|
|
300
|
+
pairs: [{
|
|
355
301
|
key,
|
|
356
|
-
value: value.join(
|
|
357
|
-
}
|
|
358
|
-
],
|
|
302
|
+
value: value.join(' ')
|
|
303
|
+
}]
|
|
359
304
|
};
|
|
360
305
|
}
|
|
361
|
-
if (typeof value ===
|
|
306
|
+
if (typeof value === 'object') {
|
|
362
307
|
return {
|
|
363
|
-
pairs: [
|
|
364
|
-
{
|
|
308
|
+
pairs: [{
|
|
365
309
|
key,
|
|
366
|
-
value: Object.entries(value)
|
|
367
|
-
|
|
368
|
-
.join(" "),
|
|
369
|
-
},
|
|
370
|
-
],
|
|
310
|
+
value: Object.entries(value).map(([subKey, subValue]) => `${subKey} ${subValue}`).join(' ')
|
|
311
|
+
}]
|
|
371
312
|
};
|
|
372
313
|
}
|
|
373
314
|
return {
|
|
374
|
-
pairs: [
|
|
375
|
-
{
|
|
315
|
+
pairs: [{
|
|
376
316
|
key,
|
|
377
|
-
value: String(value)
|
|
378
|
-
}
|
|
379
|
-
],
|
|
317
|
+
value: String(value)
|
|
318
|
+
}]
|
|
380
319
|
};
|
|
381
320
|
},
|
|
382
321
|
pipeDelimited(key, value) {
|
|
383
322
|
if (!parameterHasValue(value)) {
|
|
384
323
|
return {
|
|
385
|
-
pairs: []
|
|
324
|
+
pairs: []
|
|
386
325
|
};
|
|
387
326
|
}
|
|
388
327
|
if (Array.isArray(value)) {
|
|
389
328
|
return {
|
|
390
|
-
pairs: [
|
|
391
|
-
{
|
|
329
|
+
pairs: [{
|
|
392
330
|
key,
|
|
393
|
-
value: value.join(
|
|
394
|
-
}
|
|
395
|
-
],
|
|
331
|
+
value: value.join('|')
|
|
332
|
+
}]
|
|
396
333
|
};
|
|
397
334
|
}
|
|
398
|
-
if (typeof value ===
|
|
335
|
+
if (typeof value === 'object') {
|
|
399
336
|
return {
|
|
400
|
-
pairs: [
|
|
401
|
-
{
|
|
337
|
+
pairs: [{
|
|
402
338
|
key,
|
|
403
|
-
value: Object.entries(value)
|
|
404
|
-
|
|
405
|
-
.join("|"),
|
|
406
|
-
},
|
|
407
|
-
],
|
|
339
|
+
value: Object.entries(value).map(([subKey, subValue]) => `${subKey}|${subValue}`).join('|')
|
|
340
|
+
}]
|
|
408
341
|
};
|
|
409
342
|
}
|
|
410
343
|
return {
|
|
411
|
-
pairs: [
|
|
412
|
-
{
|
|
344
|
+
pairs: [{
|
|
413
345
|
key,
|
|
414
|
-
value: String(value)
|
|
415
|
-
}
|
|
416
|
-
],
|
|
346
|
+
value: String(value)
|
|
347
|
+
}]
|
|
417
348
|
};
|
|
418
349
|
},
|
|
419
350
|
deepObject(key, value) {
|
|
420
|
-
if (typeof value ===
|
|
351
|
+
if (typeof value === 'object' && !Array.isArray(value) && value !== null) {
|
|
421
352
|
return {
|
|
422
|
-
pairs: Object.entries(value).flatMap(([subKey, subValue]) => formatParameter.deepObject(`${key}[${subKey}]`, subValue, true)
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
keyValueSeparator: "=",
|
|
353
|
+
pairs: Object.entries(value).flatMap(([subKey, subValue]) => formatParameter.deepObject(`${key}[${subKey}]`, subValue, true).pairs),
|
|
354
|
+
pairSeparator: '&',
|
|
355
|
+
keyValueSeparator: '='
|
|
426
356
|
};
|
|
427
357
|
}
|
|
428
358
|
return {
|
|
429
|
-
pairs: [
|
|
430
|
-
{
|
|
359
|
+
pairs: [{
|
|
431
360
|
key,
|
|
432
|
-
value: String(value)
|
|
433
|
-
}
|
|
434
|
-
],
|
|
361
|
+
value: String(value)
|
|
362
|
+
}]
|
|
435
363
|
};
|
|
436
|
-
}
|
|
364
|
+
}
|
|
437
365
|
};
|
|
366
|
+
/**
|
|
367
|
+
* Stores the deprecation warning state. For every shown deprecation warning, the method and path are stored in order to
|
|
368
|
+
* avoid showing the same warning appearing multiple times.
|
|
369
|
+
*/
|
|
370
|
+
const deprecationWarningShown = {};
|
|
438
371
|
/** Common HTTP client. Configurable for different environments. */
|
|
439
372
|
class CommonHttpClient {
|
|
440
373
|
constructor(options) {
|
|
@@ -448,12 +381,34 @@ class CommonHttpClient {
|
|
|
448
381
|
getOptions() {
|
|
449
382
|
return this.options;
|
|
450
383
|
}
|
|
384
|
+
/** Logs a deprecation warning if the operation is deprecated. */
|
|
385
|
+
logDeprecationWarningIfNecessary(params) {
|
|
386
|
+
var _a;
|
|
387
|
+
const methodAndPath = `${params.method} ${params.path}`;
|
|
388
|
+
const operationName = (_a = this.options.deprecatedOperations) === null || _a === void 0 ? void 0 : _a[methodAndPath];
|
|
389
|
+
if (!operationName) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
if (!deprecationWarningShown[methodAndPath]) {
|
|
393
|
+
deprecationWarningShown[methodAndPath] = true;
|
|
394
|
+
if (this.options.logDeprecationWarning) {
|
|
395
|
+
this.options.logDeprecationWarning({
|
|
396
|
+
method: params.method,
|
|
397
|
+
path: params.path,
|
|
398
|
+
operationName
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
console.warn(`Deprecated API call ${this.options.apiClientClassName}.${operationName}: ${methodAndPath}`);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
451
406
|
/** Turns an object with query params into a URLSearchParams object. */
|
|
452
407
|
getSearchParams(params, parameters) {
|
|
453
408
|
var _a;
|
|
454
409
|
const result = new URLSearchParams();
|
|
455
410
|
for (const [key, value] of Object.entries(params)) {
|
|
456
|
-
const { style =
|
|
411
|
+
const { style = 'form', explode = style === 'form' } = (_a = parameters[key]) !== null && _a !== void 0 ? _a : {};
|
|
457
412
|
const { pairs } = formatParameter[style](key, value, explode);
|
|
458
413
|
for (const { key, value } of pairs) {
|
|
459
414
|
if (key !== undefined) {
|
|
@@ -470,7 +425,7 @@ class CommonHttpClient {
|
|
|
470
425
|
return request.path.replace(/\{(.*?)}/g, (original, paramName) => {
|
|
471
426
|
var _a;
|
|
472
427
|
if (Object.prototype.hasOwnProperty.call(pathParams, paramName)) {
|
|
473
|
-
const { style =
|
|
428
|
+
const { style = 'simple', explode = false } = (_a = parameters[paramName]) !== null && _a !== void 0 ? _a : {};
|
|
474
429
|
return encodeURI(parameterFormattedParameterToString(formatParameter[style](paramName, pathParams[paramName], explode)));
|
|
475
430
|
}
|
|
476
431
|
return original;
|
|
@@ -481,7 +436,7 @@ class CommonHttpClient {
|
|
|
481
436
|
/** Build the full URL from the request. */
|
|
482
437
|
buildUrl(request) {
|
|
483
438
|
var _a, _b, _c, _d;
|
|
484
|
-
const url = new URL(this.buildUrlPath(request, (_b = (_a = request.parameters) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : {}).replace(/^\//,
|
|
439
|
+
const url = new URL(this.buildUrlPath(request, (_b = (_a = request.parameters) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : {}).replace(/^\//, ''), this.options.baseUrl.replace(/\/?$/, '/'));
|
|
485
440
|
if (request.query) {
|
|
486
441
|
for (const [key, value] of this.getSearchParams(request.query, (_d = (_c = request.parameters) === null || _c === void 0 ? void 0 : _c.query) !== null && _d !== void 0 ? _d : {})) {
|
|
487
442
|
url.searchParams.append(key, value);
|
|
@@ -496,22 +451,19 @@ class CommonHttpClient {
|
|
|
496
451
|
const requestProps = __rest(request, []);
|
|
497
452
|
const requestInit = requestProps;
|
|
498
453
|
const response = yield fetch(url, requestInit);
|
|
499
|
-
const body = isJsonMediaType((_a = response.headers.get(
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
:
|
|
505
|
-
|
|
506
|
-
data: yield response.blob(),
|
|
507
|
-
};
|
|
454
|
+
const body = isJsonMediaType((_a = response.headers.get('content-type')) !== null && _a !== void 0 ? _a : '') ? {
|
|
455
|
+
type: 'json',
|
|
456
|
+
data: yield response.json()
|
|
457
|
+
} : {
|
|
458
|
+
type: 'blob',
|
|
459
|
+
data: yield response.blob()
|
|
460
|
+
};
|
|
508
461
|
const headers = {};
|
|
509
462
|
response.headers.forEach((value, key) => {
|
|
510
463
|
headers[key] = value;
|
|
511
464
|
});
|
|
512
|
-
if (response.headers.has(
|
|
513
|
-
|
|
514
|
-
headers["set-cookie"] = response.headers.getSetCookie();
|
|
465
|
+
if (response.headers.has('set-cookie') && 'getSetCookie' in response.headers) {
|
|
466
|
+
headers['set-cookie'] = response.headers.getSetCookie();
|
|
515
467
|
}
|
|
516
468
|
return {
|
|
517
469
|
status: response.status,
|
|
@@ -520,13 +472,14 @@ class CommonHttpClient {
|
|
|
520
472
|
url: response.url,
|
|
521
473
|
headers,
|
|
522
474
|
ok: response.ok,
|
|
523
|
-
customRequestProps: request.customRequestProps
|
|
475
|
+
customRequestProps: request.customRequestProps
|
|
524
476
|
};
|
|
525
477
|
});
|
|
526
478
|
}
|
|
527
479
|
/** Perform a request. */
|
|
528
480
|
request(request) {
|
|
529
481
|
return __awaiter(this, void 0, void 0, function* () {
|
|
482
|
+
this.logDeprecationWarningIfNecessary(request);
|
|
530
483
|
try {
|
|
531
484
|
request = yield this.preprocessRequest(request);
|
|
532
485
|
}
|
|
@@ -549,7 +502,7 @@ class CommonHttpClient {
|
|
|
549
502
|
}
|
|
550
503
|
const { body, path: _path, pathParams: _pathParams, query: _query, headers: requestHeaders, cache, credentials, redirect } = request, otherRequestProps = __rest(request, ["body", "path", "pathParams", "query", "headers", "cache", "credentials", "redirect"]);
|
|
551
504
|
const headers = this.cleanupHeaders(requestHeaders);
|
|
552
|
-
const fetchRequest = Object.assign(Object.assign({}, otherRequestProps), { headers, cache: cache !== null && cache !== void 0 ? cache :
|
|
505
|
+
const fetchRequest = Object.assign(Object.assign({}, otherRequestProps), { headers, cache: cache !== null && cache !== void 0 ? cache : 'default', credentials: credentials !== null && credentials !== void 0 ? credentials : 'same-origin', redirect: redirect !== null && redirect !== void 0 ? redirect : 'follow', body: this.getRequestBody(request) });
|
|
553
506
|
let fetchResponse;
|
|
554
507
|
try {
|
|
555
508
|
if (this.options.fetch) {
|
|
@@ -571,9 +524,7 @@ class CommonHttpClient {
|
|
|
571
524
|
}
|
|
572
525
|
}
|
|
573
526
|
if (!fetchResponse.ok) {
|
|
574
|
-
throw new this.options.errorClass(url, fetchRequest, fetchResponse, this.options, this.options.formatHttpErrorMessage
|
|
575
|
-
? this.options.formatHttpErrorMessage(fetchResponse, fetchRequest)
|
|
576
|
-
: `HTTP Error ${fetchResponse.status} (${fetchResponse.statusText})`);
|
|
527
|
+
throw new this.options.errorClass(url, fetchRequest, fetchResponse, this.options, this.options.formatHttpErrorMessage ? this.options.formatHttpErrorMessage(fetchResponse, fetchRequest) : `HTTP Error ${request.method} ${url.toString()} ${fetchResponse.status} (${fetchResponse.statusText})`);
|
|
577
528
|
}
|
|
578
529
|
return fetchResponse;
|
|
579
530
|
});
|
|
@@ -583,26 +534,24 @@ class CommonHttpClient {
|
|
|
583
534
|
return (response) => __awaiter(this, void 0, void 0, function* () {
|
|
584
535
|
var _a;
|
|
585
536
|
const body = response.body;
|
|
586
|
-
const contentType = response.headers[
|
|
587
|
-
const mediaType = contentType
|
|
588
|
-
? contentType.replace(/;.*$/, "")
|
|
589
|
-
: undefined;
|
|
537
|
+
const contentType = response.headers['content-type'];
|
|
538
|
+
const mediaType = contentType ? contentType.replace(/;.*$/, '') : undefined;
|
|
590
539
|
const mediaTypes = (_a = distribution[response.status]) !== null && _a !== void 0 ? _a : {};
|
|
591
540
|
let destType;
|
|
592
541
|
if (mediaType) {
|
|
593
542
|
destType = mediaTypes[mediaType];
|
|
594
543
|
if (!destType) {
|
|
595
|
-
destType = mediaTypes[mediaType.replace(/\/.*$/,
|
|
544
|
+
destType = mediaTypes[mediaType.replace(/\/.*$/, '/*')];
|
|
596
545
|
}
|
|
597
546
|
if (!destType) {
|
|
598
|
-
destType = mediaTypes[mediaType.replace(/^.*\//,
|
|
547
|
+
destType = mediaTypes[mediaType.replace(/^.*\//, '*/')];
|
|
599
548
|
}
|
|
600
549
|
if (!destType) {
|
|
601
|
-
destType = mediaTypes[
|
|
550
|
+
destType = mediaTypes['*/*'];
|
|
602
551
|
}
|
|
603
552
|
}
|
|
604
553
|
else {
|
|
605
|
-
destType = mediaTypes[
|
|
554
|
+
destType = mediaTypes['*/*'];
|
|
606
555
|
}
|
|
607
556
|
if (!destType) {
|
|
608
557
|
let binaryBody;
|
|
@@ -616,7 +565,7 @@ class CommonHttpClient {
|
|
|
616
565
|
mediaType,
|
|
617
566
|
status: response.status,
|
|
618
567
|
body: binaryBody,
|
|
619
|
-
response
|
|
568
|
+
response
|
|
620
569
|
};
|
|
621
570
|
}
|
|
622
571
|
try {
|
|
@@ -625,7 +574,7 @@ class CommonHttpClient {
|
|
|
625
574
|
mediaType,
|
|
626
575
|
status: response.status,
|
|
627
576
|
body: convertedBody.data,
|
|
628
|
-
response
|
|
577
|
+
response
|
|
629
578
|
};
|
|
630
579
|
}
|
|
631
580
|
catch (e) {
|
|
@@ -653,9 +602,7 @@ class CommonHttpClient {
|
|
|
653
602
|
if (headers === undefined) {
|
|
654
603
|
return {};
|
|
655
604
|
}
|
|
656
|
-
return Object.fromEntries(Object.entries(headers !== null && headers !== void 0 ? headers : {})
|
|
657
|
-
.filter((header) => header[1] !== undefined && header[1] !== null)
|
|
658
|
-
.map(([key, value]) => [key.toLowerCase(), value]));
|
|
605
|
+
return Object.fromEntries(Object.entries(headers !== null && headers !== void 0 ? headers : {}).filter((header) => header[1] !== undefined && header[1] !== null).map(([key, value]) => [key.toLowerCase(), value]));
|
|
659
606
|
}
|
|
660
607
|
getRequestBody(request) {
|
|
661
608
|
var _a;
|
|
@@ -663,9 +610,7 @@ class CommonHttpClient {
|
|
|
663
610
|
return undefined;
|
|
664
611
|
}
|
|
665
612
|
for (const [key, value] of Object.entries((_a = request.headers) !== null && _a !== void 0 ? _a : {})) {
|
|
666
|
-
if (key.toLowerCase() ===
|
|
667
|
-
value &&
|
|
668
|
-
isJsonMediaType(value)) {
|
|
613
|
+
if (key.toLowerCase() === 'content-type' && value && isJsonMediaType(value)) {
|
|
669
614
|
return JSON.stringify(request.body);
|
|
670
615
|
}
|
|
671
616
|
}
|
|
@@ -674,9 +619,7 @@ class CommonHttpClient {
|
|
|
674
619
|
preprocessRequest(request) {
|
|
675
620
|
return __awaiter(this, void 0, void 0, function* () {
|
|
676
621
|
const requestWithHeaders = Object.assign(Object.assign({}, request), { headers: Object.assign(Object.assign({}, this.options.headers), this.cleanupHeaders(request.headers)) });
|
|
677
|
-
return this.options.preprocessRequest
|
|
678
|
-
? this.options.preprocessRequest(requestWithHeaders)
|
|
679
|
-
: requestWithHeaders;
|
|
622
|
+
return this.options.preprocessRequest ? this.options.preprocessRequest(requestWithHeaders) : requestWithHeaders;
|
|
680
623
|
});
|
|
681
624
|
}
|
|
682
625
|
}
|