@ninedeploy/schemas 0.10.6 → 0.16.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.
- package/LICENSE +21 -21
- package/dist/accessGrants.d.ts +156 -0
- package/dist/accessGrants.d.ts.map +1 -0
- package/dist/accessGrants.js +100 -0
- package/dist/accessGrants.js.map +1 -0
- package/dist/agentCommand.d.ts.map +1 -1
- package/dist/agentCommand.js +11 -1
- package/dist/agentCommand.js.map +1 -1
- package/dist/auth.d.ts +53 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +26 -0
- package/dist/auth.js.map +1 -1
- package/dist/backupPolicy.d.ts +37 -0
- package/dist/backupPolicy.d.ts.map +1 -0
- package/dist/backupPolicy.js +50 -0
- package/dist/backupPolicy.js.map +1 -0
- package/dist/common.d.ts +21 -5
- package/dist/common.d.ts.map +1 -1
- package/dist/common.js +35 -6
- package/dist/common.js.map +1 -1
- package/dist/databaseImport.d.ts +145 -0
- package/dist/databaseImport.d.ts.map +1 -0
- package/dist/databaseImport.js +115 -0
- package/dist/databaseImport.js.map +1 -0
- package/dist/doctor.d.ts +16 -0
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +25 -0
- package/dist/doctor.js.map +1 -1
- package/dist/githubApp.d.ts +236 -0
- package/dist/githubApp.d.ts.map +1 -0
- package/dist/githubApp.js +223 -0
- package/dist/githubApp.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/kernel.d.ts +5 -2
- package/dist/kernel.d.ts.map +1 -1
- package/dist/kernel.js +11 -2
- package/dist/kernel.js.map +1 -1
- package/dist/management.d.ts +46 -2
- package/dist/management.d.ts.map +1 -1
- package/dist/management.js +68 -15
- package/dist/management.js.map +1 -1
- package/dist/multiNode.d.ts +325 -0
- package/dist/multiNode.d.ts.map +1 -0
- package/dist/multiNode.js +294 -0
- package/dist/multiNode.js.map +1 -0
- package/dist/ninedeployManifest.d.ts.map +1 -1
- package/dist/ninedeployManifest.js +6 -3
- package/dist/ninedeployManifest.js.map +1 -1
- package/dist/panelBackup.d.ts +73 -0
- package/dist/panelBackup.d.ts.map +1 -0
- package/dist/panelBackup.js +45 -0
- package/dist/panelBackup.js.map +1 -0
- package/dist/proxyConfig.d.ts +132 -0
- package/dist/proxyConfig.d.ts.map +1 -0
- package/dist/proxyConfig.js +105 -0
- package/dist/proxyConfig.js.map +1 -0
- package/dist/publicAccess.d.ts +64 -0
- package/dist/publicAccess.d.ts.map +1 -0
- package/dist/publicAccess.js +63 -0
- package/dist/publicAccess.js.map +1 -0
- package/dist/secretProviders.d.ts +119 -0
- package/dist/secretProviders.d.ts.map +1 -0
- package/dist/secretProviders.js +130 -0
- package/dist/secretProviders.js.map +1 -0
- package/dist/secretScan.js +1 -1
- package/dist/service.d.ts +24 -17
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +71 -26
- package/dist/service.js.map +1 -1
- package/dist/terminals.d.ts +284 -0
- package/dist/terminals.d.ts.map +1 -0
- package/dist/terminals.js +177 -0
- package/dist/terminals.js.map +1 -0
- package/dist/traffic.d.ts +276 -0
- package/dist/traffic.d.ts.map +1 -0
- package/dist/traffic.js +103 -0
- package/dist/traffic.js.map +1 -0
- package/dist/workspaces.d.ts +19 -1
- package/dist/workspaces.d.ts.map +1 -1
- package/dist/workspaces.js +26 -0
- package/dist/workspaces.js.map +1 -1
- package/package.json +5 -4
- package/src/accessGrants.ts +117 -0
- package/src/agentCommand.ts +67 -0
- package/src/ai.ts +32 -0
- package/src/auth.ts +323 -0
- package/src/backupPolicy.ts +55 -0
- package/src/common.ts +179 -0
- package/src/databaseImport.ts +138 -0
- package/src/doctor.ts +161 -0
- package/src/environments.ts +23 -0
- package/src/githubApp.ts +268 -0
- package/src/index.ts +30 -0
- package/src/insights.ts +78 -0
- package/src/kernel.ts +180 -0
- package/src/labels.ts +86 -0
- package/src/management.ts +620 -0
- package/src/multiNode.ts +354 -0
- package/src/ninedeployManifest.ts +363 -0
- package/src/panelBackup.ts +90 -0
- package/src/project.ts +42 -0
- package/src/proxyConfig.ts +139 -0
- package/src/publicAccess.ts +80 -0
- package/src/runtimeVersions.ts +232 -0
- package/src/secretProviders.ts +159 -0
- package/src/secretScan.ts +169 -0
- package/src/service.ts +1044 -0
- package/src/terminals.ts +212 -0
- package/src/traffic.ts +130 -0
- package/src/workspaces.ts +215 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Mirrors `secretProviderKind` in `@ninedeploy/db`. */
|
|
3
|
+
export declare const secretProviderKind: z.ZodEnum<{
|
|
4
|
+
aws: "aws";
|
|
5
|
+
vault: "vault";
|
|
6
|
+
}>;
|
|
7
|
+
export type SecretProviderKind = z.infer<typeof secretProviderKind>;
|
|
8
|
+
/**
|
|
9
|
+
* A Vault path relative to the KV v2 mount: segments of `[A-Za-z0-9_.-]+`
|
|
10
|
+
* joined by `/`, no leading or trailing `/`, and no `.` or `..` segment.
|
|
11
|
+
*/
|
|
12
|
+
export declare const VAULT_PATH_RE: RegExp;
|
|
13
|
+
/** A KV v2 field name. */
|
|
14
|
+
export declare const VAULT_FIELD_RE: RegExp;
|
|
15
|
+
/** An AWS secret name or full ARN. */
|
|
16
|
+
export declare const AWS_SECRET_ID_RE: RegExp;
|
|
17
|
+
export declare const AWS_REGION_RE: RegExp;
|
|
18
|
+
export declare const AWS_ACCESS_KEY_ID_RE: RegExp;
|
|
19
|
+
export declare const vaultPath: z.ZodString;
|
|
20
|
+
export declare const awsSecretId: z.ZodString;
|
|
21
|
+
export declare const vaultAuthMethod: z.ZodEnum<{
|
|
22
|
+
approle: "approle";
|
|
23
|
+
token: "token";
|
|
24
|
+
}>;
|
|
25
|
+
export type VaultAuthMethod = z.infer<typeof vaultAuthMethod>;
|
|
26
|
+
export declare const vaultProviderConfig: z.ZodObject<{
|
|
27
|
+
address: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodURL>, z.ZodTransform<string, string>>;
|
|
28
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
29
|
+
mount: z.ZodDefault<z.ZodString>;
|
|
30
|
+
authMethod: z.ZodEnum<{
|
|
31
|
+
approle: "approle";
|
|
32
|
+
token: "token";
|
|
33
|
+
}>;
|
|
34
|
+
approleMount: z.ZodDefault<z.ZodString>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
export type VaultProviderConfig = z.input<typeof vaultProviderConfig>;
|
|
37
|
+
export declare const vaultProviderCredentials: z.ZodObject<{
|
|
38
|
+
token: z.ZodOptional<z.ZodString>;
|
|
39
|
+
roleId: z.ZodOptional<z.ZodString>;
|
|
40
|
+
secretId: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
export type VaultProviderCredentials = z.infer<typeof vaultProviderCredentials>;
|
|
43
|
+
/** PUT /v1/settings/secret-providers/vault. */
|
|
44
|
+
export declare const vaultProviderPut: z.ZodObject<{
|
|
45
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
config: z.ZodObject<{
|
|
47
|
+
address: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodURL>, z.ZodTransform<string, string>>;
|
|
48
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
49
|
+
mount: z.ZodDefault<z.ZodString>;
|
|
50
|
+
authMethod: z.ZodEnum<{
|
|
51
|
+
approle: "approle";
|
|
52
|
+
token: "token";
|
|
53
|
+
}>;
|
|
54
|
+
approleMount: z.ZodDefault<z.ZodString>;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
credentials: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
token: z.ZodOptional<z.ZodString>;
|
|
58
|
+
roleId: z.ZodOptional<z.ZodString>;
|
|
59
|
+
secretId: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
export type VaultProviderPut = z.input<typeof vaultProviderPut>;
|
|
63
|
+
export declare const awsProviderConfig: z.ZodObject<{
|
|
64
|
+
region: z.ZodString;
|
|
65
|
+
endpoint: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodURL>, z.ZodTransform<string, string>>>;
|
|
66
|
+
roleArn: z.ZodOptional<z.ZodString>;
|
|
67
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
68
|
+
roleSessionName: z.ZodDefault<z.ZodString>;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
export type AwsProviderConfig = z.input<typeof awsProviderConfig>;
|
|
71
|
+
export declare const awsProviderCredentials: z.ZodObject<{
|
|
72
|
+
accessKeyId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
secretAccessKey: z.ZodOptional<z.ZodString>;
|
|
74
|
+
sessionToken: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strict>;
|
|
76
|
+
export type AwsProviderCredentials = z.infer<typeof awsProviderCredentials>;
|
|
77
|
+
/** PUT /v1/settings/secret-providers/aws. */
|
|
78
|
+
export declare const awsProviderPut: z.ZodObject<{
|
|
79
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
config: z.ZodObject<{
|
|
81
|
+
region: z.ZodString;
|
|
82
|
+
endpoint: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodURL>, z.ZodTransform<string, string>>>;
|
|
83
|
+
roleArn: z.ZodOptional<z.ZodString>;
|
|
84
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
85
|
+
roleSessionName: z.ZodDefault<z.ZodString>;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
credentials: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
accessKeyId: z.ZodOptional<z.ZodString>;
|
|
89
|
+
secretAccessKey: z.ZodOptional<z.ZodString>;
|
|
90
|
+
sessionToken: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strict>>;
|
|
92
|
+
}, z.core.$strict>;
|
|
93
|
+
export type AwsProviderPut = z.input<typeof awsProviderPut>;
|
|
94
|
+
/** POST /v1/settings/secret-providers/:kind/test. Both probes are optional. */
|
|
95
|
+
export declare const secretProviderTestRequest: z.ZodObject<{
|
|
96
|
+
probePath: z.ZodOptional<z.ZodString>;
|
|
97
|
+
probeSecretId: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
export type SecretProviderTestRequest = z.infer<typeof secretProviderTestRequest>;
|
|
100
|
+
export declare const secretProviderTestResult: z.ZodObject<{
|
|
101
|
+
ok: z.ZodBoolean;
|
|
102
|
+
detail: z.ZodString;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
export type SecretProviderTestResult = z.infer<typeof secretProviderTestResult>;
|
|
105
|
+
/** One element of GET /v1/settings/secret-providers. Never carries a credential. */
|
|
106
|
+
export declare const secretProviderView: z.ZodObject<{
|
|
107
|
+
kind: z.ZodEnum<{
|
|
108
|
+
aws: "aws";
|
|
109
|
+
vault: "vault";
|
|
110
|
+
}>;
|
|
111
|
+
configured: z.ZodBoolean;
|
|
112
|
+
enabled: z.ZodBoolean;
|
|
113
|
+
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
114
|
+
hasCredential: z.ZodBoolean;
|
|
115
|
+
lastTestedAt: z.ZodNullable<z.ZodString>;
|
|
116
|
+
lastTestError: z.ZodNullable<z.ZodString>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
export type SecretProviderView = z.infer<typeof secretProviderView>;
|
|
119
|
+
//# sourceMappingURL=secretProviders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secretProviders.d.ts","sourceRoot":"","sources":["../src/secretProviders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,wDAAwD;AACxD,eAAO,MAAM,kBAAkB;;;EAA2B,CAAC;AAC3D,M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;;;;;;;;;kBAMhB,CAAC;AACZ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAI5D,+EAA+E;AAC/E,eAAO,MAAM,yBAAyB;;;kBAO3B,CAAC;AACZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAElF,eAAO,MAAM,wBAAwB;;;iBAInC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF,oFAAoF;AACpF,eAAO,MAAM,kBAAkB;;;;;;;;;;;iBAS7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { providerBaseUrl } from './common.js';
|
|
3
|
+
// ── Secret managers (0.14) ─────────────────────────────────────────────────
|
|
4
|
+
// Request and response shapes for `/v1/settings/secret-providers`. HashiCorp
|
|
5
|
+
// Vault / OpenBao (KV v2) and AWS Secrets Manager run alongside the existing
|
|
6
|
+
// settings-based Infisical / Doppler provider, which is untouched. Credentials
|
|
7
|
+
// only ever appear in REQUEST shapes; on update an omitted credential field
|
|
8
|
+
// keeps the stored value. The server enforces https (http only with private
|
|
9
|
+
// egress) and proves the settings with a test call. Design: DESIGN.md §4.
|
|
10
|
+
/** Mirrors `secretProviderKind` in `@ninedeploy/db`. */
|
|
11
|
+
export const secretProviderKind = z.enum(['vault', 'aws']);
|
|
12
|
+
// ── Reference grammar pieces (DESIGN §4.1) ─────────────────────────────────
|
|
13
|
+
/**
|
|
14
|
+
* A Vault path relative to the KV v2 mount: segments of `[A-Za-z0-9_.-]+`
|
|
15
|
+
* joined by `/`, no leading or trailing `/`, and no `.` or `..` segment.
|
|
16
|
+
*/
|
|
17
|
+
export const VAULT_PATH_RE = /^(?!\.\.?(?:\/|$))[A-Za-z0-9_.-]+(?:\/(?!\.\.?(?:\/|$))[A-Za-z0-9_.-]+)*$/;
|
|
18
|
+
/** A KV v2 field name. */
|
|
19
|
+
export const VAULT_FIELD_RE = /^[A-Za-z0-9_.-]+$/;
|
|
20
|
+
/** An AWS secret name or full ARN. */
|
|
21
|
+
export const AWS_SECRET_ID_RE = /^[A-Za-z0-9/_+=.@:-]{1,2048}$/;
|
|
22
|
+
export const AWS_REGION_RE = /^[a-z]{2}(-gov)?-[a-z]+-\d$/;
|
|
23
|
+
export const AWS_ACCESS_KEY_ID_RE = /^(AKIA|ASIA)[A-Z0-9]{16}$/;
|
|
24
|
+
export const vaultPath = z.string().max(1024).regex(VAULT_PATH_RE, 'invalid Vault path');
|
|
25
|
+
export const awsSecretId = z.string().regex(AWS_SECRET_ID_RE, 'invalid AWS secret id');
|
|
26
|
+
// ── HashiCorp Vault / OpenBao ──────────────────────────────────────────────
|
|
27
|
+
export const vaultAuthMethod = z.enum(['token', 'approle']);
|
|
28
|
+
export const vaultProviderConfig = z
|
|
29
|
+
.object({
|
|
30
|
+
address: providerBaseUrl,
|
|
31
|
+
/** Vault Enterprise / OpenBao namespace (`X-Vault-Namespace`). */
|
|
32
|
+
namespace: vaultPath.optional(),
|
|
33
|
+
mount: vaultPath.default('secret'),
|
|
34
|
+
authMethod: vaultAuthMethod,
|
|
35
|
+
approleMount: vaultPath.default('approle'),
|
|
36
|
+
})
|
|
37
|
+
.strict();
|
|
38
|
+
const vaultSecret = z.string().min(1).max(4096);
|
|
39
|
+
export const vaultProviderCredentials = z
|
|
40
|
+
.object({
|
|
41
|
+
token: vaultSecret.optional(),
|
|
42
|
+
roleId: vaultSecret.optional(),
|
|
43
|
+
secretId: vaultSecret.optional(),
|
|
44
|
+
})
|
|
45
|
+
.strict();
|
|
46
|
+
/** PUT /v1/settings/secret-providers/vault. */
|
|
47
|
+
export const vaultProviderPut = z
|
|
48
|
+
.object({
|
|
49
|
+
enabled: z.boolean().optional(),
|
|
50
|
+
config: vaultProviderConfig,
|
|
51
|
+
credentials: vaultProviderCredentials.optional(),
|
|
52
|
+
})
|
|
53
|
+
.strict()
|
|
54
|
+
.refine((v) => v.config.authMethod !== 'token' || (v.credentials?.roleId === undefined && v.credentials?.secretId === undefined), {
|
|
55
|
+
message: 'roleId and secretId belong to authMethod "approle"',
|
|
56
|
+
path: ['credentials'],
|
|
57
|
+
})
|
|
58
|
+
.refine((v) => v.config.authMethod !== 'approle' || v.credentials?.token === undefined, {
|
|
59
|
+
message: 'token belongs to authMethod "token"',
|
|
60
|
+
path: ['credentials', 'token'],
|
|
61
|
+
});
|
|
62
|
+
// ── AWS Secrets Manager ────────────────────────────────────────────────────
|
|
63
|
+
export const awsProviderConfig = z
|
|
64
|
+
.object({
|
|
65
|
+
region: z.string().regex(AWS_REGION_RE, 'invalid AWS region'),
|
|
66
|
+
/** VPC endpoint or compatible service; https. */
|
|
67
|
+
endpoint: providerBaseUrl.optional(),
|
|
68
|
+
roleArn: z
|
|
69
|
+
.string()
|
|
70
|
+
.max(2048)
|
|
71
|
+
.regex(/^arn:aws[a-z-]*:iam::\d{12}:role\/[\w+=,.@/-]{1,512}$/, 'invalid IAM role ARN')
|
|
72
|
+
.optional(),
|
|
73
|
+
externalId: z
|
|
74
|
+
.string()
|
|
75
|
+
.min(2)
|
|
76
|
+
.max(1224)
|
|
77
|
+
.regex(/^[\w+=,.@:/-]+$/, 'invalid external id')
|
|
78
|
+
.optional(),
|
|
79
|
+
roleSessionName: z
|
|
80
|
+
.string()
|
|
81
|
+
.regex(/^[\w+=,.@-]{2,64}$/, 'invalid role session name')
|
|
82
|
+
.default('ninedeploy'),
|
|
83
|
+
})
|
|
84
|
+
.strict()
|
|
85
|
+
.refine((v) => v.externalId === undefined || v.roleArn !== undefined, {
|
|
86
|
+
message: 'externalId needs roleArn',
|
|
87
|
+
path: ['externalId'],
|
|
88
|
+
});
|
|
89
|
+
export const awsProviderCredentials = z
|
|
90
|
+
.object({
|
|
91
|
+
accessKeyId: z.string().regex(AWS_ACCESS_KEY_ID_RE, 'invalid access key id').optional(),
|
|
92
|
+
secretAccessKey: z.string().min(1).max(256).optional(),
|
|
93
|
+
sessionToken: z.string().min(1).max(4096).optional(),
|
|
94
|
+
})
|
|
95
|
+
.strict();
|
|
96
|
+
/** PUT /v1/settings/secret-providers/aws. */
|
|
97
|
+
export const awsProviderPut = z
|
|
98
|
+
.object({
|
|
99
|
+
enabled: z.boolean().optional(),
|
|
100
|
+
config: awsProviderConfig,
|
|
101
|
+
credentials: awsProviderCredentials.optional(),
|
|
102
|
+
})
|
|
103
|
+
.strict();
|
|
104
|
+
// ── Test and views ─────────────────────────────────────────────────────────
|
|
105
|
+
/** POST /v1/settings/secret-providers/:kind/test. Both probes are optional. */
|
|
106
|
+
export const secretProviderTestRequest = z
|
|
107
|
+
.object({
|
|
108
|
+
/** vault: also read this path (relative to the mount). */
|
|
109
|
+
probePath: vaultPath.optional(),
|
|
110
|
+
/** aws: also read this secret. */
|
|
111
|
+
probeSecretId: awsSecretId.optional(),
|
|
112
|
+
})
|
|
113
|
+
.strict();
|
|
114
|
+
export const secretProviderTestResult = z.object({
|
|
115
|
+
ok: z.boolean(),
|
|
116
|
+
/** Redacted; response bodies cut to 200 characters. */
|
|
117
|
+
detail: z.string(),
|
|
118
|
+
});
|
|
119
|
+
/** One element of GET /v1/settings/secret-providers. Never carries a credential. */
|
|
120
|
+
export const secretProviderView = z.object({
|
|
121
|
+
kind: secretProviderKind,
|
|
122
|
+
configured: z.boolean(),
|
|
123
|
+
enabled: z.boolean(),
|
|
124
|
+
/** Non-secret settings; `{}` when unconfigured. */
|
|
125
|
+
config: z.record(z.string(), z.unknown()),
|
|
126
|
+
hasCredential: z.boolean(),
|
|
127
|
+
lastTestedAt: z.string().nullable(),
|
|
128
|
+
lastTestError: z.string().nullable(),
|
|
129
|
+
});
|
|
130
|
+
//# sourceMappingURL=secretProviders.js.map
|
|
@@ -0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,EAAE;IACnC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC"}
|
package/dist/secretScan.js
CHANGED
package/dist/service.d.ts
CHANGED
|
@@ -71,9 +71,6 @@ export type CreateService = z.infer<typeof createService>;
|
|
|
71
71
|
* still applies `.default()` values for absent keys, which would silently
|
|
72
72
|
* rewrite `type` back to 'docker' and `branch` to 'main' on every PATCH. */
|
|
73
73
|
export declare const updateService: z.ZodObject<{
|
|
74
|
-
tagProjectIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
75
|
-
tagWorkspaceIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
76
|
-
tagLabelIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
77
74
|
name: z.ZodOptional<z.ZodString>;
|
|
78
75
|
slug: z.ZodOptional<z.ZodString>;
|
|
79
76
|
type: z.ZodOptional<z.ZodEnum<{
|
|
@@ -216,6 +213,8 @@ export declare const service: z.ZodObject<{
|
|
|
216
213
|
updatedAt: z.ZodString;
|
|
217
214
|
}, z.core.$strip>;
|
|
218
215
|
export type Service = z.infer<typeof service>;
|
|
216
|
+
/** r512: a registry host a `registry` credential may be sent to (`ghcr.io`, `registry.local:5000`). */
|
|
217
|
+
export declare const registryHost: z.ZodString;
|
|
219
218
|
export declare const createSource: z.ZodObject<{
|
|
220
219
|
name: z.ZodString;
|
|
221
220
|
type: z.ZodEnum<{
|
|
@@ -229,7 +228,9 @@ export declare const createSource: z.ZodObject<{
|
|
|
229
228
|
token: z.ZodOptional<z.ZodString>;
|
|
230
229
|
deployKey: z.ZodOptional<z.ZodString>;
|
|
231
230
|
registryUsername: z.ZodOptional<z.ZodString>;
|
|
231
|
+
registryHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
232
232
|
defaultBranch: z.ZodOptional<z.ZodString>;
|
|
233
|
+
baseUrl: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodURL>, z.ZodTransform<string, string>>>;
|
|
233
234
|
}, z.core.$strip>;
|
|
234
235
|
export type CreateSourceInput = z.input<typeof createSource>;
|
|
235
236
|
export declare const source: z.ZodObject<{
|
|
@@ -239,7 +240,16 @@ export declare const source: z.ZodObject<{
|
|
|
239
240
|
hasToken: z.ZodBoolean;
|
|
240
241
|
hasDeployKey: z.ZodBoolean;
|
|
241
242
|
registryUsername: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
243
|
+
registryHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
242
244
|
defaultBranch: z.ZodNullable<z.ZodString>;
|
|
245
|
+
baseUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
246
|
+
allowOnNodes: z.ZodOptional<z.ZodBoolean>;
|
|
247
|
+
pinHostKeys: z.ZodOptional<z.ZodBoolean>;
|
|
248
|
+
pinnedHostKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
249
|
+
host: z.ZodString;
|
|
250
|
+
type: z.ZodString;
|
|
251
|
+
fingerprint: z.ZodNullable<z.ZodString>;
|
|
252
|
+
}, z.core.$strip>>>;
|
|
243
253
|
createdAt: z.ZodString;
|
|
244
254
|
updatedAt: z.ZodOptional<z.ZodString>;
|
|
245
255
|
}, z.core.$strip>;
|
|
@@ -362,11 +372,6 @@ export declare const domain: z.ZodObject<{
|
|
|
362
372
|
updatedAt: z.ZodString;
|
|
363
373
|
}, z.core.$strip>;
|
|
364
374
|
export type Domain = z.infer<typeof domain>;
|
|
365
|
-
export declare const createWebhook: z.ZodObject<{
|
|
366
|
-
branch: z.ZodOptional<z.ZodString>;
|
|
367
|
-
watchPaths: z.ZodOptional<z.ZodString>;
|
|
368
|
-
}, z.core.$strip>;
|
|
369
|
-
export type CreateWebhookInput = z.input<typeof createWebhook>;
|
|
370
375
|
export declare const webhook: z.ZodObject<{
|
|
371
376
|
id: z.ZodNumber;
|
|
372
377
|
branch: z.ZodString;
|
|
@@ -377,15 +382,17 @@ export declare const webhook: z.ZodObject<{
|
|
|
377
382
|
createdAt: z.ZodString;
|
|
378
383
|
}, z.core.$strip>;
|
|
379
384
|
export type Webhook = z.infer<typeof webhook>;
|
|
380
|
-
/**
|
|
385
|
+
/**
|
|
386
|
+
* Returned once at creation time — the secret is never retrievable again.
|
|
387
|
+
* r334: the create route answers id/branch/active/sourceId/url/secret only;
|
|
388
|
+
* `watchPaths` and `createdAt` come from `webhooks.list`.
|
|
389
|
+
*/
|
|
381
390
|
export declare const createdWebhook: z.ZodObject<{
|
|
382
391
|
id: z.ZodNumber;
|
|
383
392
|
branch: z.ZodString;
|
|
384
393
|
active: z.ZodBoolean;
|
|
385
|
-
watchPaths: z.ZodString;
|
|
386
394
|
sourceId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
387
395
|
url: z.ZodString;
|
|
388
|
-
createdAt: z.ZodString;
|
|
389
396
|
secret: z.ZodString;
|
|
390
397
|
}, z.core.$strip>;
|
|
391
398
|
export type CreatedWebhook = z.infer<typeof createdWebhook>;
|
|
@@ -393,6 +400,8 @@ export declare const createDatabase: z.ZodObject<{
|
|
|
393
400
|
name: z.ZodString;
|
|
394
401
|
engine: z.ZodEnum<{
|
|
395
402
|
clickhouse: "clickhouse";
|
|
403
|
+
dragonfly: "dragonfly";
|
|
404
|
+
keydb: "keydb";
|
|
396
405
|
mariadb: "mariadb";
|
|
397
406
|
meilisearch: "meilisearch";
|
|
398
407
|
mongo: "mongo";
|
|
@@ -408,14 +417,9 @@ export declare const createDatabase: z.ZodObject<{
|
|
|
408
417
|
existingVolume: z.ZodOptional<z.ZodString>;
|
|
409
418
|
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
410
419
|
webGuiEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
420
|
+
serverId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
411
421
|
}, z.core.$strip>;
|
|
412
422
|
export type CreateDatabaseInput = z.input<typeof createDatabase>;
|
|
413
|
-
export declare const databasePatch: z.ZodObject<{
|
|
414
|
-
name: z.ZodOptional<z.ZodString>;
|
|
415
|
-
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
416
|
-
webGuiEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
417
|
-
}, z.core.$strip>;
|
|
418
|
-
export type DatabasePatch = z.input<typeof databasePatch>;
|
|
419
423
|
export declare const managedDatabase: z.ZodObject<{
|
|
420
424
|
id: z.ZodNumber;
|
|
421
425
|
projectId: z.ZodNullable<z.ZodNumber>;
|
|
@@ -437,6 +441,9 @@ export declare const managedDatabase: z.ZodObject<{
|
|
|
437
441
|
name: z.ZodString;
|
|
438
442
|
slug: z.ZodString;
|
|
439
443
|
}, z.core.$strip>>>>;
|
|
444
|
+
serverId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
445
|
+
serverName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
446
|
+
reachable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
440
447
|
createdAt: z.ZodString;
|
|
441
448
|
updatedAt: z.ZodString;
|
|
442
449
|
}, z.core.$strip>;
|
package/dist/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,WAAW;;;;EAAuC,CAAC;AAChE,eAAO,MAAM,SAAS;;;;;;EAAmE,CAAC;AAK1F,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0FxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D;;;4EAG4E;AAC5E,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts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;;;;;;iBAQ1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,qBAAqB;;;;;;;;iBAA4B,CAAC;AAC/D,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE/E,eAAO,MAAM,eAAe;;;;;;;;;;;;;iBAM1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,kBAAkB;;;;;;;;;;iBAU7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
package/dist/service.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { containerPath, dockerVolumeName, envVarName, gitBranch, gitRepoUrl, httpPath, repoBaseDir, repoRelativePath, slug } from './common.js';
|
|
2
|
+
import { containerPath, dockerVolumeName, envVarName, gitBranch, gitRepoUrl, httpPath, providerBaseUrl, repoBaseDir, repoRelativePath, slug } from './common.js';
|
|
3
3
|
export const serviceType = z.enum(['pm2', 'docker', 'compose']);
|
|
4
4
|
export const buildPack = z.enum(['auto', 'nixpacks', 'dockerfile', 'railpack', 'static']);
|
|
5
5
|
/** Optional project/workspace/label tag IDs for new service creation. */
|
|
@@ -101,12 +101,10 @@ export const createService = z.object({
|
|
|
101
101
|
* still applies `.default()` values for absent keys, which would silently
|
|
102
102
|
* rewrite `type` back to 'docker' and `branch` to 'main' on every PATCH. */
|
|
103
103
|
export const updateService = z.object({
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
tagWorkspaceIds: tagIds,
|
|
109
|
-
tagLabelIds: tagIds,
|
|
104
|
+
// r335: no tag fields. Tags change only through `PUT /v1/services/:id/tags`
|
|
105
|
+
// (admin-gated, with the r156 foreign-link rules). The PATCH route used to
|
|
106
|
+
// accept tagProjectIds/tagWorkspaceIds/tagLabelIds here and then silently
|
|
107
|
+
// drop them; it now answers 400 `tags_via_put` when a body carries them.
|
|
110
108
|
name: z.string().min(1).max(100).optional(),
|
|
111
109
|
slug: slug.optional(),
|
|
112
110
|
type: serviceType.optional(),
|
|
@@ -240,6 +238,11 @@ export const service = z.object({
|
|
|
240
238
|
updatedAt: z.string().datetime(),
|
|
241
239
|
});
|
|
242
240
|
// ── Sources (private repo credentials) ─────────────────────────────────────
|
|
241
|
+
/** r512: a registry host a `registry` credential may be sent to (`ghcr.io`, `registry.local:5000`). */
|
|
242
|
+
export const registryHost = z
|
|
243
|
+
.string()
|
|
244
|
+
.max(255)
|
|
245
|
+
.regex(/^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?(:\d{1,5})?$/, 'Expected a registry host such as ghcr.io or registry.local:5000');
|
|
243
246
|
export const createSource = z.object({
|
|
244
247
|
name: z.string().min(1).max(100),
|
|
245
248
|
type: z.enum(['github', 'gitlab', 'gitea', 'bitbucket', 'custom', 'registry']),
|
|
@@ -247,7 +250,15 @@ export const createSource = z.object({
|
|
|
247
250
|
deployKey: z.string().optional(),
|
|
248
251
|
// Registry-type sources: username for `docker login` (token = password).
|
|
249
252
|
registryUsername: z.string().max(255).optional(),
|
|
253
|
+
/** r512: registry hosts this credential may be sent to (Docker Hub = docker.io). */
|
|
254
|
+
registryHosts: z.array(registryHost).max(20).optional(),
|
|
250
255
|
defaultBranch: z.string().optional(),
|
|
256
|
+
/**
|
|
257
|
+
* 0.13: self-hosted provider base (Gitea), e.g. `https://git.example.com`.
|
|
258
|
+
* The server refuses `http:` unless private egress is allowed.
|
|
259
|
+
* `github_app` is deliberately NOT in `type`: only installation sync creates those sources.
|
|
260
|
+
*/
|
|
261
|
+
baseUrl: providerBaseUrl.optional(),
|
|
251
262
|
});
|
|
252
263
|
export const source = z.object({
|
|
253
264
|
id: z.number().int(),
|
|
@@ -256,11 +267,29 @@ export const source = z.object({
|
|
|
256
267
|
hasToken: z.boolean(),
|
|
257
268
|
hasDeployKey: z.boolean(),
|
|
258
269
|
registryUsername: z.string().nullable().optional(),
|
|
270
|
+
/** r512: hosts a registry credential is bound to (registry sources only). */
|
|
271
|
+
registryHosts: z.array(z.string()).optional(),
|
|
259
272
|
defaultBranch: z.string().nullable(),
|
|
273
|
+
/** 0.13: self-hosted provider base URL (Gitea); null/absent = not set. */
|
|
274
|
+
baseUrl: z.string().nullable().optional(),
|
|
275
|
+
// ── 0.16 T8 surfaces ── multi-node (0.15.2, additive): this PAT or deploy key
|
|
276
|
+
// may be sent to a node for one clone. Absent on older panels.
|
|
277
|
+
allowOnNodes: z.boolean().optional(),
|
|
278
|
+
// ── end 0.16 T8 ──
|
|
279
|
+
/** 0.15.8: the panel pins this source's git host SSH keys (absent on older panels). */
|
|
280
|
+
pinHostKeys: z.boolean().optional(),
|
|
281
|
+
/** 0.15.8: what the pin holds, as fingerprints only. */
|
|
282
|
+
pinnedHostKeys: z.array(z.object({ host: z.string(), type: z.string(), fingerprint: z.string().nullable() })).optional(),
|
|
260
283
|
createdAt: z.string().datetime(),
|
|
261
284
|
updatedAt: z.string().datetime().optional(),
|
|
262
285
|
});
|
|
263
286
|
export const triggerDeploy = z.object({
|
|
287
|
+
/**
|
|
288
|
+
* @deprecated r334: IGNORED by `POST /v1/services/:id/deploys` — a manual
|
|
289
|
+
* trigger always builds the configured branch head. Pinning a commit here
|
|
290
|
+
* was never wired (the route reads no body). To redeploy an exact commit,
|
|
291
|
+
* use `deploys.promote` (another lane's running SHA) or `deploys.rollback`.
|
|
292
|
+
*/
|
|
264
293
|
commitSha: z.string().optional(),
|
|
265
294
|
});
|
|
266
295
|
export const deployment = z.object({
|
|
@@ -308,7 +337,9 @@ export const queueResponse = z.object({
|
|
|
308
337
|
// ── Domains (Traefik routing) ─────────────────────────────────────────────
|
|
309
338
|
export const createDomain = z.object({
|
|
310
339
|
hostname: z.string().min(3).max(253),
|
|
311
|
-
|
|
340
|
+
// r473: aligned with the manifest's route.path rule — the consumer strips
|
|
341
|
+
// it downstream anyway, but the boundary should not depend on that.
|
|
342
|
+
path: z.string().min(1).max(200).regex(/^\/.*$/).default('/'),
|
|
312
343
|
// Default matches the DB column default and the CLI (`ssl !== false`):
|
|
313
344
|
// HTTPS everywhere unless explicitly disabled.
|
|
314
345
|
ssl: z.boolean().default(true),
|
|
@@ -351,14 +382,10 @@ export const domain = z.object({
|
|
|
351
382
|
updatedAt: z.string().datetime(),
|
|
352
383
|
});
|
|
353
384
|
// ── Webhooks (auto-deploy) ────────────────────────────────────────────────
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
const patterns = raw.split(/[\n,]/).map((pattern) => pattern.trim()).filter(Boolean);
|
|
359
|
-
return patterns.length <= 32 && patterns.every((pattern) => pattern.length <= 256 && (pattern.match(/\*\*/g) ?? []).length <= 4 && (pattern.match(/[?*]/g) ?? []).length <= 16);
|
|
360
|
-
}, 'watchPaths contains an unsafe glob pattern').optional(),
|
|
361
|
-
});
|
|
385
|
+
// Webhook CREATION is validated by `webhookCreate` in management.ts (the
|
|
386
|
+
// route's schema). The former duplicate here (r473: `createWebhook`) was used
|
|
387
|
+
// by no route and had drifted from the live one — removed rather than left
|
|
388
|
+
// as a trap for someone "hardening" the wrong twin.
|
|
362
389
|
export const webhook = z.object({
|
|
363
390
|
id: z.number().int(),
|
|
364
391
|
branch: z.string(),
|
|
@@ -368,12 +395,16 @@ export const webhook = z.object({
|
|
|
368
395
|
url: z.string(),
|
|
369
396
|
createdAt: z.string().datetime(),
|
|
370
397
|
});
|
|
371
|
-
/**
|
|
372
|
-
|
|
398
|
+
/**
|
|
399
|
+
* Returned once at creation time — the secret is never retrievable again.
|
|
400
|
+
* r334: the create route answers id/branch/active/sourceId/url/secret only;
|
|
401
|
+
* `watchPaths` and `createdAt` come from `webhooks.list`.
|
|
402
|
+
*/
|
|
403
|
+
export const createdWebhook = webhook.omit({ watchPaths: true, createdAt: true }).extend({ secret: z.string() });
|
|
373
404
|
// ── Managed databases ─────────────────────────────────────────────────────
|
|
374
405
|
export const createDatabase = z.object({
|
|
375
406
|
name: z.string().min(1).max(100),
|
|
376
|
-
engine: z.enum(['postgres', 'mysql', 'mariadb', 'redis', 'mongo', 'valkey', 'clickhouse', 'meilisearch', 'rabbitmq']),
|
|
407
|
+
engine: z.enum(['postgres', 'mysql', 'mariadb', 'redis', 'mongo', 'valkey', 'clickhouse', 'meilisearch', 'rabbitmq', 'keydb', 'dragonfly']),
|
|
377
408
|
version: z.string().optional(),
|
|
378
409
|
projectId: z.number().int().optional(),
|
|
379
410
|
/** Hub/template provisioning is retryable: resume a matching database owned
|
|
@@ -382,11 +413,12 @@ export const createDatabase = z.object({
|
|
|
382
413
|
existingVolume: z.string().optional(),
|
|
383
414
|
extensions: z.array(z.string()).optional(),
|
|
384
415
|
webGuiEnabled: z.boolean().optional(),
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
416
|
+
/**
|
|
417
|
+
* Multi-node (additive): the node to run the database on. null or absent =
|
|
418
|
+
* the panel host (today). Operator only when non-null; placement is fixed
|
|
419
|
+
* at create time.
|
|
420
|
+
*/
|
|
421
|
+
serverId: z.number().int().positive().nullable().optional(),
|
|
390
422
|
});
|
|
391
423
|
export const managedDatabase = z.object({
|
|
392
424
|
id: z.number().int(),
|
|
@@ -405,6 +437,14 @@ export const managedDatabase = z.object({
|
|
|
405
437
|
webGuiPort: z.number().int().nullable().optional(),
|
|
406
438
|
extensions: z.array(z.string()).optional().default([]),
|
|
407
439
|
attachedServices: z.array(z.object({ id: z.number().int(), name: z.string(), slug: z.string() })).optional().default([]),
|
|
440
|
+
// ── 0.16 T8 surfaces: the node fields the 0.15.3 routes return (additive) ──
|
|
441
|
+
/** The node the database runs on; null = the panel host. Absent before 0.15.3. */
|
|
442
|
+
serverId: z.number().int().nullable().optional(),
|
|
443
|
+
/** That node's name; null for a panel-host database. */
|
|
444
|
+
serverName: z.string().nullable().optional(),
|
|
445
|
+
/** The node's last reachability probe; null for a panel-host database or a node not probed yet. */
|
|
446
|
+
reachable: z.boolean().nullable().optional(),
|
|
447
|
+
// ── end 0.16 T8 ──
|
|
408
448
|
createdAt: z.string().datetime(),
|
|
409
449
|
updatedAt: z.string().datetime(),
|
|
410
450
|
});
|
|
@@ -425,7 +465,9 @@ export const attachment = z.object({
|
|
|
425
465
|
// ── Environment variables ──────────────────────────────────────────────────
|
|
426
466
|
export const upsertEnvVar = z.object({
|
|
427
467
|
key: envVarName.max(100),
|
|
428
|
-
|
|
468
|
+
// r473: same 32 KB cap the Hub deployTemplate path applies — the sink
|
|
469
|
+
// escapes newlines either way, but the twins should not disagree.
|
|
470
|
+
value: z.string().max(32 * 1024),
|
|
429
471
|
isSecret: z.boolean().optional(),
|
|
430
472
|
overwriteExisting: z.boolean().optional(),
|
|
431
473
|
});
|
|
@@ -770,7 +812,10 @@ export const volumeFileWrite = z.object({
|
|
|
770
812
|
/** Relative path inside the volume. */
|
|
771
813
|
path: z.string().min(1).max(1024),
|
|
772
814
|
/** Base64-encoded file content (schemas validate; argv never sees it). */
|
|
773
|
-
contentBase64: z.string().max(8 * 1024 * 1024)
|
|
815
|
+
contentBase64: z.string().max(8 * 1024 * 1024).refine((value) => {
|
|
816
|
+
const compact = value.replace(/\s/g, '');
|
|
817
|
+
return compact.length % 4 === 0 && /^[A-Za-z0-9+/]*={0,2}$/.test(compact);
|
|
818
|
+
}, { message: 'must be valid base64 content' }),
|
|
774
819
|
});
|
|
775
820
|
export const volumePathCreate = z.object({
|
|
776
821
|
path: z.string().min(1).max(1024),
|