code-share-types 0.1.1 → 0.2.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/dist/Package.d.ts CHANGED
@@ -6,3 +6,30 @@ declare const PackageSchema: z.ZodObject<{
6
6
  type Package = z.infer<typeof PackageSchema>;
7
7
  export type { Package };
8
8
  export { PackageSchema };
9
+ declare const PACKAGE_INSTALL_STATUS: {
10
+ readonly requested: "REQUESTED";
11
+ readonly installing: "INSTALLING";
12
+ readonly installed: "INSTALLED";
13
+ readonly failed: "FAILED";
14
+ };
15
+ declare const PackageInstallStatusSchema: z.ZodEnum<{
16
+ REQUESTED: "REQUESTED";
17
+ INSTALLING: "INSTALLING";
18
+ INSTALLED: "INSTALLED";
19
+ FAILED: "FAILED";
20
+ }>;
21
+ type PackageInstallStatus = z.infer<typeof PackageInstallStatusSchema>;
22
+ export type { PackageInstallStatus };
23
+ export { PACKAGE_INSTALL_STATUS, PackageInstallStatusSchema };
24
+ declare const PackageInstallStatusMapSchema: z.ZodArray<z.ZodTuple<[z.ZodObject<{
25
+ runtime: z.ZodString;
26
+ version: z.ZodString;
27
+ }, z.core.$strip>, z.ZodEnum<{
28
+ REQUESTED: "REQUESTED";
29
+ INSTALLING: "INSTALLING";
30
+ INSTALLED: "INSTALLED";
31
+ FAILED: "FAILED";
32
+ }>], null>>;
33
+ type PackageInstallStatusMap = z.infer<typeof PackageInstallStatusMapSchema>;
34
+ export type { PackageInstallStatusMap };
35
+ export { PackageInstallStatusMapSchema };
package/dist/Package.js CHANGED
@@ -4,3 +4,13 @@ const PackageSchema = z.object({
4
4
  version: z.string(),
5
5
  });
6
6
  export { PackageSchema };
7
+ const PACKAGE_INSTALL_STATUS = {
8
+ requested: "REQUESTED",
9
+ installing: "INSTALLING",
10
+ installed: "INSTALLED",
11
+ failed: "FAILED",
12
+ };
13
+ const PackageInstallStatusSchema = z.enum(Object.values(PACKAGE_INSTALL_STATUS));
14
+ export { PACKAGE_INSTALL_STATUS, PackageInstallStatusSchema };
15
+ const PackageInstallStatusMapSchema = z.array(z.tuple([PackageSchema, PackageInstallStatusSchema]));
16
+ export { PackageInstallStatusMapSchema };
@@ -1,11 +1,12 @@
1
1
  import { Server, Socket } from "socket.io";
2
+ import { ExecutorInformationList } from "../executor";
2
3
  interface InterServerEvents {
3
4
  }
4
5
  interface SocketData {
5
6
  }
6
7
  export type AppClientToServerEvents = {};
7
8
  export type AppServerToClientEvents = {
8
- "executorsConnected": (count: number) => void;
9
+ "executorsInformation": (exectorsInformation: ExecutorInformationList) => void;
9
10
  };
10
11
  export type AppSocketServer = Server<AppClientToServerEvents, AppServerToClientEvents, InterServerEvents, SocketData>;
11
12
  export type AppSocketClient = Socket<AppClientToServerEvents, AppServerToClientEvents, InterServerEvents, SocketData>;
@@ -0,0 +1,29 @@
1
+ import z from 'zod';
2
+ declare const ExecutorInformationSchema: z.ZodObject<{
3
+ package_install_statuses: z.ZodArray<z.ZodTuple<[z.ZodObject<{
4
+ runtime: z.ZodString;
5
+ version: z.ZodString;
6
+ }, z.core.$strip>, z.ZodEnum<{
7
+ REQUESTED: "REQUESTED";
8
+ INSTALLING: "INSTALLING";
9
+ INSTALLED: "INSTALLED";
10
+ FAILED: "FAILED";
11
+ }>], null>>;
12
+ }, z.core.$strip>;
13
+ type ExecutorInformation = z.infer<typeof ExecutorInformationSchema>;
14
+ export type { ExecutorInformation };
15
+ export { ExecutorInformationSchema };
16
+ declare const ExecutorInformationListSchema: z.ZodArray<z.ZodObject<{
17
+ package_install_statuses: z.ZodArray<z.ZodTuple<[z.ZodObject<{
18
+ runtime: z.ZodString;
19
+ version: z.ZodString;
20
+ }, z.core.$strip>, z.ZodEnum<{
21
+ REQUESTED: "REQUESTED";
22
+ INSTALLING: "INSTALLING";
23
+ INSTALLED: "INSTALLED";
24
+ FAILED: "FAILED";
25
+ }>], null>>;
26
+ }, z.core.$strip>>;
27
+ type ExecutorInformationList = z.infer<typeof ExecutorInformationListSchema>;
28
+ export type { ExecutorInformationList };
29
+ export { ExecutorInformationListSchema };
@@ -0,0 +1,8 @@
1
+ import z from 'zod';
2
+ import { PackageInstallStatusMapSchema } from '../../Package';
3
+ const ExecutorInformationSchema = z.object({
4
+ package_install_statuses: PackageInstallStatusMapSchema,
5
+ });
6
+ export { ExecutorInformationSchema };
7
+ const ExecutorInformationListSchema = z.array(ExecutorInformationSchema);
8
+ export { ExecutorInformationListSchema };
@@ -1,11 +1,12 @@
1
1
  import { Namespace, Socket } from "socket.io";
2
2
  import { ExecutorCodeRequest, ExecutorCodeResult } from ".";
3
- import { Package } from "../../Package";
3
+ import { Package, PackageInstallStatus } from "../../Package";
4
4
  interface InterServerEvents {
5
5
  }
6
6
  interface SocketData {
7
7
  }
8
8
  export type ExecutorClientToServerEvents = {
9
+ "packageInstallProgress": (pkg: Package, status: PackageInstallStatus) => void;
9
10
  "installedPackages": (packages: Package[]) => void;
10
11
  "executorCodeResult": (uuid: string, code: ExecutorCodeResult) => void;
11
12
  };
@@ -1,3 +1,4 @@
1
1
  export * from './ExecutorCodeRequest';
2
2
  export * from './ExecutorCodeResult';
3
+ export * from './ExecutorInformation';
3
4
  export * from './SocketTypes';
@@ -1,3 +1,4 @@
1
1
  export * from './ExecutorCodeRequest';
2
2
  export * from './ExecutorCodeResult';
3
+ export * from './ExecutorInformation';
3
4
  export * from './SocketTypes';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-share-types",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "files": [
5
5
  "/dist"
6
6
  ],