@alienplatform/testing 3.3.64 → 3.3.65

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/errors.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { AlienError, defineError } from "@alienplatform/core";
2
- import * as z$1 from "zod/v4";
2
+ import * as z from "zod/v4";
3
3
  // src/errors.ts
4
4
  const TestingOperationFailedError = defineError({
5
5
  code: "TESTING_OPERATION_FAILED",
6
- context: z$1.object({
7
- operation: z$1.string(),
8
- message: z$1.string(),
9
- details: z$1.record(z$1.string(), z$1.unknown()).optional()
6
+ context: z.object({
7
+ operation: z.string(),
8
+ message: z.string(),
9
+ details: z.record(z.string(), z.unknown()).optional()
10
10
  }),
11
11
  message: ({ operation, message }) => `Testing operation '${operation}' failed: ${message}`,
12
12
  retryable: false,
@@ -15,9 +15,9 @@ const TestingOperationFailedError = defineError({
15
15
  });
16
16
  const TestingUnsupportedPlatformError = defineError({
17
17
  code: "TESTING_UNSUPPORTED_PLATFORM",
18
- context: z$1.object({
19
- platform: z$1.string(),
20
- operation: z$1.string()
18
+ context: z.object({
19
+ platform: z.string(),
20
+ operation: z.string()
21
21
  }),
22
22
  message: ({ platform, operation }) => `Unsupported platform '${platform}' for testing operation '${operation}'`,
23
23
  retryable: false,
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","names":["z"],"sources":["../src/errors.ts"],"sourcesContent":["import { AlienError, defineError } from \"@alienplatform/core\"\nimport * as z from \"zod/v4\"\n\nexport const TestingOperationFailedError = defineError({\n code: \"TESTING_OPERATION_FAILED\",\n context: z.object({\n operation: z.string(),\n message: z.string(),\n details: z.record(z.string(), z.unknown()).optional(),\n }),\n message: ({ operation, message }) => `Testing operation '${operation}' failed: ${message}`,\n retryable: false,\n internal: false,\n httpStatusCode: 500,\n})\n\nexport const TestingUnsupportedPlatformError = defineError({\n code: \"TESTING_UNSUPPORTED_PLATFORM\",\n context: z.object({\n platform: z.string(),\n operation: z.string(),\n }),\n message: ({ platform, operation }) =>\n `Unsupported platform '${platform}' for testing operation '${operation}'`,\n retryable: false,\n internal: false,\n httpStatusCode: 400,\n})\n\nexport async function withTestingContext(\n error: unknown,\n operation: string,\n message: string,\n details?: Record<string, unknown>,\n): Promise<AlienError<any>> {\n return (await AlienError.from(error)).withContext(\n TestingOperationFailedError.create({\n operation,\n message,\n details,\n }),\n )\n}\n"],"mappings":";;;AAGA,MAAa,8BAA8B,YAAY;CACrD,MAAM;CACN,SAASA,IAAE,OAAO;EAChB,WAAWA,IAAE,OAAO;EACpB,SAASA,IAAE,OAAO;EAClB,SAASA,IAAE,OAAOA,IAAE,OAAO,GAAGA,IAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;CACtD,CAAC;CACD,UAAU,EAAE,WAAW,cAAc,sBAAsB,UAAU,YAAY;CACjF,WAAW;CACX,UAAU;CACV,gBAAgB;AAClB,CAAC;AAED,MAAa,kCAAkC,YAAY;CACzD,MAAM;CACN,SAASA,IAAE,OAAO;EAChB,UAAUA,IAAE,OAAO;EACnB,WAAWA,IAAE,OAAO;CACtB,CAAC;CACD,UAAU,EAAE,UAAU,gBACpB,yBAAyB,SAAS,2BAA2B,UAAU;CACzE,WAAW;CACX,UAAU;CACV,gBAAgB;AAClB,CAAC;AAED,eAAsB,mBACpB,OACA,WACA,SACA,SAC0B;CAC1B,QAAQ,MAAM,WAAW,KAAK,KAAK,EAAA,CAAG,YACpC,4BAA4B,OAAO;EACjC;EACA;EACA;CACF,CAAC,CACH;AACF"}
1
+ {"version":3,"file":"errors.js","names":[],"sources":["../src/errors.ts"],"sourcesContent":["import { AlienError, defineError } from \"@alienplatform/core\"\nimport * as z from \"zod/v4\"\n\nexport const TestingOperationFailedError = defineError({\n code: \"TESTING_OPERATION_FAILED\",\n context: z.object({\n operation: z.string(),\n message: z.string(),\n details: z.record(z.string(), z.unknown()).optional(),\n }),\n message: ({ operation, message }) => `Testing operation '${operation}' failed: ${message}`,\n retryable: false,\n internal: false,\n httpStatusCode: 500,\n})\n\nexport const TestingUnsupportedPlatformError = defineError({\n code: \"TESTING_UNSUPPORTED_PLATFORM\",\n context: z.object({\n platform: z.string(),\n operation: z.string(),\n }),\n message: ({ platform, operation }) =>\n `Unsupported platform '${platform}' for testing operation '${operation}'`,\n retryable: false,\n internal: false,\n httpStatusCode: 400,\n})\n\nexport async function withTestingContext(\n error: unknown,\n operation: string,\n message: string,\n details?: Record<string, unknown>,\n): Promise<AlienError<any>> {\n return (await AlienError.from(error)).withContext(\n TestingOperationFailedError.create({\n operation,\n message,\n details,\n }),\n )\n}\n"],"mappings":";;;AAGA,MAAa,8BAA8B,YAAY;CACrD,MAAM;CACN,SAAS,EAAE,OAAO;EAChB,WAAW,EAAE,OAAO;EACpB,SAAS,EAAE,OAAO;EAClB,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS;CACtD,CAAC;CACD,UAAU,EAAE,WAAW,cAAc,sBAAsB,UAAU,YAAY;CACjF,WAAW;CACX,UAAU;CACV,gBAAgB;AAClB,CAAC;AAED,MAAa,kCAAkC,YAAY;CACzD,MAAM;CACN,SAAS,EAAE,OAAO;EAChB,UAAU,EAAE,OAAO;EACnB,WAAW,EAAE,OAAO;CACtB,CAAC;CACD,UAAU,EAAE,UAAU,gBACpB,yBAAyB,SAAS,2BAA2B,UAAU;CACzE,WAAW;CACX,UAAU;CACV,gBAAgB;AAClB,CAAC;AAED,eAAsB,mBACpB,OACA,WACA,SACA,SAC0B;CAC1B,QAAQ,MAAM,WAAW,KAAK,KAAK,EAAA,CAAG,YACpC,4BAA4B,OAAO;EACjC;EACA;EACA;CACF,CAAC,CACH;AACF"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as node_child_process0 from "node:child_process";
2
- import * as z$1 from "zod/v4";
3
- import { z } from "zod/v4";
4
- import * as z$2 from "zod";
2
+ import * as z from "zod/v4";
3
+ import { z as z$2 } from "zod/v4";
4
+ import * as z$1 from "zod";
5
5
 
6
6
  // src/types.d.ts
7
7
 
@@ -129,17 +129,17 @@ declare function deploy(options: DeployOptions): Promise<Deployment>;
129
129
  /**
130
130
  * @description Canonical error container that provides a structured way to represent errors\nwith rich metadata including error codes, human-readable messages, context,\nand chaining capabilities for error propagation.\n\nThis struct is designed to be both machine-readable and user-friendly,\nsupporting serialization for API responses and detailed error reporting\nin distributed systems.
131
131
  */
132
- declare const AlienErrorSchema: z$2.ZodObject<{
133
- code: z$2.ZodString;
134
- context: z$2.ZodOptional<z$2.ZodAny>;
135
- hint: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodString>>;
136
- httpStatusCode: z$2.ZodOptional<z$2.ZodNullable<z$2.ZodInt>>;
137
- internal: z$2.ZodBoolean;
138
- message: z$2.ZodString;
139
- retryable: z$2.ZodDefault<z$2.ZodBoolean>;
140
- source: z$2.ZodOptional<z$2.ZodAny>;
141
- }, z$2.core.$strip>;
142
- type AlienError$1 = z$2.infer<typeof AlienErrorSchema>;
132
+ declare const AlienErrorSchema: z$1.ZodObject<{
133
+ code: z$1.ZodString;
134
+ context: z$1.ZodOptional<z$1.ZodAny>;
135
+ hint: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
136
+ httpStatusCode: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodInt>>;
137
+ internal: z$1.ZodBoolean;
138
+ message: z$1.ZodString;
139
+ retryable: z$1.ZodDefault<z$1.ZodBoolean>;
140
+ source: z$1.ZodOptional<z$1.ZodAny>;
141
+ }, z$1.core.$strip>;
142
+ type AlienError$1 = z$1.infer<typeof AlienErrorSchema>;
143
143
  /**
144
144
  * @description Represents all possible events in the Alien system
145
145
  */
@@ -152,7 +152,7 @@ type AlienError$1 = z$2.infer<typeof AlienErrorSchema>;
152
152
  *
153
153
  * @template TContext - Zod schema type for the error context
154
154
  */
155
- interface AlienErrorMetadata<TContext extends z.ZodTypeAny> {
155
+ interface AlienErrorMetadata<TContext extends z$2.ZodTypeAny> {
156
156
  /** Unique error code (e.g., "DATABASE_CONNECTION_FAILED") */
157
157
  code: string;
158
158
  /** Zod schema for type-safe context validation */
@@ -164,7 +164,7 @@ interface AlienErrorMetadata<TContext extends z.ZodTypeAny> {
164
164
  /** HTTP status code for API responses */
165
165
  httpStatusCode?: number;
166
166
  /** Worker to generate human-readable error message from context */
167
- message: (context: z.infer<TContext>) => string;
167
+ message: (context: z$2.infer<TContext>) => string;
168
168
  }
169
169
  /**
170
170
  * Helper function to create type-safe error definitions.
@@ -207,10 +207,10 @@ interface AlienErrorMetadata<TContext extends z.ZodTypeAny> {
207
207
  *
208
208
  * @template TContext - Zod schema type for the error context
209
209
  */
210
- interface AlienErrorDefinition<TContext extends z.ZodTypeAny> {
210
+ interface AlienErrorDefinition<TContext extends z$2.ZodTypeAny> {
211
211
  metadata: AlienErrorMetadata<TContext>;
212
212
  contextSchema: TContext;
213
- context: z.infer<TContext>;
213
+ context: z$2.infer<TContext>;
214
214
  /**
215
215
  * Convert this error definition directly to AlienErrorOptions.
216
216
  *
@@ -267,42 +267,42 @@ interface AlienErrorDefinition<TContext extends z.ZodTypeAny> {
267
267
  * ```
268
268
  */
269
269
  declare const TestingOperationFailedError: {
270
- metadata: AlienErrorMetadata<z$1.ZodObject<{
271
- operation: z$1.ZodString;
272
- message: z$1.ZodString;
273
- details: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
274
- }, z$1.core.$strip>>;
275
- contextSchema: z$1.ZodObject<{
276
- operation: z$1.ZodString;
277
- message: z$1.ZodString;
278
- details: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
279
- }, z$1.core.$strip>;
270
+ metadata: AlienErrorMetadata<z.ZodObject<{
271
+ operation: z.ZodString;
272
+ message: z.ZodString;
273
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
274
+ }, z.core.$strip>>;
275
+ contextSchema: z.ZodObject<{
276
+ operation: z.ZodString;
277
+ message: z.ZodString;
278
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
279
+ }, z.core.$strip>;
280
280
  create: (context: {
281
281
  operation: string;
282
282
  message: string;
283
283
  details?: Record<string, unknown> | undefined;
284
- }) => AlienErrorDefinition<z$1.ZodObject<{
285
- operation: z$1.ZodString;
286
- message: z$1.ZodString;
287
- details: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
288
- }, z$1.core.$strip>>;
284
+ }) => AlienErrorDefinition<z.ZodObject<{
285
+ operation: z.ZodString;
286
+ message: z.ZodString;
287
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
288
+ }, z.core.$strip>>;
289
289
  };
290
290
  declare const TestingUnsupportedPlatformError: {
291
- metadata: AlienErrorMetadata<z$1.ZodObject<{
292
- platform: z$1.ZodString;
293
- operation: z$1.ZodString;
294
- }, z$1.core.$strip>>;
295
- contextSchema: z$1.ZodObject<{
296
- platform: z$1.ZodString;
297
- operation: z$1.ZodString;
298
- }, z$1.core.$strip>;
291
+ metadata: AlienErrorMetadata<z.ZodObject<{
292
+ platform: z.ZodString;
293
+ operation: z.ZodString;
294
+ }, z.core.$strip>>;
295
+ contextSchema: z.ZodObject<{
296
+ platform: z.ZodString;
297
+ operation: z.ZodString;
298
+ }, z.core.$strip>;
299
299
  create: (context: {
300
300
  platform: string;
301
301
  operation: string;
302
- }) => AlienErrorDefinition<z$1.ZodObject<{
303
- platform: z$1.ZodString;
304
- operation: z$1.ZodString;
305
- }, z$1.core.$strip>>;
302
+ }) => AlienErrorDefinition<z.ZodObject<{
303
+ platform: z.ZodString;
304
+ operation: z.ZodString;
305
+ }, z.core.$strip>>;
306
306
  };
307
307
  export { type DeployOptions, Deployment, type DeploymentInfo, type EnvironmentVariable, type Platform, TestingOperationFailedError, TestingUnsupportedPlatformError, type UpgradeOptions, deploy };
308
308
  //# sourceMappingURL=index.d.ts.map