@api-client/core 0.20.10 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/bin/test.ts +0 -16
- package/build/src/browser.d.ts +0 -19
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +0 -31
- package/build/src/browser.js.map +1 -1
- package/build/src/events/EventTypes.d.ts +0 -40
- package/build/src/events/EventTypes.d.ts.map +1 -1
- package/build/src/events/EventTypes.js +0 -8
- package/build/src/events/EventTypes.js.map +1 -1
- package/build/src/events/Events.d.ts +0 -20
- package/build/src/events/Events.d.ts.map +1 -1
- package/build/src/events/Events.js +0 -8
- package/build/src/events/Events.js.map +1 -1
- package/build/src/events/index.d.ts +0 -3
- package/build/src/events/index.d.ts.map +1 -1
- package/build/src/events/index.js.map +1 -1
- package/build/src/index.d.ts +0 -31
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +0 -55
- package/build/src/index.js.map +1 -1
- package/build/src/lib/headers/Headers.d.ts +0 -9
- package/build/src/lib/headers/Headers.d.ts.map +1 -1
- package/build/src/lib/headers/Headers.js +0 -20
- package/build/src/lib/headers/Headers.js.map +1 -1
- package/build/src/mocking/lib/File.d.ts.map +1 -1
- package/build/src/mocking/lib/File.js +3 -5
- package/build/src/mocking/lib/File.js.map +1 -1
- package/build/src/mocking/lib/Trash.d.ts.map +1 -1
- package/build/src/mocking/lib/Trash.js +2 -8
- package/build/src/mocking/lib/Trash.js.map +1 -1
- package/build/src/models/Folder.d.ts +1 -1
- package/build/src/models/Folder.d.ts.map +1 -1
- package/build/src/models/Folder.js +3 -3
- package/build/src/models/Folder.js.map +1 -1
- package/build/src/models/index.d.ts +1 -51
- package/build/src/models/index.d.ts.map +1 -1
- package/build/src/models/index.js +1 -56
- package/build/src/models/index.js.map +1 -1
- package/build/src/models/kinds.d.ts +1 -6
- package/build/src/models/kinds.d.ts.map +1 -1
- package/build/src/models/kinds.js +1 -6
- package/build/src/models/kinds.js.map +1 -1
- package/build/src/sdk/FilesSdk.d.ts +8 -8
- package/build/src/sdk/FilesSdk.d.ts.map +1 -1
- package/build/src/sdk/FilesSdk.js +3 -3
- package/build/src/sdk/FilesSdk.js.map +1 -1
- package/build/src/sdk/HttpWeb.d.ts +1 -0
- package/build/src/sdk/HttpWeb.d.ts.map +1 -1
- package/build/src/sdk/HttpWeb.js +27 -2
- package/build/src/sdk/HttpWeb.js.map +1 -1
- package/build/src/sdk/RouteBuilder.d.ts +2 -2
- package/build/src/sdk/RouteBuilder.d.ts.map +1 -1
- package/build/src/sdk/RouteBuilder.js.map +1 -1
- package/build/src/sdk/Sdk.d.ts +0 -20
- package/build/src/sdk/Sdk.d.ts.map +1 -1
- package/build/src/sdk/Sdk.js +0 -15
- package/build/src/sdk/Sdk.js.map +1 -1
- package/build/src/sdk/SdkMock.js +1 -1
- package/build/src/sdk/SdkMock.js.map +1 -1
- package/build/src/sdk/SdkNetworkMock.d.ts +323 -0
- package/build/src/sdk/SdkNetworkMock.d.ts.map +1 -0
- package/build/src/sdk/SdkNetworkMock.js +1196 -0
- package/build/src/sdk/SdkNetworkMock.js.map +1 -0
- package/build/src/sdk/StoreSdkNode.d.ts +0 -2
- package/build/src/sdk/StoreSdkNode.d.ts.map +1 -1
- package/build/src/sdk/StoreSdkNode.js +0 -2
- package/build/src/sdk/StoreSdkNode.js.map +1 -1
- package/build/src/sdk/StoreSdkWeb.d.ts +0 -2
- package/build/src/sdk/StoreSdkWeb.d.ts.map +1 -1
- package/build/src/sdk/StoreSdkWeb.js +0 -2
- package/build/src/sdk/StoreSdkWeb.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -0
- package/eslint.config.js +0 -4
- package/knip.json +10 -0
- package/lupa.config.ts +43 -0
- package/package.json +25 -67
- package/src/events/EventTypes.ts +0 -8
- package/src/events/Events.ts +0 -8
- package/src/lib/headers/Headers.ts +0 -22
- package/src/mocking/lib/File.ts +3 -6
- package/src/mocking/lib/Trash.ts +2 -8
- package/src/models/Folder.ts +3 -3
- package/src/models/kinds.ts +1 -6
- package/src/sdk/FilesSdk.ts +10 -10
- package/src/sdk/HttpWeb.ts +27 -2
- package/src/sdk/RouteBuilder.ts +2 -2
- package/src/sdk/Sdk.ts +0 -21
- package/src/sdk/SdkMock.ts +1 -1
- package/src/sdk/SdkNetworkMock.ts +1607 -0
- package/src/sdk/StoreSdkNode.ts +0 -3
- package/src/sdk/StoreSdkWeb.ts +0 -3
- package/tests/client/env.ts +11 -0
- package/tests/client/lib/dom_purify.spec.ts +12 -0
- package/tests/client/sdk/DataCatalog.spec.ts +565 -0
- package/tests/client/sdk/Deployments.spec.ts +214 -0
- package/tests/client/sdk/FilesSdk.spec.ts +716 -0
- package/tests/client/sdk/groups.spec.ts +244 -0
- package/tests/client/sdk/network-mock/ai-mock.spec.ts +124 -0
- package/tests/client/sdk/network-mock/deployments-mock.spec.ts +182 -0
- package/tests/client/sdk/network-mock/files-mock.spec.ts +119 -0
- package/tests/client/sdk/network-mock/groups-mock.spec.ts +83 -0
- package/tests/client/sdk/network-mock/organizations-mock.spec.ts +129 -0
- package/tests/client/sdk/network-mock/shared-mock.spec.ts +25 -0
- package/tests/client/sdk/network-mock/trash-mock.spec.ts +43 -0
- package/tests/client/sdk/network-mock/users-mock.spec.ts +79 -0
- package/tests/client/sdk/organizations.spec.ts +2468 -0
- package/tests/client/src/platform.spec.ts +14 -0
- package/tests/unit/mocking/current/File.spec.ts +5 -5
- package/tests/unit/mocking/current/Trash.spec.ts +5 -5
- package/tests/unit/modeling/RuntimeApiModel.spec.ts +24 -4
- package/tests/unit/models/File/createFileCapabilities.spec.ts +3 -2
- package/tsconfig.build.json +8 -0
- package/RELEASE.md +0 -163
- package/RELEASE_SETUP.md +0 -237
- package/TESTING_SETUP.md +0 -198
- package/Testing.md +0 -21
- package/amf-models/dialects/ApiProjectVocabulary.yaml +0 -233
- package/amf-models/dialects/Environment.yaml +0 -38
- package/amf-models/dialects/HttpProject.yaml +0 -55
- package/amf-models/dialects/License.yaml +0 -31
- package/amf-models/dialects/ProjectFolder.yaml +0 -43
- package/amf-models/dialects/ProjectItem.yaml +0 -22
- package/amf-models/dialects/ProjectRequest.yaml +0 -23
- package/amf-models/dialects/ProjectSchema.yaml +0 -36
- package/amf-models/dialects/Property.yaml +0 -43
- package/amf-models/dialects/Provider.yaml +0 -32
- package/amf-models/dialects/Server.yaml +0 -31
- package/amf-models/dialects/Thing.yaml +0 -28
- package/bin/context.ts +0 -22
- package/bin/server.ts +0 -83
- package/build/src/authorization/AuthorizationError.d.ts +0 -24
- package/build/src/authorization/AuthorizationError.d.ts.map +0 -1
- package/build/src/authorization/AuthorizationError.js +0 -32
- package/build/src/authorization/AuthorizationError.js.map +0 -1
- package/build/src/authorization/CustomParameters.d.ts +0 -25
- package/build/src/authorization/CustomParameters.d.ts.map +0 -1
- package/build/src/authorization/CustomParameters.js +0 -61
- package/build/src/authorization/CustomParameters.js.map +0 -1
- package/build/src/authorization/OAuth2Authorization.d.ts +0 -333
- package/build/src/authorization/OAuth2Authorization.d.ts.map +0 -1
- package/build/src/authorization/OAuth2Authorization.js +0 -963
- package/build/src/authorization/OAuth2Authorization.js.map +0 -1
- package/build/src/authorization/OidcAuthorization.d.ts +0 -36
- package/build/src/authorization/OidcAuthorization.d.ts.map +0 -1
- package/build/src/authorization/OidcAuthorization.js +0 -146
- package/build/src/authorization/OidcAuthorization.js.map +0 -1
- package/build/src/authorization/Utils.d.ts +0 -52
- package/build/src/authorization/Utils.d.ts.map +0 -1
- package/build/src/authorization/Utils.js +0 -130
- package/build/src/authorization/Utils.js.map +0 -1
- package/build/src/authorization/index.d.ts +0 -10
- package/build/src/authorization/index.d.ts.map +0 -1
- package/build/src/authorization/index.js +0 -10
- package/build/src/authorization/index.js.map +0 -1
- package/build/src/authorization/lib/IframeAuthorization.d.ts +0 -54
- package/build/src/authorization/lib/IframeAuthorization.d.ts.map +0 -1
- package/build/src/authorization/lib/IframeAuthorization.js +0 -115
- package/build/src/authorization/lib/IframeAuthorization.js.map +0 -1
- package/build/src/authorization/lib/KnownGrants.d.ts +0 -7
- package/build/src/authorization/lib/KnownGrants.d.ts.map +0 -1
- package/build/src/authorization/lib/KnownGrants.js +0 -7
- package/build/src/authorization/lib/KnownGrants.js.map +0 -1
- package/build/src/authorization/lib/PopupAuthorization.d.ts +0 -42
- package/build/src/authorization/lib/PopupAuthorization.d.ts.map +0 -1
- package/build/src/authorization/lib/PopupAuthorization.js +0 -73
- package/build/src/authorization/lib/PopupAuthorization.js.map +0 -1
- package/build/src/authorization/lib/SecurityProcessor.d.ts +0 -67
- package/build/src/authorization/lib/SecurityProcessor.d.ts.map +0 -1
- package/build/src/authorization/lib/SecurityProcessor.js +0 -245
- package/build/src/authorization/lib/SecurityProcessor.js.map +0 -1
- package/build/src/authorization/lib/Tokens.d.ts +0 -56
- package/build/src/authorization/lib/Tokens.d.ts.map +0 -1
- package/build/src/authorization/lib/Tokens.js +0 -121
- package/build/src/authorization/lib/Tokens.js.map +0 -1
- package/build/src/authorization/lib/Utils.d.ts +0 -45
- package/build/src/authorization/lib/Utils.d.ts.map +0 -1
- package/build/src/authorization/lib/Utils.js +0 -91
- package/build/src/authorization/lib/Utils.js.map +0 -1
- package/build/src/authorization/types.d.ts +0 -196
- package/build/src/authorization/types.d.ts.map +0 -1
- package/build/src/authorization/types.js +0 -2
- package/build/src/authorization/types.js.map +0 -1
- package/build/src/cookies/CookieJar.d.ts +0 -24
- package/build/src/cookies/CookieJar.d.ts.map +0 -1
- package/build/src/cookies/CookieJar.js +0 -3
- package/build/src/cookies/CookieJar.js.map +0 -1
- package/build/src/cookies/CookieParser.d.ts +0 -81
- package/build/src/cookies/CookieParser.d.ts.map +0 -1
- package/build/src/cookies/CookieParser.js +0 -333
- package/build/src/cookies/CookieParser.js.map +0 -1
- package/build/src/cookies/InMemoryCookieJar.d.ts +0 -13
- package/build/src/cookies/InMemoryCookieJar.d.ts.map +0 -1
- package/build/src/cookies/InMemoryCookieJar.js +0 -68
- package/build/src/cookies/InMemoryCookieJar.js.map +0 -1
- package/build/src/cookies/Punycode.d.ts +0 -13
- package/build/src/cookies/Punycode.d.ts.map +0 -1
- package/build/src/cookies/Punycode.js +0 -127
- package/build/src/cookies/Punycode.js.map +0 -1
- package/build/src/data/DataExtractor.d.ts +0 -66
- package/build/src/data/DataExtractor.d.ts.map +0 -1
- package/build/src/data/DataExtractor.js +0 -178
- package/build/src/data/DataExtractor.js.map +0 -1
- package/build/src/data/DataReader.d.ts +0 -11
- package/build/src/data/DataReader.d.ts.map +0 -1
- package/build/src/data/DataReader.js +0 -4
- package/build/src/data/DataReader.js.map +0 -1
- package/build/src/data/JmespathReader.d.ts +0 -13
- package/build/src/data/JmespathReader.d.ts.map +0 -1
- package/build/src/data/JmespathReader.js +0 -27
- package/build/src/data/JmespathReader.js.map +0 -1
- package/build/src/data/Json2Xml.d.ts +0 -86
- package/build/src/data/Json2Xml.d.ts.map +0 -1
- package/build/src/data/Json2Xml.js +0 -187
- package/build/src/data/Json2Xml.js.map +0 -1
- package/build/src/data/JsonReader.d.ts +0 -9
- package/build/src/data/JsonReader.d.ts.map +0 -1
- package/build/src/data/JsonReader.js +0 -40
- package/build/src/data/JsonReader.js.map +0 -1
- package/build/src/data/PayloadPointer.d.ts +0 -22
- package/build/src/data/PayloadPointer.d.ts.map +0 -1
- package/build/src/data/PayloadPointer.js +0 -48
- package/build/src/data/PayloadPointer.js.map +0 -1
- package/build/src/data/RequestDataExtractor.d.ts +0 -49
- package/build/src/data/RequestDataExtractor.d.ts.map +0 -1
- package/build/src/data/RequestDataExtractor.js +0 -111
- package/build/src/data/RequestDataExtractor.js.map +0 -1
- package/build/src/data/UrlEncodedReader.d.ts +0 -13
- package/build/src/data/UrlEncodedReader.d.ts.map +0 -1
- package/build/src/data/UrlEncodedReader.js +0 -21
- package/build/src/data/UrlEncodedReader.js.map +0 -1
- package/build/src/data/XmlReader.d.ts +0 -15
- package/build/src/data/XmlReader.d.ts.map +0 -1
- package/build/src/data/XmlReader.js +0 -122
- package/build/src/data/XmlReader.js.map +0 -1
- package/build/src/data/index.d.ts +0 -10
- package/build/src/data/index.d.ts.map +0 -1
- package/build/src/data/index.js +0 -10
- package/build/src/data/index.js.map +0 -1
- package/build/src/events/authorization/AuthorizationEventTypes.d.ts +0 -23
- package/build/src/events/authorization/AuthorizationEventTypes.d.ts.map +0 -1
- package/build/src/events/authorization/AuthorizationEventTypes.js +0 -23
- package/build/src/events/authorization/AuthorizationEventTypes.js.map +0 -1
- package/build/src/events/authorization/AuthorizationEvents.d.ts +0 -35
- package/build/src/events/authorization/AuthorizationEvents.d.ts.map +0 -1
- package/build/src/events/authorization/AuthorizationEvents.js +0 -55
- package/build/src/events/authorization/AuthorizationEvents.js.map +0 -1
- package/build/src/events/cookies/CookieEventTypes.d.ts +0 -14
- package/build/src/events/cookies/CookieEventTypes.d.ts.map +0 -1
- package/build/src/events/cookies/CookieEventTypes.js +0 -14
- package/build/src/events/cookies/CookieEventTypes.js.map +0 -1
- package/build/src/events/cookies/CookieEvents.d.ts +0 -92
- package/build/src/events/cookies/CookieEvents.d.ts.map +0 -1
- package/build/src/events/cookies/CookieEvents.js +0 -128
- package/build/src/events/cookies/CookieEvents.js.map +0 -1
- package/build/src/events/environment/EnvironmentEventTypes.d.ts +0 -4
- package/build/src/events/environment/EnvironmentEventTypes.d.ts.map +0 -1
- package/build/src/events/environment/EnvironmentEventTypes.js +0 -4
- package/build/src/events/environment/EnvironmentEventTypes.js.map +0 -1
- package/build/src/events/environment/EnvironmentEvents.d.ts +0 -16
- package/build/src/events/environment/EnvironmentEvents.d.ts.map +0 -1
- package/build/src/events/environment/EnvironmentEvents.js +0 -20
- package/build/src/events/environment/EnvironmentEvents.js.map +0 -1
- package/build/src/events/transport/TransportEventTypes.d.ts +0 -30
- package/build/src/events/transport/TransportEventTypes.d.ts.map +0 -1
- package/build/src/events/transport/TransportEventTypes.js +0 -31
- package/build/src/events/transport/TransportEventTypes.js.map +0 -1
- package/build/src/events/transport/TransportEvents.d.ts +0 -63
- package/build/src/events/transport/TransportEvents.d.ts.map +0 -1
- package/build/src/events/transport/TransportEvents.js +0 -77
- package/build/src/events/transport/TransportEvents.js.map +0 -1
- package/build/src/legacy.d.ts +0 -40
- package/build/src/legacy.d.ts.map +0 -1
- package/build/src/legacy.js +0 -40
- package/build/src/legacy.js.map +0 -1
- package/build/src/lib/Buffer.d.ts +0 -21
- package/build/src/lib/Buffer.d.ts.map +0 -1
- package/build/src/lib/Buffer.js +0 -57
- package/build/src/lib/Buffer.js.map +0 -1
- package/build/src/lib/definitions/HttpDefinitions.d.ts +0 -35
- package/build/src/lib/definitions/HttpDefinitions.d.ts.map +0 -1
- package/build/src/lib/definitions/HttpDefinitions.js +0 -59
- package/build/src/lib/definitions/HttpDefinitions.js.map +0 -1
- package/build/src/lib/fs/Fs.d.ts +0 -53
- package/build/src/lib/fs/Fs.d.ts.map +0 -1
- package/build/src/lib/fs/Fs.js +0 -245
- package/build/src/lib/fs/Fs.js.map +0 -1
- package/build/src/lib/headers/HeadersData.d.ts +0 -36
- package/build/src/lib/headers/HeadersData.d.ts.map +0 -1
- package/build/src/lib/headers/HeadersData.js +0 -657
- package/build/src/lib/headers/HeadersData.js.map +0 -1
- package/build/src/lib/parsers/UriTemplate.d.ts +0 -110
- package/build/src/lib/parsers/UriTemplate.d.ts.map +0 -1
- package/build/src/lib/parsers/UriTemplate.js +0 -437
- package/build/src/lib/parsers/UriTemplate.js.map +0 -1
- package/build/src/lib/parsers/UrlEncoder.d.ts +0 -57
- package/build/src/lib/parsers/UrlEncoder.d.ts.map +0 -1
- package/build/src/lib/parsers/UrlEncoder.js +0 -125
- package/build/src/lib/parsers/UrlEncoder.js.map +0 -1
- package/build/src/lib/parsers/UrlParser.d.ts +0 -105
- package/build/src/lib/parsers/UrlParser.d.ts.map +0 -1
- package/build/src/lib/parsers/UrlParser.js +0 -190
- package/build/src/lib/parsers/UrlParser.js.map +0 -1
- package/build/src/lib/parsers/UrlProcessor.d.ts +0 -285
- package/build/src/lib/parsers/UrlProcessor.d.ts.map +0 -1
- package/build/src/lib/parsers/UrlProcessor.js +0 -763
- package/build/src/lib/parsers/UrlProcessor.js.map +0 -1
- package/build/src/lib/parsers/UrlValueParser.d.ts +0 -93
- package/build/src/lib/parsers/UrlValueParser.d.ts.map +0 -1
- package/build/src/lib/parsers/UrlValueParser.js +0 -172
- package/build/src/lib/parsers/UrlValueParser.js.map +0 -1
- package/build/src/lib/timers/Timers.d.ts +0 -15
- package/build/src/lib/timers/Timers.d.ts.map +0 -1
- package/build/src/lib/timers/Timers.js +0 -28
- package/build/src/lib/timers/Timers.js.map +0 -1
- package/build/src/lib/transformers/PayloadSerializer.d.ts +0 -221
- package/build/src/lib/transformers/PayloadSerializer.d.ts.map +0 -1
- package/build/src/lib/transformers/PayloadSerializer.js +0 -423
- package/build/src/lib/transformers/PayloadSerializer.js.map +0 -1
- package/build/src/mocking/LegacyInterfaces.d.ts +0 -47
- package/build/src/mocking/LegacyInterfaces.d.ts.map +0 -1
- package/build/src/mocking/LegacyInterfaces.js +0 -2
- package/build/src/mocking/LegacyInterfaces.js.map +0 -1
- package/build/src/mocking/LegacyMock.d.ts +0 -25
- package/build/src/mocking/LegacyMock.d.ts.map +0 -1
- package/build/src/mocking/LegacyMock.js +0 -34
- package/build/src/mocking/LegacyMock.js.map +0 -1
- package/build/src/mocking/ProjectMock.d.ts +0 -27
- package/build/src/mocking/ProjectMock.d.ts.map +0 -1
- package/build/src/mocking/ProjectMock.js +0 -31
- package/build/src/mocking/ProjectMock.js.map +0 -1
- package/build/src/mocking/legacy/Authorization.d.ts +0 -21
- package/build/src/mocking/legacy/Authorization.d.ts.map +0 -1
- package/build/src/mocking/legacy/Authorization.js +0 -35
- package/build/src/mocking/legacy/Authorization.js.map +0 -1
- package/build/src/mocking/legacy/Certificates.d.ts +0 -57
- package/build/src/mocking/legacy/Certificates.d.ts.map +0 -1
- package/build/src/mocking/legacy/Certificates.js +0 -128
- package/build/src/mocking/legacy/Certificates.js.map +0 -1
- package/build/src/mocking/legacy/Cookies.d.ts +0 -22
- package/build/src/mocking/legacy/Cookies.d.ts.map +0 -1
- package/build/src/mocking/legacy/Cookies.js +0 -48
- package/build/src/mocking/legacy/Cookies.js.map +0 -1
- package/build/src/mocking/legacy/HostRules.d.ts +0 -23
- package/build/src/mocking/legacy/HostRules.d.ts.map +0 -1
- package/build/src/mocking/legacy/HostRules.js +0 -40
- package/build/src/mocking/legacy/HostRules.js.map +0 -1
- package/build/src/mocking/legacy/Http.d.ts +0 -85
- package/build/src/mocking/legacy/Http.d.ts.map +0 -1
- package/build/src/mocking/legacy/Http.js +0 -199
- package/build/src/mocking/legacy/Http.js.map +0 -1
- package/build/src/mocking/legacy/HttpResponse.d.ts +0 -24
- package/build/src/mocking/legacy/HttpResponse.d.ts.map +0 -1
- package/build/src/mocking/legacy/HttpResponse.js +0 -98
- package/build/src/mocking/legacy/HttpResponse.js.map +0 -1
- package/build/src/mocking/legacy/RestApi.d.ts +0 -16
- package/build/src/mocking/legacy/RestApi.d.ts.map +0 -1
- package/build/src/mocking/legacy/RestApi.js +0 -63
- package/build/src/mocking/legacy/RestApi.js.map +0 -1
- package/build/src/mocking/legacy/Urls.d.ts +0 -22
- package/build/src/mocking/legacy/Urls.d.ts.map +0 -1
- package/build/src/mocking/legacy/Urls.js +0 -41
- package/build/src/mocking/legacy/Urls.js.map +0 -1
- package/build/src/mocking/legacy/Variables.d.ts +0 -19
- package/build/src/mocking/legacy/Variables.d.ts.map +0 -1
- package/build/src/mocking/legacy/Variables.js +0 -51
- package/build/src/mocking/legacy/Variables.js.map +0 -1
- package/build/src/mocking/lib/Certificates.d.ts +0 -28
- package/build/src/mocking/lib/Certificates.d.ts.map +0 -1
- package/build/src/mocking/lib/Certificates.js +0 -55
- package/build/src/mocking/lib/Certificates.js.map +0 -1
- package/build/src/mocking/lib/History.d.ts +0 -75
- package/build/src/mocking/lib/History.d.ts.map +0 -1
- package/build/src/mocking/lib/History.js +0 -128
- package/build/src/mocking/lib/History.js.map +0 -1
- package/build/src/mocking/lib/HostRules.d.ts +0 -23
- package/build/src/mocking/lib/HostRules.d.ts.map +0 -1
- package/build/src/mocking/lib/HostRules.js +0 -40
- package/build/src/mocking/lib/HostRules.js.map +0 -1
- package/build/src/mocking/lib/Request.d.ts +0 -44
- package/build/src/mocking/lib/Request.d.ts.map +0 -1
- package/build/src/mocking/lib/Request.js +0 -70
- package/build/src/mocking/lib/Request.js.map +0 -1
- package/build/src/mocking/lib/Response.d.ts +0 -38
- package/build/src/mocking/lib/Response.d.ts.map +0 -1
- package/build/src/mocking/lib/Response.js +0 -99
- package/build/src/mocking/lib/Response.js.map +0 -1
- package/build/src/mocking/lib/Url.d.ts +0 -22
- package/build/src/mocking/lib/Url.d.ts.map +0 -1
- package/build/src/mocking/lib/Url.js +0 -40
- package/build/src/mocking/lib/Url.js.map +0 -1
- package/build/src/models/Authorization.d.ts +0 -452
- package/build/src/models/Authorization.d.ts.map +0 -1
- package/build/src/models/Authorization.js +0 -2
- package/build/src/models/Authorization.js.map +0 -1
- package/build/src/models/AuthorizationData.d.ts +0 -30
- package/build/src/models/AuthorizationData.d.ts.map +0 -1
- package/build/src/models/AuthorizationData.js +0 -59
- package/build/src/models/AuthorizationData.js.map +0 -1
- package/build/src/models/CertificateFile.d.ts +0 -19
- package/build/src/models/CertificateFile.d.ts.map +0 -1
- package/build/src/models/CertificateFile.js +0 -70
- package/build/src/models/CertificateFile.js.map +0 -1
- package/build/src/models/ClientCertificate.d.ts +0 -188
- package/build/src/models/ClientCertificate.d.ts.map +0 -1
- package/build/src/models/ClientCertificate.js +0 -193
- package/build/src/models/ClientCertificate.js.map +0 -1
- package/build/src/models/Environment.d.ts +0 -134
- package/build/src/models/Environment.d.ts.map +0 -1
- package/build/src/models/Environment.js +0 -256
- package/build/src/models/Environment.js.map +0 -1
- package/build/src/models/ErrorResponse.d.ts +0 -37
- package/build/src/models/ErrorResponse.d.ts.map +0 -1
- package/build/src/models/ErrorResponse.js +0 -103
- package/build/src/models/ErrorResponse.js.map +0 -1
- package/build/src/models/HeadersArray.d.ts +0 -22
- package/build/src/models/HeadersArray.d.ts.map +0 -1
- package/build/src/models/HeadersArray.js +0 -58
- package/build/src/models/HeadersArray.js.map +0 -1
- package/build/src/models/HostRule.d.ts +0 -87
- package/build/src/models/HostRule.d.ts.map +0 -1
- package/build/src/models/HostRule.js +0 -142
- package/build/src/models/HostRule.js.map +0 -1
- package/build/src/models/HttpCookie.d.ts +0 -175
- package/build/src/models/HttpCookie.d.ts.map +0 -1
- package/build/src/models/HttpCookie.js +0 -343
- package/build/src/models/HttpCookie.js.map +0 -1
- package/build/src/models/HttpHistory.d.ts +0 -143
- package/build/src/models/HttpHistory.d.ts.map +0 -1
- package/build/src/models/HttpHistory.js +0 -179
- package/build/src/models/HttpHistory.js.map +0 -1
- package/build/src/models/HttpProject.d.ts +0 -540
- package/build/src/models/HttpProject.d.ts.map +0 -1
- package/build/src/models/HttpProject.js +0 -1237
- package/build/src/models/HttpProject.js.map +0 -1
- package/build/src/models/HttpRequest.d.ts +0 -88
- package/build/src/models/HttpRequest.d.ts.map +0 -1
- package/build/src/models/HttpRequest.js +0 -127
- package/build/src/models/HttpRequest.js.map +0 -1
- package/build/src/models/HttpResponse.d.ts +0 -54
- package/build/src/models/HttpResponse.d.ts.map +0 -1
- package/build/src/models/HttpResponse.js +0 -114
- package/build/src/models/HttpResponse.js.map +0 -1
- package/build/src/models/License.d.ts +0 -53
- package/build/src/models/License.d.ts.map +0 -1
- package/build/src/models/License.js +0 -91
- package/build/src/models/License.js.map +0 -1
- package/build/src/models/Project.d.ts +0 -27
- package/build/src/models/Project.d.ts.map +0 -1
- package/build/src/models/Project.js +0 -81
- package/build/src/models/Project.js.map +0 -1
- package/build/src/models/ProjectDefinitionProperty.d.ts +0 -35
- package/build/src/models/ProjectDefinitionProperty.d.ts.map +0 -1
- package/build/src/models/ProjectDefinitionProperty.js +0 -2
- package/build/src/models/ProjectDefinitionProperty.js.map +0 -1
- package/build/src/models/ProjectExecution.d.ts +0 -116
- package/build/src/models/ProjectExecution.d.ts.map +0 -1
- package/build/src/models/ProjectExecution.js +0 -147
- package/build/src/models/ProjectExecution.js.map +0 -1
- package/build/src/models/ProjectFolder.d.ts +0 -219
- package/build/src/models/ProjectFolder.d.ts.map +0 -1
- package/build/src/models/ProjectFolder.js +0 -341
- package/build/src/models/ProjectFolder.js.map +0 -1
- package/build/src/models/ProjectItem.d.ts +0 -68
- package/build/src/models/ProjectItem.d.ts.map +0 -1
- package/build/src/models/ProjectItem.js +0 -139
- package/build/src/models/ProjectItem.js.map +0 -1
- package/build/src/models/ProjectParent.d.ts +0 -27
- package/build/src/models/ProjectParent.d.ts.map +0 -1
- package/build/src/models/ProjectParent.js +0 -19
- package/build/src/models/ProjectParent.js.map +0 -1
- package/build/src/models/ProjectRequest.d.ts +0 -203
- package/build/src/models/ProjectRequest.d.ts.map +0 -1
- package/build/src/models/ProjectRequest.js +0 -440
- package/build/src/models/ProjectRequest.js.map +0 -1
- package/build/src/models/ProjectSchema.d.ts +0 -106
- package/build/src/models/ProjectSchema.d.ts.map +0 -1
- package/build/src/models/ProjectSchema.js +0 -156
- package/build/src/models/ProjectSchema.js.map +0 -1
- package/build/src/models/Property.d.ts +0 -140
- package/build/src/models/Property.d.ts.map +0 -1
- package/build/src/models/Property.js +0 -427
- package/build/src/models/Property.js.map +0 -1
- package/build/src/models/Provider.d.ts +0 -54
- package/build/src/models/Provider.d.ts.map +0 -1
- package/build/src/models/Provider.js +0 -75
- package/build/src/models/Provider.js.map +0 -1
- package/build/src/models/Request.d.ts +0 -175
- package/build/src/models/Request.d.ts.map +0 -1
- package/build/src/models/Request.js +0 -398
- package/build/src/models/Request.js.map +0 -1
- package/build/src/models/RequestAuthorization.d.ts +0 -58
- package/build/src/models/RequestAuthorization.d.ts.map +0 -1
- package/build/src/models/RequestAuthorization.js +0 -88
- package/build/src/models/RequestAuthorization.js.map +0 -1
- package/build/src/models/RequestConfig.d.ts +0 -174
- package/build/src/models/RequestConfig.d.ts.map +0 -1
- package/build/src/models/RequestConfig.js +0 -274
- package/build/src/models/RequestConfig.js.map +0 -1
- package/build/src/models/RequestLog.d.ts +0 -88
- package/build/src/models/RequestLog.d.ts.map +0 -1
- package/build/src/models/RequestLog.js +0 -158
- package/build/src/models/RequestLog.js.map +0 -1
- package/build/src/models/RequestTime.d.ts +0 -35
- package/build/src/models/RequestTime.d.ts.map +0 -1
- package/build/src/models/RequestTime.js +0 -89
- package/build/src/models/RequestTime.js.map +0 -1
- package/build/src/models/RequestUiMeta.d.ts +0 -166
- package/build/src/models/RequestUiMeta.d.ts.map +0 -1
- package/build/src/models/RequestUiMeta.js +0 -110
- package/build/src/models/RequestUiMeta.js.map +0 -1
- package/build/src/models/RequestsSize.d.ts +0 -33
- package/build/src/models/RequestsSize.d.ts.map +0 -1
- package/build/src/models/RequestsSize.js +0 -50
- package/build/src/models/RequestsSize.js.map +0 -1
- package/build/src/models/Response.d.ts +0 -61
- package/build/src/models/Response.d.ts.map +0 -1
- package/build/src/models/Response.js +0 -140
- package/build/src/models/Response.js.map +0 -1
- package/build/src/models/ResponseAuthorization.d.ts +0 -55
- package/build/src/models/ResponseAuthorization.d.ts.map +0 -1
- package/build/src/models/ResponseAuthorization.js +0 -82
- package/build/src/models/ResponseAuthorization.js.map +0 -1
- package/build/src/models/ResponseRedirect.d.ts +0 -72
- package/build/src/models/ResponseRedirect.d.ts.map +0 -1
- package/build/src/models/ResponseRedirect.js +0 -125
- package/build/src/models/ResponseRedirect.js.map +0 -1
- package/build/src/models/SentRequest.d.ts +0 -61
- package/build/src/models/SentRequest.d.ts.map +0 -1
- package/build/src/models/SentRequest.js +0 -91
- package/build/src/models/SentRequest.js.map +0 -1
- package/build/src/models/SerializablePayload.d.ts +0 -60
- package/build/src/models/SerializablePayload.d.ts.map +0 -1
- package/build/src/models/SerializablePayload.js +0 -79
- package/build/src/models/SerializablePayload.js.map +0 -1
- package/build/src/models/Server.d.ts +0 -89
- package/build/src/models/Server.d.ts.map +0 -1
- package/build/src/models/Server.js +0 -151
- package/build/src/models/Server.js.map +0 -1
- package/build/src/models/Url.d.ts +0 -50
- package/build/src/models/Url.d.ts.map +0 -1
- package/build/src/models/Url.js +0 -69
- package/build/src/models/Url.js.map +0 -1
- package/build/src/models/http-flows/AssertionError.d.ts +0 -37
- package/build/src/models/http-flows/AssertionError.d.ts.map +0 -1
- package/build/src/models/http-flows/AssertionError.js +0 -35
- package/build/src/models/http-flows/AssertionError.js.map +0 -1
- package/build/src/models/http-flows/HttpAssertion.d.ts +0 -86
- package/build/src/models/http-flows/HttpAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/HttpAssertion.js +0 -53
- package/build/src/models/http-flows/HttpAssertion.js.map +0 -1
- package/build/src/models/http-flows/HttpFlows.d.ts +0 -78
- package/build/src/models/http-flows/HttpFlows.d.ts.map +0 -1
- package/build/src/models/http-flows/HttpFlows.js +0 -35
- package/build/src/models/http-flows/HttpFlows.js.map +0 -1
- package/build/src/models/http-flows/HttpStep.d.ts +0 -30
- package/build/src/models/http-flows/HttpStep.d.ts.map +0 -1
- package/build/src/models/http-flows/HttpStep.js +0 -30
- package/build/src/models/http-flows/HttpStep.js.map +0 -1
- package/build/src/models/http-flows/LegacyTranslator.d.ts +0 -18
- package/build/src/models/http-flows/LegacyTranslator.d.ts.map +0 -1
- package/build/src/models/http-flows/LegacyTranslator.js +0 -278
- package/build/src/models/http-flows/LegacyTranslator.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/EqualAssertion.d.ts +0 -75
- package/build/src/models/http-flows/steps/assertion/EqualAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/EqualAssertion.js +0 -79
- package/build/src/models/http-flows/steps/assertion/EqualAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/GreaterThanAssertion.d.ts +0 -35
- package/build/src/models/http-flows/steps/assertion/GreaterThanAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/GreaterThanAssertion.js +0 -59
- package/build/src/models/http-flows/steps/assertion/GreaterThanAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/IncludesAssertion.d.ts +0 -27
- package/build/src/models/http-flows/steps/assertion/IncludesAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/IncludesAssertion.js +0 -45
- package/build/src/models/http-flows/steps/assertion/IncludesAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/IsEmptyAssertion.d.ts +0 -19
- package/build/src/models/http-flows/steps/assertion/IsEmptyAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/IsEmptyAssertion.js +0 -29
- package/build/src/models/http-flows/steps/assertion/IsEmptyAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/IsNotEmptyAssertion.d.ts +0 -19
- package/build/src/models/http-flows/steps/assertion/IsNotEmptyAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/IsNotEmptyAssertion.js +0 -29
- package/build/src/models/http-flows/steps/assertion/IsNotEmptyAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/LengthOfAssertion.d.ts +0 -27
- package/build/src/models/http-flows/steps/assertion/LengthOfAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/LengthOfAssertion.js +0 -45
- package/build/src/models/http-flows/steps/assertion/LengthOfAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/LessThanAssertion.d.ts +0 -35
- package/build/src/models/http-flows/steps/assertion/LessThanAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/LessThanAssertion.js +0 -59
- package/build/src/models/http-flows/steps/assertion/LessThanAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/MatchesAssertion.d.ts +0 -27
- package/build/src/models/http-flows/steps/assertion/MatchesAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/MatchesAssertion.js +0 -45
- package/build/src/models/http-flows/steps/assertion/MatchesAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/MatchesSchemaAssertion.d.ts +0 -39
- package/build/src/models/http-flows/steps/assertion/MatchesSchemaAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/MatchesSchemaAssertion.js +0 -60
- package/build/src/models/http-flows/steps/assertion/MatchesSchemaAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/NotEqualAssertion.d.ts +0 -75
- package/build/src/models/http-flows/steps/assertion/NotEqualAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/NotEqualAssertion.js +0 -79
- package/build/src/models/http-flows/steps/assertion/NotEqualAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/NotIncludesAssertion.d.ts +0 -27
- package/build/src/models/http-flows/steps/assertion/NotIncludesAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/NotIncludesAssertion.js +0 -45
- package/build/src/models/http-flows/steps/assertion/NotIncludesAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/NotOkAssertion.d.ts +0 -19
- package/build/src/models/http-flows/steps/assertion/NotOkAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/NotOkAssertion.js +0 -29
- package/build/src/models/http-flows/steps/assertion/NotOkAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/NotToBeAssertion.d.ts +0 -28
- package/build/src/models/http-flows/steps/assertion/NotToBeAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/NotToBeAssertion.js +0 -45
- package/build/src/models/http-flows/steps/assertion/NotToBeAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/OkAssertion.d.ts +0 -19
- package/build/src/models/http-flows/steps/assertion/OkAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/OkAssertion.js +0 -29
- package/build/src/models/http-flows/steps/assertion/OkAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/ToBeAssertion.d.ts +0 -34
- package/build/src/models/http-flows/steps/assertion/ToBeAssertion.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/ToBeAssertion.js +0 -53
- package/build/src/models/http-flows/steps/assertion/ToBeAssertion.js.map +0 -1
- package/build/src/models/http-flows/steps/assertion/index.d.ts +0 -16
- package/build/src/models/http-flows/steps/assertion/index.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/assertion/index.js +0 -16
- package/build/src/models/http-flows/steps/assertion/index.js.map +0 -1
- package/build/src/models/http-flows/steps/data/DeleteCookieStep.d.ts +0 -49
- package/build/src/models/http-flows/steps/data/DeleteCookieStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/data/DeleteCookieStep.js +0 -73
- package/build/src/models/http-flows/steps/data/DeleteCookieStep.js.map +0 -1
- package/build/src/models/http-flows/steps/data/DeleteVariableStep.d.ts +0 -37
- package/build/src/models/http-flows/steps/data/DeleteVariableStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/data/DeleteVariableStep.js +0 -45
- package/build/src/models/http-flows/steps/data/DeleteVariableStep.js.map +0 -1
- package/build/src/models/http-flows/steps/data/ReadDataSourceStep.d.ts +0 -54
- package/build/src/models/http-flows/steps/data/ReadDataSourceStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/data/ReadDataSourceStep.js +0 -60
- package/build/src/models/http-flows/steps/data/ReadDataSourceStep.js.map +0 -1
- package/build/src/models/http-flows/steps/data/ReadDataStep.d.ts +0 -68
- package/build/src/models/http-flows/steps/data/ReadDataStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/data/ReadDataStep.js +0 -78
- package/build/src/models/http-flows/steps/data/ReadDataStep.js.map +0 -1
- package/build/src/models/http-flows/steps/data/ReadValueStep.d.ts +0 -46
- package/build/src/models/http-flows/steps/data/ReadValueStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/data/ReadValueStep.js +0 -53
- package/build/src/models/http-flows/steps/data/ReadValueStep.js.map +0 -1
- package/build/src/models/http-flows/steps/data/SetCookieStep.d.ts +0 -102
- package/build/src/models/http-flows/steps/data/SetCookieStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/data/SetCookieStep.js +0 -139
- package/build/src/models/http-flows/steps/data/SetCookieStep.js.map +0 -1
- package/build/src/models/http-flows/steps/data/SetDataStep.d.ts +0 -78
- package/build/src/models/http-flows/steps/data/SetDataStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/data/SetDataStep.js +0 -70
- package/build/src/models/http-flows/steps/data/SetDataStep.js.map +0 -1
- package/build/src/models/http-flows/steps/data/SetVariableStep.d.ts +0 -41
- package/build/src/models/http-flows/steps/data/SetVariableStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/data/SetVariableStep.js +0 -45
- package/build/src/models/http-flows/steps/data/SetVariableStep.js.map +0 -1
- package/build/src/models/http-flows/steps/data/index.d.ts +0 -9
- package/build/src/models/http-flows/steps/data/index.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/data/index.js +0 -9
- package/build/src/models/http-flows/steps/data/index.js.map +0 -1
- package/build/src/models/http-flows/steps/transformation/AsLowerCaseStep.d.ts +0 -19
- package/build/src/models/http-flows/steps/transformation/AsLowerCaseStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/transformation/AsLowerCaseStep.js +0 -29
- package/build/src/models/http-flows/steps/transformation/AsLowerCaseStep.js.map +0 -1
- package/build/src/models/http-flows/steps/transformation/AsNumberStep.d.ts +0 -19
- package/build/src/models/http-flows/steps/transformation/AsNumberStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/transformation/AsNumberStep.js +0 -29
- package/build/src/models/http-flows/steps/transformation/AsNumberStep.js.map +0 -1
- package/build/src/models/http-flows/steps/transformation/AsUpperCaseStep.d.ts +0 -19
- package/build/src/models/http-flows/steps/transformation/AsUpperCaseStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/transformation/AsUpperCaseStep.js +0 -29
- package/build/src/models/http-flows/steps/transformation/AsUpperCaseStep.js.map +0 -1
- package/build/src/models/http-flows/steps/transformation/RoundStep.d.ts +0 -44
- package/build/src/models/http-flows/steps/transformation/RoundStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/transformation/RoundStep.js +0 -53
- package/build/src/models/http-flows/steps/transformation/RoundStep.js.map +0 -1
- package/build/src/models/http-flows/steps/transformation/SubstringStep.d.ts +0 -41
- package/build/src/models/http-flows/steps/transformation/SubstringStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/transformation/SubstringStep.js +0 -67
- package/build/src/models/http-flows/steps/transformation/SubstringStep.js.map +0 -1
- package/build/src/models/http-flows/steps/transformation/TrimStep.d.ts +0 -21
- package/build/src/models/http-flows/steps/transformation/TrimStep.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/transformation/TrimStep.js +0 -30
- package/build/src/models/http-flows/steps/transformation/TrimStep.js.map +0 -1
- package/build/src/models/http-flows/steps/transformation/index.d.ts +0 -7
- package/build/src/models/http-flows/steps/transformation/index.d.ts.map +0 -1
- package/build/src/models/http-flows/steps/transformation/index.js +0 -7
- package/build/src/models/http-flows/steps/transformation/index.js.map +0 -1
- package/build/src/models/legacy/DataExport.d.ts +0 -243
- package/build/src/models/legacy/DataExport.d.ts.map +0 -1
- package/build/src/models/legacy/DataExport.js +0 -2
- package/build/src/models/legacy/DataExport.js.map +0 -1
- package/build/src/models/legacy/Normalizer.d.ts +0 -12
- package/build/src/models/legacy/Normalizer.d.ts.map +0 -1
- package/build/src/models/legacy/Normalizer.js +0 -98
- package/build/src/models/legacy/Normalizer.js.map +0 -1
- package/build/src/models/legacy/actions/Actions.d.ts +0 -259
- package/build/src/models/legacy/actions/Actions.d.ts.map +0 -1
- package/build/src/models/legacy/actions/Actions.js +0 -2
- package/build/src/models/legacy/actions/Actions.js.map +0 -1
- package/build/src/models/legacy/authorization/Authorization.d.ts +0 -542
- package/build/src/models/legacy/authorization/Authorization.d.ts.map +0 -1
- package/build/src/models/legacy/authorization/Authorization.js +0 -2
- package/build/src/models/legacy/authorization/Authorization.js.map +0 -1
- package/build/src/models/legacy/models/ApiTypes.d.ts +0 -193
- package/build/src/models/legacy/models/ApiTypes.d.ts.map +0 -1
- package/build/src/models/legacy/models/ApiTypes.js +0 -2
- package/build/src/models/legacy/models/ApiTypes.js.map +0 -1
- package/build/src/models/legacy/models/ArcLegacyProject.d.ts +0 -38
- package/build/src/models/legacy/models/ArcLegacyProject.d.ts.map +0 -1
- package/build/src/models/legacy/models/ArcLegacyProject.js +0 -2
- package/build/src/models/legacy/models/ArcLegacyProject.js.map +0 -1
- package/build/src/models/legacy/models/AuthData.d.ts +0 -15
- package/build/src/models/legacy/models/AuthData.d.ts.map +0 -1
- package/build/src/models/legacy/models/AuthData.js +0 -2
- package/build/src/models/legacy/models/AuthData.js.map +0 -1
- package/build/src/models/legacy/models/ClientCertificate.d.ts +0 -90
- package/build/src/models/legacy/models/ClientCertificate.d.ts.map +0 -1
- package/build/src/models/legacy/models/ClientCertificate.js +0 -2
- package/build/src/models/legacy/models/ClientCertificate.js.map +0 -1
- package/build/src/models/legacy/models/Cookies.d.ts +0 -53
- package/build/src/models/legacy/models/Cookies.d.ts.map +0 -1
- package/build/src/models/legacy/models/Cookies.js +0 -2
- package/build/src/models/legacy/models/Cookies.js.map +0 -1
- package/build/src/models/legacy/models/HostRule.d.ts +0 -34
- package/build/src/models/legacy/models/HostRule.d.ts.map +0 -1
- package/build/src/models/legacy/models/HostRule.js +0 -2
- package/build/src/models/legacy/models/HostRule.js.map +0 -1
- package/build/src/models/legacy/models/RestApi.d.ts +0 -48
- package/build/src/models/legacy/models/RestApi.d.ts.map +0 -1
- package/build/src/models/legacy/models/RestApi.js +0 -2
- package/build/src/models/legacy/models/RestApi.js.map +0 -1
- package/build/src/models/legacy/models/UrlHistory.d.ts +0 -33
- package/build/src/models/legacy/models/UrlHistory.d.ts.map +0 -1
- package/build/src/models/legacy/models/UrlHistory.js +0 -2
- package/build/src/models/legacy/models/UrlHistory.js.map +0 -1
- package/build/src/models/legacy/models/Variable.d.ts +0 -37
- package/build/src/models/legacy/models/Variable.d.ts.map +0 -1
- package/build/src/models/legacy/models/Variable.js +0 -2
- package/build/src/models/legacy/models/Variable.js.map +0 -1
- package/build/src/models/legacy/models/base.d.ts +0 -91
- package/build/src/models/legacy/models/base.d.ts.map +0 -1
- package/build/src/models/legacy/models/base.js +0 -2
- package/build/src/models/legacy/models/base.js.map +0 -1
- package/build/src/models/legacy/request/ArcRequest.d.ts +0 -387
- package/build/src/models/legacy/request/ArcRequest.d.ts.map +0 -1
- package/build/src/models/legacy/request/ArcRequest.js +0 -2
- package/build/src/models/legacy/request/ArcRequest.js.map +0 -1
- package/build/src/models/legacy/request/ArcResponse.d.ts +0 -166
- package/build/src/models/legacy/request/ArcResponse.d.ts.map +0 -1
- package/build/src/models/legacy/request/ArcResponse.js +0 -2
- package/build/src/models/legacy/request/ArcResponse.js.map +0 -1
- package/build/src/models/legacy/request/HistoryData.d.ts +0 -45
- package/build/src/models/legacy/request/HistoryData.d.ts.map +0 -1
- package/build/src/models/legacy/request/HistoryData.js +0 -2
- package/build/src/models/legacy/request/HistoryData.js.map +0 -1
- package/build/src/models/legacy/request/Legacy.d.ts +0 -43
- package/build/src/models/legacy/request/Legacy.d.ts.map +0 -1
- package/build/src/models/legacy/request/Legacy.js +0 -2
- package/build/src/models/legacy/request/Legacy.js.map +0 -1
- package/build/src/models/legacy/request/RequestBody.d.ts +0 -83
- package/build/src/models/legacy/request/RequestBody.d.ts.map +0 -1
- package/build/src/models/legacy/request/RequestBody.js +0 -2
- package/build/src/models/legacy/request/RequestBody.js.map +0 -1
- package/build/src/models/transformers/ArcDexieTransformer.d.ts +0 -109
- package/build/src/models/transformers/ArcDexieTransformer.d.ts.map +0 -1
- package/build/src/models/transformers/ArcDexieTransformer.js +0 -249
- package/build/src/models/transformers/ArcDexieTransformer.js.map +0 -1
- package/build/src/models/transformers/ArcLegacyNormalizer.d.ts +0 -43
- package/build/src/models/transformers/ArcLegacyNormalizer.d.ts.map +0 -1
- package/build/src/models/transformers/ArcLegacyNormalizer.js +0 -79
- package/build/src/models/transformers/ArcLegacyNormalizer.js.map +0 -1
- package/build/src/models/transformers/ArcLegacyTransformer.d.ts +0 -86
- package/build/src/models/transformers/ArcLegacyTransformer.d.ts.map +0 -1
- package/build/src/models/transformers/ArcLegacyTransformer.js +0 -151
- package/build/src/models/transformers/ArcLegacyTransformer.js.map +0 -1
- package/build/src/models/transformers/ArcPouchTransformer.d.ts +0 -46
- package/build/src/models/transformers/ArcPouchTransformer.d.ts.map +0 -1
- package/build/src/models/transformers/ArcPouchTransformer.js +0 -170
- package/build/src/models/transformers/ArcPouchTransformer.js.map +0 -1
- package/build/src/models/transformers/BaseTransformer.d.ts +0 -49
- package/build/src/models/transformers/BaseTransformer.d.ts.map +0 -1
- package/build/src/models/transformers/BaseTransformer.js +0 -104
- package/build/src/models/transformers/BaseTransformer.js.map +0 -1
- package/build/src/models/transformers/ImportUtils.d.ts +0 -45
- package/build/src/models/transformers/ImportUtils.d.ts.map +0 -1
- package/build/src/models/transformers/ImportUtils.js +0 -131
- package/build/src/models/transformers/ImportUtils.js.map +0 -1
- package/build/src/models/transformers/LegacyDataExportToApiProject.d.ts +0 -16
- package/build/src/models/transformers/LegacyDataExportToApiProject.d.ts.map +0 -1
- package/build/src/models/transformers/LegacyDataExportToApiProject.js +0 -70
- package/build/src/models/transformers/LegacyDataExportToApiProject.js.map +0 -1
- package/build/src/models/transformers/LegacyExportProcessor.d.ts +0 -48
- package/build/src/models/transformers/LegacyExportProcessor.d.ts.map +0 -1
- package/build/src/models/transformers/LegacyExportProcessor.js +0 -214
- package/build/src/models/transformers/LegacyExportProcessor.js.map +0 -1
- package/build/src/models/transformers/PostmanBackupTransformer.d.ts +0 -97
- package/build/src/models/transformers/PostmanBackupTransformer.d.ts.map +0 -1
- package/build/src/models/transformers/PostmanBackupTransformer.js +0 -185
- package/build/src/models/transformers/PostmanBackupTransformer.js.map +0 -1
- package/build/src/models/transformers/PostmanDataTransformer.d.ts +0 -10
- package/build/src/models/transformers/PostmanDataTransformer.d.ts.map +0 -1
- package/build/src/models/transformers/PostmanDataTransformer.js +0 -50
- package/build/src/models/transformers/PostmanDataTransformer.js.map +0 -1
- package/build/src/models/transformers/PostmanTransformer.d.ts +0 -50
- package/build/src/models/transformers/PostmanTransformer.d.ts.map +0 -1
- package/build/src/models/transformers/PostmanTransformer.js +0 -90
- package/build/src/models/transformers/PostmanTransformer.js.map +0 -1
- package/build/src/models/transformers/PostmanV21Transformer.d.ts +0 -129
- package/build/src/models/transformers/PostmanV21Transformer.d.ts.map +0 -1
- package/build/src/models/transformers/PostmanV21Transformer.js +0 -196
- package/build/src/models/transformers/PostmanV21Transformer.js.map +0 -1
- package/build/src/models/transformers/PostmanV2Transformer.d.ts +0 -129
- package/build/src/models/transformers/PostmanV2Transformer.d.ts.map +0 -1
- package/build/src/models/transformers/PostmanV2Transformer.js +0 -196
- package/build/src/models/transformers/PostmanV2Transformer.js.map +0 -1
- package/build/src/models/transformers/har.d.ts +0 -858
- package/build/src/models/transformers/har.d.ts.map +0 -1
- package/build/src/models/transformers/har.js +0 -2
- package/build/src/models/transformers/har.js.map +0 -1
- package/build/src/proxy/HttpProjectProxy.d.ts +0 -42
- package/build/src/proxy/HttpProjectProxy.d.ts.map +0 -1
- package/build/src/proxy/HttpProjectProxy.js +0 -132
- package/build/src/proxy/HttpProjectProxy.js.map +0 -1
- package/build/src/proxy/Proxy.d.ts +0 -27
- package/build/src/proxy/Proxy.d.ts.map +0 -1
- package/build/src/proxy/Proxy.js +0 -7
- package/build/src/proxy/Proxy.js.map +0 -1
- package/build/src/proxy/ProxyService.d.ts +0 -24
- package/build/src/proxy/ProxyService.d.ts.map +0 -1
- package/build/src/proxy/ProxyService.js +0 -29
- package/build/src/proxy/ProxyService.js.map +0 -1
- package/build/src/proxy/RequestProxy.d.ts +0 -52
- package/build/src/proxy/RequestProxy.d.ts.map +0 -1
- package/build/src/proxy/RequestProxy.js +0 -56
- package/build/src/proxy/RequestProxy.js.map +0 -1
- package/build/src/runtime/http-engine/CoreEngine.d.ts +0 -299
- package/build/src/runtime/http-engine/CoreEngine.d.ts.map +0 -1
- package/build/src/runtime/http-engine/CoreEngine.js +0 -928
- package/build/src/runtime/http-engine/CoreEngine.js.map +0 -1
- package/build/src/runtime/http-engine/CoreEngine2.d.ts +0 -2
- package/build/src/runtime/http-engine/CoreEngine2.d.ts.map +0 -1
- package/build/src/runtime/http-engine/CoreEngine2.js +0 -2
- package/build/src/runtime/http-engine/CoreEngine2.js.map +0 -1
- package/build/src/runtime/http-engine/FormData.d.ts +0 -50
- package/build/src/runtime/http-engine/FormData.d.ts.map +0 -1
- package/build/src/runtime/http-engine/FormData.js +0 -167
- package/build/src/runtime/http-engine/FormData.js.map +0 -1
- package/build/src/runtime/http-engine/HttpErrorCodes.d.ts +0 -4
- package/build/src/runtime/http-engine/HttpErrorCodes.d.ts.map +0 -1
- package/build/src/runtime/http-engine/HttpErrorCodes.js +0 -166
- package/build/src/runtime/http-engine/HttpErrorCodes.js.map +0 -1
- package/build/src/runtime/http-engine/PayloadSupport.d.ts +0 -19
- package/build/src/runtime/http-engine/PayloadSupport.d.ts.map +0 -1
- package/build/src/runtime/http-engine/PayloadSupport.js +0 -80
- package/build/src/runtime/http-engine/PayloadSupport.js.map +0 -1
- package/build/src/runtime/http-engine/RequestUtils.d.ts +0 -66
- package/build/src/runtime/http-engine/RequestUtils.d.ts.map +0 -1
- package/build/src/runtime/http-engine/RequestUtils.js +0 -143
- package/build/src/runtime/http-engine/RequestUtils.js.map +0 -1
- package/build/src/runtime/http-engine/auth/AuthManager.d.ts +0 -73
- package/build/src/runtime/http-engine/auth/AuthManager.d.ts.map +0 -1
- package/build/src/runtime/http-engine/auth/AuthManager.js +0 -186
- package/build/src/runtime/http-engine/auth/AuthManager.js.map +0 -1
- package/build/src/runtime/http-engine/auth/index.d.ts +0 -2
- package/build/src/runtime/http-engine/auth/index.d.ts.map +0 -1
- package/build/src/runtime/http-engine/auth/index.js +0 -2
- package/build/src/runtime/http-engine/auth/index.js.map +0 -1
- package/build/src/runtime/http-engine/certificates/CertificateManager.d.ts +0 -11
- package/build/src/runtime/http-engine/certificates/CertificateManager.d.ts.map +0 -1
- package/build/src/runtime/http-engine/certificates/CertificateManager.js +0 -76
- package/build/src/runtime/http-engine/certificates/CertificateManager.js.map +0 -1
- package/build/src/runtime/http-engine/certificates/index.d.ts +0 -2
- package/build/src/runtime/http-engine/certificates/index.d.ts.map +0 -1
- package/build/src/runtime/http-engine/certificates/index.js +0 -2
- package/build/src/runtime/http-engine/certificates/index.js.map +0 -1
- package/build/src/runtime/http-engine/compression/CompressionManager.d.ts +0 -25
- package/build/src/runtime/http-engine/compression/CompressionManager.d.ts.map +0 -1
- package/build/src/runtime/http-engine/compression/CompressionManager.js +0 -89
- package/build/src/runtime/http-engine/compression/CompressionManager.js.map +0 -1
- package/build/src/runtime/http-engine/compression/index.d.ts +0 -2
- package/build/src/runtime/http-engine/compression/index.d.ts.map +0 -1
- package/build/src/runtime/http-engine/compression/index.js +0 -2
- package/build/src/runtime/http-engine/compression/index.js.map +0 -1
- package/build/src/runtime/http-engine/connections/ConnectionManager.d.ts +0 -57
- package/build/src/runtime/http-engine/connections/ConnectionManager.d.ts.map +0 -1
- package/build/src/runtime/http-engine/connections/ConnectionManager.js +0 -78
- package/build/src/runtime/http-engine/connections/ConnectionManager.js.map +0 -1
- package/build/src/runtime/http-engine/connections/DigestAuthHandler.d.ts +0 -70
- package/build/src/runtime/http-engine/connections/DigestAuthHandler.d.ts.map +0 -1
- package/build/src/runtime/http-engine/connections/DigestAuthHandler.js +0 -184
- package/build/src/runtime/http-engine/connections/DigestAuthHandler.js.map +0 -1
- package/build/src/runtime/http-engine/connections/DirectConnection.d.ts +0 -22
- package/build/src/runtime/http-engine/connections/DirectConnection.d.ts.map +0 -1
- package/build/src/runtime/http-engine/connections/DirectConnection.js +0 -111
- package/build/src/runtime/http-engine/connections/DirectConnection.js.map +0 -1
- package/build/src/runtime/http-engine/connections/ProxyAuthHandler.d.ts +0 -60
- package/build/src/runtime/http-engine/connections/ProxyAuthHandler.d.ts.map +0 -1
- package/build/src/runtime/http-engine/connections/ProxyAuthHandler.js +0 -138
- package/build/src/runtime/http-engine/connections/ProxyAuthHandler.js.map +0 -1
- package/build/src/runtime/http-engine/connections/ProxyConnection.d.ts +0 -14
- package/build/src/runtime/http-engine/connections/ProxyConnection.d.ts.map +0 -1
- package/build/src/runtime/http-engine/connections/ProxyConnection.js +0 -47
- package/build/src/runtime/http-engine/connections/ProxyConnection.js.map +0 -1
- package/build/src/runtime/http-engine/connections/TunnelConnection.d.ts +0 -13
- package/build/src/runtime/http-engine/connections/TunnelConnection.d.ts.map +0 -1
- package/build/src/runtime/http-engine/connections/TunnelConnection.js +0 -175
- package/build/src/runtime/http-engine/connections/TunnelConnection.js.map +0 -1
- package/build/src/runtime/http-engine/connections/index.d.ts +0 -7
- package/build/src/runtime/http-engine/connections/index.d.ts.map +0 -1
- package/build/src/runtime/http-engine/connections/index.js +0 -7
- package/build/src/runtime/http-engine/connections/index.js.map +0 -1
- package/build/src/runtime/http-engine/constants.d.ts +0 -69
- package/build/src/runtime/http-engine/constants.d.ts.map +0 -1
- package/build/src/runtime/http-engine/constants.js +0 -90
- package/build/src/runtime/http-engine/constants.js.map +0 -1
- package/build/src/runtime/http-engine/cookies/CookieProcessor.d.ts +0 -5
- package/build/src/runtime/http-engine/cookies/CookieProcessor.d.ts.map +0 -1
- package/build/src/runtime/http-engine/cookies/CookieProcessor.js +0 -20
- package/build/src/runtime/http-engine/cookies/CookieProcessor.js.map +0 -1
- package/build/src/runtime/http-engine/cookies/index.d.ts +0 -2
- package/build/src/runtime/http-engine/cookies/index.d.ts.map +0 -1
- package/build/src/runtime/http-engine/cookies/index.js +0 -2
- package/build/src/runtime/http-engine/cookies/index.js.map +0 -1
- package/build/src/runtime/http-engine/errors/HttpEngineErrors.d.ts +0 -156
- package/build/src/runtime/http-engine/errors/HttpEngineErrors.d.ts.map +0 -1
- package/build/src/runtime/http-engine/errors/HttpEngineErrors.js +0 -227
- package/build/src/runtime/http-engine/errors/HttpEngineErrors.js.map +0 -1
- package/build/src/runtime/http-engine/errors/index.d.ts +0 -2
- package/build/src/runtime/http-engine/errors/index.d.ts.map +0 -1
- package/build/src/runtime/http-engine/errors/index.js +0 -2
- package/build/src/runtime/http-engine/errors/index.js.map +0 -1
- package/build/src/runtime/http-engine/message/MessageBuilder.d.ts +0 -66
- package/build/src/runtime/http-engine/message/MessageBuilder.d.ts.map +0 -1
- package/build/src/runtime/http-engine/message/MessageBuilder.js +0 -161
- package/build/src/runtime/http-engine/message/MessageBuilder.js.map +0 -1
- package/build/src/runtime/http-engine/message/MessageProcessor.d.ts +0 -27
- package/build/src/runtime/http-engine/message/MessageProcessor.d.ts.map +0 -1
- package/build/src/runtime/http-engine/message/MessageProcessor.js +0 -51
- package/build/src/runtime/http-engine/message/MessageProcessor.js.map +0 -1
- package/build/src/runtime/http-engine/message/index.d.ts +0 -3
- package/build/src/runtime/http-engine/message/index.d.ts.map +0 -1
- package/build/src/runtime/http-engine/message/index.js +0 -3
- package/build/src/runtime/http-engine/message/index.js.map +0 -1
- package/build/src/runtime/http-engine/ntlm/Des.d.ts +0 -5
- package/build/src/runtime/http-engine/ntlm/Des.d.ts.map +0 -1
- package/build/src/runtime/http-engine/ntlm/Des.js +0 -361
- package/build/src/runtime/http-engine/ntlm/Des.js.map +0 -1
- package/build/src/runtime/http-engine/ntlm/MD4.d.ts +0 -14
- package/build/src/runtime/http-engine/ntlm/MD4.d.ts.map +0 -1
- package/build/src/runtime/http-engine/ntlm/MD4.js +0 -122
- package/build/src/runtime/http-engine/ntlm/MD4.js.map +0 -1
- package/build/src/runtime/http-engine/ntlm/NtlmAuth.d.ts +0 -21
- package/build/src/runtime/http-engine/ntlm/NtlmAuth.d.ts.map +0 -1
- package/build/src/runtime/http-engine/ntlm/NtlmAuth.js +0 -163
- package/build/src/runtime/http-engine/ntlm/NtlmAuth.js.map +0 -1
- package/build/src/runtime/http-engine/ntlm/NtlmMessage.d.ts +0 -11
- package/build/src/runtime/http-engine/ntlm/NtlmMessage.d.ts.map +0 -1
- package/build/src/runtime/http-engine/ntlm/NtlmMessage.js +0 -58
- package/build/src/runtime/http-engine/ntlm/NtlmMessage.js.map +0 -1
- package/build/src/runtime/http-engine/parsers/BodyParser.d.ts +0 -39
- package/build/src/runtime/http-engine/parsers/BodyParser.d.ts.map +0 -1
- package/build/src/runtime/http-engine/parsers/BodyParser.js +0 -145
- package/build/src/runtime/http-engine/parsers/BodyParser.js.map +0 -1
- package/build/src/runtime/http-engine/parsers/HeadersParser.d.ts +0 -29
- package/build/src/runtime/http-engine/parsers/HeadersParser.d.ts.map +0 -1
- package/build/src/runtime/http-engine/parsers/HeadersParser.js +0 -88
- package/build/src/runtime/http-engine/parsers/HeadersParser.js.map +0 -1
- package/build/src/runtime/http-engine/parsers/HttpResponseParser.d.ts +0 -91
- package/build/src/runtime/http-engine/parsers/HttpResponseParser.d.ts.map +0 -1
- package/build/src/runtime/http-engine/parsers/HttpResponseParser.js +0 -236
- package/build/src/runtime/http-engine/parsers/HttpResponseParser.js.map +0 -1
- package/build/src/runtime/http-engine/parsers/StatusParser.d.ts +0 -20
- package/build/src/runtime/http-engine/parsers/StatusParser.d.ts.map +0 -1
- package/build/src/runtime/http-engine/parsers/StatusParser.js +0 -51
- package/build/src/runtime/http-engine/parsers/StatusParser.js.map +0 -1
- package/build/src/runtime/http-engine/parsers/index.d.ts +0 -5
- package/build/src/runtime/http-engine/parsers/index.d.ts.map +0 -1
- package/build/src/runtime/http-engine/parsers/index.js +0 -5
- package/build/src/runtime/http-engine/parsers/index.js.map +0 -1
- package/build/src/runtime/http-engine/response/ResponseProcessor.d.ts +0 -22
- package/build/src/runtime/http-engine/response/ResponseProcessor.d.ts.map +0 -1
- package/build/src/runtime/http-engine/response/ResponseProcessor.js +0 -25
- package/build/src/runtime/http-engine/response/ResponseProcessor.js.map +0 -1
- package/build/src/runtime/http-engine/response/index.d.ts +0 -2
- package/build/src/runtime/http-engine/response/index.d.ts.map +0 -1
- package/build/src/runtime/http-engine/response/index.js +0 -2
- package/build/src/runtime/http-engine/response/index.js.map +0 -1
- package/build/src/runtime/http-engine/statistics/StatisticsProcessor.d.ts +0 -7
- package/build/src/runtime/http-engine/statistics/StatisticsProcessor.d.ts.map +0 -1
- package/build/src/runtime/http-engine/statistics/StatisticsProcessor.js +0 -40
- package/build/src/runtime/http-engine/statistics/StatisticsProcessor.js.map +0 -1
- package/build/src/runtime/http-engine/statistics/index.d.ts +0 -2
- package/build/src/runtime/http-engine/statistics/index.d.ts.map +0 -1
- package/build/src/runtime/http-engine/statistics/index.js +0 -2
- package/build/src/runtime/http-engine/statistics/index.js.map +0 -1
- package/build/src/runtime/http-engine/url/UrlProcessor.d.ts +0 -24
- package/build/src/runtime/http-engine/url/UrlProcessor.d.ts.map +0 -1
- package/build/src/runtime/http-engine/url/UrlProcessor.js +0 -50
- package/build/src/runtime/http-engine/url/UrlProcessor.js.map +0 -1
- package/build/src/runtime/http-engine/url/index.d.ts +0 -2
- package/build/src/runtime/http-engine/url/index.d.ts.map +0 -1
- package/build/src/runtime/http-engine/url/index.js +0 -2
- package/build/src/runtime/http-engine/url/index.js.map +0 -1
- package/build/src/runtime/http-runner/ConditionCheck.d.ts +0 -75
- package/build/src/runtime/http-runner/ConditionCheck.d.ts.map +0 -1
- package/build/src/runtime/http-runner/ConditionCheck.js +0 -185
- package/build/src/runtime/http-runner/ConditionCheck.js.map +0 -1
- package/build/src/runtime/http-runner/HttpAssertionRunner.d.ts +0 -26
- package/build/src/runtime/http-runner/HttpAssertionRunner.d.ts.map +0 -1
- package/build/src/runtime/http-runner/HttpAssertionRunner.js +0 -180
- package/build/src/runtime/http-runner/HttpAssertionRunner.js.map +0 -1
- package/build/src/runtime/http-runner/HttpFlowRunner.d.ts +0 -21
- package/build/src/runtime/http-runner/HttpFlowRunner.d.ts.map +0 -1
- package/build/src/runtime/http-runner/HttpFlowRunner.js +0 -74
- package/build/src/runtime/http-runner/HttpFlowRunner.js.map +0 -1
- package/build/src/runtime/http-runner/HttpFlows.d.ts +0 -120
- package/build/src/runtime/http-runner/HttpFlows.d.ts.map +0 -1
- package/build/src/runtime/http-runner/HttpFlows.js +0 -568
- package/build/src/runtime/http-runner/HttpFlows.js.map +0 -1
- package/build/src/runtime/http-runner/HttpRequestRunner.d.ts +0 -148
- package/build/src/runtime/http-runner/HttpRequestRunner.d.ts.map +0 -1
- package/build/src/runtime/http-runner/HttpRequestRunner.js +0 -380
- package/build/src/runtime/http-runner/HttpRequestRunner.js.map +0 -1
- package/build/src/runtime/http-runner/HttpRuntimeEnvironment.d.ts +0 -26
- package/build/src/runtime/http-runner/HttpRuntimeEnvironment.d.ts.map +0 -1
- package/build/src/runtime/http-runner/HttpRuntimeEnvironment.js +0 -2
- package/build/src/runtime/http-runner/HttpRuntimeEnvironment.js.map +0 -1
- package/build/src/runtime/http-runner/RequestCookiesProcessor.d.ts +0 -26
- package/build/src/runtime/http-runner/RequestCookiesProcessor.d.ts.map +0 -1
- package/build/src/runtime/http-runner/RequestCookiesProcessor.js +0 -66
- package/build/src/runtime/http-runner/RequestCookiesProcessor.js.map +0 -1
- package/build/src/runtime/node/BaseRunner.d.ts +0 -21
- package/build/src/runtime/node/BaseRunner.d.ts.map +0 -1
- package/build/src/runtime/node/BaseRunner.js +0 -27
- package/build/src/runtime/node/BaseRunner.js.map +0 -1
- package/build/src/runtime/node/InteropInterfaces.d.ts +0 -136
- package/build/src/runtime/node/InteropInterfaces.d.ts.map +0 -1
- package/build/src/runtime/node/InteropInterfaces.js +0 -2
- package/build/src/runtime/node/InteropInterfaces.js.map +0 -1
- package/build/src/runtime/node/ProjectParallelRunner.d.ts +0 -96
- package/build/src/runtime/node/ProjectParallelRunner.d.ts.map +0 -1
- package/build/src/runtime/node/ProjectParallelRunner.js +0 -253
- package/build/src/runtime/node/ProjectParallelRunner.js.map +0 -1
- package/build/src/runtime/node/ProjectRequestRunner.d.ts +0 -109
- package/build/src/runtime/node/ProjectRequestRunner.d.ts.map +0 -1
- package/build/src/runtime/node/ProjectRequestRunner.js +0 -300
- package/build/src/runtime/node/ProjectRequestRunner.js.map +0 -1
- package/build/src/runtime/node/ProjectRunner.d.ts +0 -192
- package/build/src/runtime/node/ProjectRunner.d.ts.map +0 -1
- package/build/src/runtime/node/ProjectRunner.js +0 -304
- package/build/src/runtime/node/ProjectRunner.js.map +0 -1
- package/build/src/runtime/node/ProjectRunnerWorker.d.ts +0 -2
- package/build/src/runtime/node/ProjectRunnerWorker.d.ts.map +0 -1
- package/build/src/runtime/node/ProjectRunnerWorker.js +0 -77
- package/build/src/runtime/node/ProjectRunnerWorker.js.map +0 -1
- package/build/src/runtime/node/ProjectSerialRunner.d.ts +0 -12
- package/build/src/runtime/node/ProjectSerialRunner.d.ts.map +0 -1
- package/build/src/runtime/node/ProjectSerialRunner.js +0 -37
- package/build/src/runtime/node/ProjectSerialRunner.js.map +0 -1
- package/build/src/runtime/node/enums.d.ts +0 -9
- package/build/src/runtime/node/enums.d.ts.map +0 -1
- package/build/src/runtime/node/enums.js +0 -10
- package/build/src/runtime/node/enums.js.map +0 -1
- package/build/src/runtime/reporters/ProjectRunCliReporter.d.ts +0 -8
- package/build/src/runtime/reporters/ProjectRunCliReporter.d.ts.map +0 -1
- package/build/src/runtime/reporters/ProjectRunCliReporter.js +0 -75
- package/build/src/runtime/reporters/ProjectRunCliReporter.js.map +0 -1
- package/build/src/runtime/reporters/Reporter.d.ts +0 -36
- package/build/src/runtime/reporters/Reporter.d.ts.map +0 -1
- package/build/src/runtime/reporters/Reporter.js +0 -98
- package/build/src/runtime/reporters/Reporter.js.map +0 -1
- package/build/src/runtime/variables/Cache.d.ts +0 -24
- package/build/src/runtime/variables/Cache.d.ts.map +0 -1
- package/build/src/runtime/variables/Cache.js +0 -51
- package/build/src/runtime/variables/Cache.js.map +0 -1
- package/build/src/runtime/variables/EvalFunctions.d.ts +0 -59
- package/build/src/runtime/variables/EvalFunctions.d.ts.map +0 -1
- package/build/src/runtime/variables/EvalFunctions.js +0 -126
- package/build/src/runtime/variables/EvalFunctions.js.map +0 -1
- package/build/src/runtime/variables/ProjectVariables.d.ts +0 -6
- package/build/src/runtime/variables/ProjectVariables.d.ts.map +0 -1
- package/build/src/runtime/variables/ProjectVariables.js +0 -7
- package/build/src/runtime/variables/ProjectVariables.js.map +0 -1
- package/build/src/runtime/variables/VariablesProcessor.d.ts +0 -169
- package/build/src/runtime/variables/VariablesProcessor.d.ts.map +0 -1
- package/build/src/runtime/variables/VariablesProcessor.js +0 -518
- package/build/src/runtime/variables/VariablesProcessor.js.map +0 -1
- package/build/src/runtime/variables/VariablesTokenizer.d.ts +0 -27
- package/build/src/runtime/variables/VariablesTokenizer.d.ts.map +0 -1
- package/build/src/runtime/variables/VariablesTokenizer.js +0 -53
- package/build/src/runtime/variables/VariablesTokenizer.js.map +0 -1
- package/build/src/sdk/HistorySdk.d.ts +0 -60
- package/build/src/sdk/HistorySdk.d.ts.map +0 -1
- package/build/src/sdk/HistorySdk.js +0 -243
- package/build/src/sdk/HistorySdk.js.map +0 -1
- package/build/src/sdk/ProjectExecutionsSdk.d.ts +0 -56
- package/build/src/sdk/ProjectExecutionsSdk.d.ts.map +0 -1
- package/build/src/sdk/ProjectExecutionsSdk.js +0 -114
- package/build/src/sdk/ProjectExecutionsSdk.js.map +0 -1
- package/build/src/sdk/WsClient.d.ts +0 -25
- package/build/src/sdk/WsClient.d.ts.map +0 -1
- package/build/src/sdk/WsClient.js +0 -4
- package/build/src/sdk/WsClient.js.map +0 -1
- package/build/src/sdk/WsClientNode.d.ts +0 -25
- package/build/src/sdk/WsClientNode.d.ts.map +0 -1
- package/build/src/sdk/WsClientNode.js +0 -66
- package/build/src/sdk/WsClientNode.js.map +0 -1
- package/build/src/sdk/WsClientWeb.d.ts +0 -24
- package/build/src/sdk/WsClientWeb.d.ts.map +0 -1
- package/build/src/sdk/WsClientWeb.js +0 -73
- package/build/src/sdk/WsClientWeb.js.map +0 -1
- package/build/src/testing/TestCliHelper.d.ts +0 -30
- package/build/src/testing/TestCliHelper.d.ts.map +0 -1
- package/build/src/testing/TestCliHelper.js +0 -83
- package/build/src/testing/TestCliHelper.js.map +0 -1
- package/build/src/testing/getPort.d.ts +0 -52
- package/build/src/testing/getPort.d.ts.map +0 -1
- package/build/src/testing/getPort.js +0 -169
- package/build/src/testing/getPort.js.map +0 -1
- package/build/tsconfig.tsbuildinfo +0 -1
- package/noop.ts +0 -3
- package/oauth-popup.html +0 -33
- package/skills-lock.json +0 -10
- package/src/authorization/AuthorizationError.ts +0 -32
- package/src/authorization/CustomParameters.ts +0 -66
- package/src/authorization/OAuth2Authorization.ts +0 -1013
- package/src/authorization/OidcAuthorization.ts +0 -158
- package/src/authorization/Utils.ts +0 -136
- package/src/authorization/lib/IframeAuthorization.ts +0 -127
- package/src/authorization/lib/KnownGrants.ts +0 -6
- package/src/authorization/lib/PopupAuthorization.ts +0 -80
- package/src/authorization/lib/SecurityProcessor.ts +0 -294
- package/src/authorization/lib/Tokens.ts +0 -135
- package/src/authorization/lib/Utils.ts +0 -95
- package/src/authorization/types.ts +0 -197
- package/src/cookies/CookieJar.ts +0 -26
- package/src/cookies/CookieParser.ts +0 -353
- package/src/cookies/InMemoryCookieJar.ts +0 -70
- package/src/cookies/Punycode.ts +0 -134
- package/src/data/DataExtractor.ts +0 -200
- package/src/data/DataReader.ts +0 -11
- package/src/data/JmespathReader.ts +0 -26
- package/src/data/Json2Xml.ts +0 -192
- package/src/data/JsonReader.ts +0 -41
- package/src/data/PayloadPointer.ts +0 -50
- package/src/data/RequestDataExtractor.ts +0 -124
- package/src/data/UrlEncodedReader.ts +0 -21
- package/src/data/XmlReader.ts +0 -128
- package/src/events/authorization/AuthorizationEventTypes.ts +0 -22
- package/src/events/authorization/AuthorizationEvents.ts +0 -74
- package/src/events/cookies/CookieEventTypes.ts +0 -13
- package/src/events/cookies/CookieEvents.ts +0 -168
- package/src/events/environment/EnvironmentEventTypes.ts +0 -3
- package/src/events/environment/EnvironmentEvents.ts +0 -25
- package/src/events/transport/TransportEventTypes.ts +0 -32
- package/src/events/transport/TransportEvents.ts +0 -105
- package/src/lib/Buffer.ts +0 -62
- package/src/lib/definitions/HttpDefinitions.ts +0 -68
- package/src/lib/fs/Fs.ts +0 -258
- package/src/lib/headers/HeadersData.ts +0 -692
- package/src/lib/parsers/UriTemplate.ts +0 -533
- package/src/lib/parsers/UrlEncoder.ts +0 -129
- package/src/lib/parsers/UrlParser.ts +0 -202
- package/src/lib/parsers/UrlProcessor.ts +0 -882
- package/src/lib/parsers/UrlValueParser.ts +0 -213
- package/src/lib/timers/Timers.ts +0 -27
- package/src/lib/transformers/PayloadSerializer.ts +0 -538
- package/src/mocking/LegacyInterfaces.ts +0 -51
- package/src/mocking/LegacyMock.ts +0 -37
- package/src/mocking/ProjectMock.ts +0 -38
- package/src/mocking/README.md +0 -40
- package/src/mocking/legacy/Authorization.ts +0 -40
- package/src/mocking/legacy/Certificates.ts +0 -148
- package/src/mocking/legacy/Cookies.ts +0 -53
- package/src/mocking/legacy/HostRules.ts +0 -45
- package/src/mocking/legacy/Http.ts +0 -248
- package/src/mocking/legacy/HttpResponse.ts +0 -107
- package/src/mocking/legacy/RestApi.ts +0 -70
- package/src/mocking/legacy/Urls.ts +0 -46
- package/src/mocking/legacy/Variables.ts +0 -54
- package/src/mocking/lib/Certificates.ts +0 -64
- package/src/mocking/lib/History.ts +0 -187
- package/src/mocking/lib/HostRules.ts +0 -45
- package/src/mocking/lib/Request.ts +0 -100
- package/src/mocking/lib/Response.ts +0 -121
- package/src/mocking/lib/Url.ts +0 -45
- package/src/models/Authorization.ts +0 -502
- package/src/models/AuthorizationData.ts +0 -67
- package/src/models/CertificateFile.ts +0 -79
- package/src/models/ClientCertificate.ts +0 -328
- package/src/models/Environment.ts +0 -309
- package/src/models/ErrorResponse.ts +0 -115
- package/src/models/HeadersArray.ts +0 -63
- package/src/models/HostRule.ts +0 -178
- package/src/models/HttpCookie.ts +0 -459
- package/src/models/HttpHistory.ts +0 -256
- package/src/models/HttpProject.ts +0 -1533
- package/src/models/HttpRequest.ts +0 -166
- package/src/models/HttpResponse.ts +0 -136
- package/src/models/License.ts +0 -113
- package/src/models/Project.ts +0 -93
- package/src/models/ProjectDefinitionProperty.ts +0 -40
- package/src/models/ProjectExecution.ts +0 -225
- package/src/models/ProjectFolder.ts +0 -440
- package/src/models/ProjectItem.ts +0 -158
- package/src/models/ProjectParent.ts +0 -34
- package/src/models/ProjectRequest.ts +0 -522
- package/src/models/ProjectSchema.ts +0 -202
- package/src/models/Property.ts +0 -517
- package/src/models/Provider.ts +0 -99
- package/src/models/Request.ts +0 -475
- package/src/models/RequestAuthorization.ts +0 -122
- package/src/models/RequestConfig.ts +0 -368
- package/src/models/RequestLog.ts +0 -193
- package/src/models/RequestTime.ts +0 -105
- package/src/models/RequestUiMeta.ts +0 -248
- package/src/models/RequestsSize.ts +0 -63
- package/src/models/Response.ts +0 -163
- package/src/models/ResponseAuthorization.ts +0 -104
- package/src/models/ResponseRedirect.ts +0 -156
- package/src/models/SentRequest.ts +0 -122
- package/src/models/SerializablePayload.ts +0 -122
- package/src/models/Server.ts +0 -183
- package/src/models/Url.ts +0 -87
- package/src/models/http-flows/AssertionError.ts +0 -57
- package/src/models/http-flows/HttpAssertion.ts +0 -90
- package/src/models/http-flows/HttpFlows.ts +0 -82
- package/src/models/http-flows/HttpStep.ts +0 -50
- package/src/models/http-flows/LegacyTranslator.ts +0 -303
- package/src/models/http-flows/steps/assertion/EqualAssertion.ts +0 -124
- package/src/models/http-flows/steps/assertion/GreaterThanAssertion.ts +0 -81
- package/src/models/http-flows/steps/assertion/IncludesAssertion.ts +0 -62
- package/src/models/http-flows/steps/assertion/IsEmptyAssertion.ts +0 -41
- package/src/models/http-flows/steps/assertion/IsNotEmptyAssertion.ts +0 -41
- package/src/models/http-flows/steps/assertion/LengthOfAssertion.ts +0 -62
- package/src/models/http-flows/steps/assertion/LessThanAssertion.ts +0 -81
- package/src/models/http-flows/steps/assertion/MatchesAssertion.ts +0 -62
- package/src/models/http-flows/steps/assertion/MatchesSchemaAssertion.ts +0 -87
- package/src/models/http-flows/steps/assertion/NotEqualAssertion.ts +0 -124
- package/src/models/http-flows/steps/assertion/NotIncludesAssertion.ts +0 -62
- package/src/models/http-flows/steps/assertion/NotOkAssertion.ts +0 -41
- package/src/models/http-flows/steps/assertion/NotToBeAssertion.ts +0 -63
- package/src/models/http-flows/steps/assertion/OkAssertion.ts +0 -41
- package/src/models/http-flows/steps/assertion/ToBeAssertion.ts +0 -70
- package/src/models/http-flows/steps/data/DeleteCookieStep.ts +0 -108
- package/src/models/http-flows/steps/data/DeleteVariableStep.ts +0 -78
- package/src/models/http-flows/steps/data/ReadDataSourceStep.ts +0 -104
- package/src/models/http-flows/steps/data/ReadDataStep.ts +0 -133
- package/src/models/http-flows/steps/data/ReadValueStep.ts +0 -89
- package/src/models/http-flows/steps/data/SetCookieStep.ts +0 -208
- package/src/models/http-flows/steps/data/SetDataStep.ts +0 -125
- package/src/models/http-flows/steps/data/SetVariableStep.ts +0 -82
- package/src/models/http-flows/steps/transformation/AsLowerCaseStep.ts +0 -41
- package/src/models/http-flows/steps/transformation/AsNumberStep.ts +0 -41
- package/src/models/http-flows/steps/transformation/AsUpperCaseStep.ts +0 -41
- package/src/models/http-flows/steps/transformation/RoundStep.ts +0 -87
- package/src/models/http-flows/steps/transformation/SubstringStep.ts +0 -96
- package/src/models/http-flows/steps/transformation/TrimStep.ts +0 -43
- package/src/models/legacy/DataExport.ts +0 -254
- package/src/models/legacy/Normalizer.ts +0 -107
- package/src/models/legacy/actions/Actions.ts +0 -277
- package/src/models/legacy/authorization/Authorization.ts +0 -581
- package/src/models/legacy/models/ApiTypes.ts +0 -202
- package/src/models/legacy/models/ArcLegacyProject.ts +0 -38
- package/src/models/legacy/models/AuthData.ts +0 -15
- package/src/models/legacy/models/ClientCertificate.ts +0 -93
- package/src/models/legacy/models/Cookies.ts +0 -52
- package/src/models/legacy/models/HostRule.ts +0 -35
- package/src/models/legacy/models/RestApi.ts +0 -49
- package/src/models/legacy/models/UrlHistory.ts +0 -33
- package/src/models/legacy/models/Variable.ts +0 -40
- package/src/models/legacy/models/base.ts +0 -95
- package/src/models/legacy/request/ArcRequest.ts +0 -405
- package/src/models/legacy/request/ArcResponse.ts +0 -177
- package/src/models/legacy/request/HistoryData.ts +0 -47
- package/src/models/legacy/request/RequestBody.ts +0 -87
- package/src/models/transformers/ArcDexieTransformer.ts +0 -323
- package/src/models/transformers/ArcLegacyNormalizer.ts +0 -84
- package/src/models/transformers/ArcLegacyTransformer.ts +0 -196
- package/src/models/transformers/ArcPouchTransformer.ts +0 -184
- package/src/models/transformers/BaseTransformer.ts +0 -113
- package/src/models/transformers/ImportUtils.ts +0 -135
- package/src/models/transformers/LegacyDataExportToApiProject.ts +0 -76
- package/src/models/transformers/LegacyExportProcessor.ts +0 -248
- package/src/models/transformers/PostmanBackupTransformer.ts +0 -303
- package/src/models/transformers/PostmanDataTransformer.ts +0 -54
- package/src/models/transformers/PostmanTransformer.ts +0 -113
- package/src/models/transformers/PostmanV21Transformer.ts +0 -317
- package/src/models/transformers/PostmanV2Transformer.ts +0 -317
- package/src/models/transformers/har.ts +0 -865
- package/src/proxy/HttpProjectProxy.ts +0 -169
- package/src/proxy/Proxy.ts +0 -30
- package/src/proxy/ProxyService.ts +0 -37
- package/src/proxy/RequestProxy.ts +0 -101
- package/src/proxy/readme.md +0 -8
- package/src/runtime/http-engine/CoreEngine.ts +0 -1084
- package/src/runtime/http-engine/CoreEngine2.ts +0 -0
- package/src/runtime/http-engine/FormData.ts +0 -200
- package/src/runtime/http-engine/HttpErrorCodes.ts +0 -176
- package/src/runtime/http-engine/PayloadSupport.ts +0 -93
- package/src/runtime/http-engine/RequestUtils.ts +0 -162
- package/src/runtime/http-engine/auth/AuthManager.ts +0 -242
- package/src/runtime/http-engine/certificates/CertificateManager.ts +0 -74
- package/src/runtime/http-engine/compression/CompressionManager.ts +0 -99
- package/src/runtime/http-engine/connections/ConnectionManager.ts +0 -123
- package/src/runtime/http-engine/connections/DigestAuthHandler.ts +0 -238
- package/src/runtime/http-engine/connections/DirectConnection.ts +0 -138
- package/src/runtime/http-engine/connections/ProxyAuthHandler.ts +0 -179
- package/src/runtime/http-engine/connections/ProxyConnection.ts +0 -55
- package/src/runtime/http-engine/connections/TunnelConnection.ts +0 -192
- package/src/runtime/http-engine/constants.ts +0 -103
- package/src/runtime/http-engine/cookies/CookieProcessor.ts +0 -25
- package/src/runtime/http-engine/errors/HttpEngineErrors.ts +0 -319
- package/src/runtime/http-engine/message/MessageBuilder.ts +0 -201
- package/src/runtime/http-engine/message/MessageProcessor.ts +0 -73
- package/src/runtime/http-engine/ntlm/Des.ts +0 -372
- package/src/runtime/http-engine/ntlm/MD4.ts +0 -137
- package/src/runtime/http-engine/ntlm/NtlmAuth.ts +0 -187
- package/src/runtime/http-engine/ntlm/NtlmMessage.ts +0 -64
- package/src/runtime/http-engine/parsers/BodyParser.ts +0 -171
- package/src/runtime/http-engine/parsers/HeadersParser.ts +0 -103
- package/src/runtime/http-engine/parsers/HttpResponseParser.ts +0 -280
- package/src/runtime/http-engine/parsers/StatusParser.ts +0 -69
- package/src/runtime/http-engine/response/ResponseProcessor.ts +0 -46
- package/src/runtime/http-engine/statistics/StatisticsProcessor.ts +0 -52
- package/src/runtime/http-engine/url/UrlProcessor.ts +0 -55
- package/src/runtime/http-runner/ConditionCheck.ts +0 -193
- package/src/runtime/http-runner/HttpAssertionRunner.ts +0 -204
- package/src/runtime/http-runner/HttpFlowRunner.ts +0 -105
- package/src/runtime/http-runner/HttpFlows.ts +0 -649
- package/src/runtime/http-runner/HttpRequestRunner.ts +0 -427
- package/src/runtime/http-runner/HttpRuntimeEnvironment.ts +0 -27
- package/src/runtime/http-runner/RequestCookiesProcessor.ts +0 -80
- package/src/runtime/node/BaseRunner.ts +0 -29
- package/src/runtime/node/InteropInterfaces.ts +0 -143
- package/src/runtime/node/ProjectParallelRunner.ts +0 -321
- package/src/runtime/node/ProjectRequestRunner.ts +0 -364
- package/src/runtime/node/ProjectRunner.ts +0 -395
- package/src/runtime/node/ProjectRunnerWorker.ts +0 -83
- package/src/runtime/node/ProjectSerialRunner.ts +0 -37
- package/src/runtime/node/enums.ts +0 -8
- package/src/runtime/reporters/ProjectRunCliReporter.ts +0 -81
- package/src/runtime/reporters/Reporter.ts +0 -113
- package/src/runtime/variables/Cache.ts +0 -53
- package/src/runtime/variables/EvalFunctions.ts +0 -135
- package/src/runtime/variables/ProjectVariables.ts +0 -5
- package/src/runtime/variables/VariablesProcessor.ts +0 -555
- package/src/runtime/variables/VariablesTokenizer.ts +0 -55
- package/src/sdk/HistorySdk.ts +0 -272
- package/src/sdk/ProjectExecutionsSdk.ts +0 -135
- package/src/sdk/WsClient.ts +0 -28
- package/src/sdk/WsClientNode.ts +0 -68
- package/src/sdk/WsClientWeb.ts +0 -75
- package/src/testing/TestCliHelper.ts +0 -93
- package/src/testing/getPort.ts +0 -215
- package/tests/resources/http/drive-list.ts +0 -575
- package/tests/resources/http/html.html +0 -317
- package/tests/resources/http/jpeg.jpg +0 -0
- package/tests/resources/http/json.json +0 -187
- package/tests/resources/http/png.png +0 -0
- package/tests/resources/http/svg.svg +0 -3
- package/tests/resources/http/webp.webp +0 -0
- package/tests/resources/http/xml.xml +0 -211
- package/tests/resources/ssl/cert-auth-server/alice-password.p12 +0 -0
- package/tests/resources/ssl/cert-auth-server/alice-password.txt +0 -1
- package/tests/resources/ssl/cert-auth-server/alice.p12 +0 -0
- package/tests/resources/ssl/cert-auth-server/alice_cert.pem +0 -28
- package/tests/resources/ssl/cert-auth-server/alice_csr.pem +0 -26
- package/tests/resources/ssl/cert-auth-server/alice_key.pem +0 -52
- package/tests/resources/ssl/cert-auth-server/bob-password.txt +0 -1
- package/tests/resources/ssl/cert-auth-server/bob.p12 +0 -0
- package/tests/resources/ssl/cert-auth-server/bob_cert.pem +0 -27
- package/tests/resources/ssl/cert-auth-server/bob_csr.pem +0 -26
- package/tests/resources/ssl/cert-auth-server/bob_key.pem +0 -52
- package/tests/resources/ssl/cert-auth-server/create.sh +0 -17
- package/tests/resources/ssl/cert-auth-server/server_cert.pem +0 -31
- package/tests/resources/ssl/cert-auth-server/server_key.pem +0 -52
- package/tests/resources/ssl/certs/ca.cert.pem +0 -23
- package/tests/resources/ssl/certs/ca.privkey.pem +0 -27
- package/tests/resources/ssl/certs/ca.srl +0 -1
- package/tests/resources/ssl/certs/cert.pem +0 -20
- package/tests/resources/ssl/certs/csr.pem +0 -17
- package/tests/resources/ssl/certs/fullchain.pem +0 -43
- package/tests/resources/ssl/certs/privkey.pem +0 -27
- package/tests/resources/ssl/certs/root-ca.crt +0 -0
- package/tests/servers/ExpressServer.ts +0 -124
- package/tests/servers/ProxyServer.ts +0 -374
- package/tests/servers/cert-helper.ts +0 -2
- package/tests/servers/express-routes/ApiEndpoint.ts +0 -24
- package/tests/servers/express-routes/BaseApi.ts +0 -106
- package/tests/servers/express-routes/BasicAuthRoute.ts +0 -36
- package/tests/servers/express-routes/BearerAuthRoute.ts +0 -35
- package/tests/servers/express-routes/CertificatesApi.ts +0 -46
- package/tests/servers/express-routes/CompressApi.ts +0 -71
- package/tests/servers/express-routes/CookieApi.ts +0 -20
- package/tests/servers/express-routes/DelayRoute.ts +0 -28
- package/tests/servers/express-routes/GetApi.ts +0 -58
- package/tests/servers/express-routes/HeadersApi.ts +0 -17
- package/tests/servers/express-routes/ImagesApi.ts +0 -44
- package/tests/servers/express-routes/NTLMRoute.ts +0 -29
- package/tests/servers/express-routes/PostApi.ts +0 -31
- package/tests/servers/express-routes/QueryParamsApi.ts +0 -17
- package/tests/servers/express-routes/RedirectsApi.ts +0 -139
- package/tests/servers/express-routes/ResponsesApi.ts +0 -68
- package/tests/servers/express-routes/StatusCodeApi.ts +0 -38
- package/tests/servers/express-routes/StreamApi.ts +0 -60
- package/tests/servers/express-routes/TestsApi.ts +0 -47
- package/tests/servers/oauth2mock/ServerMock.js +0 -454
- package/tests/servers/ssl.ts +0 -93
- package/tests/unit/authorization/SecurityProcessor.spec.ts +0 -538
- package/tests/unit/cookies/CookieParser.spec.ts +0 -354
- package/tests/unit/cookies/InMemoryCookieJar.spec.ts +0 -112
- package/tests/unit/data/JmesparthReader.spec.ts +0 -36
- package/tests/unit/data/Json2Xml.spec.ts +0 -178
- package/tests/unit/data/JsonReader.spec.ts +0 -82
- package/tests/unit/data/PayloadPointer.spec.ts +0 -56
- package/tests/unit/data/RequestDataExtractor.spec.ts +0 -469
- package/tests/unit/data/UrlEncodedReader.spec.ts +0 -12
- package/tests/unit/data/XmlReader.spec.ts +0 -84
- package/tests/unit/events/authorization.spec.ts +0 -150
- package/tests/unit/events/cookie.spec.ts +0 -274
- package/tests/unit/events/transport.spec.ts +0 -139
- package/tests/unit/legacy-transformers/ARC-legacy-import.spec.ts +0 -150
- package/tests/unit/legacy-transformers/ArcDexieTransformer.spec.ts +0 -194
- package/tests/unit/legacy-transformers/ArcLegacyTransformer.spec.ts +0 -112
- package/tests/unit/legacy-transformers/ArcPouchTransformer.spec.ts +0 -245
- package/tests/unit/legacy-transformers/DataTestHelper.ts +0 -50
- package/tests/unit/legacy-transformers/LegacyExportProcessor.spec.ts +0 -450
- package/tests/unit/legacy-transformers/data/arc-pouchdb.json +0 -396
- package/tests/unit/legacy-transformers/data/dexie-data-export.json +0 -890
- package/tests/unit/legacy-transformers/data/dexie-history-export.json +0 -877
- package/tests/unit/legacy-transformers/data/dexie-saved-export.json +0 -385
- package/tests/unit/legacy-transformers/data/legacy-data-import.json +0 -51
- package/tests/unit/legacy-transformers/data/legacy-request-import.json +0 -20
- package/tests/unit/legacy-transformers/data/pouch-data-export.json +0 -242
- package/tests/unit/lib/UriTemplate.spec.ts +0 -418
- package/tests/unit/lib/UrlEncoder.spec.ts +0 -36
- package/tests/unit/lib/UrlParser.spec.ts +0 -359
- package/tests/unit/lib/UrlProcessor.spec.ts +0 -894
- package/tests/unit/lib/buffer.spec.ts +0 -33
- package/tests/unit/lib/payload_serializer.spec.ts +0 -171
- package/tests/unit/mocking/current/Certificates.spec.ts +0 -96
- package/tests/unit/mocking/current/HostRules.spec.ts +0 -59
- package/tests/unit/mocking/current/Urls.spec.ts +0 -58
- package/tests/unit/mocking/legacy/ArcMock.spec.ts +0 -16
- package/tests/unit/mocking/legacy/Authorization.spec.ts +0 -57
- package/tests/unit/mocking/legacy/Certificates.spec.ts +0 -185
- package/tests/unit/mocking/legacy/Cookies.spec.ts +0 -67
- package/tests/unit/mocking/legacy/HostRules.spec.ts +0 -59
- package/tests/unit/mocking/legacy/Http.spec.ts +0 -533
- package/tests/unit/mocking/legacy/RestApi.spec.ts +0 -132
- package/tests/unit/mocking/legacy/Urls.spec.ts +0 -57
- package/tests/unit/mocking/legacy/Variables.spec.ts +0 -73
- package/tests/unit/models/Certificate/from_name.spec.ts +0 -21
- package/tests/unit/models/Project/consume.spec.ts +0 -16
- package/tests/unit/models/Project/create.spec.ts +0 -132
- package/tests/unit/models/certificate.spec.ts +0 -257
- package/tests/unit/models/environment.spec.ts +0 -574
- package/tests/unit/models/error_response.spec.ts +0 -183
- package/tests/unit/models/headers_array.spec.ts +0 -86
- package/tests/unit/models/host_rule.spec.ts +0 -196
- package/tests/unit/models/http-actions/assertion/equal_assertion.spec.ts +0 -103
- package/tests/unit/models/http-actions/assertion/greater_than_assertion.spec.ts +0 -91
- package/tests/unit/models/http-actions/assertion/includes_assertion.spec.ts +0 -71
- package/tests/unit/models/http-actions/assertion/less_than_assertion.spec.ts +0 -91
- package/tests/unit/models/http-actions/assertion/matches_assertion.spec.ts +0 -71
- package/tests/unit/models/http-actions/assertion/matches_schema_assertion.spec.ts +0 -117
- package/tests/unit/models/http-actions/assertion/not_equal_assertion.spec.ts +0 -103
- package/tests/unit/models/http-actions/assertion/not_includes_assertion.spec.ts +0 -71
- package/tests/unit/models/http-actions/assertion/not_ok_assertion.spec.ts +0 -47
- package/tests/unit/models/http-actions/assertion/not_to_be_assertion.spec.ts +0 -72
- package/tests/unit/models/http-actions/assertion/ok_assertion.spec.ts +0 -44
- package/tests/unit/models/http-actions/assertion/to_be_assertion.spec.ts +0 -71
- package/tests/unit/models/http-actions/transformation/as_lower_case_step.spec.ts +0 -47
- package/tests/unit/models/http-actions/transformation/as_number_step.spec.ts +0 -47
- package/tests/unit/models/http-actions/transformation/as_upper_case_step.spec.ts +0 -47
- package/tests/unit/models/http-actions/transformation/round_step.spec.ts +0 -69
- package/tests/unit/models/http-actions/transformation/substring_step.spec.ts +0 -85
- package/tests/unit/models/http-actions/transformation/trim_step.spec.ts +0 -44
- package/tests/unit/models/http_cookie.spec.ts +0 -516
- package/tests/unit/models/http_history.spec.ts +0 -443
- package/tests/unit/models/http_project.spec.ts +0 -2424
- package/tests/unit/models/http_request.spec.ts +0 -365
- package/tests/unit/models/http_response.spec.ts +0 -289
- package/tests/unit/models/license.spec.ts +0 -108
- package/tests/unit/models/project_folder.spec.ts +0 -926
- package/tests/unit/models/project_item.spec.ts +0 -137
- package/tests/unit/models/project_request.spec.ts +0 -1047
- package/tests/unit/models/project_schema.spec.ts +0 -236
- package/tests/unit/models/property.spec.ts +0 -625
- package/tests/unit/models/provider.spec.ts +0 -102
- package/tests/unit/models/request.spec.ts +0 -1206
- package/tests/unit/models/request_log.spec.ts +0 -308
- package/tests/unit/models/request_time.spec.ts +0 -138
- package/tests/unit/models/response.spec.ts +0 -384
- package/tests/unit/models/response_redirect.spec.ts +0 -303
- package/tests/unit/models/sent_request.spec.ts +0 -206
- package/tests/unit/models/server.spec.ts +0 -195
- package/tests/unit/postman-transformers/PostmanTransformer.spec.ts +0 -418
- package/tests/unit/postman-transformers/data/Backup.postman_dump.json +0 -750
- package/tests/unit/postman-transformers/data/HTTPBin.postman_collection-2.0.json +0 -508
- package/tests/unit/postman-transformers/data/HTTPBin.postman_collection-2.1.json +0 -542
- package/tests/unit/runtime/http-engine/HttpResponseParser.spec.ts +0 -337
- package/tests/unit/runtime/http-engine/abort.spec.ts +0 -83
- package/tests/unit/runtime/http-engine/auth.spec.ts +0 -52
- package/tests/unit/runtime/http-engine/certificates/CertificateManager.spec.ts +0 -482
- package/tests/unit/runtime/http-engine/certificates.spec.ts +0 -180
- package/tests/unit/runtime/http-engine/cleanup.spec.ts +0 -44
- package/tests/unit/runtime/http-engine/compression/CompressionManager.spec.ts +0 -498
- package/tests/unit/runtime/http-engine/compression.spec.ts +0 -114
- package/tests/unit/runtime/http-engine/connections/ConnectionManager.spec.ts +0 -379
- package/tests/unit/runtime/http-engine/connections/DigestAuthHandler.spec.ts +0 -164
- package/tests/unit/runtime/http-engine/core_engine.spec.ts +0 -560
- package/tests/unit/runtime/http-engine/engine_statuses.spec.ts +0 -58
- package/tests/unit/runtime/http-engine/events.spec.ts +0 -50
- package/tests/unit/runtime/http-engine/form_data.spec.ts +0 -112
- package/tests/unit/runtime/http-engine/headers.spec.ts +0 -149
- package/tests/unit/runtime/http-engine/hosts.spec.ts +0 -29
- package/tests/unit/runtime/http-engine/http-get.spec.ts +0 -36
- package/tests/unit/runtime/http-engine/http-post.spec.ts +0 -72
- package/tests/unit/runtime/http-engine/logger.spec.ts +0 -24
- package/tests/unit/runtime/http-engine/message.spec.ts +0 -184
- package/tests/unit/runtime/http-engine/params.spec.ts +0 -388
- package/tests/unit/runtime/http-engine/payload_support.spec.ts +0 -127
- package/tests/unit/runtime/http-engine/proxy.spec.ts +0 -522
- package/tests/unit/runtime/http-engine/redirects.spec.ts +0 -217
- package/tests/unit/runtime/http-engine/request_utils.spec.ts +0 -176
- package/tests/unit/runtime/http-engine/responses.spec.ts +0 -272
- package/tests/unit/runtime/http-engine/timeout.spec.ts +0 -33
- package/tests/unit/runtime/http-engine/timings.spec.ts +0 -50
- package/tests/unit/runtime/proxy/HttpProjectProxy.spec.ts +0 -241
- package/tests/unit/runtime/proxy/RequestProxy.spec.ts +0 -130
- package/tests/unit/runtime/reporters/project_run_cli_reporter.spec.ts +0 -62
- package/tests/unit/runtime/runners/http_assertion_runner.spec.ts +0 -1303
- package/tests/unit/runtime/runners/http_flow_runner.spec.ts +0 -1174
- package/tests/unit/runtime/runners/parallel_runner.spec.ts +0 -365
- package/tests/unit/runtime/runners/project_runner.spec.ts +0 -839
- package/tests/unit/runtime/runners/request_runner.spec.ts +0 -933
- package/tests/unit/runtime/runners/serial_runner.spec.ts +0 -629
- package/tests/unit/runtime/variables/cache.spec.ts +0 -95
- package/tests/unit/runtime/variables/eval_functions.spec.ts +0 -66
- package/tests/unit/runtime/variables/variables_processor.spec.ts +0 -563
- package/tests/unit/src/Platform.spec.ts +0 -24
- package/tsconfig.browser.json +0 -33
- package/tsconfig.node.json +0 -34
- /package/{API_MODELING_EXPLAINER.md → architecture/API_MODELING_EXPLAINER.md} +0 -0
- /package/{DATA_MODELING_EXPLAINER.md → architecture/DATA_MODELING_EXPLAINER.md} +0 -0
|
@@ -0,0 +1,2468 @@
|
|
|
1
|
+
import { test } from '@pawel-up/lupa/testing'
|
|
2
|
+
import { SdkNetworkMock } from '../../../src/sdk/SdkNetworkMock.js'
|
|
3
|
+
import { StoreSdk } from '../../../src/sdk/StoreSdkWeb.js'
|
|
4
|
+
import { RouteBuilder } from '../../../src/sdk/RouteBuilder.js'
|
|
5
|
+
import type { PatchInfo } from '../../../src/patch/types.js'
|
|
6
|
+
import type { InvitationSchema } from '../../../src/models/store/Invitation.js'
|
|
7
|
+
import { InvitationKind, OrganizationKind, UserKind } from '../../../src/models/kinds.js'
|
|
8
|
+
import type { OrganizationSchema, UserOrganizationGrantType } from '../../../src/models/store/Organization.js'
|
|
9
|
+
import type { UserSchema } from '../../../src/models/store/User.js'
|
|
10
|
+
import type { ContextListOptions, ContextListResult } from '../../../src/events/BaseEvents.js'
|
|
11
|
+
import { Exception } from '../../../src/exceptions/exception.js'
|
|
12
|
+
|
|
13
|
+
const baseUri = globalThis.location.protocol + '//' + globalThis.location.host
|
|
14
|
+
const baseToken = 'test-token'
|
|
15
|
+
|
|
16
|
+
test.group('list()', (group) => {
|
|
17
|
+
let sdk: StoreSdk
|
|
18
|
+
let mocker: SdkNetworkMock
|
|
19
|
+
|
|
20
|
+
group.each.setup(() => {
|
|
21
|
+
sdk = new StoreSdk(baseUri)
|
|
22
|
+
sdk.token = baseToken
|
|
23
|
+
sdk.silent = true
|
|
24
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const mockOrganizations: OrganizationSchema[] = [
|
|
28
|
+
{
|
|
29
|
+
kind: OrganizationKind,
|
|
30
|
+
key: 'org-abc-123',
|
|
31
|
+
name: 'Organization Alpha',
|
|
32
|
+
slug: 'organization-alpha',
|
|
33
|
+
createdBy: 'user-creator-1',
|
|
34
|
+
createdDate: Date.now() - 86400000,
|
|
35
|
+
grantType: 'owner',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
kind: OrganizationKind,
|
|
39
|
+
key: 'org-def-456',
|
|
40
|
+
name: 'Organization Beta',
|
|
41
|
+
slug: 'organization-beta',
|
|
42
|
+
createdBy: 'user-creator-2',
|
|
43
|
+
createdDate: Date.now() - 172800000,
|
|
44
|
+
grantType: 'editor',
|
|
45
|
+
},
|
|
46
|
+
]
|
|
47
|
+
const mockResponse: ContextListResult<OrganizationSchema> = { data: mockOrganizations }
|
|
48
|
+
|
|
49
|
+
test('should successfully list organizations', async ({ network, assert }) => {
|
|
50
|
+
const handle = await mocker.organizations.list(network, {
|
|
51
|
+
response: {
|
|
52
|
+
body: JSON.stringify(mockResponse),
|
|
53
|
+
status: 200,
|
|
54
|
+
headers: { 'Content-Type': 'application/json' },
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const result = await sdk.organizations.list()
|
|
59
|
+
|
|
60
|
+
await handle.assert.calledOnce('list organizations was called once')
|
|
61
|
+
await handle.assert.calledWith({
|
|
62
|
+
method: 'GET',
|
|
63
|
+
url: sdk.getUrl(RouteBuilder.organizations()).toString(),
|
|
64
|
+
headers: {
|
|
65
|
+
Authorization: `Bearer ${baseToken}`,
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
assert.deepEqual(result, mockResponse, 'list organizations returned expected result')
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
test('should use custom token if provided in request options', async ({ network, assert }) => {
|
|
73
|
+
const handle = await mocker.organizations.list(network, {
|
|
74
|
+
response: {
|
|
75
|
+
body: JSON.stringify(mockResponse),
|
|
76
|
+
status: 200,
|
|
77
|
+
headers: { 'Content-Type': 'application/json' },
|
|
78
|
+
},
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const result = await sdk.organizations.list({ token: 'custom-org-list-token' })
|
|
82
|
+
|
|
83
|
+
await handle.assert.calledOnce('list organizations was called once')
|
|
84
|
+
await handle.assert.calledWith({
|
|
85
|
+
method: 'GET',
|
|
86
|
+
url: sdk.getUrl(RouteBuilder.organizations()).toString(),
|
|
87
|
+
headers: {
|
|
88
|
+
Authorization: `Bearer custom-org-list-token`,
|
|
89
|
+
},
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
assert.deepEqual(result, mockResponse, 'list organizations returned expected result')
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
test('should throw an error if API returns a non-200 status', async ({ network, assert }) => {
|
|
96
|
+
const errorPayload = {
|
|
97
|
+
message: 'Server Error For Orgs',
|
|
98
|
+
status: 500,
|
|
99
|
+
help: 'Try again.',
|
|
100
|
+
name: 'OrgListServerError',
|
|
101
|
+
code: 'E_ORG_LIST_SERVER_ERROR',
|
|
102
|
+
}
|
|
103
|
+
await mocker.organizations.list(network, {
|
|
104
|
+
response: {
|
|
105
|
+
body: JSON.stringify(errorPayload),
|
|
106
|
+
status: 500,
|
|
107
|
+
headers: { 'Content-Type': 'application/json' },
|
|
108
|
+
},
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
const error = await assert.rejects<Exception>(
|
|
112
|
+
async () => await sdk.organizations.list(),
|
|
113
|
+
Exception,
|
|
114
|
+
'Server Error For Orgs'
|
|
115
|
+
)
|
|
116
|
+
assert.strictEqual(error.status, 500)
|
|
117
|
+
assert.strictEqual(error.help, 'Try again.')
|
|
118
|
+
assert.strictEqual(error.name, 'OrgListServerError')
|
|
119
|
+
assert.strictEqual(error.code, 'E_ORG_LIST_SERVER_ERROR')
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
test('should throw an error if API response has no body', async ({ network, assert }) => {
|
|
123
|
+
await mocker.organizations.list(network, {
|
|
124
|
+
response: {
|
|
125
|
+
status: 200,
|
|
126
|
+
headers: { 'Content-Type': 'application/json' },
|
|
127
|
+
},
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
await assert.rejects<Exception>(
|
|
131
|
+
async () => await sdk.organizations.list(),
|
|
132
|
+
Exception,
|
|
133
|
+
'Unable to list your organizations. The response has no value.'
|
|
134
|
+
)
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
test('should correctly build URL when baseUri has a path', async ({ network }) => {
|
|
138
|
+
const customBaseUri = 'http://localhost:3000/api/orgs-base'
|
|
139
|
+
sdk.baseUri = customBaseUri
|
|
140
|
+
const handle = await mocker.organizations.list(network, {
|
|
141
|
+
response: {
|
|
142
|
+
body: JSON.stringify(mockResponse),
|
|
143
|
+
status: 200,
|
|
144
|
+
},
|
|
145
|
+
baseUri: customBaseUri,
|
|
146
|
+
})
|
|
147
|
+
await sdk.organizations.list()
|
|
148
|
+
await handle.assert.calledOnceWith({
|
|
149
|
+
method: 'GET',
|
|
150
|
+
url: 'http://localhost:3000/api/orgs-base/v1/orgs',
|
|
151
|
+
headers: {
|
|
152
|
+
Authorization: `Bearer ${baseToken}`,
|
|
153
|
+
},
|
|
154
|
+
})
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
test.group('create()', (group) => {
|
|
159
|
+
let sdk: StoreSdk
|
|
160
|
+
let mocker: SdkNetworkMock
|
|
161
|
+
|
|
162
|
+
group.each.setup(() => {
|
|
163
|
+
sdk = new StoreSdk(baseUri)
|
|
164
|
+
sdk.token = baseToken
|
|
165
|
+
sdk.silent = true
|
|
166
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
167
|
+
})
|
|
168
|
+
const newOrgName = 'My New Organization'
|
|
169
|
+
const newOrgSlug = 'my-new-organization'
|
|
170
|
+
const mockCreatedOrganization: OrganizationSchema = {
|
|
171
|
+
kind: OrganizationKind,
|
|
172
|
+
key: 'org-newly-created-789',
|
|
173
|
+
slug: newOrgSlug,
|
|
174
|
+
name: newOrgName,
|
|
175
|
+
createdBy: 'user-current-creator',
|
|
176
|
+
createdDate: Date.now(),
|
|
177
|
+
grantType: 'owner', // Typically, the creator becomes the owner
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
test('should successfully create an organization', async ({ network, assert }) => {
|
|
181
|
+
const handle = await mocker.organizations.create(network, {
|
|
182
|
+
response: {
|
|
183
|
+
status: 200, // As per SDK implementation, expects 200 for create
|
|
184
|
+
body: JSON.stringify({ data: mockCreatedOrganization }),
|
|
185
|
+
headers: { 'Content-Type': 'application/json' },
|
|
186
|
+
},
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
const result = await sdk.organizations.create(newOrgName, newOrgSlug)
|
|
190
|
+
|
|
191
|
+
await handle.assert.calledOnce()
|
|
192
|
+
await handle.assert.calledOnceWith({
|
|
193
|
+
method: 'POST',
|
|
194
|
+
url: sdk.getUrl(RouteBuilder.organizations()).toString(),
|
|
195
|
+
headers: {
|
|
196
|
+
'Authorization': `Bearer ${baseToken}`,
|
|
197
|
+
'Content-Type': 'application/json',
|
|
198
|
+
},
|
|
199
|
+
})
|
|
200
|
+
assert.deepEqual(result, mockCreatedOrganization)
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
204
|
+
const handle = await mocker.organizations.create(network, {
|
|
205
|
+
response: {
|
|
206
|
+
status: 200,
|
|
207
|
+
body: JSON.stringify({ data: mockCreatedOrganization }),
|
|
208
|
+
headers: { 'Content-Type': 'application/json' },
|
|
209
|
+
},
|
|
210
|
+
})
|
|
211
|
+
await sdk.organizations.create(newOrgName, newOrgSlug, { token: 'custom-create-org-token' })
|
|
212
|
+
await handle.assert.calledOnceWith({
|
|
213
|
+
method: 'POST',
|
|
214
|
+
url: sdk.getUrl(RouteBuilder.organizations()).toString(),
|
|
215
|
+
headers: {
|
|
216
|
+
'Authorization': `Bearer custom-create-org-token`,
|
|
217
|
+
'Content-Type': 'application/json',
|
|
218
|
+
},
|
|
219
|
+
})
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
test('should throw an error if API returns a non-200 status (e.g., 500)', async ({ network, assert }) => {
|
|
223
|
+
const errorPayload = {
|
|
224
|
+
message: 'Server Error Creating Org',
|
|
225
|
+
status: 500,
|
|
226
|
+
help: 'Try again.',
|
|
227
|
+
name: 'OrgCreateServerError',
|
|
228
|
+
code: 'E_ORG_CREATE_SERVER_ERROR',
|
|
229
|
+
}
|
|
230
|
+
await mocker.organizations.create(network, {
|
|
231
|
+
response: {
|
|
232
|
+
status: 500,
|
|
233
|
+
body: JSON.stringify(errorPayload),
|
|
234
|
+
headers: { 'Content-Type': 'application/json' },
|
|
235
|
+
},
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
const error = await assert.rejects<Exception>(
|
|
239
|
+
async () => await sdk.organizations.create(newOrgName, newOrgSlug),
|
|
240
|
+
Exception,
|
|
241
|
+
'Server Error Creating Org'
|
|
242
|
+
)
|
|
243
|
+
assert.strictEqual(error.status, 500)
|
|
244
|
+
assert.strictEqual(error.help, 'Try again.')
|
|
245
|
+
assert.strictEqual(error.name, 'OrgCreateServerError')
|
|
246
|
+
assert.strictEqual(error.code, 'E_ORG_CREATE_SERVER_ERROR')
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
test('should throw an error if API response has no body on 200 status', async ({ network, assert }) => {
|
|
250
|
+
await mocker.organizations.create(network, {
|
|
251
|
+
response: {
|
|
252
|
+
status: 200,
|
|
253
|
+
body: '',
|
|
254
|
+
headers: { 'Content-Type': 'application/json' },
|
|
255
|
+
},
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
const error = await assert.rejects<Exception>(
|
|
259
|
+
async () => await sdk.organizations.create(newOrgName, newOrgSlug),
|
|
260
|
+
Exception,
|
|
261
|
+
'Unable to create an organization. The response has no value.'
|
|
262
|
+
)
|
|
263
|
+
assert.strictEqual(error.status, 200)
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
test('should throw an error if API response data is missing "kind" property on 200 status', async ({
|
|
267
|
+
network,
|
|
268
|
+
assert,
|
|
269
|
+
}) => {
|
|
270
|
+
const invalidResponse = { ...mockCreatedOrganization }
|
|
271
|
+
// @ts-expect-error Testing missing kind property
|
|
272
|
+
delete invalidResponse.kind
|
|
273
|
+
await mocker.organizations.create(network, {
|
|
274
|
+
response: {
|
|
275
|
+
status: 200,
|
|
276
|
+
body: JSON.stringify({ data: invalidResponse }),
|
|
277
|
+
headers: { 'Content-Type': 'application/json' },
|
|
278
|
+
},
|
|
279
|
+
})
|
|
280
|
+
|
|
281
|
+
const error = await assert.rejects<Exception>(
|
|
282
|
+
async () => await sdk.organizations.create(newOrgName, newOrgSlug),
|
|
283
|
+
Exception,
|
|
284
|
+
'Unable to create an organization. Unknown response from the server.'
|
|
285
|
+
)
|
|
286
|
+
assert.strictEqual(error.status, 200)
|
|
287
|
+
})
|
|
288
|
+
})
|
|
289
|
+
|
|
290
|
+
test.group('slugs.generate()', (group) => {
|
|
291
|
+
let sdk: StoreSdk
|
|
292
|
+
let mocker: SdkNetworkMock
|
|
293
|
+
|
|
294
|
+
group.each.setup(() => {
|
|
295
|
+
sdk = new StoreSdk(baseUri)
|
|
296
|
+
sdk.token = baseToken
|
|
297
|
+
sdk.silent = true
|
|
298
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
299
|
+
})
|
|
300
|
+
const orgName = 'Test Organization Name'
|
|
301
|
+
const mockSlugResponse = { slug: 'test-organization-name' }
|
|
302
|
+
|
|
303
|
+
test('should successfully generate a slug for an organization name', async ({ network, assert }) => {
|
|
304
|
+
const handle = await mocker.organizations.slugs.generate(network, {
|
|
305
|
+
response: {
|
|
306
|
+
status: 200,
|
|
307
|
+
body: JSON.stringify({ data: mockSlugResponse }),
|
|
308
|
+
headers: { 'Content-Type': 'application/json' },
|
|
309
|
+
},
|
|
310
|
+
})
|
|
311
|
+
|
|
312
|
+
const result = await sdk.organizations.slugs.generate(orgName)
|
|
313
|
+
|
|
314
|
+
const expectedUrl = sdk.getUrl(RouteBuilder.orgSlugGenerate()).toString()
|
|
315
|
+
await handle.assert.calledOnceWith({
|
|
316
|
+
method: 'POST',
|
|
317
|
+
url: expectedUrl,
|
|
318
|
+
headers: {
|
|
319
|
+
'Authorization': `Bearer ${baseToken}`,
|
|
320
|
+
'Content-Type': 'application/json',
|
|
321
|
+
},
|
|
322
|
+
})
|
|
323
|
+
assert.strictEqual(result, mockSlugResponse.slug)
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
327
|
+
const handle = await mocker.organizations.slugs.generate(network, {
|
|
328
|
+
response: {
|
|
329
|
+
status: 200,
|
|
330
|
+
body: JSON.stringify({ data: mockSlugResponse }),
|
|
331
|
+
headers: { 'Content-Type': 'application/json' },
|
|
332
|
+
},
|
|
333
|
+
})
|
|
334
|
+
await sdk.organizations.slugs.generate(orgName, { token: 'custom-slug-token' })
|
|
335
|
+
await handle.assert.calledOnceWith({
|
|
336
|
+
headers: { Authorization: `Bearer custom-slug-token` },
|
|
337
|
+
})
|
|
338
|
+
})
|
|
339
|
+
|
|
340
|
+
test('should throw an error if API returns a non-200 status', async ({ network, assert }) => {
|
|
341
|
+
const errorPayload = {
|
|
342
|
+
message: 'Server Error Generating Slug',
|
|
343
|
+
status: 500,
|
|
344
|
+
}
|
|
345
|
+
await mocker.organizations.slugs.generate(network, {
|
|
346
|
+
response: {
|
|
347
|
+
status: 500,
|
|
348
|
+
body: JSON.stringify(errorPayload),
|
|
349
|
+
headers: { 'Content-Type': 'application/json' },
|
|
350
|
+
},
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
const error = await assert.rejects<Exception>(
|
|
354
|
+
async () => await sdk.organizations.slugs.generate(orgName),
|
|
355
|
+
Exception,
|
|
356
|
+
errorPayload.message
|
|
357
|
+
)
|
|
358
|
+
assert.strictEqual(error.status, 500)
|
|
359
|
+
})
|
|
360
|
+
|
|
361
|
+
test('should throw an error if API response has no body', async ({ network, assert }) => {
|
|
362
|
+
await mocker.organizations.slugs.generate(network, {
|
|
363
|
+
response: {
|
|
364
|
+
status: 200,
|
|
365
|
+
body: '',
|
|
366
|
+
headers: { 'Content-Type': 'application/json' },
|
|
367
|
+
},
|
|
368
|
+
})
|
|
369
|
+
const error = await assert.rejects<Exception>(
|
|
370
|
+
async () => await sdk.organizations.slugs.generate(orgName),
|
|
371
|
+
Exception,
|
|
372
|
+
'Unable to generate the slug. The response has no value.'
|
|
373
|
+
)
|
|
374
|
+
assert.strictEqual(error.status, 200)
|
|
375
|
+
})
|
|
376
|
+
|
|
377
|
+
test('should throw an error if API response body is invalid JSON', async ({ network, assert }) => {
|
|
378
|
+
await mocker.organizations.slugs.generate(network, {
|
|
379
|
+
response: {
|
|
380
|
+
status: 200,
|
|
381
|
+
body: 'not json',
|
|
382
|
+
headers: { 'Content-Type': 'application/json' },
|
|
383
|
+
},
|
|
384
|
+
})
|
|
385
|
+
const error = await assert.rejects<Exception>(
|
|
386
|
+
async () => await sdk.organizations.slugs.generate(orgName),
|
|
387
|
+
Exception,
|
|
388
|
+
'Unable to generate the slug. Invalid JSON response.'
|
|
389
|
+
)
|
|
390
|
+
assert.strictEqual(error.status, 200)
|
|
391
|
+
})
|
|
392
|
+
|
|
393
|
+
test('should throw an error if API response data is missing "slug" property', async ({ network, assert }) => {
|
|
394
|
+
const invalidResponse = { other: 'stuff' }
|
|
395
|
+
await mocker.organizations.slugs.generate(network, {
|
|
396
|
+
response: {
|
|
397
|
+
status: 200,
|
|
398
|
+
body: JSON.stringify({ data: invalidResponse }),
|
|
399
|
+
headers: { 'Content-Type': 'application/json' },
|
|
400
|
+
},
|
|
401
|
+
})
|
|
402
|
+
const error = await assert.rejects<Exception>(
|
|
403
|
+
async () => await sdk.organizations.slugs.generate(orgName),
|
|
404
|
+
Exception,
|
|
405
|
+
'Unable to generate the slug. Unknown response from the server.'
|
|
406
|
+
)
|
|
407
|
+
assert.strictEqual(error.status, 200)
|
|
408
|
+
})
|
|
409
|
+
})
|
|
410
|
+
|
|
411
|
+
test.group('slugs.validate()', (group) => {
|
|
412
|
+
let sdk: StoreSdk
|
|
413
|
+
let mocker: SdkNetworkMock
|
|
414
|
+
|
|
415
|
+
group.each.setup(() => {
|
|
416
|
+
sdk = new StoreSdk(baseUri)
|
|
417
|
+
sdk.token = baseToken
|
|
418
|
+
sdk.silent = true
|
|
419
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
420
|
+
})
|
|
421
|
+
const orgSlug = 'test-organization-name'
|
|
422
|
+
const mockValidateResponse = { valid: true }
|
|
423
|
+
|
|
424
|
+
test('should successfully validate an organization slug', async ({ network, assert }) => {
|
|
425
|
+
const handle = await mocker.organizations.slugs.validate(network, {
|
|
426
|
+
response: {
|
|
427
|
+
status: 200,
|
|
428
|
+
body: JSON.stringify({ data: mockValidateResponse }),
|
|
429
|
+
headers: { 'Content-Type': 'application/json' },
|
|
430
|
+
},
|
|
431
|
+
})
|
|
432
|
+
|
|
433
|
+
const result = await sdk.organizations.slugs.validate(orgSlug)
|
|
434
|
+
|
|
435
|
+
await handle.assert.calledOnceWith({
|
|
436
|
+
method: 'POST',
|
|
437
|
+
headers: { Authorization: `Bearer ${baseToken}` },
|
|
438
|
+
body: JSON.stringify({ slug: orgSlug }),
|
|
439
|
+
})
|
|
440
|
+
assert.deepEqual(result, mockValidateResponse)
|
|
441
|
+
})
|
|
442
|
+
|
|
443
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
444
|
+
const handle = await mocker.organizations.slugs.validate(network, {
|
|
445
|
+
response: {
|
|
446
|
+
status: 200,
|
|
447
|
+
body: JSON.stringify({ data: mockValidateResponse }),
|
|
448
|
+
headers: { 'Content-Type': 'application/json' },
|
|
449
|
+
},
|
|
450
|
+
})
|
|
451
|
+
await sdk.organizations.slugs.validate(orgSlug, { token: 'custom-validate-token' })
|
|
452
|
+
await handle.assert.calledOnceWith({
|
|
453
|
+
headers: { Authorization: `Bearer custom-validate-token` },
|
|
454
|
+
})
|
|
455
|
+
})
|
|
456
|
+
|
|
457
|
+
test('should throw an error if API returns a non-200 status', async ({ network, assert }) => {
|
|
458
|
+
const errorPayload = {
|
|
459
|
+
message: 'Server Error Validating Slug',
|
|
460
|
+
status: 500,
|
|
461
|
+
}
|
|
462
|
+
await mocker.organizations.slugs.validate(network, {
|
|
463
|
+
response: {
|
|
464
|
+
status: 500,
|
|
465
|
+
body: JSON.stringify(errorPayload),
|
|
466
|
+
headers: { 'Content-Type': 'application/json' },
|
|
467
|
+
},
|
|
468
|
+
})
|
|
469
|
+
|
|
470
|
+
const error = await assert.rejects<Exception>(
|
|
471
|
+
async () => await sdk.organizations.slugs.validate(orgSlug),
|
|
472
|
+
Exception,
|
|
473
|
+
errorPayload.message
|
|
474
|
+
)
|
|
475
|
+
assert.strictEqual(error.status, 500)
|
|
476
|
+
})
|
|
477
|
+
|
|
478
|
+
test('should throw an error if API response has no body', async ({ network, assert }) => {
|
|
479
|
+
await mocker.organizations.slugs.validate(network, {
|
|
480
|
+
response: {
|
|
481
|
+
status: 200,
|
|
482
|
+
body: '',
|
|
483
|
+
headers: { 'Content-Type': 'application/json' },
|
|
484
|
+
},
|
|
485
|
+
})
|
|
486
|
+
const error = await assert.rejects<Exception>(
|
|
487
|
+
async () => await sdk.organizations.slugs.validate(orgSlug),
|
|
488
|
+
Exception,
|
|
489
|
+
'Unable to validate the slug. The response has no value.'
|
|
490
|
+
)
|
|
491
|
+
assert.strictEqual(error.status, 200)
|
|
492
|
+
})
|
|
493
|
+
|
|
494
|
+
test('should throw an error if API response body is invalid JSON', async ({ network, assert }) => {
|
|
495
|
+
await mocker.organizations.slugs.validate(network, {
|
|
496
|
+
response: {
|
|
497
|
+
status: 200,
|
|
498
|
+
body: 'not json',
|
|
499
|
+
headers: { 'Content-Type': 'application/json' },
|
|
500
|
+
},
|
|
501
|
+
})
|
|
502
|
+
const error = await assert.rejects<Exception>(
|
|
503
|
+
async () => await sdk.organizations.slugs.validate(orgSlug),
|
|
504
|
+
Exception,
|
|
505
|
+
'Unable to validate the slug. Invalid JSON response.'
|
|
506
|
+
)
|
|
507
|
+
assert.strictEqual(error.status, 200)
|
|
508
|
+
})
|
|
509
|
+
|
|
510
|
+
test('should throw an error if API response data is missing "valid" property', async ({ network, assert }) => {
|
|
511
|
+
const invalidResponse = { other: 'stuff' }
|
|
512
|
+
await mocker.organizations.slugs.validate(network, {
|
|
513
|
+
response: {
|
|
514
|
+
status: 200,
|
|
515
|
+
body: JSON.stringify({ data: invalidResponse }),
|
|
516
|
+
headers: { 'Content-Type': 'application/json' },
|
|
517
|
+
},
|
|
518
|
+
})
|
|
519
|
+
|
|
520
|
+
const error = await assert.rejects<Exception>(
|
|
521
|
+
async () => await sdk.organizations.slugs.validate(orgSlug),
|
|
522
|
+
Exception,
|
|
523
|
+
'Unable to validate the slug. Unknown response from the server.'
|
|
524
|
+
)
|
|
525
|
+
assert.strictEqual(error.status, 200)
|
|
526
|
+
})
|
|
527
|
+
})
|
|
528
|
+
|
|
529
|
+
test.group('invitations.list()', (group) => {
|
|
530
|
+
let sdk: StoreSdk
|
|
531
|
+
let mocker: SdkNetworkMock
|
|
532
|
+
|
|
533
|
+
group.each.setup(() => {
|
|
534
|
+
sdk = new StoreSdk(baseUri)
|
|
535
|
+
sdk.token = baseToken
|
|
536
|
+
sdk.silent = true
|
|
537
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
538
|
+
})
|
|
539
|
+
const oid = 'org-list-inv-456'
|
|
540
|
+
const mockInvitationList: InvitationSchema[] = [
|
|
541
|
+
{
|
|
542
|
+
kind: InvitationKind,
|
|
543
|
+
key: 'inv-abc-123',
|
|
544
|
+
email: 'test1@example.com',
|
|
545
|
+
name: 'Test User 1',
|
|
546
|
+
grantType: 'editor',
|
|
547
|
+
oid,
|
|
548
|
+
createdAt: Date.now(),
|
|
549
|
+
updatedAt: Date.now(),
|
|
550
|
+
expiresAt: new Date(Date.now() + 86400000).getTime(),
|
|
551
|
+
status: 'pending',
|
|
552
|
+
token: 'token1',
|
|
553
|
+
uid: 'user1',
|
|
554
|
+
resent: 0,
|
|
555
|
+
lastSentAt: 0,
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
kind: InvitationKind,
|
|
559
|
+
key: 'inv-def-456',
|
|
560
|
+
email: 'test2@example.com',
|
|
561
|
+
name: 'Test User 2',
|
|
562
|
+
grantType: 'viewer',
|
|
563
|
+
oid,
|
|
564
|
+
createdAt: Date.now(),
|
|
565
|
+
updatedAt: Date.now(),
|
|
566
|
+
expiresAt: new Date(Date.now() + 172800000).getTime(),
|
|
567
|
+
status: 'accepted',
|
|
568
|
+
token: 'token2',
|
|
569
|
+
uid: 'user2',
|
|
570
|
+
resent: 0,
|
|
571
|
+
lastSentAt: 0,
|
|
572
|
+
},
|
|
573
|
+
]
|
|
574
|
+
const mockResponse = { data: mockInvitationList }
|
|
575
|
+
|
|
576
|
+
test('should successfully list invitations', async ({ network, assert }) => {
|
|
577
|
+
const handle = await mocker.organizations.invitations.list(network, {
|
|
578
|
+
response: {
|
|
579
|
+
status: 200,
|
|
580
|
+
body: JSON.stringify(mockResponse),
|
|
581
|
+
headers: { 'Content-Type': 'application/json' },
|
|
582
|
+
},
|
|
583
|
+
})
|
|
584
|
+
|
|
585
|
+
const result = await sdk.organizations.invitations.list(oid)
|
|
586
|
+
|
|
587
|
+
await handle.assert.calledOnceWith({
|
|
588
|
+
headers: { Authorization: `Bearer ${baseToken}` },
|
|
589
|
+
})
|
|
590
|
+
assert.deepEqual(result, mockResponse)
|
|
591
|
+
})
|
|
592
|
+
|
|
593
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
594
|
+
const handle = await mocker.organizations.invitations.list(network, {
|
|
595
|
+
response: {
|
|
596
|
+
status: 200,
|
|
597
|
+
body: JSON.stringify(mockResponse),
|
|
598
|
+
headers: { 'Content-Type': 'application/json' },
|
|
599
|
+
},
|
|
600
|
+
})
|
|
601
|
+
await sdk.organizations.invitations.list(oid, { token: 'custom-list-token' })
|
|
602
|
+
await handle.assert.calledOnceWith({
|
|
603
|
+
headers: { Authorization: `Bearer custom-list-token` },
|
|
604
|
+
})
|
|
605
|
+
})
|
|
606
|
+
|
|
607
|
+
test('should throw an error if API returns a non-200 status', async ({ network, assert }) => {
|
|
608
|
+
await mocker.organizations.invitations.list(network, {
|
|
609
|
+
response: {
|
|
610
|
+
status: 500,
|
|
611
|
+
body: JSON.stringify({
|
|
612
|
+
message: 'Internal Server Error',
|
|
613
|
+
status: 500,
|
|
614
|
+
help: 'Please try again later.',
|
|
615
|
+
name: 'InternalServerError',
|
|
616
|
+
code: 'E_INTERNAL_SERVER_ERROR',
|
|
617
|
+
}),
|
|
618
|
+
headers: { 'Content-Type': 'application/json' },
|
|
619
|
+
},
|
|
620
|
+
})
|
|
621
|
+
|
|
622
|
+
const error = await assert.rejects<Exception>(
|
|
623
|
+
async () => await sdk.organizations.invitations.list(oid),
|
|
624
|
+
Exception,
|
|
625
|
+
'Internal Server Error'
|
|
626
|
+
)
|
|
627
|
+
assert.strictEqual(error.help, 'Please try again later.')
|
|
628
|
+
assert.strictEqual(error.name, 'InternalServerError')
|
|
629
|
+
assert.strictEqual(error.code, 'E_INTERNAL_SERVER_ERROR')
|
|
630
|
+
assert.strictEqual(error.status, 500)
|
|
631
|
+
})
|
|
632
|
+
|
|
633
|
+
test('should throw an error if API response has no body', async ({ network, assert }) => {
|
|
634
|
+
await mocker.organizations.invitations.list(network, {
|
|
635
|
+
response: {
|
|
636
|
+
status: 200,
|
|
637
|
+
body: '',
|
|
638
|
+
headers: { 'Content-Type': 'application/json' },
|
|
639
|
+
},
|
|
640
|
+
})
|
|
641
|
+
const error = await assert.rejects<Exception>(
|
|
642
|
+
async () => await sdk.organizations.invitations.list(oid),
|
|
643
|
+
Exception,
|
|
644
|
+
'Unable to list organization invitations. The response has no value.'
|
|
645
|
+
)
|
|
646
|
+
assert.strictEqual(error.status, 200)
|
|
647
|
+
})
|
|
648
|
+
|
|
649
|
+
test('should throw an error if API response body is invalid JSON', async ({ network, assert }) => {
|
|
650
|
+
await mocker.organizations.invitations.list(network, {
|
|
651
|
+
response: {
|
|
652
|
+
status: 200,
|
|
653
|
+
body: 'this is not json',
|
|
654
|
+
headers: { 'Content-Type': 'application/json' },
|
|
655
|
+
},
|
|
656
|
+
})
|
|
657
|
+
|
|
658
|
+
const error = await assert.rejects<Exception>(
|
|
659
|
+
async () => await sdk.organizations.invitations.list(oid),
|
|
660
|
+
Exception,
|
|
661
|
+
'Unable to list organization invitations. Invalid JSON response.'
|
|
662
|
+
)
|
|
663
|
+
assert.strictEqual(error.status, 200)
|
|
664
|
+
})
|
|
665
|
+
|
|
666
|
+
test('should throw an error if API response data is missing "data" array', async ({ network, assert }) => {
|
|
667
|
+
await mocker.organizations.invitations.list(network, {
|
|
668
|
+
response: {
|
|
669
|
+
status: 200,
|
|
670
|
+
body: JSON.stringify({ data: { kind: OrganizationKind, otherData: 'stuff' } }),
|
|
671
|
+
headers: { 'Content-Type': 'application/json' },
|
|
672
|
+
},
|
|
673
|
+
})
|
|
674
|
+
|
|
675
|
+
const error = await assert.rejects<Exception>(
|
|
676
|
+
async () => await sdk.organizations.invitations.list(oid),
|
|
677
|
+
Exception,
|
|
678
|
+
'Unable to list organization invitations. Unknown response from the server.'
|
|
679
|
+
)
|
|
680
|
+
assert.strictEqual(error.status, 200)
|
|
681
|
+
})
|
|
682
|
+
})
|
|
683
|
+
|
|
684
|
+
test.group('invitations.create()', (group) => {
|
|
685
|
+
let sdk: StoreSdk
|
|
686
|
+
let mocker: SdkNetworkMock
|
|
687
|
+
|
|
688
|
+
group.each.setup(() => {
|
|
689
|
+
sdk = new StoreSdk(baseUri)
|
|
690
|
+
sdk.token = baseToken
|
|
691
|
+
sdk.silent = true
|
|
692
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
693
|
+
})
|
|
694
|
+
const oid = 'org-test-123'
|
|
695
|
+
const email = 'invitee@example.com'
|
|
696
|
+
const grantType: UserOrganizationGrantType = 'viewer'
|
|
697
|
+
const name = 'Invitee Name'
|
|
698
|
+
const mockInvitation: InvitationSchema = {
|
|
699
|
+
kind: InvitationKind,
|
|
700
|
+
key: 'inv-new-789',
|
|
701
|
+
email,
|
|
702
|
+
name,
|
|
703
|
+
grantType,
|
|
704
|
+
oid,
|
|
705
|
+
createdAt: Date.now(),
|
|
706
|
+
updatedAt: Date.now(),
|
|
707
|
+
expiresAt: new Date(Date.now() + 86400000).getTime(), // tomorrow
|
|
708
|
+
status: 'pending',
|
|
709
|
+
token: 'new-invitation-token',
|
|
710
|
+
uid: 'user-new-abc',
|
|
711
|
+
resent: 0,
|
|
712
|
+
lastSentAt: 0,
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
test('should successfully create an invitation with name', async ({ network, assert }) => {
|
|
716
|
+
const handle = await mocker.organizations.invitations.create(network, {
|
|
717
|
+
response: {
|
|
718
|
+
status: 200,
|
|
719
|
+
body: JSON.stringify({ data: mockInvitation }),
|
|
720
|
+
headers: { 'Content-Type': 'application/json' },
|
|
721
|
+
},
|
|
722
|
+
})
|
|
723
|
+
|
|
724
|
+
const result = await sdk.organizations.invitations.create(oid, email, grantType, name, {
|
|
725
|
+
token: 'custom-invite-token',
|
|
726
|
+
})
|
|
727
|
+
|
|
728
|
+
await handle.assert.calledOnceWith({
|
|
729
|
+
headers: { 'Authorization': `Bearer custom-invite-token`, 'Content-Type': 'application/json' },
|
|
730
|
+
body: JSON.stringify({ email, name, grant_type: grantType }),
|
|
731
|
+
})
|
|
732
|
+
assert.deepEqual(result, mockInvitation)
|
|
733
|
+
})
|
|
734
|
+
|
|
735
|
+
test('should successfully create an invitation without name', async ({ network, assert }) => {
|
|
736
|
+
const mockInvitationWithoutName = { ...mockInvitation }
|
|
737
|
+
delete mockInvitationWithoutName.name // Simulate no name provided
|
|
738
|
+
const handle = await mocker.organizations.invitations.create(network, {
|
|
739
|
+
response: {
|
|
740
|
+
status: 200,
|
|
741
|
+
body: JSON.stringify({ data: mockInvitationWithoutName }),
|
|
742
|
+
headers: { 'Content-Type': 'application/json' },
|
|
743
|
+
},
|
|
744
|
+
})
|
|
745
|
+
|
|
746
|
+
const result = await sdk.organizations.invitations.create(oid, email, grantType, undefined, {
|
|
747
|
+
token: 'custom-invite-token',
|
|
748
|
+
})
|
|
749
|
+
|
|
750
|
+
await handle.assert.calledOnceWith({
|
|
751
|
+
headers: { 'Authorization': `Bearer custom-invite-token`, 'Content-Type': 'application/json' },
|
|
752
|
+
body: JSON.stringify({ email, grant_type: grantType }),
|
|
753
|
+
})
|
|
754
|
+
assert.deepEqual(result, mockInvitationWithoutName)
|
|
755
|
+
})
|
|
756
|
+
|
|
757
|
+
test('should use default token if none provided in request options', async ({ network }) => {
|
|
758
|
+
const handle = await mocker.organizations.invitations.create(network, {
|
|
759
|
+
response: {
|
|
760
|
+
status: 200,
|
|
761
|
+
body: JSON.stringify({ data: mockInvitation }),
|
|
762
|
+
headers: { 'Content-Type': 'application/json' },
|
|
763
|
+
},
|
|
764
|
+
})
|
|
765
|
+
await sdk.organizations.invitations.create(oid, email, grantType, name)
|
|
766
|
+
await handle.assert.calledOnceWith({
|
|
767
|
+
headers: { 'Authorization': `Bearer ${baseToken}`, 'Content-Type': 'application/json' },
|
|
768
|
+
})
|
|
769
|
+
})
|
|
770
|
+
|
|
771
|
+
test('should throw an error if API returns a non-200 status', async ({ network, assert }) => {
|
|
772
|
+
await mocker.organizations.invitations.create(network, {
|
|
773
|
+
response: {
|
|
774
|
+
body: JSON.stringify({
|
|
775
|
+
message: 'Server Error',
|
|
776
|
+
status: 500,
|
|
777
|
+
help: 'Please try again later.',
|
|
778
|
+
name: 'InternalServerError',
|
|
779
|
+
code: 'E_INTERNAL_SERVER_ERROR',
|
|
780
|
+
}),
|
|
781
|
+
status: 500,
|
|
782
|
+
headers: { 'Content-Type': 'application/json' },
|
|
783
|
+
},
|
|
784
|
+
})
|
|
785
|
+
|
|
786
|
+
const error = await assert.rejects<Exception>(
|
|
787
|
+
async () => await sdk.organizations.invitations.create(oid, email, grantType, name),
|
|
788
|
+
Exception,
|
|
789
|
+
'Server Error'
|
|
790
|
+
)
|
|
791
|
+
assert.strictEqual(error.status, 500)
|
|
792
|
+
assert.strictEqual(error.help, 'Please try again later.')
|
|
793
|
+
assert.strictEqual(error.name, 'InternalServerError')
|
|
794
|
+
assert.strictEqual(error.code, 'E_INTERNAL_SERVER_ERROR')
|
|
795
|
+
})
|
|
796
|
+
|
|
797
|
+
test('should throw an error if API response has no body', async ({ network, assert }) => {
|
|
798
|
+
await mocker.organizations.invitations.create(network, {
|
|
799
|
+
response: {
|
|
800
|
+
status: 200,
|
|
801
|
+
body: '',
|
|
802
|
+
headers: { 'Content-Type': 'application/json' },
|
|
803
|
+
},
|
|
804
|
+
})
|
|
805
|
+
|
|
806
|
+
const error = await assert.rejects<Exception>(
|
|
807
|
+
async () => await sdk.organizations.invitations.create(oid, email, grantType, name),
|
|
808
|
+
Exception,
|
|
809
|
+
'Unable to create an invitation. The response has no value.'
|
|
810
|
+
)
|
|
811
|
+
assert.strictEqual(error.status, 200)
|
|
812
|
+
})
|
|
813
|
+
|
|
814
|
+
test('should throw an error if API response body is invalid JSON', async ({ network, assert }) => {
|
|
815
|
+
await mocker.organizations.invitations.create(network, {
|
|
816
|
+
response: {
|
|
817
|
+
status: 200,
|
|
818
|
+
body: 'not json',
|
|
819
|
+
headers: { 'Content-Type': 'application/json' },
|
|
820
|
+
},
|
|
821
|
+
})
|
|
822
|
+
|
|
823
|
+
const error = await assert.rejects<Exception>(
|
|
824
|
+
async () => await sdk.organizations.invitations.create(oid, email, grantType, name),
|
|
825
|
+
Exception,
|
|
826
|
+
'Unable to create an invitation. Invalid JSON response.'
|
|
827
|
+
)
|
|
828
|
+
assert.strictEqual(error.status, 200)
|
|
829
|
+
})
|
|
830
|
+
|
|
831
|
+
test('should throw an error if API response data is missing "kind" property', async ({ network, assert }) => {
|
|
832
|
+
const invalidResponse = { ...mockInvitation }
|
|
833
|
+
// @ts-expect-error Testing missing kind property
|
|
834
|
+
delete invalidResponse.kind
|
|
835
|
+
await mocker.organizations.invitations.create(network, {
|
|
836
|
+
response: {
|
|
837
|
+
status: 200,
|
|
838
|
+
body: JSON.stringify({ data: invalidResponse }),
|
|
839
|
+
headers: { 'Content-Type': 'application/json' },
|
|
840
|
+
},
|
|
841
|
+
})
|
|
842
|
+
|
|
843
|
+
await assert.rejects<Exception>(
|
|
844
|
+
async () => await sdk.organizations.invitations.create(oid, email, grantType, name),
|
|
845
|
+
Exception,
|
|
846
|
+
'Unable to create an invitation. Unknown response from the server.'
|
|
847
|
+
)
|
|
848
|
+
})
|
|
849
|
+
})
|
|
850
|
+
|
|
851
|
+
test.group('invitations.patch()', (group) => {
|
|
852
|
+
let sdk: StoreSdk
|
|
853
|
+
let mocker: SdkNetworkMock
|
|
854
|
+
|
|
855
|
+
group.each.setup(() => {
|
|
856
|
+
sdk = new StoreSdk(baseUri)
|
|
857
|
+
sdk.token = baseToken
|
|
858
|
+
sdk.silent = true
|
|
859
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
860
|
+
})
|
|
861
|
+
const oid = 'org-123'
|
|
862
|
+
const id = 'inv-456'
|
|
863
|
+
const patchInfo: PatchInfo = {
|
|
864
|
+
id: 'inv-456',
|
|
865
|
+
patch: [{ op: 'replace', path: '/name', value: 'New Name' }],
|
|
866
|
+
timestamp: Date.now(),
|
|
867
|
+
}
|
|
868
|
+
const mockInvitation: InvitationSchema = {
|
|
869
|
+
kind: InvitationKind,
|
|
870
|
+
key: 'inv-456',
|
|
871
|
+
email: 'test@example.com',
|
|
872
|
+
name: 'New Name',
|
|
873
|
+
grantType: 'editor',
|
|
874
|
+
oid: 'org-123',
|
|
875
|
+
createdAt: Date.now(),
|
|
876
|
+
updatedAt: Date.now(),
|
|
877
|
+
expiresAt: new Date(Date.now() + 86400000).getTime(), // tomorrow
|
|
878
|
+
status: 'pending',
|
|
879
|
+
token: 'invitation-token',
|
|
880
|
+
uid: 'user-789',
|
|
881
|
+
resent: 0,
|
|
882
|
+
lastSentAt: 0,
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
test('should successfully patch an invitation', async ({ network, assert }) => {
|
|
886
|
+
const handle = await mocker.organizations.invitations.patch(network, {
|
|
887
|
+
response: {
|
|
888
|
+
status: 200,
|
|
889
|
+
body: JSON.stringify({ data: mockInvitation }),
|
|
890
|
+
headers: { 'Content-Type': 'application/json' },
|
|
891
|
+
},
|
|
892
|
+
})
|
|
893
|
+
|
|
894
|
+
const result = await sdk.organizations.invitations.patch(oid, id, patchInfo, { token: 'custom-token' })
|
|
895
|
+
|
|
896
|
+
await handle.assert.calledOnceWith({
|
|
897
|
+
headers: { 'Authorization': `Bearer custom-token`, 'Content-Type': 'application/json' },
|
|
898
|
+
body: JSON.stringify(patchInfo),
|
|
899
|
+
})
|
|
900
|
+
assert.deepEqual(result, mockInvitation)
|
|
901
|
+
})
|
|
902
|
+
|
|
903
|
+
test('should use default token if none provided in request options', async ({ network }) => {
|
|
904
|
+
const handle = await mocker.organizations.invitations.patch(network, {
|
|
905
|
+
response: {
|
|
906
|
+
status: 200,
|
|
907
|
+
body: JSON.stringify({ data: mockInvitation }),
|
|
908
|
+
headers: { 'Content-Type': 'application/json' },
|
|
909
|
+
},
|
|
910
|
+
})
|
|
911
|
+
await sdk.organizations.invitations.patch(oid, id, patchInfo)
|
|
912
|
+
await handle.assert.calledOnceWith({
|
|
913
|
+
headers: { 'Authorization': `Bearer ${baseToken}`, 'Content-Type': 'application/json' },
|
|
914
|
+
body: JSON.stringify(patchInfo),
|
|
915
|
+
})
|
|
916
|
+
})
|
|
917
|
+
|
|
918
|
+
test('should throw an error if API returns a non-200 status', async ({ network, assert }) => {
|
|
919
|
+
await mocker.organizations.invitations.patch(network, {
|
|
920
|
+
response: {
|
|
921
|
+
status: 400,
|
|
922
|
+
body: JSON.stringify({
|
|
923
|
+
message: 'Bad Request',
|
|
924
|
+
status: 400,
|
|
925
|
+
help: 'Please try again later.',
|
|
926
|
+
name: 'InternalServerError',
|
|
927
|
+
code: 'E_INTERNAL_SERVER_ERROR',
|
|
928
|
+
}),
|
|
929
|
+
headers: { 'Content-Type': 'application/json' },
|
|
930
|
+
},
|
|
931
|
+
})
|
|
932
|
+
|
|
933
|
+
const error = await assert.rejects<Exception>(
|
|
934
|
+
async () => await sdk.organizations.invitations.patch(oid, id, patchInfo),
|
|
935
|
+
Exception,
|
|
936
|
+
'Bad Request'
|
|
937
|
+
)
|
|
938
|
+
|
|
939
|
+
assert.strictEqual(error.help, 'Please try again later.')
|
|
940
|
+
assert.strictEqual(error.name, 'InternalServerError')
|
|
941
|
+
assert.strictEqual(error.code, 'E_INTERNAL_SERVER_ERROR')
|
|
942
|
+
assert.strictEqual(error.status, 400)
|
|
943
|
+
})
|
|
944
|
+
|
|
945
|
+
test('should throw an error if API response has no body', async ({ network, assert }) => {
|
|
946
|
+
await mocker.organizations.invitations.patch(network, {
|
|
947
|
+
response: {
|
|
948
|
+
status: 200,
|
|
949
|
+
body: '',
|
|
950
|
+
headers: { 'Content-Type': 'application/json' },
|
|
951
|
+
},
|
|
952
|
+
})
|
|
953
|
+
|
|
954
|
+
await assert.rejects<Exception>(
|
|
955
|
+
async () => await sdk.organizations.invitations.patch(oid, id, patchInfo),
|
|
956
|
+
Exception,
|
|
957
|
+
'Unable to update invitation. The response has no value.'
|
|
958
|
+
)
|
|
959
|
+
})
|
|
960
|
+
|
|
961
|
+
test('should throw an error if API response body is invalid JSON', async ({ network, assert }) => {
|
|
962
|
+
await mocker.organizations.invitations.patch(network, {
|
|
963
|
+
response: {
|
|
964
|
+
status: 200,
|
|
965
|
+
body: 'invalid json',
|
|
966
|
+
headers: { 'Content-Type': 'application/json' },
|
|
967
|
+
},
|
|
968
|
+
})
|
|
969
|
+
|
|
970
|
+
await assert.rejects<Exception>(
|
|
971
|
+
async () => await sdk.organizations.invitations.patch(oid, id, patchInfo),
|
|
972
|
+
Exception,
|
|
973
|
+
'Unable to update invitation. Invalid JSON response.'
|
|
974
|
+
)
|
|
975
|
+
})
|
|
976
|
+
|
|
977
|
+
test('should throw an error if API response data is missing "kind" property', async ({ network, assert }) => {
|
|
978
|
+
const invalidInvitation = { ...mockInvitation }
|
|
979
|
+
// @ts-expect-error Testing missing kind property
|
|
980
|
+
delete invalidInvitation.kind
|
|
981
|
+
await mocker.organizations.invitations.patch(network, {
|
|
982
|
+
response: {
|
|
983
|
+
status: 200,
|
|
984
|
+
body: JSON.stringify({ data: invalidInvitation }),
|
|
985
|
+
headers: { 'Content-Type': 'application/json' },
|
|
986
|
+
},
|
|
987
|
+
})
|
|
988
|
+
|
|
989
|
+
await assert.rejects<Exception>(
|
|
990
|
+
async () => await sdk.organizations.invitations.patch(oid, id, patchInfo),
|
|
991
|
+
Exception,
|
|
992
|
+
'Unable to update invitation. Unknown response from the server.'
|
|
993
|
+
)
|
|
994
|
+
})
|
|
995
|
+
})
|
|
996
|
+
|
|
997
|
+
test.group('invitations.findByToken()', (group) => {
|
|
998
|
+
let sdk: StoreSdk
|
|
999
|
+
let mocker: SdkNetworkMock
|
|
1000
|
+
|
|
1001
|
+
group.each.setup(() => {
|
|
1002
|
+
sdk = new StoreSdk(baseUri)
|
|
1003
|
+
sdk.token = baseToken
|
|
1004
|
+
sdk.silent = true
|
|
1005
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
1006
|
+
})
|
|
1007
|
+
const oid = 'org-find-inv-by-token-001'
|
|
1008
|
+
const targetInvitationToken = 'a-valid-invitation-token-for-finding'
|
|
1009
|
+
const mockFoundInvitation: InvitationSchema = {
|
|
1010
|
+
kind: InvitationKind,
|
|
1011
|
+
key: 'inv-found-xyz-789',
|
|
1012
|
+
email: 'found@example.com',
|
|
1013
|
+
name: 'Found User',
|
|
1014
|
+
grantType: 'owner',
|
|
1015
|
+
oid,
|
|
1016
|
+
createdAt: Date.now(),
|
|
1017
|
+
updatedAt: Date.now(),
|
|
1018
|
+
expiresAt: new Date(Date.now() + 86400000 * 2).getTime(), // 2 days
|
|
1019
|
+
status: 'pending',
|
|
1020
|
+
token: targetInvitationToken,
|
|
1021
|
+
uid: 'user-found-abc',
|
|
1022
|
+
resent: 0,
|
|
1023
|
+
lastSentAt: 0,
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
test('should successfully find an invitation by token', async ({ network, assert }) => {
|
|
1027
|
+
const handle = await mocker.organizations.invitations.findByToken(network, {
|
|
1028
|
+
response: {
|
|
1029
|
+
status: 200,
|
|
1030
|
+
body: JSON.stringify({ data: mockFoundInvitation }),
|
|
1031
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1032
|
+
},
|
|
1033
|
+
})
|
|
1034
|
+
|
|
1035
|
+
const result = await sdk.organizations.invitations.findByToken(targetInvitationToken)
|
|
1036
|
+
|
|
1037
|
+
const expectedBaseUrl = sdk.getUrl(RouteBuilder.findInvitation())
|
|
1038
|
+
const expectedUrlWithToken = new URL(expectedBaseUrl.toString())
|
|
1039
|
+
expectedUrlWithToken.searchParams.set('token', targetInvitationToken)
|
|
1040
|
+
|
|
1041
|
+
await handle.assert.calledOnceWith({
|
|
1042
|
+
method: 'GET',
|
|
1043
|
+
headers: { Authorization: `Bearer ${baseToken}` },
|
|
1044
|
+
})
|
|
1045
|
+
assert.deepEqual(result, mockFoundInvitation)
|
|
1046
|
+
})
|
|
1047
|
+
|
|
1048
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
1049
|
+
const handle = await mocker.organizations.invitations.findByToken(network, {
|
|
1050
|
+
response: {
|
|
1051
|
+
status: 200,
|
|
1052
|
+
body: JSON.stringify({ data: mockFoundInvitation }),
|
|
1053
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1054
|
+
},
|
|
1055
|
+
})
|
|
1056
|
+
await sdk.organizations.invitations.findByToken(targetInvitationToken, { token: 'custom-find-token' })
|
|
1057
|
+
await handle.assert.calledOnceWith({
|
|
1058
|
+
method: 'GET',
|
|
1059
|
+
headers: { Authorization: `Bearer custom-find-token` },
|
|
1060
|
+
})
|
|
1061
|
+
})
|
|
1062
|
+
|
|
1063
|
+
test('should throw an Exception if API returns a non-200 status', async ({ network, assert }) => {
|
|
1064
|
+
await mocker.organizations.invitations.findByToken(network, {
|
|
1065
|
+
response: {
|
|
1066
|
+
status: 500,
|
|
1067
|
+
body: JSON.stringify({
|
|
1068
|
+
message: 'Server Error',
|
|
1069
|
+
status: 500,
|
|
1070
|
+
help: 'Please try again later.',
|
|
1071
|
+
name: 'InternalServerError',
|
|
1072
|
+
code: 'E_INTERNAL_SERVER_ERROR',
|
|
1073
|
+
}),
|
|
1074
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1075
|
+
},
|
|
1076
|
+
})
|
|
1077
|
+
|
|
1078
|
+
const error = await assert.rejects<Exception>(
|
|
1079
|
+
async () => await sdk.organizations.invitations.findByToken(targetInvitationToken),
|
|
1080
|
+
Exception,
|
|
1081
|
+
'Server Error'
|
|
1082
|
+
)
|
|
1083
|
+
assert.strictEqual(error.help, 'Please try again later.')
|
|
1084
|
+
assert.strictEqual(error.name, 'InternalServerError')
|
|
1085
|
+
assert.strictEqual(error.code, 'E_INTERNAL_SERVER_ERROR')
|
|
1086
|
+
assert.strictEqual(error.status, 500)
|
|
1087
|
+
})
|
|
1088
|
+
|
|
1089
|
+
test('should throw an Exception if API returns 404 (handled by inspectCommonStatusCodes)', async ({
|
|
1090
|
+
network,
|
|
1091
|
+
assert,
|
|
1092
|
+
}) => {
|
|
1093
|
+
// Note: inspectCommonStatusCodes will use a generic "Not found." message
|
|
1094
|
+
// if the response body isn't a valid Exception.
|
|
1095
|
+
await mocker.organizations.invitations.findByToken(network, {
|
|
1096
|
+
response: {
|
|
1097
|
+
status: 404,
|
|
1098
|
+
body: JSON.stringify({ msg: 'Resource does not exist' }),
|
|
1099
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1100
|
+
},
|
|
1101
|
+
})
|
|
1102
|
+
|
|
1103
|
+
const error = await assert.rejects<Exception>(
|
|
1104
|
+
async () => await sdk.organizations.invitations.findByToken(targetInvitationToken),
|
|
1105
|
+
Exception,
|
|
1106
|
+
'Not found'
|
|
1107
|
+
)
|
|
1108
|
+
assert.strictEqual(error.status, 404)
|
|
1109
|
+
})
|
|
1110
|
+
|
|
1111
|
+
test('should throw an Exception if API response has no body on 200 status', async ({ network, assert }) => {
|
|
1112
|
+
await mocker.organizations.invitations.findByToken(network, {
|
|
1113
|
+
response: {
|
|
1114
|
+
status: 200,
|
|
1115
|
+
body: '',
|
|
1116
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1117
|
+
},
|
|
1118
|
+
})
|
|
1119
|
+
|
|
1120
|
+
const error = await assert.rejects<Exception>(
|
|
1121
|
+
async () => await sdk.organizations.invitations.findByToken(targetInvitationToken),
|
|
1122
|
+
Exception,
|
|
1123
|
+
'Unable to find invitation by token. The response has no value.'
|
|
1124
|
+
)
|
|
1125
|
+
assert.strictEqual(error.status, 200)
|
|
1126
|
+
})
|
|
1127
|
+
|
|
1128
|
+
test('should throw an Exception if API response body is invalid JSON on 200 status', async ({ network, assert }) => {
|
|
1129
|
+
await mocker.organizations.invitations.findByToken(network, {
|
|
1130
|
+
response: {
|
|
1131
|
+
status: 200,
|
|
1132
|
+
body: 'this is not json at all',
|
|
1133
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1134
|
+
},
|
|
1135
|
+
})
|
|
1136
|
+
|
|
1137
|
+
const error = await assert.rejects<Exception>(
|
|
1138
|
+
async () => await sdk.organizations.invitations.findByToken(targetInvitationToken),
|
|
1139
|
+
Exception,
|
|
1140
|
+
'Unable to find invitation by token. Invalid JSON response.'
|
|
1141
|
+
)
|
|
1142
|
+
assert.strictEqual(error.status, 200)
|
|
1143
|
+
})
|
|
1144
|
+
|
|
1145
|
+
test('should throw an Exception if API response data is missing "kind" property on 200 status', async ({
|
|
1146
|
+
network,
|
|
1147
|
+
assert,
|
|
1148
|
+
}) => {
|
|
1149
|
+
const invalidResponse = { ...mockFoundInvitation }
|
|
1150
|
+
// @ts-expect-error Testing missing kind property
|
|
1151
|
+
delete invalidResponse.kind
|
|
1152
|
+
await mocker.organizations.invitations.findByToken(network, {
|
|
1153
|
+
response: {
|
|
1154
|
+
status: 200,
|
|
1155
|
+
body: JSON.stringify({ data: invalidResponse }),
|
|
1156
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1157
|
+
},
|
|
1158
|
+
})
|
|
1159
|
+
|
|
1160
|
+
const error = await assert.rejects<Exception>(
|
|
1161
|
+
async () => await sdk.organizations.invitations.findByToken(targetInvitationToken),
|
|
1162
|
+
Exception,
|
|
1163
|
+
'Unable to find invitation by token. Unknown response from the server.'
|
|
1164
|
+
)
|
|
1165
|
+
assert.strictEqual(error.status, 200)
|
|
1166
|
+
})
|
|
1167
|
+
|
|
1168
|
+
test('should throw an Exception if API response data is missing "kind" property on 200 status', async ({
|
|
1169
|
+
network,
|
|
1170
|
+
assert,
|
|
1171
|
+
}) => {
|
|
1172
|
+
const invalidResponse = { ...mockFoundInvitation }
|
|
1173
|
+
// @ts-expect-error Testing missing kind property
|
|
1174
|
+
delete invalidResponse.kind
|
|
1175
|
+
await mocker.organizations.invitations.findByToken(network, {
|
|
1176
|
+
response: {
|
|
1177
|
+
status: 200,
|
|
1178
|
+
body: JSON.stringify({ data: invalidResponse }),
|
|
1179
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1180
|
+
},
|
|
1181
|
+
})
|
|
1182
|
+
|
|
1183
|
+
const error = await assert.rejects<Exception>(
|
|
1184
|
+
async () => await sdk.organizations.invitations.findByToken(targetInvitationToken),
|
|
1185
|
+
Exception,
|
|
1186
|
+
'Unable to find invitation by token. Unknown response from the server.'
|
|
1187
|
+
)
|
|
1188
|
+
assert.strictEqual(error.status, 200)
|
|
1189
|
+
})
|
|
1190
|
+
|
|
1191
|
+
test('should correctly build URL when baseUri has a path', async ({ network }) => {
|
|
1192
|
+
const customBaseUri = 'http://localhost:3000/api/v2'
|
|
1193
|
+
sdk.baseUri = customBaseUri
|
|
1194
|
+
const handle = await mocker.organizations.invitations.findByToken(network, {
|
|
1195
|
+
response: {
|
|
1196
|
+
status: 200,
|
|
1197
|
+
body: JSON.stringify({ data: mockFoundInvitation }),
|
|
1198
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1199
|
+
},
|
|
1200
|
+
baseUri: customBaseUri,
|
|
1201
|
+
})
|
|
1202
|
+
|
|
1203
|
+
await sdk.organizations.invitations.findByToken(targetInvitationToken)
|
|
1204
|
+
|
|
1205
|
+
const expectedBaseUrl = sdk.getUrl(RouteBuilder.findInvitation()) // Should be http://localhost:3000/api/v2/v1/orgs/...
|
|
1206
|
+
const expectedUrlWithToken = new URL(expectedBaseUrl.toString())
|
|
1207
|
+
expectedUrlWithToken.searchParams.set('token', targetInvitationToken)
|
|
1208
|
+
|
|
1209
|
+
await handle.assert.calledOnceWith({
|
|
1210
|
+
method: 'GET',
|
|
1211
|
+
url: expectedUrlWithToken.toString(),
|
|
1212
|
+
})
|
|
1213
|
+
})
|
|
1214
|
+
})
|
|
1215
|
+
|
|
1216
|
+
test.group('invitations.decline()', (group) => {
|
|
1217
|
+
let sdk: StoreSdk
|
|
1218
|
+
let mocker: SdkNetworkMock
|
|
1219
|
+
|
|
1220
|
+
group.each.setup(() => {
|
|
1221
|
+
sdk = new StoreSdk(baseUri)
|
|
1222
|
+
sdk.token = baseToken
|
|
1223
|
+
sdk.silent = true
|
|
1224
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
1225
|
+
})
|
|
1226
|
+
const oid = 'org-decline-inv-test-001'
|
|
1227
|
+
const invitationId = 'inv-to-decline-456'
|
|
1228
|
+
const mockDeclinedInvitation: InvitationSchema = {
|
|
1229
|
+
kind: InvitationKind,
|
|
1230
|
+
key: invitationId,
|
|
1231
|
+
email: 'declined@example.com',
|
|
1232
|
+
name: 'Declined User',
|
|
1233
|
+
grantType: 'viewer',
|
|
1234
|
+
oid,
|
|
1235
|
+
createdAt: Date.now() - 100000, // Some time ago
|
|
1236
|
+
updatedAt: Date.now(), // Updated now
|
|
1237
|
+
expiresAt: new Date(Date.now() + 86400000).getTime(), // Expires tomorrow
|
|
1238
|
+
status: 'declined',
|
|
1239
|
+
token: 'old-invitation-token-now-declined',
|
|
1240
|
+
uid: 'user-who-declined',
|
|
1241
|
+
resent: 0,
|
|
1242
|
+
lastSentAt: 0,
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
test('should successfully decline an invitation', async ({ network, assert }) => {
|
|
1246
|
+
const handle = await mocker.organizations.invitations.decline(network, {
|
|
1247
|
+
response: {
|
|
1248
|
+
status: 200,
|
|
1249
|
+
body: JSON.stringify({ data: mockDeclinedInvitation }),
|
|
1250
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1251
|
+
},
|
|
1252
|
+
})
|
|
1253
|
+
|
|
1254
|
+
const result = await sdk.organizations.invitations.decline(oid, invitationId)
|
|
1255
|
+
|
|
1256
|
+
const expectedUrl = sdk.getUrl(RouteBuilder.declineInvitation(oid, invitationId)).toString()
|
|
1257
|
+
|
|
1258
|
+
await handle.assert.calledOnceWith({
|
|
1259
|
+
method: 'POST',
|
|
1260
|
+
url: expectedUrl,
|
|
1261
|
+
headers: { Authorization: `Bearer ${baseToken}` },
|
|
1262
|
+
})
|
|
1263
|
+
assert.deepEqual(result, mockDeclinedInvitation)
|
|
1264
|
+
})
|
|
1265
|
+
|
|
1266
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
1267
|
+
const handle = await mocker.organizations.invitations.decline(network, {
|
|
1268
|
+
response: {
|
|
1269
|
+
status: 200,
|
|
1270
|
+
body: JSON.stringify({ data: mockDeclinedInvitation }),
|
|
1271
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1272
|
+
},
|
|
1273
|
+
})
|
|
1274
|
+
|
|
1275
|
+
await sdk.organizations.invitations.decline(oid, invitationId, { token: 'custom-decline-token' })
|
|
1276
|
+
|
|
1277
|
+
await handle.assert.calledOnceWith({
|
|
1278
|
+
method: 'POST',
|
|
1279
|
+
headers: { Authorization: `Bearer custom-decline-token` },
|
|
1280
|
+
})
|
|
1281
|
+
})
|
|
1282
|
+
|
|
1283
|
+
test('should throw an Exception if API returns a non-200 status', async ({ network, assert }) => {
|
|
1284
|
+
await mocker.organizations.invitations.decline(network, {
|
|
1285
|
+
response: {
|
|
1286
|
+
status: 500,
|
|
1287
|
+
body: JSON.stringify({
|
|
1288
|
+
message: 'Server Error',
|
|
1289
|
+
status: 500,
|
|
1290
|
+
help: 'Please try again later.',
|
|
1291
|
+
name: 'InternalServerError',
|
|
1292
|
+
code: 'E_INTERNAL_SERVER_ERROR',
|
|
1293
|
+
}),
|
|
1294
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1295
|
+
},
|
|
1296
|
+
})
|
|
1297
|
+
|
|
1298
|
+
const error = await assert.rejects<Exception>(
|
|
1299
|
+
async () => await sdk.organizations.invitations.decline(oid, invitationId),
|
|
1300
|
+
Exception,
|
|
1301
|
+
'Server Error'
|
|
1302
|
+
)
|
|
1303
|
+
assert.strictEqual(error.help, 'Please try again later.')
|
|
1304
|
+
assert.strictEqual(error.name, 'InternalServerError')
|
|
1305
|
+
assert.strictEqual(error.code, 'E_INTERNAL_SERVER_ERROR')
|
|
1306
|
+
assert.strictEqual(error.status, 500)
|
|
1307
|
+
})
|
|
1308
|
+
|
|
1309
|
+
test('should throw an Exception if API returns 404 (handled by inspectCommonStatusCodes)', async ({
|
|
1310
|
+
network,
|
|
1311
|
+
assert,
|
|
1312
|
+
}) => {
|
|
1313
|
+
await mocker.organizations.invitations.decline(network, {
|
|
1314
|
+
response: {
|
|
1315
|
+
status: 404,
|
|
1316
|
+
body: JSON.stringify({ msg: 'Invitation not found to decline' }),
|
|
1317
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1318
|
+
},
|
|
1319
|
+
})
|
|
1320
|
+
|
|
1321
|
+
const error = await assert.rejects<Exception>(
|
|
1322
|
+
async () => await sdk.organizations.invitations.decline(oid, invitationId),
|
|
1323
|
+
Exception,
|
|
1324
|
+
'Not found'
|
|
1325
|
+
)
|
|
1326
|
+
assert.strictEqual(error.status, 404)
|
|
1327
|
+
})
|
|
1328
|
+
|
|
1329
|
+
test('should throw an Exception if API response has no body on 200 status', async ({ network, assert }) => {
|
|
1330
|
+
await mocker.organizations.invitations.decline(network, {
|
|
1331
|
+
response: {
|
|
1332
|
+
status: 200,
|
|
1333
|
+
body: '',
|
|
1334
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1335
|
+
},
|
|
1336
|
+
})
|
|
1337
|
+
|
|
1338
|
+
const error = await assert.rejects<Exception>(
|
|
1339
|
+
async () => await sdk.organizations.invitations.decline(oid, invitationId),
|
|
1340
|
+
Exception,
|
|
1341
|
+
'Unable to decline invitation. The response has no value.'
|
|
1342
|
+
)
|
|
1343
|
+
assert.strictEqual(error.status, 200)
|
|
1344
|
+
})
|
|
1345
|
+
|
|
1346
|
+
test('should throw an Exception if API response body is invalid JSON on 200 status', async ({ network, assert }) => {
|
|
1347
|
+
await mocker.organizations.invitations.decline(network, {
|
|
1348
|
+
response: {
|
|
1349
|
+
status: 200,
|
|
1350
|
+
body: 'not a valid json response for decline',
|
|
1351
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1352
|
+
},
|
|
1353
|
+
})
|
|
1354
|
+
|
|
1355
|
+
const error = await assert.rejects<Exception>(
|
|
1356
|
+
async () => await sdk.organizations.invitations.decline(oid, invitationId),
|
|
1357
|
+
Exception,
|
|
1358
|
+
'Unable to decline invitation. Invalid JSON response.'
|
|
1359
|
+
)
|
|
1360
|
+
assert.strictEqual(error.status, 200)
|
|
1361
|
+
})
|
|
1362
|
+
|
|
1363
|
+
test('should throw an Exception if API response data is missing "kind" property on 200 status', async ({
|
|
1364
|
+
network,
|
|
1365
|
+
assert,
|
|
1366
|
+
}) => {
|
|
1367
|
+
const invalidResponse = { ...mockDeclinedInvitation }
|
|
1368
|
+
// @ts-expect-error Testing missing kind property
|
|
1369
|
+
delete invalidResponse.kind
|
|
1370
|
+
|
|
1371
|
+
await mocker.organizations.invitations.decline(network, {
|
|
1372
|
+
response: {
|
|
1373
|
+
status: 200,
|
|
1374
|
+
body: JSON.stringify({ data: invalidResponse }),
|
|
1375
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1376
|
+
},
|
|
1377
|
+
})
|
|
1378
|
+
|
|
1379
|
+
const error = await assert.rejects<Exception>(
|
|
1380
|
+
async () => await sdk.organizations.invitations.decline(oid, invitationId),
|
|
1381
|
+
Exception,
|
|
1382
|
+
'Unable to decline invitation. Unknown response from the server.'
|
|
1383
|
+
)
|
|
1384
|
+
assert.strictEqual(error.status, 200)
|
|
1385
|
+
})
|
|
1386
|
+
|
|
1387
|
+
test('should correctly build URL when baseUri has a path', async ({ network }) => {
|
|
1388
|
+
const customBaseUri = 'http://localhost:3000/api/v3'
|
|
1389
|
+
sdk.baseUri = customBaseUri
|
|
1390
|
+
const handle = await mocker.organizations.invitations.decline(network, {
|
|
1391
|
+
response: {
|
|
1392
|
+
status: 200,
|
|
1393
|
+
body: JSON.stringify({ data: mockDeclinedInvitation }),
|
|
1394
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1395
|
+
},
|
|
1396
|
+
baseUri: customBaseUri,
|
|
1397
|
+
})
|
|
1398
|
+
|
|
1399
|
+
await sdk.organizations.invitations.decline(oid, invitationId)
|
|
1400
|
+
const expectedUrl = sdk.getUrl(RouteBuilder.declineInvitation(oid, invitationId)).toString()
|
|
1401
|
+
await handle.assert.calledOnceWith({
|
|
1402
|
+
method: 'POST',
|
|
1403
|
+
url: expectedUrl,
|
|
1404
|
+
})
|
|
1405
|
+
})
|
|
1406
|
+
})
|
|
1407
|
+
|
|
1408
|
+
test.group('invitations.delete()', (group) => {
|
|
1409
|
+
let sdk: StoreSdk
|
|
1410
|
+
let mocker: SdkNetworkMock
|
|
1411
|
+
|
|
1412
|
+
group.each.setup(() => {
|
|
1413
|
+
sdk = new StoreSdk(baseUri)
|
|
1414
|
+
sdk.token = baseToken
|
|
1415
|
+
sdk.silent = true
|
|
1416
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
1417
|
+
})
|
|
1418
|
+
const oid = 'org-delete-inv-op-002'
|
|
1419
|
+
const invitationIdToDelete = 'inv-to-be-deleted-789'
|
|
1420
|
+
const mockSoftDeletedInvitation: InvitationSchema = {
|
|
1421
|
+
kind: InvitationKind,
|
|
1422
|
+
key: invitationIdToDelete,
|
|
1423
|
+
email: 'deleted@example.com',
|
|
1424
|
+
name: 'Deleted User',
|
|
1425
|
+
grantType: 'owner',
|
|
1426
|
+
oid,
|
|
1427
|
+
createdAt: Date.now() - 200000, // Some time ago
|
|
1428
|
+
updatedAt: Date.now(), // Updated now
|
|
1429
|
+
deleted: true, // Soft-deleted flag
|
|
1430
|
+
deletedInfo: {
|
|
1431
|
+
byMe: true, // Indicating the user who deleted it
|
|
1432
|
+
time: Date.now(),
|
|
1433
|
+
},
|
|
1434
|
+
expiresAt: new Date(Date.now() + 86400000 * 3).getTime(), // Expires in 3 days
|
|
1435
|
+
status: 'declined',
|
|
1436
|
+
token: 'old-invitation-token-now-deleted-xyz',
|
|
1437
|
+
uid: 'user-who-was-deleted',
|
|
1438
|
+
resent: 0,
|
|
1439
|
+
lastSentAt: 0,
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
test('should successfully soft-delete an invitation and return it', async ({ network, assert }) => {
|
|
1443
|
+
const handle = await mocker.organizations.invitations.delete(network, {
|
|
1444
|
+
response: {
|
|
1445
|
+
status: 200,
|
|
1446
|
+
body: JSON.stringify({ data: mockSoftDeletedInvitation }),
|
|
1447
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1448
|
+
},
|
|
1449
|
+
})
|
|
1450
|
+
|
|
1451
|
+
const result = await sdk.organizations.invitations.delete(oid, invitationIdToDelete)
|
|
1452
|
+
|
|
1453
|
+
const expectedUrl = sdk.getUrl(RouteBuilder.invitation(oid, invitationIdToDelete)).toString()
|
|
1454
|
+
await handle.assert.calledOnceWith({
|
|
1455
|
+
method: 'DELETE',
|
|
1456
|
+
url: expectedUrl,
|
|
1457
|
+
})
|
|
1458
|
+
assert.deepEqual(result, mockSoftDeletedInvitation)
|
|
1459
|
+
})
|
|
1460
|
+
|
|
1461
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
1462
|
+
const handle = await mocker.organizations.invitations.delete(network, {
|
|
1463
|
+
response: {
|
|
1464
|
+
status: 200,
|
|
1465
|
+
body: JSON.stringify({ data: mockSoftDeletedInvitation }),
|
|
1466
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1467
|
+
},
|
|
1468
|
+
})
|
|
1469
|
+
await sdk.organizations.invitations.delete(oid, invitationIdToDelete, { token: 'custom-delete-op-token' })
|
|
1470
|
+
await handle.assert.calledOnceWith({
|
|
1471
|
+
method: 'DELETE',
|
|
1472
|
+
headers: { Authorization: 'Bearer custom-delete-op-token' },
|
|
1473
|
+
})
|
|
1474
|
+
})
|
|
1475
|
+
|
|
1476
|
+
test('should throw an Exception if API returns a non-200 status', async ({ network, assert }) => {
|
|
1477
|
+
await mocker.organizations.invitations.delete(network, {
|
|
1478
|
+
response: {
|
|
1479
|
+
status: 500,
|
|
1480
|
+
body: JSON.stringify({
|
|
1481
|
+
message: 'Server Error',
|
|
1482
|
+
status: 500,
|
|
1483
|
+
help: 'Please try again later.',
|
|
1484
|
+
name: 'InternalServerError',
|
|
1485
|
+
code: 'E_INTERNAL_SERVER_ERROR',
|
|
1486
|
+
}),
|
|
1487
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1488
|
+
},
|
|
1489
|
+
})
|
|
1490
|
+
|
|
1491
|
+
const error = await assert.rejects<Exception>(
|
|
1492
|
+
async () => await sdk.organizations.invitations.delete(oid, invitationIdToDelete),
|
|
1493
|
+
Exception,
|
|
1494
|
+
'Server Error'
|
|
1495
|
+
)
|
|
1496
|
+
assert.strictEqual(error.help, 'Please try again later.')
|
|
1497
|
+
assert.strictEqual(error.name, 'InternalServerError')
|
|
1498
|
+
assert.strictEqual(error.code, 'E_INTERNAL_SERVER_ERROR')
|
|
1499
|
+
})
|
|
1500
|
+
|
|
1501
|
+
test('should throw an Exception if API returns 404 (handled by inspectCommonStatusCodes)', async ({
|
|
1502
|
+
network,
|
|
1503
|
+
assert,
|
|
1504
|
+
}) => {
|
|
1505
|
+
await mocker.organizations.invitations.delete(network, {
|
|
1506
|
+
response: {
|
|
1507
|
+
status: 404,
|
|
1508
|
+
body: JSON.stringify({ msg: 'Invitation not found to delete' }),
|
|
1509
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1510
|
+
},
|
|
1511
|
+
})
|
|
1512
|
+
|
|
1513
|
+
const error = await assert.rejects<Exception>(
|
|
1514
|
+
async () => await sdk.organizations.invitations.delete(oid, invitationIdToDelete),
|
|
1515
|
+
Exception,
|
|
1516
|
+
'Not found'
|
|
1517
|
+
)
|
|
1518
|
+
assert.strictEqual(error.status, 404)
|
|
1519
|
+
})
|
|
1520
|
+
|
|
1521
|
+
test('should throw an Exception if API response has no body on 200 status', async ({ network, assert }) => {
|
|
1522
|
+
await mocker.organizations.invitations.delete(network, {
|
|
1523
|
+
response: {
|
|
1524
|
+
status: 200,
|
|
1525
|
+
body: '',
|
|
1526
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1527
|
+
},
|
|
1528
|
+
})
|
|
1529
|
+
await assert.rejects<Exception>(
|
|
1530
|
+
async () => await sdk.organizations.invitations.delete(oid, invitationIdToDelete),
|
|
1531
|
+
Exception,
|
|
1532
|
+
'Unable to delete invitation. The response has no value.'
|
|
1533
|
+
)
|
|
1534
|
+
})
|
|
1535
|
+
|
|
1536
|
+
test('should throw an Exception if API response body is invalid JSON on 200 status', async ({ network, assert }) => {
|
|
1537
|
+
await mocker.organizations.invitations.delete(network, {
|
|
1538
|
+
response: {
|
|
1539
|
+
status: 200,
|
|
1540
|
+
body: 'this is not json for delete op',
|
|
1541
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1542
|
+
},
|
|
1543
|
+
})
|
|
1544
|
+
await assert.rejects<Exception>(
|
|
1545
|
+
async () => await sdk.organizations.invitations.delete(oid, invitationIdToDelete),
|
|
1546
|
+
Exception,
|
|
1547
|
+
'Unable to delete invitation. Invalid JSON response.'
|
|
1548
|
+
)
|
|
1549
|
+
})
|
|
1550
|
+
|
|
1551
|
+
test('should throw an Exception if API response data is missing "kind" property on 200 status', async ({
|
|
1552
|
+
network,
|
|
1553
|
+
assert,
|
|
1554
|
+
}) => {
|
|
1555
|
+
const invalidResponse = { ...mockSoftDeletedInvitation }
|
|
1556
|
+
// @ts-expect-error Testing missing kind property
|
|
1557
|
+
delete invalidResponse.kind
|
|
1558
|
+
|
|
1559
|
+
await mocker.organizations.invitations.delete(network, {
|
|
1560
|
+
response: {
|
|
1561
|
+
status: 200,
|
|
1562
|
+
body: JSON.stringify({ data: invalidResponse }),
|
|
1563
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1564
|
+
},
|
|
1565
|
+
})
|
|
1566
|
+
|
|
1567
|
+
await assert.rejects<Exception>(
|
|
1568
|
+
async () => await sdk.organizations.invitations.delete(oid, invitationIdToDelete),
|
|
1569
|
+
Exception,
|
|
1570
|
+
'Unable to delete invitation. Unknown response from the server.'
|
|
1571
|
+
)
|
|
1572
|
+
})
|
|
1573
|
+
|
|
1574
|
+
test('should correctly build URL when baseUri has a path', async ({ network }) => {
|
|
1575
|
+
const customBaseUri = 'http://localhost:3000/api/v4'
|
|
1576
|
+
sdk.baseUri = customBaseUri
|
|
1577
|
+
const handle = await mocker.organizations.invitations.delete(network, {
|
|
1578
|
+
response: {
|
|
1579
|
+
status: 200,
|
|
1580
|
+
body: JSON.stringify({ data: mockSoftDeletedInvitation }),
|
|
1581
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1582
|
+
},
|
|
1583
|
+
baseUri: customBaseUri,
|
|
1584
|
+
})
|
|
1585
|
+
await sdk.organizations.invitations.delete(oid, invitationIdToDelete)
|
|
1586
|
+
const expectedUrl = sdk.getUrl(RouteBuilder.invitation(oid, invitationIdToDelete)).toString()
|
|
1587
|
+
await handle.assert.calledOnceWith({
|
|
1588
|
+
method: 'DELETE',
|
|
1589
|
+
url: expectedUrl,
|
|
1590
|
+
})
|
|
1591
|
+
})
|
|
1592
|
+
})
|
|
1593
|
+
|
|
1594
|
+
test.group('users.list()', (group) => {
|
|
1595
|
+
let sdk: StoreSdk
|
|
1596
|
+
let mocker: SdkNetworkMock
|
|
1597
|
+
|
|
1598
|
+
group.each.setup(() => {
|
|
1599
|
+
sdk = new StoreSdk(baseUri)
|
|
1600
|
+
sdk.token = baseToken
|
|
1601
|
+
sdk.silent = true
|
|
1602
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
1603
|
+
})
|
|
1604
|
+
const oid = 'org-user-list-789'
|
|
1605
|
+
const mockUserList: UserSchema[] = [
|
|
1606
|
+
{
|
|
1607
|
+
key: 'user-abc-123',
|
|
1608
|
+
kind: UserKind,
|
|
1609
|
+
name: 'User Alpha',
|
|
1610
|
+
email: [{ email: 'alpha@example.com' }],
|
|
1611
|
+
created: 1,
|
|
1612
|
+
updated: 2,
|
|
1613
|
+
},
|
|
1614
|
+
{
|
|
1615
|
+
key: 'user-def-456',
|
|
1616
|
+
kind: UserKind,
|
|
1617
|
+
name: 'User Beta',
|
|
1618
|
+
email: [{ email: 'beta@example.com' }],
|
|
1619
|
+
created: 3,
|
|
1620
|
+
updated: 4,
|
|
1621
|
+
},
|
|
1622
|
+
]
|
|
1623
|
+
const mockResponse: ContextListResult<UserSchema> = { data: mockUserList }
|
|
1624
|
+
|
|
1625
|
+
test('should successfully list users in an organization', async ({ network, assert }) => {
|
|
1626
|
+
const handle = await mocker.organizations.users.list(network, {
|
|
1627
|
+
response: {
|
|
1628
|
+
status: 200,
|
|
1629
|
+
body: JSON.stringify(mockResponse),
|
|
1630
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1631
|
+
},
|
|
1632
|
+
})
|
|
1633
|
+
|
|
1634
|
+
const result = await sdk.organizations.users.list(oid)
|
|
1635
|
+
|
|
1636
|
+
const expectedUrl = sdk.getUrl(RouteBuilder.organizationUsers(oid)).toString()
|
|
1637
|
+
await handle.assert.calledOnceWith({
|
|
1638
|
+
method: 'GET',
|
|
1639
|
+
url: expectedUrl,
|
|
1640
|
+
})
|
|
1641
|
+
assert.deepEqual(result, mockResponse)
|
|
1642
|
+
})
|
|
1643
|
+
|
|
1644
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
1645
|
+
const handle = await mocker.organizations.users.list(network, {
|
|
1646
|
+
response: {
|
|
1647
|
+
status: 200,
|
|
1648
|
+
body: JSON.stringify(mockResponse),
|
|
1649
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1650
|
+
},
|
|
1651
|
+
})
|
|
1652
|
+
await sdk.organizations.users.list(oid, undefined, { token: 'custom-user-list-token' })
|
|
1653
|
+
await handle.assert.calledOnceWith({
|
|
1654
|
+
method: 'GET',
|
|
1655
|
+
headers: { Authorization: 'Bearer custom-user-list-token' },
|
|
1656
|
+
})
|
|
1657
|
+
})
|
|
1658
|
+
|
|
1659
|
+
test('should append ContextListOptions to the URL', async ({ network }) => {
|
|
1660
|
+
const handle = await mocker.organizations.users.list(network, {
|
|
1661
|
+
response: {
|
|
1662
|
+
status: 200,
|
|
1663
|
+
body: JSON.stringify(mockResponse),
|
|
1664
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1665
|
+
},
|
|
1666
|
+
})
|
|
1667
|
+
const listOptions: ContextListOptions = { limit: 10, cursor: 'next-page', sort: 'name', order: 'asc' }
|
|
1668
|
+
await sdk.organizations.users.list(oid, listOptions)
|
|
1669
|
+
|
|
1670
|
+
const expectedUrl = sdk.getUrl(RouteBuilder.organizationUsers(oid))
|
|
1671
|
+
sdk.appendListOptions(expectedUrl, listOptions) // Helper to build expected URL with options
|
|
1672
|
+
|
|
1673
|
+
await handle.assert.calledOnceWith({
|
|
1674
|
+
method: 'GET',
|
|
1675
|
+
url: expectedUrl.toString(),
|
|
1676
|
+
})
|
|
1677
|
+
})
|
|
1678
|
+
|
|
1679
|
+
test('should throw an error if API returns a non-200 status', async ({ network, assert }) => {
|
|
1680
|
+
await mocker.organizations.users.list(network, {
|
|
1681
|
+
response: {
|
|
1682
|
+
status: 500,
|
|
1683
|
+
body: JSON.stringify({
|
|
1684
|
+
message: 'Server Error For Users',
|
|
1685
|
+
status: 500,
|
|
1686
|
+
help: 'Try again.',
|
|
1687
|
+
name: 'UserListServerError',
|
|
1688
|
+
code: 'E_USER_LIST_SERVER_ERROR',
|
|
1689
|
+
}),
|
|
1690
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1691
|
+
},
|
|
1692
|
+
})
|
|
1693
|
+
|
|
1694
|
+
const error = await assert.rejects<Exception>(
|
|
1695
|
+
async () => await sdk.organizations.users.list(oid),
|
|
1696
|
+
Exception,
|
|
1697
|
+
'Server Error For Users'
|
|
1698
|
+
)
|
|
1699
|
+
|
|
1700
|
+
assert.strictEqual(error.help, 'Try again.')
|
|
1701
|
+
assert.strictEqual(error.name, 'UserListServerError')
|
|
1702
|
+
assert.strictEqual(error.code, 'E_USER_LIST_SERVER_ERROR')
|
|
1703
|
+
assert.strictEqual(error.status, 500)
|
|
1704
|
+
})
|
|
1705
|
+
|
|
1706
|
+
test('should throw an error if API response has no body', async ({ network, assert }) => {
|
|
1707
|
+
await mocker.organizations.users.list(network, {
|
|
1708
|
+
response: {
|
|
1709
|
+
status: 200,
|
|
1710
|
+
body: '',
|
|
1711
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1712
|
+
},
|
|
1713
|
+
})
|
|
1714
|
+
|
|
1715
|
+
await assert.rejects<Exception>(
|
|
1716
|
+
async () => await sdk.organizations.users.list(oid),
|
|
1717
|
+
Exception,
|
|
1718
|
+
'Unable to list projects. The response has no value.'
|
|
1719
|
+
)
|
|
1720
|
+
})
|
|
1721
|
+
|
|
1722
|
+
test('should throw an error if API response body is invalid JSON', async ({ network, assert }) => {
|
|
1723
|
+
await mocker.organizations.users.list(network, {
|
|
1724
|
+
response: {
|
|
1725
|
+
status: 200,
|
|
1726
|
+
body: 'this is not json for users',
|
|
1727
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1728
|
+
},
|
|
1729
|
+
})
|
|
1730
|
+
|
|
1731
|
+
await assert.rejects<Exception>(
|
|
1732
|
+
async () => await sdk.organizations.users.list(oid),
|
|
1733
|
+
Exception,
|
|
1734
|
+
'Unable to list projects. Invalid JSON response.'
|
|
1735
|
+
)
|
|
1736
|
+
})
|
|
1737
|
+
|
|
1738
|
+
test('should throw an error if API response data is missing "data" array', async ({ network, assert }) => {
|
|
1739
|
+
await mocker.organizations.users.list(network, {
|
|
1740
|
+
response: {
|
|
1741
|
+
status: 200,
|
|
1742
|
+
body: JSON.stringify({ kind: 'list', otherData: 'no data here' }),
|
|
1743
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1744
|
+
},
|
|
1745
|
+
})
|
|
1746
|
+
|
|
1747
|
+
await assert.rejects<Exception>(
|
|
1748
|
+
async () => await sdk.organizations.users.list(oid),
|
|
1749
|
+
Exception,
|
|
1750
|
+
'Unable to list projects. Unknown response from the server.'
|
|
1751
|
+
)
|
|
1752
|
+
})
|
|
1753
|
+
|
|
1754
|
+
test('should correctly build URL when baseUri has a path', async ({ network }) => {
|
|
1755
|
+
const customBaseUri = 'http://localhost:3000/api/v5'
|
|
1756
|
+
sdk.baseUri = customBaseUri
|
|
1757
|
+
const handle = await mocker.organizations.users.list(network, {
|
|
1758
|
+
response: {
|
|
1759
|
+
status: 200,
|
|
1760
|
+
body: JSON.stringify(mockResponse),
|
|
1761
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1762
|
+
},
|
|
1763
|
+
baseUri: customBaseUri,
|
|
1764
|
+
})
|
|
1765
|
+
await sdk.organizations.users.list(oid)
|
|
1766
|
+
const expectedUrl = sdk.getUrl(RouteBuilder.organizationUsers(oid)).toString()
|
|
1767
|
+
await handle.assert.calledOnceWith({
|
|
1768
|
+
method: 'GET',
|
|
1769
|
+
url: expectedUrl,
|
|
1770
|
+
})
|
|
1771
|
+
})
|
|
1772
|
+
})
|
|
1773
|
+
|
|
1774
|
+
test.group('users.read()', (group) => {
|
|
1775
|
+
let sdk: StoreSdk
|
|
1776
|
+
let mocker: SdkNetworkMock
|
|
1777
|
+
|
|
1778
|
+
group.each.setup(() => {
|
|
1779
|
+
sdk = new StoreSdk(baseUri)
|
|
1780
|
+
sdk.token = baseToken
|
|
1781
|
+
sdk.silent = true
|
|
1782
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
1783
|
+
})
|
|
1784
|
+
const oid = 'org-user-read-123'
|
|
1785
|
+
const userId = 'user-to-read-456'
|
|
1786
|
+
const mockUser: UserSchema = {
|
|
1787
|
+
key: userId,
|
|
1788
|
+
kind: UserKind,
|
|
1789
|
+
name: 'Specific User',
|
|
1790
|
+
email: [{ email: 'specific@example.com', verified: true }],
|
|
1791
|
+
created: Date.now() - 100000,
|
|
1792
|
+
updated: Date.now(),
|
|
1793
|
+
status: 'active',
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
test('should successfully read a user from an organization', async ({ network, assert }) => {
|
|
1797
|
+
const handle = await mocker.organizations.users.read(network, {
|
|
1798
|
+
response: {
|
|
1799
|
+
status: 200,
|
|
1800
|
+
body: JSON.stringify({ data: mockUser }),
|
|
1801
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1802
|
+
},
|
|
1803
|
+
})
|
|
1804
|
+
|
|
1805
|
+
const result = await sdk.organizations.users.read(oid, userId)
|
|
1806
|
+
|
|
1807
|
+
const expectedUrl = sdk.getUrl(RouteBuilder.organizationUser(oid, userId)).toString()
|
|
1808
|
+
await handle.assert.calledOnceWith({
|
|
1809
|
+
method: 'GET',
|
|
1810
|
+
url: expectedUrl,
|
|
1811
|
+
headers: { Authorization: `Bearer ${baseToken}` },
|
|
1812
|
+
})
|
|
1813
|
+
assert.deepEqual(result, mockUser)
|
|
1814
|
+
})
|
|
1815
|
+
|
|
1816
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
1817
|
+
const handle = await mocker.organizations.users.read(network, {
|
|
1818
|
+
response: {
|
|
1819
|
+
status: 200,
|
|
1820
|
+
body: JSON.stringify({ data: mockUser }),
|
|
1821
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1822
|
+
},
|
|
1823
|
+
})
|
|
1824
|
+
await sdk.organizations.users.read(oid, userId, { token: 'custom-read-user-token' })
|
|
1825
|
+
await handle.assert.calledOnceWith({
|
|
1826
|
+
method: 'GET',
|
|
1827
|
+
headers: { Authorization: `Bearer custom-read-user-token` },
|
|
1828
|
+
})
|
|
1829
|
+
})
|
|
1830
|
+
|
|
1831
|
+
test('should throw an error if API returns a non-200 status (e.g., 500)', async ({ network, assert }) => {
|
|
1832
|
+
const errorResponse = {
|
|
1833
|
+
message: 'Server Error For Reading User',
|
|
1834
|
+
status: 500,
|
|
1835
|
+
help: 'Try again later.',
|
|
1836
|
+
name: 'UserReadServerError',
|
|
1837
|
+
code: 'E_USER_READ_SERVER_ERROR',
|
|
1838
|
+
}
|
|
1839
|
+
await mocker.organizations.users.read(network, {
|
|
1840
|
+
response: {
|
|
1841
|
+
status: 500,
|
|
1842
|
+
body: JSON.stringify(errorResponse),
|
|
1843
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1844
|
+
},
|
|
1845
|
+
})
|
|
1846
|
+
|
|
1847
|
+
const error = await assert.rejects<Exception>(
|
|
1848
|
+
async () => await sdk.organizations.users.read(oid, userId),
|
|
1849
|
+
Exception,
|
|
1850
|
+
errorResponse.message
|
|
1851
|
+
)
|
|
1852
|
+
assert.strictEqual(error.help, errorResponse.help)
|
|
1853
|
+
assert.strictEqual(error.name, errorResponse.name)
|
|
1854
|
+
assert.strictEqual(error.code, errorResponse.code)
|
|
1855
|
+
assert.strictEqual(error.status, errorResponse.status)
|
|
1856
|
+
})
|
|
1857
|
+
|
|
1858
|
+
test('should throw an error if API returns 404 (Not Found)', async ({ network, assert }) => {
|
|
1859
|
+
await mocker.organizations.users.read(network, {
|
|
1860
|
+
response: {
|
|
1861
|
+
status: 404,
|
|
1862
|
+
body: JSON.stringify({ message: 'User not found' }),
|
|
1863
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1864
|
+
},
|
|
1865
|
+
})
|
|
1866
|
+
|
|
1867
|
+
const error = await assert.rejects<Exception>(
|
|
1868
|
+
async () => await sdk.organizations.users.read(oid, userId),
|
|
1869
|
+
Exception,
|
|
1870
|
+
'User not found'
|
|
1871
|
+
)
|
|
1872
|
+
assert.strictEqual(error.status, 404)
|
|
1873
|
+
})
|
|
1874
|
+
|
|
1875
|
+
test('should throw an error if API response has no body on 200 status', async ({ network, assert }) => {
|
|
1876
|
+
await mocker.organizations.users.read(network, {
|
|
1877
|
+
response: {
|
|
1878
|
+
status: 200,
|
|
1879
|
+
body: '',
|
|
1880
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1881
|
+
},
|
|
1882
|
+
})
|
|
1883
|
+
|
|
1884
|
+
const error = await assert.rejects<Exception>(
|
|
1885
|
+
async () => await sdk.organizations.users.read(oid, userId),
|
|
1886
|
+
Exception,
|
|
1887
|
+
'Unable to read the user info. The response has no value.'
|
|
1888
|
+
)
|
|
1889
|
+
assert.strictEqual(error.status, 200)
|
|
1890
|
+
})
|
|
1891
|
+
|
|
1892
|
+
test('should throw an error if API response body is invalid JSON on 200 status', async ({ network, assert }) => {
|
|
1893
|
+
await mocker.organizations.users.read(network, {
|
|
1894
|
+
response: {
|
|
1895
|
+
status: 200,
|
|
1896
|
+
body: 'this is not json for a single user',
|
|
1897
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1898
|
+
},
|
|
1899
|
+
})
|
|
1900
|
+
|
|
1901
|
+
const error = await assert.rejects<Exception>(
|
|
1902
|
+
async () => await sdk.organizations.users.read(oid, userId),
|
|
1903
|
+
Exception,
|
|
1904
|
+
'Unable to read the user info. Invalid JSON response.'
|
|
1905
|
+
)
|
|
1906
|
+
assert.strictEqual(error.status, 200)
|
|
1907
|
+
})
|
|
1908
|
+
|
|
1909
|
+
test('should correctly build URL when baseUri has a path', async ({ network }) => {
|
|
1910
|
+
const customBaseUri = 'http://localhost:3000/api/v6'
|
|
1911
|
+
sdk.baseUri = customBaseUri
|
|
1912
|
+
const handle = await mocker.organizations.users.read(network, {
|
|
1913
|
+
response: {
|
|
1914
|
+
status: 200,
|
|
1915
|
+
body: JSON.stringify({ data: mockUser }),
|
|
1916
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1917
|
+
},
|
|
1918
|
+
baseUri: customBaseUri,
|
|
1919
|
+
})
|
|
1920
|
+
await sdk.organizations.users.read(oid, userId)
|
|
1921
|
+
await handle.assert.calledOnceWith({
|
|
1922
|
+
url: `http://localhost:3000/api/v6/v1/orgs/${oid}/users/${userId}`,
|
|
1923
|
+
})
|
|
1924
|
+
})
|
|
1925
|
+
})
|
|
1926
|
+
|
|
1927
|
+
test.group('users.activate()', (group) => {
|
|
1928
|
+
let sdk: StoreSdk
|
|
1929
|
+
let mocker: SdkNetworkMock
|
|
1930
|
+
|
|
1931
|
+
group.each.setup(() => {
|
|
1932
|
+
sdk = new StoreSdk(baseUri)
|
|
1933
|
+
sdk.token = baseToken
|
|
1934
|
+
sdk.silent = true
|
|
1935
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
1936
|
+
})
|
|
1937
|
+
const oid = 'org-user-activate-789'
|
|
1938
|
+
const userId = 'user-to-activate-101'
|
|
1939
|
+
const mockActivatedUser: UserSchema = {
|
|
1940
|
+
key: userId,
|
|
1941
|
+
kind: UserKind,
|
|
1942
|
+
name: 'Newly Activated User',
|
|
1943
|
+
email: [{ email: 'activated@example.com', verified: true }],
|
|
1944
|
+
created: Date.now() - 200000,
|
|
1945
|
+
updated: Date.now(),
|
|
1946
|
+
status: 'active', // Key change
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
test('should successfully activate a user in an organization', async ({ network, assert }) => {
|
|
1950
|
+
const handle = await mocker.organizations.users.activate(network, {
|
|
1951
|
+
response: {
|
|
1952
|
+
status: 200,
|
|
1953
|
+
body: JSON.stringify({ data: mockActivatedUser }),
|
|
1954
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1955
|
+
},
|
|
1956
|
+
})
|
|
1957
|
+
|
|
1958
|
+
const result = await sdk.organizations.users.activate(oid, userId)
|
|
1959
|
+
|
|
1960
|
+
const expectedUrl = sdk.getUrl(RouteBuilder.organizationUserActivate(oid, userId)).toString()
|
|
1961
|
+
await handle.assert.calledOnceWith({
|
|
1962
|
+
url: expectedUrl,
|
|
1963
|
+
method: 'POST',
|
|
1964
|
+
headers: { Authorization: `Bearer ${baseToken}` },
|
|
1965
|
+
})
|
|
1966
|
+
assert.deepEqual(result, mockActivatedUser)
|
|
1967
|
+
})
|
|
1968
|
+
|
|
1969
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
1970
|
+
const handle = await mocker.organizations.users.activate(network, {
|
|
1971
|
+
response: {
|
|
1972
|
+
status: 200,
|
|
1973
|
+
body: JSON.stringify(mockActivatedUser),
|
|
1974
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1975
|
+
},
|
|
1976
|
+
})
|
|
1977
|
+
await sdk.organizations.users.activate(oid, userId, { token: 'custom-activate-user-token' })
|
|
1978
|
+
await handle.assert.calledOnceWith({
|
|
1979
|
+
method: 'POST',
|
|
1980
|
+
headers: { Authorization: `Bearer custom-activate-user-token` },
|
|
1981
|
+
})
|
|
1982
|
+
})
|
|
1983
|
+
|
|
1984
|
+
test('should throw an error if API returns a non-200 status (e.g., 500)', async ({ network, assert }) => {
|
|
1985
|
+
const errorResponse = {
|
|
1986
|
+
message: 'Server Error Activating User',
|
|
1987
|
+
status: 500,
|
|
1988
|
+
help: 'Try again later.',
|
|
1989
|
+
name: 'UserActivateServerError',
|
|
1990
|
+
code: 'E_USER_ACTIVATE_SERVER_ERROR',
|
|
1991
|
+
}
|
|
1992
|
+
await mocker.organizations.users.activate(network, {
|
|
1993
|
+
response: {
|
|
1994
|
+
status: 500,
|
|
1995
|
+
body: JSON.stringify(errorResponse),
|
|
1996
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1997
|
+
},
|
|
1998
|
+
})
|
|
1999
|
+
|
|
2000
|
+
const error = await assert.rejects(
|
|
2001
|
+
async () => await sdk.organizations.users.activate(oid, userId),
|
|
2002
|
+
Exception,
|
|
2003
|
+
'Server Error Activating User'
|
|
2004
|
+
)
|
|
2005
|
+
assert.strictEqual(error.message, errorResponse.message)
|
|
2006
|
+
assert.strictEqual(error.help, errorResponse.help)
|
|
2007
|
+
assert.strictEqual(error.name, errorResponse.name)
|
|
2008
|
+
assert.strictEqual(error.code, errorResponse.code)
|
|
2009
|
+
assert.strictEqual(error.status, errorResponse.status)
|
|
2010
|
+
})
|
|
2011
|
+
|
|
2012
|
+
test('should throw an error if API returns 400 (e.g., user already active)', async ({ network, assert }) => {
|
|
2013
|
+
const errorResponse = { message: 'User is already active', status: 400, code: 'E_USER_ALREADY_ACTIVE' }
|
|
2014
|
+
await mocker.organizations.users.activate(network, {
|
|
2015
|
+
response: {
|
|
2016
|
+
status: 400,
|
|
2017
|
+
body: JSON.stringify(errorResponse),
|
|
2018
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2019
|
+
},
|
|
2020
|
+
})
|
|
2021
|
+
|
|
2022
|
+
const error = await assert.rejects(async () => await sdk.organizations.users.activate(oid, userId), Exception)
|
|
2023
|
+
assert.strictEqual(error.message, errorResponse.message)
|
|
2024
|
+
assert.strictEqual(error.status, 400)
|
|
2025
|
+
assert.strictEqual(error.code, errorResponse.code)
|
|
2026
|
+
})
|
|
2027
|
+
|
|
2028
|
+
test('should throw an error if API response has no body on 200 status', async ({ network, assert }) => {
|
|
2029
|
+
await mocker.organizations.users.activate(network, {
|
|
2030
|
+
response: {
|
|
2031
|
+
status: 200,
|
|
2032
|
+
body: '',
|
|
2033
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2034
|
+
},
|
|
2035
|
+
})
|
|
2036
|
+
const error = await assert.rejects(
|
|
2037
|
+
async () => await sdk.organizations.users.activate(oid, userId),
|
|
2038
|
+
Exception,
|
|
2039
|
+
'Unable to activate the user. The response has no value.'
|
|
2040
|
+
)
|
|
2041
|
+
assert.strictEqual(error.status, 200)
|
|
2042
|
+
})
|
|
2043
|
+
|
|
2044
|
+
test('should throw an error if API response body is invalid JSON on 200 status', async ({ network, assert }) => {
|
|
2045
|
+
await mocker.organizations.users.activate(network, {
|
|
2046
|
+
response: {
|
|
2047
|
+
status: 200,
|
|
2048
|
+
body: 'this is not json for activating a user',
|
|
2049
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2050
|
+
},
|
|
2051
|
+
})
|
|
2052
|
+
const error = await assert.rejects(
|
|
2053
|
+
async () => await sdk.organizations.users.activate(oid, userId),
|
|
2054
|
+
Exception,
|
|
2055
|
+
'Unable to activate the user. Invalid JSON response.'
|
|
2056
|
+
)
|
|
2057
|
+
assert.strictEqual(error.status, 200)
|
|
2058
|
+
})
|
|
2059
|
+
|
|
2060
|
+
test('should correctly build URL when baseUri has a path', async ({ network }) => {
|
|
2061
|
+
const customBaseUri = 'http://localhost:3000/api/v7'
|
|
2062
|
+
sdk.baseUri = customBaseUri
|
|
2063
|
+
const handle = await mocker.organizations.users.activate(network, {
|
|
2064
|
+
response: {
|
|
2065
|
+
status: 200,
|
|
2066
|
+
body: JSON.stringify(mockActivatedUser),
|
|
2067
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2068
|
+
},
|
|
2069
|
+
baseUri: customBaseUri,
|
|
2070
|
+
})
|
|
2071
|
+
await sdk.organizations.users.activate(oid, userId)
|
|
2072
|
+
await handle.assert.calledOnceWith({
|
|
2073
|
+
url: `http://localhost:3000/api/v7/v1/orgs/${oid}/users/${userId}/activate`,
|
|
2074
|
+
})
|
|
2075
|
+
})
|
|
2076
|
+
})
|
|
2077
|
+
|
|
2078
|
+
test.group('users.deactivate()', (group) => {
|
|
2079
|
+
let sdk: StoreSdk
|
|
2080
|
+
let mocker: SdkNetworkMock
|
|
2081
|
+
|
|
2082
|
+
group.each.setup(() => {
|
|
2083
|
+
sdk = new StoreSdk(baseUri)
|
|
2084
|
+
sdk.token = baseToken
|
|
2085
|
+
sdk.silent = true
|
|
2086
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
2087
|
+
})
|
|
2088
|
+
const oid = 'org-user-deactivate-456'
|
|
2089
|
+
const userId = 'user-to-deactivate-789'
|
|
2090
|
+
const mockDeactivatedUser: UserSchema = {
|
|
2091
|
+
key: userId,
|
|
2092
|
+
kind: UserKind,
|
|
2093
|
+
name: 'Deactivated User',
|
|
2094
|
+
email: [{ email: 'deactivated@example.com', verified: true }],
|
|
2095
|
+
created: Date.now() - 300000,
|
|
2096
|
+
updated: Date.now(),
|
|
2097
|
+
status: 'suspended', // Key change to indicate deactivation
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
test('should successfully deactivate a user in an organization', async ({ network, assert }) => {
|
|
2101
|
+
const handle = await mocker.organizations.users.deactivate(network, {
|
|
2102
|
+
response: {
|
|
2103
|
+
status: 200,
|
|
2104
|
+
body: JSON.stringify({ data: mockDeactivatedUser }),
|
|
2105
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2106
|
+
},
|
|
2107
|
+
})
|
|
2108
|
+
|
|
2109
|
+
const result = await sdk.organizations.users.deactivate(oid, userId)
|
|
2110
|
+
|
|
2111
|
+
const expectedUrl = sdk.getUrl(RouteBuilder.organizationUserDeactivate(oid, userId)).toString()
|
|
2112
|
+
await handle.assert.calledOnceWith({
|
|
2113
|
+
url: expectedUrl,
|
|
2114
|
+
method: 'POST',
|
|
2115
|
+
headers: { Authorization: `Bearer ${baseToken}` },
|
|
2116
|
+
})
|
|
2117
|
+
assert.deepEqual(result, mockDeactivatedUser)
|
|
2118
|
+
})
|
|
2119
|
+
|
|
2120
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
2121
|
+
const handle = await mocker.organizations.users.deactivate(network, {
|
|
2122
|
+
response: {
|
|
2123
|
+
status: 200,
|
|
2124
|
+
body: JSON.stringify(mockDeactivatedUser),
|
|
2125
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2126
|
+
},
|
|
2127
|
+
})
|
|
2128
|
+
await sdk.organizations.users.deactivate(oid, userId, { token: 'custom-deactivate-user-token' })
|
|
2129
|
+
await handle.assert.calledOnceWith({
|
|
2130
|
+
headers: { Authorization: `Bearer custom-deactivate-user-token` },
|
|
2131
|
+
})
|
|
2132
|
+
})
|
|
2133
|
+
|
|
2134
|
+
test('should throw an error if API returns a non-200 status (e.g., 500)', async ({ network, assert }) => {
|
|
2135
|
+
const errorResponse = {
|
|
2136
|
+
message: 'Server Error Deactivating User',
|
|
2137
|
+
status: 500,
|
|
2138
|
+
help: 'Try again later.',
|
|
2139
|
+
name: 'UserDeactivateServerError',
|
|
2140
|
+
code: 'E_USER_DEACTIVATE_SERVER_ERROR',
|
|
2141
|
+
}
|
|
2142
|
+
await mocker.organizations.users.deactivate(network, {
|
|
2143
|
+
response: {
|
|
2144
|
+
status: 500,
|
|
2145
|
+
body: JSON.stringify(errorResponse),
|
|
2146
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2147
|
+
},
|
|
2148
|
+
})
|
|
2149
|
+
const error = await assert.rejects(async () => await sdk.organizations.users.deactivate(oid, userId), Exception)
|
|
2150
|
+
assert.strictEqual(error.message, errorResponse.message)
|
|
2151
|
+
assert.strictEqual(error.help, errorResponse.help)
|
|
2152
|
+
assert.strictEqual(error.name, errorResponse.name)
|
|
2153
|
+
assert.strictEqual(error.code, errorResponse.code)
|
|
2154
|
+
assert.strictEqual(error.status, errorResponse.status)
|
|
2155
|
+
})
|
|
2156
|
+
|
|
2157
|
+
test('should throw an error if API returns 400 (e.g., user already deactivated)', async ({ network, assert }) => {
|
|
2158
|
+
const errorResponse = {
|
|
2159
|
+
message: 'User is already deactivated',
|
|
2160
|
+
status: 400,
|
|
2161
|
+
code: 'E_USER_ALREADY_DEACTIVATED',
|
|
2162
|
+
}
|
|
2163
|
+
await mocker.organizations.users.deactivate(network, {
|
|
2164
|
+
response: {
|
|
2165
|
+
status: 400,
|
|
2166
|
+
body: JSON.stringify(errorResponse),
|
|
2167
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2168
|
+
},
|
|
2169
|
+
})
|
|
2170
|
+
const error = await assert.rejects(async () => await sdk.organizations.users.deactivate(oid, userId), Exception)
|
|
2171
|
+
assert.strictEqual(error.message, errorResponse.message)
|
|
2172
|
+
assert.strictEqual(error.status, 400)
|
|
2173
|
+
assert.strictEqual(error.code, errorResponse.code)
|
|
2174
|
+
})
|
|
2175
|
+
|
|
2176
|
+
test('should throw an error if API response has no body on 200 status', async ({ network, assert }) => {
|
|
2177
|
+
await mocker.organizations.users.deactivate(network, {
|
|
2178
|
+
response: {
|
|
2179
|
+
status: 200,
|
|
2180
|
+
body: '',
|
|
2181
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2182
|
+
},
|
|
2183
|
+
})
|
|
2184
|
+
const error = await assert.rejects(async () => await sdk.organizations.users.deactivate(oid, userId), Exception)
|
|
2185
|
+
assert.strictEqual(error.message, 'Unable to deactivate the user. The response has no value.')
|
|
2186
|
+
})
|
|
2187
|
+
|
|
2188
|
+
test('should throw an error if API response body is invalid JSON on 200 status', async ({ network, assert }) => {
|
|
2189
|
+
await mocker.organizations.users.deactivate(network, {
|
|
2190
|
+
response: {
|
|
2191
|
+
status: 200,
|
|
2192
|
+
body: 'this is not json for deactivating a user',
|
|
2193
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2194
|
+
},
|
|
2195
|
+
})
|
|
2196
|
+
const error = await assert.rejects(async () => await sdk.organizations.users.deactivate(oid, userId), Exception)
|
|
2197
|
+
assert.strictEqual(error.message, 'Unable to deactivate the user. Invalid JSON response.')
|
|
2198
|
+
})
|
|
2199
|
+
|
|
2200
|
+
test('should correctly build URL when baseUri has a path', async ({ network }) => {
|
|
2201
|
+
const customBaseUri = 'http://localhost:3000/custom'
|
|
2202
|
+
sdk.baseUri = customBaseUri
|
|
2203
|
+
const handle = await mocker.organizations.users.deactivate(network, {
|
|
2204
|
+
response: {
|
|
2205
|
+
status: 200,
|
|
2206
|
+
body: JSON.stringify(mockDeactivatedUser),
|
|
2207
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2208
|
+
},
|
|
2209
|
+
baseUri: customBaseUri,
|
|
2210
|
+
})
|
|
2211
|
+
await sdk.organizations.users.deactivate(oid, userId)
|
|
2212
|
+
await handle.assert.calledOnceWith({
|
|
2213
|
+
url: `http://localhost:3000/custom/v1/orgs/${oid}/users/${userId}/deactivate`,
|
|
2214
|
+
})
|
|
2215
|
+
})
|
|
2216
|
+
})
|
|
2217
|
+
|
|
2218
|
+
test.group('users.delete()', (group) => {
|
|
2219
|
+
let sdk: StoreSdk
|
|
2220
|
+
let mocker: SdkNetworkMock
|
|
2221
|
+
|
|
2222
|
+
group.each.setup(() => {
|
|
2223
|
+
sdk = new StoreSdk(baseUri)
|
|
2224
|
+
sdk.token = baseToken
|
|
2225
|
+
sdk.silent = true
|
|
2226
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
2227
|
+
})
|
|
2228
|
+
const oid = 'org-user-delete-op-789'
|
|
2229
|
+
const userIdToDelete = 'user-to-be-deleted-101'
|
|
2230
|
+
|
|
2231
|
+
test('should successfully delete a user from an organization', async ({ network }) => {
|
|
2232
|
+
const handle = await mocker.organizations.users.delete(network)
|
|
2233
|
+
|
|
2234
|
+
await sdk.organizations.users.delete(oid, userIdToDelete)
|
|
2235
|
+
|
|
2236
|
+
await handle.assert.calledOnceWith({
|
|
2237
|
+
method: 'DELETE',
|
|
2238
|
+
url: sdk.getUrl(RouteBuilder.organizationUser(oid, userIdToDelete)).toString(),
|
|
2239
|
+
headers: { Authorization: `Bearer ${baseToken}` },
|
|
2240
|
+
})
|
|
2241
|
+
})
|
|
2242
|
+
|
|
2243
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
2244
|
+
const handle = await mocker.organizations.users.delete(network)
|
|
2245
|
+
await sdk.organizations.users.delete(oid, userIdToDelete, { token: 'custom-delete-user-token' })
|
|
2246
|
+
await handle.assert.calledOnceWith({ headers: { Authorization: `Bearer custom-delete-user-token` } })
|
|
2247
|
+
})
|
|
2248
|
+
|
|
2249
|
+
test('should throw an error if API returns a non-204 status (e.g., 500)', async ({ network, assert }) => {
|
|
2250
|
+
const errorResponse = {
|
|
2251
|
+
message: 'Server Error Deleting User',
|
|
2252
|
+
status: 500,
|
|
2253
|
+
help: 'Try again later.',
|
|
2254
|
+
name: 'UserDeleteServerError',
|
|
2255
|
+
code: 'E_USER_DELETE_SERVER_ERROR',
|
|
2256
|
+
}
|
|
2257
|
+
await mocker.organizations.users.delete(network, {
|
|
2258
|
+
response: {
|
|
2259
|
+
status: 500,
|
|
2260
|
+
body: JSON.stringify(errorResponse),
|
|
2261
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2262
|
+
},
|
|
2263
|
+
})
|
|
2264
|
+
|
|
2265
|
+
const error = await assert.rejects(async () => await sdk.organizations.users.delete(oid, userIdToDelete), Exception)
|
|
2266
|
+
assert.strictEqual(error.message, errorResponse.message)
|
|
2267
|
+
assert.strictEqual(error.help, errorResponse.help)
|
|
2268
|
+
assert.strictEqual(error.name, errorResponse.name)
|
|
2269
|
+
assert.strictEqual(error.code, errorResponse.code)
|
|
2270
|
+
assert.strictEqual(error.status, errorResponse.status)
|
|
2271
|
+
})
|
|
2272
|
+
|
|
2273
|
+
test('should throw an error if API returns 404 (Not Found)', async ({ network, assert }) => {
|
|
2274
|
+
await mocker.organizations.users.delete(network, {
|
|
2275
|
+
response: {
|
|
2276
|
+
status: 404,
|
|
2277
|
+
body: JSON.stringify({ message: 'User to delete not found' }),
|
|
2278
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2279
|
+
},
|
|
2280
|
+
})
|
|
2281
|
+
const error = await assert.rejects(async () => await sdk.organizations.users.delete(oid, userIdToDelete), Exception)
|
|
2282
|
+
assert.strictEqual(error.message, 'User to delete not found')
|
|
2283
|
+
assert.strictEqual(error.status, 404)
|
|
2284
|
+
})
|
|
2285
|
+
|
|
2286
|
+
test('should throw an error if API returns 403 (Forbidden)', async ({ network, assert }) => {
|
|
2287
|
+
await mocker.organizations.users.delete(network, {
|
|
2288
|
+
response: {
|
|
2289
|
+
status: 403,
|
|
2290
|
+
body: JSON.stringify({ message: 'Permission denied to delete user' }),
|
|
2291
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2292
|
+
},
|
|
2293
|
+
})
|
|
2294
|
+
const error = await assert.rejects(async () => await sdk.organizations.users.delete(oid, userIdToDelete), Exception)
|
|
2295
|
+
assert.strictEqual(error.message, 'Permission denied to delete user')
|
|
2296
|
+
assert.strictEqual(error.status, 403)
|
|
2297
|
+
})
|
|
2298
|
+
|
|
2299
|
+
test('should correctly build URL when baseUri has a path', async ({ network }) => {
|
|
2300
|
+
const customBaseUri = 'http://localhost:3000/api/delete-org-user'
|
|
2301
|
+
sdk.baseUri = customBaseUri
|
|
2302
|
+
const handle = await mocker.organizations.users.delete(network, { baseUri: customBaseUri })
|
|
2303
|
+
await sdk.organizations.users.delete(oid, userIdToDelete)
|
|
2304
|
+
await handle.assert.calledOnceWith({
|
|
2305
|
+
url: `${customBaseUri}/v1/orgs/${oid}/users/${userIdToDelete}`,
|
|
2306
|
+
})
|
|
2307
|
+
})
|
|
2308
|
+
})
|
|
2309
|
+
|
|
2310
|
+
test.group('users.readBatch()', (group) => {
|
|
2311
|
+
let sdk: StoreSdk
|
|
2312
|
+
let mocker: SdkNetworkMock
|
|
2313
|
+
|
|
2314
|
+
group.each.setup(() => {
|
|
2315
|
+
sdk = new StoreSdk(baseUri)
|
|
2316
|
+
sdk.token = baseToken
|
|
2317
|
+
sdk.silent = true
|
|
2318
|
+
mocker = new SdkNetworkMock(baseUri)
|
|
2319
|
+
})
|
|
2320
|
+
const oid = 'org-user-read-batch-789'
|
|
2321
|
+
const userKeysToRead = ['user-key-alpha', 'user-key-beta', 'user-key-gamma']
|
|
2322
|
+
const mockUserAlpha: UserSchema = {
|
|
2323
|
+
key: 'user-key-alpha',
|
|
2324
|
+
kind: UserKind,
|
|
2325
|
+
name: 'User Alpha Batch',
|
|
2326
|
+
email: [{ email: 'alpha.batch@example.com' }],
|
|
2327
|
+
created: Date.now() - 50000,
|
|
2328
|
+
updated: Date.now() - 10000,
|
|
2329
|
+
}
|
|
2330
|
+
const mockUserBeta: UserSchema = {
|
|
2331
|
+
key: 'user-key-beta',
|
|
2332
|
+
kind: UserKind,
|
|
2333
|
+
name: 'User Beta Batch',
|
|
2334
|
+
email: [{ email: 'beta.batch@example.com', verified: true }],
|
|
2335
|
+
created: Date.now() - 60000,
|
|
2336
|
+
updated: Date.now() - 5000,
|
|
2337
|
+
status: 'active',
|
|
2338
|
+
}
|
|
2339
|
+
const mockUsersInBatch: UserSchema[] = [mockUserAlpha, mockUserBeta]
|
|
2340
|
+
const mockSuccessfulResponse: ContextListResult<UserSchema> = { data: mockUsersInBatch }
|
|
2341
|
+
|
|
2342
|
+
test('should successfully read a batch of users from an organization', async ({ network, assert }) => {
|
|
2343
|
+
const handle = await mocker.organizations.users.readBatch(network, {
|
|
2344
|
+
response: {
|
|
2345
|
+
status: 200,
|
|
2346
|
+
body: JSON.stringify(mockSuccessfulResponse),
|
|
2347
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2348
|
+
},
|
|
2349
|
+
})
|
|
2350
|
+
|
|
2351
|
+
const result = await sdk.organizations.users.readBatch(oid, userKeysToRead)
|
|
2352
|
+
|
|
2353
|
+
await handle.assert.calledOnceWith({
|
|
2354
|
+
method: 'POST',
|
|
2355
|
+
body: JSON.stringify({ ids: userKeysToRead }),
|
|
2356
|
+
headers: { Authorization: `Bearer ${baseToken}` },
|
|
2357
|
+
})
|
|
2358
|
+
assert.deepEqual(result, mockSuccessfulResponse)
|
|
2359
|
+
})
|
|
2360
|
+
|
|
2361
|
+
test('should use custom token if provided in request options', async ({ network }) => {
|
|
2362
|
+
const handle = await mocker.organizations.users.readBatch(network, {
|
|
2363
|
+
response: {
|
|
2364
|
+
status: 200,
|
|
2365
|
+
body: JSON.stringify(mockSuccessfulResponse),
|
|
2366
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2367
|
+
},
|
|
2368
|
+
})
|
|
2369
|
+
await sdk.organizations.users.readBatch(oid, userKeysToRead, { token: 'custom-read-batch-token' })
|
|
2370
|
+
await handle.assert.calledOnceWith({
|
|
2371
|
+
headers: {
|
|
2372
|
+
Authorization: 'Bearer custom-read-batch-token',
|
|
2373
|
+
},
|
|
2374
|
+
})
|
|
2375
|
+
})
|
|
2376
|
+
|
|
2377
|
+
test('should throw an error if API returns a non-200 status (e.g., 500)', async ({ network, assert }) => {
|
|
2378
|
+
const errorResponse = {
|
|
2379
|
+
message: 'Server Error For Reading User Batch',
|
|
2380
|
+
status: 500,
|
|
2381
|
+
help: 'Try again later.',
|
|
2382
|
+
name: 'UserReadBatchServerError',
|
|
2383
|
+
code: 'E_USER_READ_BATCH_SERVER_ERROR',
|
|
2384
|
+
}
|
|
2385
|
+
await mocker.organizations.users.readBatch(network, {
|
|
2386
|
+
response: {
|
|
2387
|
+
status: 500,
|
|
2388
|
+
body: JSON.stringify(errorResponse),
|
|
2389
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2390
|
+
},
|
|
2391
|
+
})
|
|
2392
|
+
|
|
2393
|
+
const error = await assert.rejects<Exception>(
|
|
2394
|
+
async () => await sdk.organizations.users.readBatch(oid, userKeysToRead),
|
|
2395
|
+
Exception,
|
|
2396
|
+
errorResponse.message
|
|
2397
|
+
)
|
|
2398
|
+
assert.strictEqual(error.name, errorResponse.name)
|
|
2399
|
+
assert.strictEqual(error.code, errorResponse.code)
|
|
2400
|
+
assert.strictEqual(error.status, errorResponse.status)
|
|
2401
|
+
})
|
|
2402
|
+
|
|
2403
|
+
test('should throw an error if API response has no body on 200 status', async ({ network, assert }) => {
|
|
2404
|
+
await mocker.organizations.users.readBatch(network, {
|
|
2405
|
+
response: {
|
|
2406
|
+
status: 200,
|
|
2407
|
+
body: '',
|
|
2408
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2409
|
+
},
|
|
2410
|
+
})
|
|
2411
|
+
await assert.rejects(
|
|
2412
|
+
async () => await sdk.organizations.users.readBatch(oid, userKeysToRead),
|
|
2413
|
+
Exception,
|
|
2414
|
+
'Unable to read the user batch info. The response has no value.'
|
|
2415
|
+
)
|
|
2416
|
+
})
|
|
2417
|
+
|
|
2418
|
+
test('should throw an error if API response body is invalid JSON on 200 status', async ({ network, assert }) => {
|
|
2419
|
+
await mocker.organizations.users.readBatch(network, {
|
|
2420
|
+
response: {
|
|
2421
|
+
status: 200,
|
|
2422
|
+
body: 'this is not json for a user batch',
|
|
2423
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2424
|
+
},
|
|
2425
|
+
})
|
|
2426
|
+
await assert.rejects(
|
|
2427
|
+
async () => await sdk.organizations.users.readBatch(oid, userKeysToRead),
|
|
2428
|
+
Exception,
|
|
2429
|
+
'Unable to read the user batch info. Invalid JSON response.'
|
|
2430
|
+
)
|
|
2431
|
+
})
|
|
2432
|
+
|
|
2433
|
+
test('should throw an error if API response data is missing "data" array on 200 status', async ({
|
|
2434
|
+
network,
|
|
2435
|
+
assert,
|
|
2436
|
+
}) => {
|
|
2437
|
+
await mocker.organizations.users.readBatch(network, {
|
|
2438
|
+
response: {
|
|
2439
|
+
status: 200,
|
|
2440
|
+
body: JSON.stringify({ notItems: 'something else' }),
|
|
2441
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2442
|
+
},
|
|
2443
|
+
})
|
|
2444
|
+
await assert.rejects(
|
|
2445
|
+
async () => await sdk.organizations.users.readBatch(oid, userKeysToRead),
|
|
2446
|
+
Exception,
|
|
2447
|
+
'Unable to read the user batch info. Unknown response from the server.'
|
|
2448
|
+
)
|
|
2449
|
+
})
|
|
2450
|
+
|
|
2451
|
+
test('should correctly build URL when baseUri has a path', async ({ network }) => {
|
|
2452
|
+
const customBaseUri = 'http://localhost:3000/api/org-batch-user'
|
|
2453
|
+
sdk.baseUri = customBaseUri
|
|
2454
|
+
const handle = await mocker.organizations.users.readBatch(network, {
|
|
2455
|
+
response: {
|
|
2456
|
+
status: 200,
|
|
2457
|
+
body: JSON.stringify(mockSuccessfulResponse),
|
|
2458
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2459
|
+
},
|
|
2460
|
+
baseUri: customBaseUri,
|
|
2461
|
+
})
|
|
2462
|
+
await sdk.organizations.users.readBatch(oid, userKeysToRead)
|
|
2463
|
+
await handle.assert.calledOnceWith({
|
|
2464
|
+
headers: { Authorization: `Bearer ${baseToken}` },
|
|
2465
|
+
body: JSON.stringify({ ids: userKeysToRead }),
|
|
2466
|
+
})
|
|
2467
|
+
})
|
|
2468
|
+
})
|