shoal-web-sdk 0.0.158 → 0.0.159

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.
@@ -1,6 +1,7 @@
1
1
  export type ClientOptions = {
2
2
  baseUrl: 'http://localhost:8080/core-service' | 'https://api-dev.shoalstack.com/core-service' | (string & {});
3
3
  };
4
+ export type PlainString = string;
4
5
  export type EnvironmentVariables = {
5
6
  vars: Array<EnvironmentVariable>;
6
7
  };
@@ -26,7 +27,7 @@ export type ErrorResponse = {
26
27
  internalCode: ErrorCode;
27
28
  };
28
29
  export type CreateProject = {
29
- name: string;
30
+ name: PlainString;
30
31
  handle: string;
31
32
  description?: string;
32
33
  };
@@ -73,12 +74,12 @@ export type CreateInvite = {
73
74
  role: string;
74
75
  };
75
76
  export type CreateSpace = {
76
- name: string;
77
+ name: PlainString;
77
78
  handle: string;
78
79
  billingPlanCode: unknown;
79
80
  };
80
81
  export type CreateEnvironment = {
81
- name: string;
82
+ name: PlainString;
82
83
  handle: string;
83
84
  description?: string;
84
85
  };
@@ -293,8 +294,8 @@ export type KindeOrganisationBillingAgreement = {
293
294
  */
294
295
  plan_code?: string;
295
296
  };
296
- export type Nodes = {
297
- nodes: Array<Node>;
297
+ export type UpdateNodes = {
298
+ nodes: Array<UpdateNode>;
298
299
  };
299
300
  export type Uuids = {
300
301
  ids: Array<string>;
@@ -364,6 +365,38 @@ export type Node = {
364
365
  typ: 'scheduler';
365
366
  } & SchedulerNodeProps);
366
367
  };
368
+ export type UpdateNode = {
369
+ id: string;
370
+ name?: PlainString;
371
+ description?: string;
372
+ x: number;
373
+ y: number;
374
+ width: number;
375
+ height: number;
376
+ edges?: Array<Edge>;
377
+ typ: NodeType;
378
+ props?: ({
379
+ typ: 'comment';
380
+ } & CommentNodeProps) | ({
381
+ typ: 'cache';
382
+ } & CacheNodeProps) | ({
383
+ typ: 'container';
384
+ } & ContainerNodeProps) | ({
385
+ typ: 'cronjob';
386
+ } & CronJobNodeProps) | ({
387
+ typ: 'database';
388
+ } & DatabaseNodeProps) | ({
389
+ typ: 'function';
390
+ } & FunctionNodeProps) | ({
391
+ typ: 'queue';
392
+ } & QueueNodeProps) | ({
393
+ typ: 'proxy';
394
+ } & ProxyNodeProps) | ({
395
+ typ: 'vm';
396
+ } & VmNodeProps) | ({
397
+ typ: 'scheduler';
398
+ } & SchedulerNodeProps);
399
+ };
367
400
  export type EdgeType = 'network' | 'route';
368
401
  export type NodeType = 'cache' | 'comment' | 'container' | 'cronjob' | 'database' | 'function' | 'queue' | 'proxy' | 'vm' | 'scheduler';
369
402
  export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
@@ -700,7 +733,7 @@ export type FetchGraphM2mResponses = {
700
733
  };
701
734
  export type FetchGraphM2mResponse = FetchGraphM2mResponses[keyof FetchGraphM2mResponses];
