chore: import upstream snapshot with attribution
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,173 @@
|
||||
import { z } from 'zod'
|
||||
import { defineRouteContract } from '@/lib/api/contracts/types'
|
||||
|
||||
export const onePasswordCredentialsBodySchema = z.object({
|
||||
connectionMode: z.enum(['service_account', 'connect']).nullish(),
|
||||
serviceAccountToken: z.string().nullish(),
|
||||
serverUrl: z.string().nullish(),
|
||||
apiKey: z.string().nullish(),
|
||||
})
|
||||
|
||||
export const onePasswordListVaultsBodySchema = onePasswordCredentialsBodySchema.extend({
|
||||
filter: z.string().nullish(),
|
||||
})
|
||||
|
||||
export const onePasswordGetVaultBodySchema = onePasswordCredentialsBodySchema.extend({
|
||||
vaultId: z.string().min(1, 'Vault ID is required'),
|
||||
})
|
||||
|
||||
export const onePasswordListItemsBodySchema = onePasswordGetVaultBodySchema.extend({
|
||||
filter: z.string().nullish(),
|
||||
})
|
||||
|
||||
export const onePasswordGetItemBodySchema = onePasswordGetVaultBodySchema.extend({
|
||||
itemId: z.string().min(1, 'Item ID is required'),
|
||||
})
|
||||
|
||||
export const onePasswordCreateItemBodySchema = onePasswordGetVaultBodySchema.extend({
|
||||
category: z.string().min(1, 'Category is required'),
|
||||
title: z.string().nullish(),
|
||||
tags: z.string().nullish(),
|
||||
fields: z.string().nullish(),
|
||||
})
|
||||
|
||||
export const onePasswordUpdateItemBodySchema = onePasswordGetItemBodySchema.extend({
|
||||
operations: z.string().min(1, 'Patch operations are required'),
|
||||
})
|
||||
|
||||
export const onePasswordReplaceItemBodySchema = onePasswordGetItemBodySchema.extend({
|
||||
item: z.string().min(1, 'Item JSON is required'),
|
||||
})
|
||||
|
||||
export const onePasswordResolveSecretBodySchema = onePasswordCredentialsBodySchema.extend({
|
||||
secretReference: z.string().min(1, 'Secret reference is required'),
|
||||
})
|
||||
|
||||
export const onePasswordGetItemFileBodySchema = onePasswordGetItemBodySchema.extend({
|
||||
fileId: z.string().min(1, 'File ID is required'),
|
||||
})
|
||||
|
||||
export const onePasswordListVaultsContract = defineRouteContract({
|
||||
method: 'POST',
|
||||
path: '/api/tools/onepassword/list-vaults',
|
||||
body: onePasswordListVaultsBodySchema,
|
||||
response: {
|
||||
mode: 'json',
|
||||
// untyped-response: service-account mode returns normalized vault shapes while connect-server mode forwards 1Password Connect /v1/vaults response unchanged
|
||||
schema: z.unknown(),
|
||||
},
|
||||
})
|
||||
|
||||
export const onePasswordGetVaultContract = defineRouteContract({
|
||||
method: 'POST',
|
||||
path: '/api/tools/onepassword/get-vault',
|
||||
body: onePasswordGetVaultBodySchema,
|
||||
response: {
|
||||
mode: 'json',
|
||||
// untyped-response: service-account mode returns a normalized vault shape while connect-server mode forwards 1Password Connect /v1/vaults/{id} response unchanged
|
||||
schema: z.unknown(),
|
||||
},
|
||||
})
|
||||
|
||||
export const onePasswordListItemsContract = defineRouteContract({
|
||||
method: 'POST',
|
||||
path: '/api/tools/onepassword/list-items',
|
||||
body: onePasswordListItemsBodySchema,
|
||||
response: {
|
||||
mode: 'json',
|
||||
// untyped-response: service-account mode returns normalized item-overview shapes while connect-server mode forwards 1Password Connect /v1/vaults/{id}/items response unchanged
|
||||
schema: z.unknown(),
|
||||
},
|
||||
})
|
||||
|
||||
export const onePasswordGetItemContract = defineRouteContract({
|
||||
method: 'POST',
|
||||
path: '/api/tools/onepassword/get-item',
|
||||
body: onePasswordGetItemBodySchema,
|
||||
response: {
|
||||
mode: 'json',
|
||||
// untyped-response: service-account mode returns a normalized item shape while connect-server mode forwards 1Password Connect /v1/vaults/{vaultId}/items/{itemId} response unchanged
|
||||
schema: z.unknown(),
|
||||
},
|
||||
})
|
||||
|
||||
export const onePasswordCreateItemContract = defineRouteContract({
|
||||
method: 'POST',
|
||||
path: '/api/tools/onepassword/create-item',
|
||||
body: onePasswordCreateItemBodySchema,
|
||||
response: {
|
||||
mode: 'json',
|
||||
// untyped-response: service-account mode returns a normalized item shape while connect-server mode forwards 1Password Connect create-item response unchanged
|
||||
schema: z.unknown(),
|
||||
},
|
||||
})
|
||||
|
||||
export const onePasswordUpdateItemContract = defineRouteContract({
|
||||
method: 'POST',
|
||||
path: '/api/tools/onepassword/update-item',
|
||||
body: onePasswordUpdateItemBodySchema,
|
||||
response: {
|
||||
mode: 'json',
|
||||
// untyped-response: service-account mode returns a normalized item shape while connect-server mode forwards 1Password Connect PATCH item response unchanged
|
||||
schema: z.unknown(),
|
||||
},
|
||||
})
|
||||
|
||||
export const onePasswordReplaceItemContract = defineRouteContract({
|
||||
method: 'POST',
|
||||
path: '/api/tools/onepassword/replace-item',
|
||||
body: onePasswordReplaceItemBodySchema,
|
||||
response: {
|
||||
mode: 'json',
|
||||
// untyped-response: service-account mode returns a normalized item shape while connect-server mode forwards 1Password Connect PUT item response unchanged
|
||||
schema: z.unknown(),
|
||||
},
|
||||
})
|
||||
|
||||
const onePasswordDeleteItemResponseSchema = z.object({
|
||||
success: z.literal(true),
|
||||
})
|
||||
|
||||
export const onePasswordDeleteItemContract = defineRouteContract({
|
||||
method: 'POST',
|
||||
path: '/api/tools/onepassword/delete-item',
|
||||
body: onePasswordGetItemBodySchema,
|
||||
response: {
|
||||
mode: 'json',
|
||||
schema: onePasswordDeleteItemResponseSchema,
|
||||
},
|
||||
})
|
||||
|
||||
const onePasswordResolveSecretResponseSchema = z.object({
|
||||
value: z.string(),
|
||||
reference: z.string(),
|
||||
})
|
||||
|
||||
export const onePasswordResolveSecretContract = defineRouteContract({
|
||||
method: 'POST',
|
||||
path: '/api/tools/onepassword/resolve-secret',
|
||||
body: onePasswordResolveSecretBodySchema,
|
||||
response: {
|
||||
mode: 'json',
|
||||
schema: onePasswordResolveSecretResponseSchema,
|
||||
},
|
||||
})
|
||||
|
||||
const onePasswordGetItemFileResponseSchema = z.object({
|
||||
file: z.object({
|
||||
name: z.string(),
|
||||
mimeType: z.string(),
|
||||
data: z.string(),
|
||||
size: z.number(),
|
||||
}),
|
||||
})
|
||||
|
||||
export const onePasswordGetItemFileContract = defineRouteContract({
|
||||
method: 'POST',
|
||||
path: '/api/tools/onepassword/get-item-file',
|
||||
body: onePasswordGetItemFileBodySchema,
|
||||
response: {
|
||||
mode: 'json',
|
||||
schema: onePasswordGetItemFileResponseSchema,
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user