terse-types 0.0.37 → 0.0.38

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.
@@ -138,6 +138,12 @@ export declare const ApiRoutes: {
138
138
  ROTATE_SIGNING_SECRET: string;
139
139
  ROTATE_API_KEY: string;
140
140
  };
141
+ PROJECT_SECRETS: {
142
+ LIST: string;
143
+ UPSERT: string;
144
+ DELETE: string;
145
+ IMPORT: string;
146
+ };
141
147
  SDK: {
142
148
  ME: string;
143
149
  ME_ORGANIZATIONS: string;
@@ -138,6 +138,12 @@
138
138
  "ROTATE_SIGNING_SECRET": "/projects/:id/rotate-signing-secret",
139
139
  "ROTATE_API_KEY": "/projects/:id/rotate-api-key"
140
140
  },
141
+ "PROJECT_SECRETS": {
142
+ "LIST": "/projects/:id/secrets",
143
+ "UPSERT": "/projects/:id/secrets",
144
+ "DELETE": "/projects/:id/secrets/:name",
145
+ "IMPORT": "/projects/:id/secrets/import"
146
+ },
141
147
  "SDK": {
142
148
  "ME": "/sdk/me",
143
149
  "ME_ORGANIZATIONS": "/sdk/me/organizations",
@@ -49,6 +49,7 @@ export declare const userByIdKey: (userId: string | null | undefined) => readonl
49
49
  export declare const agentFilesKey: (agentId: string) => readonly [string, string];
50
50
  export declare const agentFileContentKey: (agentId: string, fileId: string) => readonly [string, string, string];
51
51
  export declare const projectDeploysKey: (projectId: string) => readonly [string, string];
52
+ export declare const projectSecretsKey: (projectId: string) => readonly [string, string];
52
53
  export declare const projectSourceFilesKey: (projectId: string) => readonly [string, string];
53
54
  export declare const projectSourceFileContentKey: (projectId: string, fileId: string) => readonly [string, string, string];
54
55
  export declare const billingContextKey: (params?: Partial<BillingContextQuery>) => readonly [string, string, string, string];
@@ -143,6 +143,7 @@ export const userByIdKey = (userId) => {
143
143
  export const agentFilesKey = (agentId) => ["agentFiles", agentId];
144
144
  export const agentFileContentKey = (agentId, fileId) => ["agentFileContent", agentId, fileId];
145
145
  export const projectDeploysKey = (projectId) => ["projectDeploys", projectId];
146
+ export const projectSecretsKey = (projectId) => ["projectSecrets", projectId];
146
147
  export const projectSourceFilesKey = (projectId) => ["projectSourceFiles", projectId];
147
148
  export const projectSourceFileContentKey = (projectId, fileId) => ["projectSourceFileContent", projectId, fileId];
148
149
  export const billingContextKey = (params) => [
package/dist/types.d.ts CHANGED
@@ -9321,6 +9321,37 @@ export declare const projectRotateApiKeyResponseSchema: z.ZodObject<{
9321
9321
  projectApiKey: z.ZodString;
9322
9322
  }, z.core.$strip>;
9323
9323
  export type ProjectRotateApiKeyResponse = z.infer<typeof projectRotateApiKeyResponseSchema>;
9324
+ export declare const SECRET_NAME_PATTERN: RegExp;
9325
+ export declare const MAX_SECRET_VALUE_BYTES: number;
9326
+ export declare function validateSecretName(name: string): string | null;
9327
+ export declare function validateSecretValue(value: string): string | null;
9328
+ export declare const projectSecretSummarySchema: z.ZodObject<{
9329
+ name: z.ZodString;
9330
+ }, z.core.$strip>;
9331
+ export type ProjectSecretSummary = z.infer<typeof projectSecretSummarySchema>;
9332
+ export declare const projectSecretsListResponseSchema: z.ZodObject<{
9333
+ secrets: z.ZodArray<z.ZodObject<{
9334
+ name: z.ZodString;
9335
+ }, z.core.$strip>>;
9336
+ }, z.core.$strip>;
9337
+ export type ProjectSecretsListResponse = z.infer<typeof projectSecretsListResponseSchema>;
9338
+ export declare const projectSecretUpsertRequestSchema: z.ZodObject<{
9339
+ name: z.ZodString;
9340
+ value: z.ZodString;
9341
+ }, z.core.$strip>;
9342
+ export type ProjectSecretUpsertRequest = z.infer<typeof projectSecretUpsertRequestSchema>;
9343
+ export declare const projectSecretsImportRequestSchema: z.ZodObject<{
9344
+ entries: z.ZodArray<z.ZodObject<{
9345
+ name: z.ZodString;
9346
+ value: z.ZodString;
9347
+ }, z.core.$strip>>;
9348
+ }, z.core.$strip>;
9349
+ export type ProjectSecretsImportRequest = z.infer<typeof projectSecretsImportRequestSchema>;
9350
+ export declare const projectSecretsImportResponseSchema: z.ZodObject<{
9351
+ added: z.ZodArray<z.ZodString>;
9352
+ updated: z.ZodArray<z.ZodString>;
9353
+ }, z.core.$strip>;
9354
+ export type ProjectSecretsImportResponse = z.infer<typeof projectSecretsImportResponseSchema>;
9324
9355
  export declare const terseProjectConfigSchema: z.ZodObject<{
9325
9356
  projectId: z.ZodString;
9326
9357
  name: z.ZodString;
package/dist/types.js CHANGED
@@ -541,6 +541,40 @@ export const projectRotateSigningSecretResponseSchema = z.object({
541
541
  export const projectRotateApiKeyResponseSchema = z.object({
542
542
  projectApiKey: z.string()
543
543
  });
544
+ export const SECRET_NAME_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
545
+ export const MAX_SECRET_VALUE_BYTES = 32 * 1024;
546
+ export function validateSecretName(name) {
547
+ if (!SECRET_NAME_PATTERN.test(name)) {
548
+ return "Secret names must match ^[A-Z][A-Z0-9_]{0,63}$";
549
+ }
550
+ if (name.startsWith("TERSE_")) {
551
+ return "Secret names cannot start with TERSE_";
552
+ }
553
+ return null;
554
+ }
555
+ export function validateSecretValue(value) {
556
+ if (new TextEncoder().encode(value).length > MAX_SECRET_VALUE_BYTES) {
557
+ return "Secret value must be 32KB or less";
558
+ }
559
+ return null;
560
+ }
561
+ export const projectSecretSummarySchema = z.object({
562
+ name: z.string()
563
+ });
564
+ export const projectSecretsListResponseSchema = z.object({
565
+ secrets: z.array(projectSecretSummarySchema)
566
+ });
567
+ export const projectSecretUpsertRequestSchema = z.object({
568
+ name: z.string(),
569
+ value: z.string()
570
+ });
571
+ export const projectSecretsImportRequestSchema = z.object({
572
+ entries: z.array(projectSecretUpsertRequestSchema).max(500)
573
+ });
574
+ export const projectSecretsImportResponseSchema = z.object({
575
+ added: z.array(z.string()),
576
+ updated: z.array(z.string())
577
+ });
544
578
  export const terseProjectConfigSchema = z.object({
545
579
  projectId: z.string().min(1),
546
580
  name: z.string().min(1),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terse-types",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "type": "module",
5
5
  "description": "Shared Terse TypeScript types, enums, constants, and helpers.",
6
6
  "main": "./dist/index.js",