@aignostics/sdk 2.3.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aignostics-sdk-3.0.0.tgz +0 -0
- package/dist/api-3iWGLFaA.d.cts +1914 -0
- package/dist/api-3iWGLFaA.d.ts +1914 -0
- package/dist/index.cjs +567 -275
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -1506
- package/dist/index.d.ts +24 -1506
- package/dist/index.js +558 -274
- package/dist/index.js.map +1 -1
- package/dist/test-utils/http-mocks.cjs +21936 -0
- package/dist/test-utils/http-mocks.cjs.map +1 -0
- package/dist/test-utils/http-mocks.d.cts +65 -0
- package/dist/test-utils/http-mocks.d.ts +65 -0
- package/dist/test-utils/http-mocks.js +21922 -0
- package/dist/test-utils/http-mocks.js.map +1 -0
- package/package.json +7 -2
- package/dist/aignostics-sdk-2.3.1.tgz +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as msw_node from 'msw/node';
|
|
2
|
+
import * as msw from 'msw';
|
|
3
|
+
import * as fishery from 'fishery';
|
|
4
|
+
import { Factory } from 'fishery';
|
|
5
|
+
import { A as ApplicationReadShortResponse, a as ApplicationReadResponse, R as RunReadResponse, c as RunCreationResponse, I as ItemResultReadResponse, d as ApplicationVersion, o as OutputArtifactResultReadResponse } from '../api-3iWGLFaA.cjs';
|
|
6
|
+
import 'axios';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Mock responses for API endpoints using factories
|
|
10
|
+
*/
|
|
11
|
+
declare const mockResponses: {
|
|
12
|
+
applicationsSuccess: ApplicationReadShortResponse[];
|
|
13
|
+
applicationsEmpty: never[];
|
|
14
|
+
applicationSuccess: ApplicationReadResponse;
|
|
15
|
+
applicationRunsSuccess: RunReadResponse[];
|
|
16
|
+
runSuccess: RunReadResponse;
|
|
17
|
+
createRunSuccess: RunCreationResponse;
|
|
18
|
+
runResultsSuccess: ItemResultReadResponse[];
|
|
19
|
+
error: {
|
|
20
|
+
error: string;
|
|
21
|
+
message: string;
|
|
22
|
+
statusCode: number;
|
|
23
|
+
};
|
|
24
|
+
validationError: {
|
|
25
|
+
detail: {
|
|
26
|
+
loc: string[];
|
|
27
|
+
type: string;
|
|
28
|
+
msg: string;
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
declare const factories: {
|
|
33
|
+
applicationShort: Factory<ApplicationReadShortResponse, any, ApplicationReadShortResponse, fishery.DeepPartialObject<ApplicationReadShortResponse>>;
|
|
34
|
+
application: Factory<ApplicationReadResponse, any, ApplicationReadResponse, fishery.DeepPartialObject<ApplicationReadResponse>>;
|
|
35
|
+
applicationVersion: Factory<ApplicationVersion, any, ApplicationVersion, fishery.DeepPartialObject<ApplicationVersion>>;
|
|
36
|
+
run: Factory<RunReadResponse, any, RunReadResponse, fishery.DeepPartialObject<RunReadResponse>>;
|
|
37
|
+
runCreationResponse: Factory<RunCreationResponse, any, RunCreationResponse, fishery.DeepPartialObject<RunCreationResponse>>;
|
|
38
|
+
itemResult: Factory<ItemResultReadResponse, any, ItemResultReadResponse, fishery.DeepPartialObject<ItemResultReadResponse>>;
|
|
39
|
+
outputArtifact: Factory<OutputArtifactResultReadResponse, any, OutputArtifactResultReadResponse, fishery.DeepPartialObject<OutputArtifactResultReadResponse>>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* HTTP request handlers for different scenarios
|
|
43
|
+
*/
|
|
44
|
+
declare const handlers: {
|
|
45
|
+
success: msw.HttpHandler[];
|
|
46
|
+
empty: msw.HttpHandler[];
|
|
47
|
+
notFoundError: msw.HttpHandler[];
|
|
48
|
+
validationError: msw.HttpHandler[];
|
|
49
|
+
internalServerError: msw.HttpHandler[];
|
|
50
|
+
networkError: msw.HttpHandler[];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Create a mock server with specific handlers
|
|
54
|
+
*/
|
|
55
|
+
declare function createMockServer(handlerSet?: keyof typeof handlers): msw_node.SetupServerApi;
|
|
56
|
+
/**
|
|
57
|
+
* Default mock server for successful responses
|
|
58
|
+
*/
|
|
59
|
+
declare const server: msw_node.SetupServerApi;
|
|
60
|
+
/**
|
|
61
|
+
* Helper function to reset handlers for a specific scenario
|
|
62
|
+
*/
|
|
63
|
+
declare function setMockScenario(scenario: keyof typeof handlers): void;
|
|
64
|
+
|
|
65
|
+
export { createMockServer, factories, handlers, mockResponses, server, setMockScenario };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as msw_node from 'msw/node';
|
|
2
|
+
import * as msw from 'msw';
|
|
3
|
+
import * as fishery from 'fishery';
|
|
4
|
+
import { Factory } from 'fishery';
|
|
5
|
+
import { A as ApplicationReadShortResponse, a as ApplicationReadResponse, R as RunReadResponse, c as RunCreationResponse, I as ItemResultReadResponse, d as ApplicationVersion, o as OutputArtifactResultReadResponse } from '../api-3iWGLFaA.js';
|
|
6
|
+
import 'axios';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Mock responses for API endpoints using factories
|
|
10
|
+
*/
|
|
11
|
+
declare const mockResponses: {
|
|
12
|
+
applicationsSuccess: ApplicationReadShortResponse[];
|
|
13
|
+
applicationsEmpty: never[];
|
|
14
|
+
applicationSuccess: ApplicationReadResponse;
|
|
15
|
+
applicationRunsSuccess: RunReadResponse[];
|
|
16
|
+
runSuccess: RunReadResponse;
|
|
17
|
+
createRunSuccess: RunCreationResponse;
|
|
18
|
+
runResultsSuccess: ItemResultReadResponse[];
|
|
19
|
+
error: {
|
|
20
|
+
error: string;
|
|
21
|
+
message: string;
|
|
22
|
+
statusCode: number;
|
|
23
|
+
};
|
|
24
|
+
validationError: {
|
|
25
|
+
detail: {
|
|
26
|
+
loc: string[];
|
|
27
|
+
type: string;
|
|
28
|
+
msg: string;
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
declare const factories: {
|
|
33
|
+
applicationShort: Factory<ApplicationReadShortResponse, any, ApplicationReadShortResponse, fishery.DeepPartialObject<ApplicationReadShortResponse>>;
|
|
34
|
+
application: Factory<ApplicationReadResponse, any, ApplicationReadResponse, fishery.DeepPartialObject<ApplicationReadResponse>>;
|
|
35
|
+
applicationVersion: Factory<ApplicationVersion, any, ApplicationVersion, fishery.DeepPartialObject<ApplicationVersion>>;
|
|
36
|
+
run: Factory<RunReadResponse, any, RunReadResponse, fishery.DeepPartialObject<RunReadResponse>>;
|
|
37
|
+
runCreationResponse: Factory<RunCreationResponse, any, RunCreationResponse, fishery.DeepPartialObject<RunCreationResponse>>;
|
|
38
|
+
itemResult: Factory<ItemResultReadResponse, any, ItemResultReadResponse, fishery.DeepPartialObject<ItemResultReadResponse>>;
|
|
39
|
+
outputArtifact: Factory<OutputArtifactResultReadResponse, any, OutputArtifactResultReadResponse, fishery.DeepPartialObject<OutputArtifactResultReadResponse>>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* HTTP request handlers for different scenarios
|
|
43
|
+
*/
|
|
44
|
+
declare const handlers: {
|
|
45
|
+
success: msw.HttpHandler[];
|
|
46
|
+
empty: msw.HttpHandler[];
|
|
47
|
+
notFoundError: msw.HttpHandler[];
|
|
48
|
+
validationError: msw.HttpHandler[];
|
|
49
|
+
internalServerError: msw.HttpHandler[];
|
|
50
|
+
networkError: msw.HttpHandler[];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Create a mock server with specific handlers
|
|
54
|
+
*/
|
|
55
|
+
declare function createMockServer(handlerSet?: keyof typeof handlers): msw_node.SetupServerApi;
|
|
56
|
+
/**
|
|
57
|
+
* Default mock server for successful responses
|
|
58
|
+
*/
|
|
59
|
+
declare const server: msw_node.SetupServerApi;
|
|
60
|
+
/**
|
|
61
|
+
* Helper function to reset handlers for a specific scenario
|
|
62
|
+
*/
|
|
63
|
+
declare function setMockScenario(scenario: keyof typeof handlers): void;
|
|
64
|
+
|
|
65
|
+
export { createMockServer, factories, handlers, mockResponses, server, setMockScenario };
|