@smooai/testing 1.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.
@@ -0,0 +1,280 @@
1
+ /**
2
+ * TypeScript types matching the Smoo AI Testing API schemas.
3
+ */
4
+ interface TestRunSummary {
5
+ total?: number;
6
+ passed?: number;
7
+ failed?: number;
8
+ skipped?: number;
9
+ pending?: number;
10
+ other?: number;
11
+ }
12
+ interface TestRunDeployment {
13
+ id: string;
14
+ name: string;
15
+ status: string;
16
+ source: string | null;
17
+ externalId: string | null;
18
+ externalUrl: string | null;
19
+ ref: string | null;
20
+ metadata: Record<string, unknown> | null;
21
+ }
22
+ interface TestRun {
23
+ id: string;
24
+ organizationId: string;
25
+ environmentId: string | null;
26
+ deploymentId: string | null;
27
+ name: string;
28
+ tool: string | null;
29
+ status: string;
30
+ summary: TestRunSummary | null;
31
+ durationMs: number | null;
32
+ runnerName: string | null;
33
+ runnerUrl: string | null;
34
+ startedAt: string | null;
35
+ completedAt: string | null;
36
+ metadata: Record<string, unknown> | null;
37
+ createdAt: string;
38
+ updatedAt: string;
39
+ deployment?: TestRunDeployment | null;
40
+ results?: TestResult[];
41
+ }
42
+ interface CreateTestRunInput {
43
+ name: string;
44
+ environment?: string;
45
+ environmentId?: string;
46
+ deploymentId?: string;
47
+ tool?: string;
48
+ buildName?: string;
49
+ buildUrl?: string;
50
+ runnerName?: string;
51
+ runnerUrl?: string;
52
+ metadata?: Record<string, unknown>;
53
+ }
54
+ interface UpdateTestRunInput {
55
+ status?: string;
56
+ summary?: TestRunSummary;
57
+ completedAt?: string;
58
+ startedAt?: string;
59
+ tool?: string;
60
+ metadata?: Record<string, unknown>;
61
+ }
62
+ interface ListTestRunsFilters {
63
+ limit?: number;
64
+ offset?: number;
65
+ status?: string;
66
+ environmentId?: string;
67
+ tool?: string;
68
+ runnerName?: string;
69
+ startDate?: string;
70
+ endDate?: string;
71
+ }
72
+ interface TestResult {
73
+ id?: string;
74
+ name: string;
75
+ suite?: string;
76
+ status: string;
77
+ durationMs?: number;
78
+ message?: string;
79
+ trace?: string;
80
+ retryCount?: number;
81
+ flaky?: boolean;
82
+ browser?: string;
83
+ tags?: string[];
84
+ metadata?: Record<string, unknown>;
85
+ }
86
+ interface TestCaseStep {
87
+ id?: string;
88
+ stepNumber: number;
89
+ action: string;
90
+ expectedResult?: string;
91
+ data?: string;
92
+ }
93
+ interface TestCase {
94
+ id: string;
95
+ organizationId: string;
96
+ title: string;
97
+ description: string | null;
98
+ preconditions: string | null;
99
+ expectedResult: string | null;
100
+ priority: string | null;
101
+ automationStatus: string | null;
102
+ automationId: string | null;
103
+ tags: string[] | null;
104
+ estimatedDurationMs: number | null;
105
+ metadata: Record<string, unknown> | null;
106
+ createdAt: string;
107
+ updatedAt: string;
108
+ steps?: TestCaseStep[];
109
+ recentResults?: TestResult[];
110
+ }
111
+ interface CreateTestCaseInput {
112
+ title: string;
113
+ description?: string;
114
+ preconditions?: string;
115
+ expectedResult?: string;
116
+ priority?: string;
117
+ automationStatus?: string;
118
+ automationId?: string;
119
+ tags?: string[];
120
+ estimatedDurationMs?: number;
121
+ metadata?: Record<string, unknown>;
122
+ steps?: Omit<TestCaseStep, 'id'>[];
123
+ }
124
+ interface UpdateTestCaseInput {
125
+ title?: string;
126
+ description?: string;
127
+ preconditions?: string;
128
+ expectedResult?: string;
129
+ priority?: string;
130
+ automationStatus?: string;
131
+ automationId?: string;
132
+ tags?: string[];
133
+ estimatedDurationMs?: number;
134
+ metadata?: Record<string, unknown>;
135
+ steps?: TestCaseStep[];
136
+ }
137
+ interface ListTestCasesFilters {
138
+ limit?: number;
139
+ offset?: number;
140
+ tags?: string;
141
+ priority?: string;
142
+ automationStatus?: string;
143
+ }
144
+ interface TestEnvironment {
145
+ id: string;
146
+ organizationId: string;
147
+ name: string;
148
+ description: string | null;
149
+ baseUrl: string | null;
150
+ metadata: Record<string, unknown> | null;
151
+ createdAt: string;
152
+ updatedAt: string;
153
+ }
154
+ interface CreateTestEnvironmentInput {
155
+ name: string;
156
+ description?: string;
157
+ baseUrl?: string;
158
+ metadata?: Record<string, unknown>;
159
+ }
160
+ interface UpdateTestEnvironmentInput {
161
+ name?: string;
162
+ description?: string;
163
+ baseUrl?: string;
164
+ metadata?: Record<string, unknown>;
165
+ }
166
+ type DeploymentStatus = 'pending' | 'in_progress' | 'success' | 'failure' | 'cancelled';
167
+ interface Deployment {
168
+ id: string;
169
+ organizationId: string;
170
+ environmentId: string | null;
171
+ name: string;
172
+ status: DeploymentStatus;
173
+ source: string | null;
174
+ externalId: string | null;
175
+ externalUrl: string | null;
176
+ ref: string | null;
177
+ metadata: Record<string, unknown> | null;
178
+ startedAt: string | null;
179
+ completedAt: string | null;
180
+ createdAt: string;
181
+ updatedAt: string;
182
+ }
183
+ interface CreateDeploymentInput {
184
+ name: string;
185
+ environmentId?: string;
186
+ status?: DeploymentStatus;
187
+ source?: string;
188
+ externalId?: string;
189
+ externalUrl?: string;
190
+ ref?: string;
191
+ metadata?: Record<string, unknown>;
192
+ startedAt?: string;
193
+ }
194
+ interface UpdateDeploymentInput {
195
+ name?: string;
196
+ status?: DeploymentStatus;
197
+ source?: string;
198
+ externalId?: string;
199
+ externalUrl?: string;
200
+ ref?: string;
201
+ metadata?: Record<string, unknown>;
202
+ startedAt?: string;
203
+ completedAt?: string;
204
+ }
205
+ interface ListDeploymentsFilters {
206
+ limit?: number;
207
+ offset?: number;
208
+ status?: string;
209
+ environmentId?: string;
210
+ source?: string;
211
+ startDate?: string;
212
+ endDate?: string;
213
+ }
214
+ interface PaginatedResponse<T> {
215
+ data: T[];
216
+ pagination: {
217
+ limit: number;
218
+ offset: number;
219
+ total: number;
220
+ hasMore: boolean;
221
+ };
222
+ }
223
+ interface CtrfReport {
224
+ results: {
225
+ tool?: {
226
+ name?: string;
227
+ version?: string;
228
+ };
229
+ summary?: {
230
+ tests?: number;
231
+ passed?: number;
232
+ failed?: number;
233
+ skipped?: number;
234
+ pending?: number;
235
+ other?: number;
236
+ start?: number;
237
+ stop?: number;
238
+ };
239
+ tests?: CtrfTest[];
240
+ environment?: {
241
+ reportName?: string;
242
+ [key: string]: unknown;
243
+ };
244
+ };
245
+ }
246
+ interface CtrfTest {
247
+ name: string;
248
+ status: 'passed' | 'failed' | 'skipped' | 'pending' | 'other';
249
+ duration?: number;
250
+ suite?: string;
251
+ filePath?: string;
252
+ message?: string;
253
+ trace?: string;
254
+ retries?: number;
255
+ flaky?: boolean;
256
+ browser?: string;
257
+ tags?: string[];
258
+ extra?: Record<string, unknown>;
259
+ }
260
+ interface Credentials {
261
+ clientId: string;
262
+ clientSecret: string;
263
+ orgId: string;
264
+ apiUrl: string;
265
+ authUrl: string;
266
+ }
267
+ interface TokenResponse {
268
+ access_token: string;
269
+ token_type: string;
270
+ expires_in?: number;
271
+ }
272
+ interface SmooTestingClientOptions {
273
+ clientId: string;
274
+ clientSecret: string;
275
+ orgId: string;
276
+ apiUrl?: string;
277
+ authUrl?: string;
278
+ }
279
+
280
+ export type { CreateDeploymentInput, CreateTestCaseInput, CreateTestEnvironmentInput, CreateTestRunInput, Credentials, CtrfReport, CtrfTest, Deployment, DeploymentStatus, ListDeploymentsFilters, ListTestCasesFilters, ListTestRunsFilters, PaginatedResponse, SmooTestingClientOptions, TestCase, TestCaseStep, TestEnvironment, TestResult, TestRun, TestRunDeployment, TestRunSummary, TokenResponse, UpdateDeploymentInput, UpdateTestCaseInput, UpdateTestEnvironmentInput, UpdateTestRunInput };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/lib/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/types.ts"],"sourcesContent":["/**\n * TypeScript types matching the Smoo AI Testing API schemas.\n */\n\n// ── Test Runs ──\n\nexport interface TestRunSummary {\n total?: number;\n passed?: number;\n failed?: number;\n skipped?: number;\n pending?: number;\n other?: number;\n}\n\nexport interface TestRunDeployment {\n id: string;\n name: string;\n status: string;\n source: string | null;\n externalId: string | null;\n externalUrl: string | null;\n ref: string | null;\n metadata: Record<string, unknown> | null;\n}\n\nexport interface TestRun {\n id: string;\n organizationId: string;\n environmentId: string | null;\n deploymentId: string | null;\n name: string;\n tool: string | null;\n status: string;\n summary: TestRunSummary | null;\n durationMs: number | null;\n runnerName: string | null;\n runnerUrl: string | null;\n startedAt: string | null;\n completedAt: string | null;\n metadata: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n deployment?: TestRunDeployment | null;\n results?: TestResult[];\n}\n\nexport interface CreateTestRunInput {\n name: string;\n environment?: string;\n environmentId?: string;\n deploymentId?: string;\n tool?: string;\n buildName?: string;\n buildUrl?: string;\n runnerName?: string;\n runnerUrl?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface UpdateTestRunInput {\n status?: string;\n summary?: TestRunSummary;\n completedAt?: string;\n startedAt?: string;\n tool?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface ListTestRunsFilters {\n limit?: number;\n offset?: number;\n status?: string;\n environmentId?: string;\n tool?: string;\n runnerName?: string;\n startDate?: string;\n endDate?: string;\n}\n\n// ── Test Results ──\n\nexport interface TestResult {\n id?: string;\n name: string;\n suite?: string;\n status: string;\n durationMs?: number;\n message?: string;\n trace?: string;\n retryCount?: number;\n flaky?: boolean;\n browser?: string;\n tags?: string[];\n metadata?: Record<string, unknown>;\n}\n\n// ── Test Cases ──\n\nexport interface TestCaseStep {\n id?: string;\n stepNumber: number;\n action: string;\n expectedResult?: string;\n data?: string;\n}\n\nexport interface TestCase {\n id: string;\n organizationId: string;\n title: string;\n description: string | null;\n preconditions: string | null;\n expectedResult: string | null;\n priority: string | null;\n automationStatus: string | null;\n automationId: string | null;\n tags: string[] | null;\n estimatedDurationMs: number | null;\n metadata: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n steps?: TestCaseStep[];\n recentResults?: TestResult[];\n}\n\nexport interface CreateTestCaseInput {\n title: string;\n description?: string;\n preconditions?: string;\n expectedResult?: string;\n priority?: string;\n automationStatus?: string;\n automationId?: string;\n tags?: string[];\n estimatedDurationMs?: number;\n metadata?: Record<string, unknown>;\n steps?: Omit<TestCaseStep, 'id'>[];\n}\n\nexport interface UpdateTestCaseInput {\n title?: string;\n description?: string;\n preconditions?: string;\n expectedResult?: string;\n priority?: string;\n automationStatus?: string;\n automationId?: string;\n tags?: string[];\n estimatedDurationMs?: number;\n metadata?: Record<string, unknown>;\n steps?: TestCaseStep[];\n}\n\nexport interface ListTestCasesFilters {\n limit?: number;\n offset?: number;\n tags?: string;\n priority?: string;\n automationStatus?: string;\n}\n\n// ── Test Environments ──\n\nexport interface TestEnvironment {\n id: string;\n organizationId: string;\n name: string;\n description: string | null;\n baseUrl: string | null;\n metadata: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CreateTestEnvironmentInput {\n name: string;\n description?: string;\n baseUrl?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface UpdateTestEnvironmentInput {\n name?: string;\n description?: string;\n baseUrl?: string;\n metadata?: Record<string, unknown>;\n}\n\n// ── Deployments ──\n\nexport type DeploymentStatus = 'pending' | 'in_progress' | 'success' | 'failure' | 'cancelled';\n\nexport interface Deployment {\n id: string;\n organizationId: string;\n environmentId: string | null;\n name: string;\n status: DeploymentStatus;\n source: string | null;\n externalId: string | null;\n externalUrl: string | null;\n ref: string | null;\n metadata: Record<string, unknown> | null;\n startedAt: string | null;\n completedAt: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CreateDeploymentInput {\n name: string;\n environmentId?: string;\n status?: DeploymentStatus;\n source?: string;\n externalId?: string;\n externalUrl?: string;\n ref?: string;\n metadata?: Record<string, unknown>;\n startedAt?: string;\n}\n\nexport interface UpdateDeploymentInput {\n name?: string;\n status?: DeploymentStatus;\n source?: string;\n externalId?: string;\n externalUrl?: string;\n ref?: string;\n metadata?: Record<string, unknown>;\n startedAt?: string;\n completedAt?: string;\n}\n\nexport interface ListDeploymentsFilters {\n limit?: number;\n offset?: number;\n status?: string;\n environmentId?: string;\n source?: string;\n startDate?: string;\n endDate?: string;\n}\n\n// ── Pagination ──\n\nexport interface PaginatedResponse<T> {\n data: T[];\n pagination: {\n limit: number;\n offset: number;\n total: number;\n hasMore: boolean;\n };\n}\n\n// ── CTRF (Common Test Report Format) ──\n\nexport interface CtrfReport {\n results: {\n tool?: { name?: string; version?: string };\n summary?: {\n tests?: number;\n passed?: number;\n failed?: number;\n skipped?: number;\n pending?: number;\n other?: number;\n start?: number;\n stop?: number;\n };\n tests?: CtrfTest[];\n environment?: {\n reportName?: string;\n [key: string]: unknown;\n };\n };\n}\n\nexport interface CtrfTest {\n name: string;\n status: 'passed' | 'failed' | 'skipped' | 'pending' | 'other';\n duration?: number;\n suite?: string;\n filePath?: string;\n message?: string;\n trace?: string;\n retries?: number;\n flaky?: boolean;\n browser?: string;\n tags?: string[];\n extra?: Record<string, unknown>;\n}\n\n// ── Auth / Credentials ──\n\nexport interface Credentials {\n clientId: string;\n clientSecret: string;\n orgId: string;\n apiUrl: string;\n authUrl: string;\n}\n\nexport interface TokenResponse {\n access_token: string;\n token_type: string;\n expires_in?: number;\n}\n\n// ── Client Options ──\n\nexport interface SmooTestingClientOptions {\n clientId: string;\n clientSecret: string;\n orgId: string;\n apiUrl?: string;\n authUrl?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@smooai/testing",
3
+ "version": "1.0.0",
4
+ "description": "Smoo AI Testing SDK — CLI and library for interacting with the Smoo AI Testing API. Report test results, manage test runs, cases, environments, and deployments.",
5
+ "homepage": "https://github.com/SmooAI/testing#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/SmooAI/testing/issues"
8
+ },
9
+ "license": "MIT",
10
+ "author": {
11
+ "name": "SmooAI",
12
+ "email": "brent@smooai.com",
13
+ "url": "https://smooai.com"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/SmooAI/testing.git"
18
+ },
19
+ "bin": {
20
+ "smooai-testing": "./dist/cli.mjs"
21
+ },
22
+ "files": [
23
+ "dist/**"
24
+ ],
25
+ "main": "./dist/index.js",
26
+ "module": "./dist/index.mjs",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.mjs",
32
+ "require": "./dist/index.js",
33
+ "default": "./dist/index.js"
34
+ }
35
+ },
36
+ "dependencies": {
37
+ "chalk": "^5.4.1",
38
+ "commander": "^13.0.0",
39
+ "ink": "^6.8.0",
40
+ "ink-big-text": "^2.0.0",
41
+ "ink-gradient": "^3.0.0",
42
+ "ink-spinner": "^5.0.0",
43
+ "react": "^19.0.0",
44
+ "zod": "^3.24.0"
45
+ },
46
+ "devDependencies": {
47
+ "@changesets/cli": "^2.28.1",
48
+ "@smooai/config-typescript": "^1.0.16",
49
+ "@types/node": "^22.13.10",
50
+ "@types/react": "^19.2.14",
51
+ "husky": "^9.1.7",
52
+ "oxfmt": "^0.28.0",
53
+ "oxlint": "^0.16.0",
54
+ "react-dom": "^19.2.4",
55
+ "sst": "^3.19.3",
56
+ "tsup": "^8.4.0",
57
+ "typescript": "^5.7.0",
58
+ "vite-tsconfig-paths": "^5.1.4",
59
+ "vitest": "^3.1.1"
60
+ },
61
+ "scripts": {
62
+ "build": "pnpm build:lib && pnpm build:cli",
63
+ "build:lib": "tsup",
64
+ "build:cli": "tsup --config tsup.cli.config.ts",
65
+ "check-all": "pnpm run typecheck && pnpm run lint && pnpm run format:check && pnpm run test && pnpm run build",
66
+ "ci:publish": "pnpm build && pnpm changeset publish",
67
+ "format": "oxfmt --write .",
68
+ "format:check": "oxfmt --check .",
69
+ "lint": "oxlint --ignore-pattern dist .",
70
+ "lint:fix": "oxlint --ignore-pattern dist --fix .",
71
+ "pre-commit-check": "pnpm run typecheck && pnpm run lint && pnpm run format:check && pnpm run test",
72
+ "test": "vitest run --passWithNoTests",
73
+ "test:integration": "vitest run --passWithNoTests --config vitest.integration.config.mts",
74
+ "typecheck": "tsc --noEmit --skipLibCheck",
75
+ "watch": "tsup --watch"
76
+ }
77
+ }