@dremio/js-sdk 0.31.3 → 0.31.5
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/cloud/projects/Project.d.ts +3 -3
- package/dist/cloud/projects/ProjectsResource.d.ts +2 -2
- package/dist/cloud/projects/ProjectsResource.js +1 -1
- package/dist/cloud/projects/ProjectsResource.js.map +1 -1
- package/dist/cloud/projects/projectPropertiesCodec.d.ts +11 -11
- package/dist/cloud/projects/projectPropertiesCodec.js +4 -4
- package/dist/cloud/projects/projectPropertiesCodec.js.map +1 -1
- package/package.json +1 -1
|
@@ -27,14 +27,14 @@ export declare class Project implements ProjectInterface {
|
|
|
27
27
|
update(properties: z.output<typeof projectUpdateSchema>): AsyncResult<Project, HttpError | z.core.util.SafeParseResult<z.output<typeof projectUpdateSchema>>["error"]>;
|
|
28
28
|
get settled(): boolean;
|
|
29
29
|
static updateSchema: z.ZodMiniObject<{
|
|
30
|
-
credentials: z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
30
|
+
credentials: z.ZodMiniOptional<z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
31
31
|
accessKeyId: z.ZodMiniString<string>;
|
|
32
32
|
secretAccessKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
33
33
|
type: z.ZodMiniLiteral<"ACCESS_KEY">;
|
|
34
34
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
35
35
|
externalId: z.ZodMiniString<string>;
|
|
36
36
|
externalIdSignature: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
37
|
-
instanceProfileArn: z.ZodMiniOptional<z.ZodMiniString<string
|
|
37
|
+
instanceProfileArn: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
38
38
|
roleArn: z.ZodMiniString<string>;
|
|
39
39
|
type: z.ZodMiniLiteral<"IAM_ROLE">;
|
|
40
40
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
@@ -43,7 +43,7 @@ export declare class Project implements ProjectInterface {
|
|
|
43
43
|
clientSecret: z.ZodMiniString<string>;
|
|
44
44
|
tenantId: z.ZodMiniString<string>;
|
|
45
45
|
type: z.ZodMiniLiteral<"AZURE_STORAGE_CLIENT_CREDENTIALS">;
|
|
46
|
-
}, z.core.$strip>], "type"
|
|
46
|
+
}, z.core.$strip>], "type">>>;
|
|
47
47
|
name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
48
48
|
}, z.core.$strip>;
|
|
49
49
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ResourceConfig, V3Config } from "../../common/Config.ts";
|
|
1
|
+
import type { ResourceConfig, V2Config, V3Config } from "../../common/Config.ts";
|
|
2
2
|
import { Project } from "./Project.ts";
|
|
3
3
|
import type { SignalParam } from "../../common/Params.ts";
|
|
4
4
|
import * as z from "zod/mini";
|
|
5
5
|
import { projectPropertiesCodec } from "./projectPropertiesCodec.js";
|
|
6
6
|
export declare class ProjectsResource {
|
|
7
7
|
#private;
|
|
8
|
-
constructor(config: ResourceConfig & V3Config);
|
|
8
|
+
constructor(config: ResourceConfig & V2Config & V3Config);
|
|
9
9
|
_createFromEntity(entity: z.input<typeof projectPropertiesCodec>): Project;
|
|
10
10
|
activate(id: string): Promise<import("ts-results-es").Result<undefined, import("../index.ts").HttpError>>;
|
|
11
11
|
delete(id: string): Promise<import("ts-results-es").Result<undefined, import("../index.ts").HttpError>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectsResource.js","sourceRoot":"","sources":["../../../src/cloud/projects/ProjectsResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE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ED,QAAQ,CAAC,EAAU,EAAE,EAAE,MAAM,KAAkB,EAAE;QAC/C,OAAO,IAAI,CAAC,OAAO;aAChB,SAAS,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;aACvC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAqD,CAAC;aAC3E,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAC7D,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ResourceConfig, V2Config, V3Config } from \"../../common/Config.ts\";\nimport { Project } from \"./Project.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { fromAbortable } from \"../../common/fromAbortable.ts\";\nimport { share, switchMap, timer } from \"rxjs\";\nimport * as z from \"zod/mini\";\nimport { projectPropertiesCodec } from \"./projectPropertiesCodec.js\";\nexport class ProjectsResource {\n readonly #config: ResourceConfig & V2Config & V3Config;\n\n constructor(config: ResourceConfig & V2Config & V3Config) {\n this.#config = config;\n }\n\n _createFromEntity(entity: z.input<typeof projectPropertiesCodec>) {\n try {\n return new Project(this.#config, z.decode(projectPropertiesCodec, entity), this);\n } catch (e) {\n this.#config.logger?.error(entity, \"failed to parse\");\n throw e;\n }\n }\n\n activate(id: string) {\n return this.#config\n .v2Request(`projects/${id}/activate`, {\n keepalive: true,\n method: \"PUT\",\n })\n .map(() => undefined).promise;\n }\n\n delete(id: string) {\n return this.#config\n .v3Request(`projects/${id}`, { keepalive: true, method: \"DELETE\" })\n .map(() => undefined).promise;\n }\n\n list() {\n const l = ({ signal }: SignalParam = {}) =>\n this.#config\n .v3Request(\"projects\", { signal })\n .map((res) => res.json() as Promise<z.input<typeof projectPropertiesCodec>[]>)\n .map((projects) => projects.map((entity) => this._createFromEntity(entity))).promise;\n return {\n async *data({ signal }: SignalParam = {}) {\n yield* (await l({ signal })).unwrap();\n },\n };\n }\n\n observe(id: string) {\n return timer(0, 5000).pipe(\n switchMap(() =>\n fromAbortable(({ signal }) =>\n this.retrieve(id, { signal }).then((result) => result.unwrap()),\n ),\n ),\n share(),\n );\n }\n\n retrieve(id: string, { signal }: SignalParam = {}) {\n return this.#config\n .v3Request(`projects/${id}`, { signal })\n .map((res) => res.json() as Promise<z.input<typeof projectPropertiesCodec>>)\n .map((entity) => this._createFromEntity(entity)).promise;\n }\n}\n"]}
|
|
@@ -7,14 +7,14 @@ export declare const projectPropertiesCodec: z.ZodMiniCodec<z.ZodMiniObject<{
|
|
|
7
7
|
}>;
|
|
8
8
|
createdAt: z.ZodMiniString<string>;
|
|
9
9
|
createdBy: z.ZodMiniString<string>;
|
|
10
|
-
credentials: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
10
|
+
credentials: z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
11
11
|
accessKeyId: z.ZodMiniString<string>;
|
|
12
12
|
secretAccessKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
13
13
|
type: z.ZodMiniLiteral<"ACCESS_KEY">;
|
|
14
14
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
15
15
|
externalId: z.ZodMiniString<string>;
|
|
16
16
|
externalIdSignature: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
17
|
-
instanceProfileArn: z.ZodMiniOptional<z.ZodMiniString<string
|
|
17
|
+
instanceProfileArn: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
18
18
|
roleArn: z.ZodMiniString<string>;
|
|
19
19
|
type: z.ZodMiniLiteral<"IAM_ROLE">;
|
|
20
20
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
@@ -23,7 +23,7 @@ export declare const projectPropertiesCodec: z.ZodMiniCodec<z.ZodMiniObject<{
|
|
|
23
23
|
clientSecret: z.ZodMiniString<string>;
|
|
24
24
|
tenantId: z.ZodMiniString<string>;
|
|
25
25
|
type: z.ZodMiniLiteral<"AZURE_STORAGE_CLIENT_CREDENTIALS">;
|
|
26
|
-
}, z.core.$strip>], "type"
|
|
26
|
+
}, z.core.$strip>], "type">>;
|
|
27
27
|
id: z.ZodMiniString<string>;
|
|
28
28
|
jdbcConnectionString: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
29
29
|
lastStateError: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
@@ -35,7 +35,7 @@ export declare const projectPropertiesCodec: z.ZodMiniCodec<z.ZodMiniObject<{
|
|
|
35
35
|
name: z.ZodMiniString<string>;
|
|
36
36
|
numberOfEngines: z.ZodMiniNumber<number>;
|
|
37
37
|
primaryCatalog: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
38
|
-
projectStore: z.ZodMiniString<string
|
|
38
|
+
projectStore: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
39
39
|
state: z.ZodMiniEnum<{
|
|
40
40
|
ACTIVE: "ACTIVE";
|
|
41
41
|
INACTIVE: "INACTIVE";
|
|
@@ -72,14 +72,14 @@ export declare const projectPropertiesCodec: z.ZodMiniCodec<z.ZodMiniObject<{
|
|
|
72
72
|
AWS: "AWS";
|
|
73
73
|
AZURE: "AZURE";
|
|
74
74
|
}>;
|
|
75
|
-
credentials: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
75
|
+
credentials: z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
76
76
|
accessKeyId: z.ZodMiniString<string>;
|
|
77
77
|
secretAccessKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
78
78
|
type: z.ZodMiniLiteral<"ACCESS_KEY">;
|
|
79
79
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
80
80
|
externalId: z.ZodMiniString<string>;
|
|
81
81
|
externalIdSignature: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
82
|
-
instanceProfileArn: z.ZodMiniOptional<z.ZodMiniString<string
|
|
82
|
+
instanceProfileArn: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
83
83
|
roleArn: z.ZodMiniString<string>;
|
|
84
84
|
type: z.ZodMiniLiteral<"IAM_ROLE">;
|
|
85
85
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
@@ -88,7 +88,7 @@ export declare const projectPropertiesCodec: z.ZodMiniCodec<z.ZodMiniObject<{
|
|
|
88
88
|
clientSecret: z.ZodMiniString<string>;
|
|
89
89
|
tenantId: z.ZodMiniString<string>;
|
|
90
90
|
type: z.ZodMiniLiteral<"AZURE_STORAGE_CLIENT_CREDENTIALS">;
|
|
91
|
-
}, z.core.$strip>], "type"
|
|
91
|
+
}, z.core.$strip>], "type">>;
|
|
92
92
|
jdbcConnectionString: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
93
93
|
lastStateError: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
94
94
|
error: z.ZodMiniString<string>;
|
|
@@ -96,19 +96,19 @@ export declare const projectPropertiesCodec: z.ZodMiniCodec<z.ZodMiniObject<{
|
|
|
96
96
|
}, z.core.$strip>>;
|
|
97
97
|
numberOfEngines: z.ZodMiniNumber<number>;
|
|
98
98
|
primaryCatalog: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
99
|
-
projectStore: z.ZodMiniString<string
|
|
99
|
+
projectStore: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
100
100
|
createdAt: z.ZodMiniCustom<Date, Date>;
|
|
101
101
|
modifiedAt: z.ZodMiniCustom<Date, Date>;
|
|
102
102
|
}, z.core.$strip>>;
|
|
103
103
|
export declare const projectUpdateSchema: z.ZodMiniObject<{
|
|
104
|
-
credentials: z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
104
|
+
credentials: z.ZodMiniOptional<z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
105
105
|
accessKeyId: z.ZodMiniString<string>;
|
|
106
106
|
secretAccessKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
107
107
|
type: z.ZodMiniLiteral<"ACCESS_KEY">;
|
|
108
108
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
109
109
|
externalId: z.ZodMiniString<string>;
|
|
110
110
|
externalIdSignature: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
111
|
-
instanceProfileArn: z.ZodMiniOptional<z.ZodMiniString<string
|
|
111
|
+
instanceProfileArn: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
112
112
|
roleArn: z.ZodMiniString<string>;
|
|
113
113
|
type: z.ZodMiniLiteral<"IAM_ROLE">;
|
|
114
114
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
@@ -117,6 +117,6 @@ export declare const projectUpdateSchema: z.ZodMiniObject<{
|
|
|
117
117
|
clientSecret: z.ZodMiniString<string>;
|
|
118
118
|
tenantId: z.ZodMiniString<string>;
|
|
119
119
|
type: z.ZodMiniLiteral<"AZURE_STORAGE_CLIENT_CREDENTIALS">;
|
|
120
|
-
}, z.core.$strip>], "type"
|
|
120
|
+
}, z.core.$strip>], "type">>>;
|
|
121
121
|
name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
122
122
|
}, z.core.$strip>;
|
|
@@ -19,7 +19,7 @@ const sharedProjectPropertiesInSchema = z.object({
|
|
|
19
19
|
cloudType: z.enum(["AWS", "AZURE"]),
|
|
20
20
|
createdAt: z.string(),
|
|
21
21
|
createdBy: z.string(),
|
|
22
|
-
credentials: z.discriminatedUnion("type", [
|
|
22
|
+
credentials: z.optional(z.discriminatedUnion("type", [
|
|
23
23
|
z.object({
|
|
24
24
|
accessKeyId: z.string(),
|
|
25
25
|
secretAccessKey: z.optional(z.string()),
|
|
@@ -28,7 +28,7 @@ const sharedProjectPropertiesInSchema = z.object({
|
|
|
28
28
|
z.object({
|
|
29
29
|
externalId: z.string(),
|
|
30
30
|
externalIdSignature: z.optional(z.string()),
|
|
31
|
-
instanceProfileArn: z.optional(z.string()),
|
|
31
|
+
instanceProfileArn: z.optional(z.nullable(z.string())),
|
|
32
32
|
roleArn: z.string(),
|
|
33
33
|
type: z.literal("IAM_ROLE"),
|
|
34
34
|
}),
|
|
@@ -39,7 +39,7 @@ const sharedProjectPropertiesInSchema = z.object({
|
|
|
39
39
|
tenantId: z.string(),
|
|
40
40
|
type: z.literal("AZURE_STORAGE_CLIENT_CREDENTIALS"),
|
|
41
41
|
}),
|
|
42
|
-
]),
|
|
42
|
+
])),
|
|
43
43
|
id: z.string(),
|
|
44
44
|
jdbcConnectionString: z.optional(z.string()),
|
|
45
45
|
lastStateError: z.optional(z.object({ error: z.string(), timestamp: z.number() })),
|
|
@@ -48,7 +48,7 @@ const sharedProjectPropertiesInSchema = z.object({
|
|
|
48
48
|
name: z.string(),
|
|
49
49
|
numberOfEngines: z.number().check(z.int(), z.minimum(0)),
|
|
50
50
|
primaryCatalog: z.optional(z.string()),
|
|
51
|
-
projectStore: z.string(),
|
|
51
|
+
projectStore: z.optional(z.string()),
|
|
52
52
|
state: z.enum([
|
|
53
53
|
"ACTIVATING",
|
|
54
54
|
"ACTIVE",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectPropertiesCodec.js","sourceRoot":"","sources":["../../../src/cloud/projects/projectPropertiesCodec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,+BAA+B,G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AAC,CAAC,EAAE,4CAA4C,CAAC,EAC5D,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,4CAA4C,CAAC,EAC7D,CAAC,CAAC,KAAK,CACL,2BAA2B,EAC3B,2HAA2H,CAC5H,EACD,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACzB,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5E,IAAI,SAAS,EAAE,CAAC;YACd,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,GAAG;gBACV,OAAO,EAAE,yCAAyC,SAAS,GAAG;aAC/D,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CACH;CACF,CAAC,CACH,CAAC;AAEF,MAAM,sBAAsB,GAAG;IAC7B,QAAQ;IACR,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;CACA,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as z from \"zod/mini\";\n\nconst sharedProjectPropertiesInSchema = z.object({\n cloudId: z.string(),\n cloudType: z.enum([\"AWS\", \"AZURE\"]),\n createdAt: z.string(),\n createdBy: z.string(),\n credentials: z.optional(\n z.discriminatedUnion(\"type\", [\n z.object({\n accessKeyId: z.string(),\n secretAccessKey: z.optional(z.string()),\n type: z.literal(\"ACCESS_KEY\"),\n }),\n z.object({\n externalId: z.string(),\n externalIdSignature: z.optional(z.string()),\n instanceProfileArn: z.optional(z.nullable(z.string())),\n roleArn: z.string(),\n type: z.literal(\"IAM_ROLE\"),\n }),\n z.object({\n accountName: z.string(),\n clientId: z.string(),\n clientSecret: z.string(),\n tenantId: z.string(),\n type: z.literal(\"AZURE_STORAGE_CLIENT_CREDENTIALS\"),\n }),\n ]),\n ),\n id: z.string(),\n jdbcConnectionString: z.optional(z.string()),\n lastStateError: z.optional(z.object({ error: z.string(), timestamp: z.number() })),\n modifiedAt: z.string(),\n modifiedBy: z.string(),\n name: z.string(),\n numberOfEngines: z.number().check(z.int(), z.minimum(0)),\n primaryCatalog: z.optional(z.string()),\n projectStore: z.optional(z.string()),\n state: z.enum([\n \"ACTIVATING\",\n \"ACTIVE\",\n \"ARCHIVED\",\n \"ARCHIVING\",\n \"CREATING\",\n \"DEACTIVATING\",\n \"INACTIVE\",\n \"RESTORING\",\n ]),\n type: z.enum([\"QUERY_ENGINE\"]),\n});\n\nexport const projectPropertiesCodec = z.codec(\n sharedProjectPropertiesInSchema,\n z.extend(z.omit(sharedProjectPropertiesInSchema, { createdAt: true, modifiedAt: true }), {\n createdAt: z.instanceof(Date),\n modifiedAt: z.instanceof(Date),\n }),\n {\n decode(v) {\n const { createdAt, modifiedAt, ...rest } = v;\n return {\n ...rest,\n createdAt: new Date(createdAt),\n modifiedAt: new Date(modifiedAt),\n };\n },\n encode(v) {\n const { createdAt, modifiedAt, ...rest } = v;\n return {\n ...rest,\n createdAt: createdAt.toString(),\n modifiedAt: modifiedAt.toString(),\n };\n },\n },\n);\n\nexport const projectUpdateSchema = z.partial(\n z.extend(z.pick(projectPropertiesCodec.def.in, { credentials: true }), {\n name: z.string().check(\n z.minLength(6, \"Project name must be at least 6 characters\"),\n z.maxLength(30, \"Project name must be at most 30 characters\"),\n z.regex(\n /^[a-z][a-z0-9-]*[a-z0-9]$/,\n \"Project name must start with a letter, contain only lowercase letters, numbers, and hyphens, and cannot end with a hyphen\",\n ),\n z.superRefine((val, ctx) => {\n const foundWord = projectDisallowedWords.find((word) => val.includes(word));\n if (foundWord) {\n ctx.addIssue({\n code: \"custom\",\n input: val,\n message: `Project name cannot contain the word \"${foundWord}\"`,\n });\n }\n }),\n ),\n }),\n);\n\nconst projectDisallowedWords = [\n \"dremio\",\n \"ssl\",\n \"admin\",\n \"system\",\n \"null\",\n \"undefined\",\n \"static\",\n \"assets\",\n \"login\",\n \"logout\",\n] as const;\n"]}
|