702
735
  export type UpdateGraphM2mData = {
703
- body: Nodes;
736
+ body: UpdateNodes;
704
737
  path: {
705
738
  /**
706
739
  * A version UUID.
@@ -2410,7 +2443,7 @@ export type GetGraphOverviewResponses = {
2410
2443
  };
2411
2444
  export type GetGraphOverviewResponse = GetGraphOverviewResponses[keyof GetGraphOverviewResponses];
2412
2445
  export type UpdateGraphStateData = {
2413
- body: Nodes;
2446
+ body: UpdateNodes;
2414
2447
  path: {
2415
2448
  /**
2416
2449
  * The space handle. This must be globally unique.
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ export declare const zPlainString: z.ZodString;
2
3
  export declare const zEnvironmentVariable: z.ZodObject<{
3
4
  key: z.ZodString;
4
5
  value: z.ZodString;
@@ -743,7 +744,8 @@ export declare const zNode: z.ZodObject<{
743
744
  paused: z.ZodBoolean;
744
745
  }, z.core.$strip>>]>>;
745
746
  }, z.core.$strip>;
746
- export declare const zNodes: z.ZodObject<{
747
+ export declare const zGraph: z.ZodObject<{
748
+ versionUUID: z.ZodUUID;
747
749
  nodes: z.ZodArray<z.ZodObject<{
748
750
  id: z.ZodUUID;
749
751
  name: z.ZodOptional<z.ZodString>;
@@ -863,8 +865,125 @@ export declare const zNodes: z.ZodObject<{
863
865
  }, z.core.$strip>>]>>;
864
866
  }, z.core.$strip>>;
865
867
  }, z.core.$strip>;
866
- export declare const zGraph: z.ZodObject<{
867
- versionUUID: z.ZodUUID;
868
+ export declare const zUpdateNode: z.ZodObject<{
869
+ id: z.ZodUUID;
870
+ name: z.ZodOptional<z.ZodString>;
871
+ description: z.ZodOptional<z.ZodString>;
872
+ x: z.ZodNumber;
873
+ y: z.ZodNumber;
874
+ width: z.ZodInt;
875
+ height: z.ZodInt;
876
+ edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
877
+ id: z.ZodUUID;
878
+ src: z.ZodUUID;
879
+ dst: z.ZodUUID;
880
+ typ: z.ZodEnum<{
881
+ network: "network";
882
+ route: "route";
883
+ }>;
884
+ props: z.ZodOptional<z.ZodUnion<readonly [z.ZodIntersection<z.ZodObject<{
885
+ typ: z.ZodLiteral<"network">;
886
+ }, z.core.$strip>, z.ZodObject<{
887
+ a: z.ZodOptional<z.ZodString>;
888
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
889
+ typ: z.ZodLiteral<"route">;
890
+ }, z.core.$strip>, z.ZodObject<{
891
+ path: z.ZodOptional<z.ZodString>;
892
+ }, z.core.$strip>>]>>;
893
+ }, z.core.$strip>>>;
894
+ typ: z.ZodEnum<{
895
+ function: "function";
896
+ cache: "cache";
897
+ comment: "comment";
898
+ container: "container";
899
+ cronjob: "cronjob";
900
+ database: "database";
901
+ queue: "queue";
902
+ proxy: "proxy";
903
+ vm: "vm";
904
+ scheduler: "scheduler";
905
+ }>;
906
+ props: z.ZodOptional<z.ZodUnion<readonly [z.ZodIntersection<z.ZodObject<{
907
+ typ: z.ZodLiteral<"comment">;
908
+ }, z.core.$strip>, z.ZodObject<{
909
+ comment: z.ZodOptional<z.ZodString>;
910
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
911
+ typ: z.ZodLiteral<"cache">;
912
+ }, z.core.$strip>, z.ZodObject<{
913
+ size: z.ZodOptional<z.ZodInt>;
914
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
915
+ typ: z.ZodLiteral<"container">;
916
+ }, z.core.$strip>, z.ZodObject<{
917
+ region: z.ZodEnum<{
918
+ "europe-west2": "europe-west2";
919
+ }>;
920
+ port: z.ZodInt;
921
+ cpu: z.ZodEnum<{
922
+ 1: "1";
923
+ 2: "2";
924
+ }>;
925
+ memory: z.ZodEnum<{
926
+ "512Mi": "512Mi";
927
+ "1Gi": "1Gi";
928
+ "2Gi": "2Gi";
929
+ }>;
930
+ ingress: z.ZodEnum<{
931
+ INGRESS_TRAFFIC_ALL: "INGRESS_TRAFFIC_ALL";
932
+ INGRESS_TRAFFIC_INTERNAL_ONLY: "INGRESS_TRAFFIC_INTERNAL_ONLY";
933
+ INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER: "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER";
934
+ }>;
935
+ timeoutSeconds: z.ZodOptional<z.ZodInt>;
936
+ maxInstances: z.ZodOptional<z.ZodInt>;
937
+ minInstances: z.ZodOptional<z.ZodInt>;
938
+ concurrency: z.ZodOptional<z.ZodInt>;
939
+ allowUnauthenticated: z.ZodOptional<z.ZodBoolean>;
940
+ uri: z.ZodOptional<z.ZodString>;
941
+ installationId: z.ZodOptional<z.ZodString>;
942
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
943
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
944
+ typ: z.ZodLiteral<"cronjob">;
945
+ }, z.core.$strip>, z.ZodObject<{
946
+ cronTab: z.ZodOptional<z.ZodString>;
947
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
948
+ typ: z.ZodLiteral<"database">;
949
+ }, z.core.$strip>, z.ZodObject<{
950
+ space: z.ZodOptional<z.ZodInt>;
951
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
952
+ typ: z.ZodLiteral<"function">;
953
+ }, z.core.$strip>, z.ZodObject<{
954
+ cpus: z.ZodOptional<z.ZodInt>;
955
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
956
+ typ: z.ZodLiteral<"queue">;
957
+ }, z.core.$strip>, z.ZodObject<{
958
+ foobar: z.ZodOptional<z.ZodString>;
959
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
960
+ typ: z.ZodLiteral<"proxy">;
961
+ }, z.core.$strip>, z.ZodObject<{
962
+ subdomain: z.ZodOptional<z.ZodString>;
963
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
964
+ typ: z.ZodLiteral<"vm">;
965
+ }, z.core.$strip>, z.ZodObject<{
966
+ os: z.ZodOptional<z.ZodString>;
967
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
968
+ typ: z.ZodLiteral<"scheduler">;
969
+ }, z.core.$strip>, z.ZodObject<{
970
+ expression: z.ZodString;
971
+ timezone: z.ZodString;
972
+ requestMethod: z.ZodEnum<{
973
+ DELETE: "DELETE";
974
+ GET: "GET";
975
+ HEAD: "HEAD";
976
+ OPTIONS: "OPTIONS";
977
+ PATCH: "PATCH";
978
+ POST: "POST";
979
+ PUT: "PUT";
980
+ }>;
981
+ requestPayload: z.ZodOptional<z.ZodString>;
982
+ requestHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
983
+ paused: z.ZodBoolean;
984
+ }, z.core.$strip>>]>>;
985
+ }, z.core.$strip>;
986
+ export declare const zUpdateNodes: z.ZodObject<{
868
987
  nodes: z.ZodArray<z.ZodObject<{
869
988
  id: z.ZodUUID;
870
989
  name: z.ZodOptional<z.ZodString>;
@@ -1,5 +1,6 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
  import { z } from 'zod';
3
+ export const zPlainString = z.string().regex(/^[a-zA-Z0-9 ]+$/);
3
4
  export const zEnvironmentVariable = z.object({
4
5
  key: z.string(),
5
6
  value: z.string()
@@ -58,7 +59,7 @@ export const zErrorResponse = z.object({
58
59
  internalCode: zErrorCode
59
60
  });
60
61
  export const zCreateProject = z.object({
61
- name: z.string(),
62
+ name: zPlainString,
62
63
  handle: z.string(),
63
64
  description: z.optional(z.string())
64
65
  });
@@ -92,12 +93,12 @@ export const zCreateInvite = z.object({
92
93
  role: z.string()
93
94
  });
94
95
  export const zCreateSpace = z.object({
95
- name: z.string(),
96
+ name: zPlainString,
96
97
  handle: z.string(),
97
98
  billingPlanCode: z.unknown()
98
99
  });
99
100
  export const zCreateEnvironment = z.object({
100
- name: z.string(),
101
+ name: zPlainString,
101
102
  handle: z.string(),
102
103
  description: z.optional(z.string())
103
104
  });
@@ -466,13 +467,56 @@ export const zNode = z.object({
466
467
  }).and(zSchedulerNodeProps)
467
468
  ]))
468
469
  });
469
- export const zNodes = z.object({
470
- nodes: z.array(zNode)
471
- });
472
470
  export const zGraph = z.object({
473
471
  versionUUID: z.uuid(),
474
472
  nodes: z.array(zNode)
475
473
  });
474
+ export const zUpdateNode = z.object({
475
+ id: z.uuid(),
476
+ name: z.optional(zPlainString),
477
+ description: z.optional(z.string()),
478
+ x: z.number(),
479
+ y: z.number(),
480
+ width: z.int(),
481
+ height: z.int(),
482
+ edges: z.optional(z.array(zEdge)),
483
+ typ: zNodeType,
484
+ props: z.optional(z.union([
485
+ z.object({
486
+ typ: z.literal('comment')
487
+ }).and(zCommentNodeProps),
488
+ z.object({
489
+ typ: z.literal('cache')
490
+ }).and(zCacheNodeProps),
491
+ z.object({
492
+ typ: z.literal('container')
493
+ }).and(zContainerNodeProps),
494
+ z.object({
495
+ typ: z.literal('cronjob')
496
+ }).and(zCronJobNodeProps),
497
+ z.object({
498
+ typ: z.literal('database')
499
+ }).and(zDatabaseNodeProps),
500
+ z.object({
501
+ typ: z.literal('function')
502
+ }).and(zFunctionNodeProps),
503
+ z.object({
504
+ typ: z.literal('queue')
505
+ }).and(zQueueNodeProps),
506
+ z.object({
507
+ typ: z.literal('proxy')
508
+ }).and(zProxyNodeProps),
509
+ z.object({
510
+ typ: z.literal('vm')
511
+ }).and(zVmNodeProps),
512
+ z.object({
513
+ typ: z.literal('scheduler')
514
+ }).and(zSchedulerNodeProps)
515
+ ]))
516
+ });
517
+ export const zUpdateNodes = z.object({
518
+ nodes: z.array(zUpdateNode)
519
+ });
476
520
  export const zSignedUrlUploadResponse = z.object({
477
521
  signedUrl: z.string(),
478
522
  expiration: z.iso.datetime(),
@@ -662,7 +706,7 @@ export const zFetchGraphM2mData = z.object({
662
706
  */
663
707
  export const zFetchGraphM2mResponse = zGraph;
664
708
  export const zUpdateGraphM2mData = z.object({
665
- body: zNodes,
709
+ body: zUpdateNodes,
666
710
  path: z.object({
667
711
  versionUUID: z.uuid()
668
712
  }),
@@ -1113,7 +1157,7 @@ export const zGetGraphOverviewData = z.object({
1113
1157
  */
1114
1158
  export const zGetGraphOverviewResponse = zGraph;
1115
1159
  export const zUpdateGraphStateData = z.object({
1116
- body: zNodes,
1160
+ body: zUpdateNodes,
1117
1161
  path: z.object({
1118
1162
  spaceHandle: z.string(),
1119
1163
  projectHandle: z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoal-web-sdk",
3
- "version": "0.0.158",
3
+ "version": "0.0.159",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build-hooks": "npx tsx tanstack-codegen/generator.ts",