@voyant-travel/apps 0.1.0 → 0.2.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.
Files changed (39) hide show
  1. package/LICENSE +201 -0
  2. package/dist/contracts.d.ts +8 -87
  3. package/dist/contracts.js +0 -50
  4. package/dist/index.d.ts +1 -5
  5. package/dist/index.js +1 -5
  6. package/dist/installation-reconciliation.d.ts +1 -1
  7. package/dist/installation-reconciliation.js +1 -5
  8. package/dist/installation-service.d.ts +14 -25
  9. package/dist/installation-service.js +7 -22
  10. package/dist/routes.d.ts +1 -8
  11. package/dist/routes.js +1 -67
  12. package/dist/schema.d.ts +4 -536
  13. package/dist/schema.js +1 -52
  14. package/dist/service.d.ts +18 -18
  15. package/migrations/meta/_journal.json +0 -7
  16. package/package.json +78 -116
  17. package/dist/access-boundary.d.ts +0 -29
  18. package/dist/access-boundary.js +0 -33
  19. package/dist/app-api-contracts.d.ts +0 -51
  20. package/dist/app-api-contracts.js +0 -50
  21. package/dist/app-api-routes.d.ts +0 -26
  22. package/dist/app-api-routes.js +0 -133
  23. package/dist/app-api-service.d.ts +0 -1263
  24. package/dist/app-api-service.js +0 -231
  25. package/dist/app-api-service.test.d.ts +0 -1
  26. package/dist/app-api-service.test.js +0 -105
  27. package/dist/consent.d.ts +0 -15
  28. package/dist/consent.js +0 -50
  29. package/dist/consent.test.d.ts +0 -1
  30. package/dist/consent.test.js +0 -80
  31. package/dist/oauth-crypto.d.ts +0 -8
  32. package/dist/oauth-crypto.js +0 -23
  33. package/dist/oauth-crypto.test.d.ts +0 -1
  34. package/dist/oauth-crypto.test.js +0 -11
  35. package/dist/oauth-service.d.ts +0 -65
  36. package/dist/oauth-service.js +0 -381
  37. package/dist/oauth-service.test.d.ts +0 -1
  38. package/dist/oauth-service.test.js +0 -8
  39. package/migrations/20260717143000_app_oauth_authorization.sql +0 -47
package/dist/schema.js CHANGED
@@ -39,7 +39,6 @@ export const appAccessCredentialStatusEnum = pgEnum("app_access_credential_statu
39
39
  "inactive",
40
40
  "revoked",
41
41
  ]);
42
- export const appAccessTokenModeEnum = pgEnum("app_access_token_mode", ["offline", "online"]);
43
42
  export const appInstallationRegistrationStatusEnum = pgEnum("app_installation_registration_status", ["active", "inactive"]);
44
43
  export const appWebhookSubscriptionStatusEnum = pgEnum("app_webhook_subscription_status", [
45
44
  "active",
@@ -49,9 +48,7 @@ export const appWebhookSubscriptionStatusEnum = pgEnum("app_webhook_subscription
49
48
  export const appAuditEventKindEnum = pgEnum("app_audit_event_kind", [
50
49
  "lifecycle",
51
50
  "grant",
52
- "consent",
53
51
  "credential",
54
- "token",
55
52
  "reconciliation",
56
53
  "purge",
57
54
  ]);
@@ -161,7 +158,6 @@ export const appInstallations = pgTable("app_installations", {
161
158
  status: appInstallationStatusEnum("status").notNull().default("pending"),
162
159
  namespace: text("namespace").notNull(),
163
160
  installedBy: text("installed_by").notNull(),
164
- credentialGeneration: integer("credential_generation").notNull().default(0),
165
161
  updatePolicy: appInstallationUpdatePolicyEnum("update_policy").notNull().default("compatible"),
166
162
  lastCompatibleReleaseCheckAt: timestamp("last_compatible_release_check_at", {
167
163
  withTimezone: true,
@@ -206,62 +202,15 @@ export const appAccessCredentials = pgTable("app_access_credentials", {
206
202
  .notNull()
207
203
  .references(() => appInstallations.id, { onDelete: "cascade" }),
208
204
  generation: integer("generation").notNull(),
209
- tokenMode: appAccessTokenModeEnum("token_mode").notNull().default("offline"),
210
205
  credentialHash: text("credential_hash").notNull(),
211
206
  encryptedMetadata: jsonb("encrypted_metadata").$type().notNull(),
212
207
  status: appAccessCredentialStatusEnum("status").notNull().default("active"),
213
- actorId: text("actor_id"),
214
- viewerId: text("viewer_id"),
215
208
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
216
209
  expiresAt: timestamp("expires_at", { withTimezone: true }),
217
210
  deactivatedAt: timestamp("deactivated_at", { withTimezone: true }),
218
211
  }, (table) => [
219
212
  index("idx_app_access_credentials_installation").on(table.installationId, table.status),
220
- index("idx_app_access_credentials_generation").on(table.installationId, table.tokenMode, table.generation),
221
- ]);
222
- export const appOAuthAuthorizationCodes = pgTable("app_oauth_authorization_codes", {
223
- id: typeId("app_oauth_authorization_codes"),
224
- appId: text("app_id")
225
- .notNull()
226
- .references(() => apps.id, { onDelete: "cascade" }),
227
- installationId: text("installation_id")
228
- .notNull()
229
- .references(() => appInstallations.id, { onDelete: "cascade" }),
230
- releaseId: text("release_id")
231
- .notNull()
232
- .references(() => appReleases.id, { onDelete: "cascade" }),
233
- deploymentId: text("deployment_id").notNull(),
234
- codeHash: text("code_hash").notNull(),
235
- stateHash: text("state_hash").notNull(),
236
- redirectUri: text("redirect_uri").notNull(),
237
- codeChallenge: text("code_challenge").notNull(),
238
- codeChallengeMethod: text("code_challenge_method").notNull(),
239
- requestedScopes: jsonb("requested_scopes").$type().notNull(),
240
- grantedScopes: jsonb("granted_scopes").$type().notNull(),
241
- deniedOptionalScopes: jsonb("denied_optional_scopes").$type().notNull(),
242
- actorId: text("actor_id").notNull(),
243
- expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),
244
- consumedAt: timestamp("consumed_at", { withTimezone: true }),
245
- createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
246
- }, (table) => [
247
- uniqueIndex("uidx_app_oauth_codes_hash").on(table.codeHash),
248
- index("idx_app_oauth_codes_installation").on(table.installationId, table.expiresAt),
249
- ]);
250
- export const appOAuthRefreshTokens = pgTable("app_oauth_refresh_tokens", {
251
- id: typeId("app_oauth_refresh_tokens"),
252
- installationId: text("installation_id")
253
- .notNull()
254
- .references(() => appInstallations.id, { onDelete: "cascade" }),
255
- tokenHash: text("token_hash").notNull(),
256
- generation: integer("generation").notNull(),
257
- status: appAccessCredentialStatusEnum("status").notNull().default("active"),
258
- rotatedFromId: text("rotated_from_id"),
259
- createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
260
- expiresAt: timestamp("expires_at", { withTimezone: true }),
261
- revokedAt: timestamp("revoked_at", { withTimezone: true }),
262
- }, (table) => [
263
- uniqueIndex("uidx_app_oauth_refresh_tokens_hash").on(table.tokenHash),
264
- index("idx_app_oauth_refresh_tokens_installation").on(table.installationId, table.status),
213
+ uniqueIndex("uidx_app_access_credentials_generation").on(table.installationId, table.generation),
265
214
  ]);
266
215
  export const appInstallationSettings = pgTable("app_installation_settings", {
267
216
  id: typeId("app_installation_settings"),
package/dist/service.d.ts CHANGED
@@ -8,14 +8,14 @@ export interface AppsServiceOptions extends CompileAppManifestOptions {
8
8
  }
9
9
  export declare function createAppsService(options?: AppsServiceOptions): {
10
10
  createCustomApp: (db: PostgresJsDatabase, input: CreateCustomAppRegistrationInput) => Promise<{
11
- id: string;
12
- platformNamespace: string;
13
- distribution: "custom" | "marketplace";
14
11
  ownerId: string;
15
12
  displayName: string;
16
13
  slug: string;
17
- lifecycleState: "active" | "suspended" | "deleted";
18
14
  createdBy: string;
15
+ distribution: "custom" | "marketplace";
16
+ id: string;
17
+ platformNamespace: string;
18
+ lifecycleState: "active" | "suspended" | "deleted";
19
19
  createdAt: Date;
20
20
  updatedAt: Date;
21
21
  }>;
@@ -50,19 +50,19 @@ export declare function createAppsService(options?: AppsServiceOptions): {
50
50
  } | null>;
51
51
  releaseFromUpload: (db: PostgresJsDatabase, appId: string, input: ReleaseManifestUploadInput) => Promise<{
52
52
  release: {
53
- appId: string;
54
- id: string;
53
+ releaseVersion: string;
54
+ apiCompatibility: {
55
+ min: string;
56
+ max: string;
57
+ };
55
58
  createdBy: string;
59
+ id: string;
56
60
  createdAt: Date;
57
- releaseVersion: string;
61
+ appId: string;
58
62
  manifestSchemaVersion: string;
59
63
  manifestDigest: string;
60
64
  manifestSnapshot: Record<string, unknown>;
61
65
  normalizedRecord: Record<string, unknown>;
62
- apiCompatibility: {
63
- min: string;
64
- max: string;
65
- };
66
66
  defaultLocale: string;
67
67
  supportedLocales: string[];
68
68
  state: "suspended" | "available" | "yanked";
@@ -72,19 +72,19 @@ export declare function createAppsService(options?: AppsServiceOptions): {
72
72
  }>;
73
73
  releaseFromFetch: (db: PostgresJsDatabase, appId: string, input: ReleaseManifestFetchInput) => Promise<{
74
74
  release: {
75
- appId: string;
76
- id: string;
75
+ releaseVersion: string;
76
+ apiCompatibility: {
77
+ min: string;
78
+ max: string;
79
+ };
77
80
  createdBy: string;
81
+ id: string;
78
82
  createdAt: Date;
79
- releaseVersion: string;
83
+ appId: string;
80
84
  manifestSchemaVersion: string;
81
85
  manifestDigest: string;
82
86
  manifestSnapshot: Record<string, unknown>;
83
87
  normalizedRecord: Record<string, unknown>;
84
- apiCompatibility: {
85
- min: string;
86
- max: string;
87
- };
88
88
  defaultLocale: string;
89
89
  supportedLocales: string[];
90
90
  state: "suspended" | "available" | "yanked";
@@ -22,13 +22,6 @@
22
22
  "when": 1784291400000,
23
23
  "tag": "20260717123000_app_webhook_delivery_health",
24
24
  "breakpoints": true
25
- },
26
- {
27
- "idx": 3,
28
- "version": "7",
29
- "when": 1784298600000,
30
- "tag": "20260717143000_app_oauth_authorization",
31
- "breakpoints": true
32
25
  }
33
26
  ]
34
27
  }
package/package.json CHANGED
@@ -1,52 +1,79 @@
1
1
  {
2
2
  "name": "@voyant-travel/apps",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
7
- ".": "./src/index.ts",
8
- "./access-boundary": "./src/access-boundary.ts",
9
- "./api-runtime": "./src/api-runtime.ts",
10
- "./compiler": "./src/compiler.ts",
11
- "./contracts": "./src/contracts.ts",
12
- "./consent": "./src/consent.ts",
13
- "./ingestion": "./src/ingestion.ts",
14
- "./installation-service": "./src/installation-service.ts",
15
- "./oauth-crypto": "./src/oauth-crypto.ts",
16
- "./oauth-service": "./src/oauth-service.ts",
17
- "./routes": "./src/routes.ts",
18
- "./schema": "./src/schema.ts",
19
- "./service": "./src/service.ts",
20
- "./voyant": "./src/voyant.ts"
21
- },
22
- "scripts": {
23
- "typecheck": "tsc -p tsconfig.typecheck.json",
24
- "lint": "biome check src/",
25
- "test": "vitest run",
26
- "build": "tsc -p tsconfig.build.json",
27
- "clean": "rm -rf dist tsconfig.tsbuildinfo",
28
- "prepack": "pnpm run build"
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./api-runtime": {
13
+ "types": "./dist/api-runtime.d.ts",
14
+ "import": "./dist/api-runtime.js",
15
+ "default": "./dist/api-runtime.js"
16
+ },
17
+ "./compiler": {
18
+ "types": "./dist/compiler.d.ts",
19
+ "import": "./dist/compiler.js",
20
+ "default": "./dist/compiler.js"
21
+ },
22
+ "./contracts": {
23
+ "types": "./dist/contracts.d.ts",
24
+ "import": "./dist/contracts.js",
25
+ "default": "./dist/contracts.js"
26
+ },
27
+ "./ingestion": {
28
+ "types": "./dist/ingestion.d.ts",
29
+ "import": "./dist/ingestion.js",
30
+ "default": "./dist/ingestion.js"
31
+ },
32
+ "./installation-service": {
33
+ "types": "./dist/installation-service.d.ts",
34
+ "import": "./dist/installation-service.js",
35
+ "default": "./dist/installation-service.js"
36
+ },
37
+ "./routes": {
38
+ "types": "./dist/routes.d.ts",
39
+ "import": "./dist/routes.js",
40
+ "default": "./dist/routes.js"
41
+ },
42
+ "./schema": {
43
+ "types": "./dist/schema.d.ts",
44
+ "import": "./dist/schema.js",
45
+ "default": "./dist/schema.js"
46
+ },
47
+ "./service": {
48
+ "types": "./dist/service.d.ts",
49
+ "import": "./dist/service.js",
50
+ "default": "./dist/service.js"
51
+ },
52
+ "./voyant": {
53
+ "types": "./dist/voyant.d.ts",
54
+ "import": "./dist/voyant.js",
55
+ "default": "./dist/voyant.js"
56
+ }
29
57
  },
30
58
  "dependencies": {
31
- "@hono/zod-openapi": "catalog:",
32
- "@voyant-travel/admin": "workspace:^",
33
- "@voyant-travel/admin-extension-sdk": "workspace:^",
34
- "@voyant-travel/core": "workspace:^",
35
- "@voyant-travel/custom-fields": "workspace:^",
36
- "@voyant-travel/db": "workspace:^",
37
- "@voyant-travel/hono": "workspace:^",
38
- "@voyant-travel/types": "workspace:^",
39
- "@voyant-travel/webhook-delivery": "workspace:^",
40
- "drizzle-orm": "catalog:",
41
- "hono": "catalog:",
42
- "zod": "catalog:"
59
+ "@hono/zod-openapi": "^1.4.0",
60
+ "drizzle-orm": "^0.45.2",
61
+ "hono": "^4.12.27",
62
+ "zod": "^4.4.3",
63
+ "@voyant-travel/admin": "^0.126.2",
64
+ "@voyant-travel/admin-extension-sdk": "^0.1.1",
65
+ "@voyant-travel/core": "^0.125.0",
66
+ "@voyant-travel/custom-fields": "^0.2.1",
67
+ "@voyant-travel/db": "^0.114.10",
68
+ "@voyant-travel/webhook-delivery": "^0.4.0",
69
+ "@voyant-travel/hono": "^0.128.1"
43
70
  },
44
71
  "devDependencies": {
45
- "@types/node": "catalog:",
46
- "@voyant-travel/voyant-typescript-config": "workspace:^",
72
+ "@types/node": "^25.5.2",
47
73
  "drizzle-kit": "^0.31.10",
48
- "typescript": "catalog:",
49
- "vitest": "catalog:"
74
+ "typescript": "^6.0.3",
75
+ "vitest": "^4.1.9",
76
+ "@voyant-travel/voyant-typescript-config": "^0.1.0"
50
77
  },
51
78
  "files": [
52
79
  "dist",
@@ -54,81 +81,7 @@
54
81
  "migrations/meta/_journal.json"
55
82
  ],
56
83
  "publishConfig": {
57
- "access": "public",
58
- "exports": {
59
- ".": {
60
- "types": "./dist/index.d.ts",
61
- "import": "./dist/index.js",
62
- "default": "./dist/index.js"
63
- },
64
- "./access-boundary": {
65
- "types": "./dist/access-boundary.d.ts",
66
- "import": "./dist/access-boundary.js",
67
- "default": "./dist/access-boundary.js"
68
- },
69
- "./api-runtime": {
70
- "types": "./dist/api-runtime.d.ts",
71
- "import": "./dist/api-runtime.js",
72
- "default": "./dist/api-runtime.js"
73
- },
74
- "./compiler": {
75
- "types": "./dist/compiler.d.ts",
76
- "import": "./dist/compiler.js",
77
- "default": "./dist/compiler.js"
78
- },
79
- "./contracts": {
80
- "types": "./dist/contracts.d.ts",
81
- "import": "./dist/contracts.js",
82
- "default": "./dist/contracts.js"
83
- },
84
- "./consent": {
85
- "types": "./dist/consent.d.ts",
86
- "import": "./dist/consent.js",
87
- "default": "./dist/consent.js"
88
- },
89
- "./ingestion": {
90
- "types": "./dist/ingestion.d.ts",
91
- "import": "./dist/ingestion.js",
92
- "default": "./dist/ingestion.js"
93
- },
94
- "./installation-service": {
95
- "types": "./dist/installation-service.d.ts",
96
- "import": "./dist/installation-service.js",
97
- "default": "./dist/installation-service.js"
98
- },
99
- "./oauth-crypto": {
100
- "types": "./dist/oauth-crypto.d.ts",
101
- "import": "./dist/oauth-crypto.js",
102
- "default": "./dist/oauth-crypto.js"
103
- },
104
- "./oauth-service": {
105
- "types": "./dist/oauth-service.d.ts",
106
- "import": "./dist/oauth-service.js",
107
- "default": "./dist/oauth-service.js"
108
- },
109
- "./routes": {
110
- "types": "./dist/routes.d.ts",
111
- "import": "./dist/routes.js",
112
- "default": "./dist/routes.js"
113
- },
114
- "./schema": {
115
- "types": "./dist/schema.d.ts",
116
- "import": "./dist/schema.js",
117
- "default": "./dist/schema.js"
118
- },
119
- "./service": {
120
- "types": "./dist/service.d.ts",
121
- "import": "./dist/service.js",
122
- "default": "./dist/service.js"
123
- },
124
- "./voyant": {
125
- "types": "./dist/voyant.d.ts",
126
- "import": "./dist/voyant.js",
127
- "default": "./dist/voyant.js"
128
- }
129
- },
130
- "main": "./dist/index.js",
131
- "types": "./dist/index.d.ts"
84
+ "access": "public"
132
85
  },
133
86
  "repository": {
134
87
  "type": "git",
@@ -155,5 +108,14 @@
155
108
  ]
156
109
  },
157
110
  "schema": "./schema"
158
- }
159
- }
111
+ },
112
+ "scripts": {
113
+ "typecheck": "tsc -p tsconfig.typecheck.json",
114
+ "lint": "biome check src/",
115
+ "test": "vitest run",
116
+ "build": "tsc -p tsconfig.build.json",
117
+ "clean": "rm -rf dist tsconfig.tsbuildinfo"
118
+ },
119
+ "main": "./dist/index.js",
120
+ "types": "./dist/index.d.ts"
121
+ }
@@ -1,29 +0,0 @@
1
- import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
- export interface AppInstallationAccessInput {
3
- installationId: string;
4
- requiredScopes?: readonly string[];
5
- }
6
- export declare function assertActiveAppInstallationAccess(db: PostgresJsDatabase, input: AppInstallationAccessInput): Promise<{
7
- id: string;
8
- appId: string;
9
- deploymentId: string;
10
- releaseId: string;
11
- status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
12
- namespace: string;
13
- installedBy: string;
14
- credentialGeneration: number;
15
- updatePolicy: "patch" | "manual" | "compatible" | "pinned";
16
- lastCompatibleReleaseCheckAt: Date | null;
17
- pendingReleaseId: string | null;
18
- pendingReason: string | null;
19
- installedAt: Date;
20
- authorizedAt: Date | null;
21
- activatedAt: Date | null;
22
- pausedAt: Date | null;
23
- degradedAt: Date | null;
24
- revokedAt: Date | null;
25
- uninstalledAt: Date | null;
26
- purgedAt: Date | null;
27
- createdAt: Date;
28
- updatedAt: Date;
29
- }>;
@@ -1,33 +0,0 @@
1
- import { ApiHttpError } from "@voyant-travel/hono";
2
- import { and, eq } from "drizzle-orm";
3
- import { appGrants, appInstallations } from "./schema.js";
4
- export async function assertActiveAppInstallationAccess(db, input) {
5
- const [installation] = await db
6
- .select()
7
- .from(appInstallations)
8
- .where(eq(appInstallations.id, input.installationId))
9
- .limit(1);
10
- if (installation?.status !== "active") {
11
- throw new ApiHttpError("App installation is not active", {
12
- status: 403,
13
- code: "app_installation_not_active",
14
- });
15
- }
16
- const required = new Set(input.requiredScopes ?? []);
17
- if (required.size === 0)
18
- return installation;
19
- const grants = await db
20
- .select({ scope: appGrants.scope })
21
- .from(appGrants)
22
- .where(and(eq(appGrants.installationId, installation.id), eq(appGrants.status, "granted")));
23
- for (const grant of grants)
24
- required.delete(grant.scope);
25
- if (required.size > 0) {
26
- throw new ApiHttpError("App installation is missing required scopes", {
27
- status: 403,
28
- code: "app_installation_scope_missing",
29
- details: { scopes: [...required].sort() },
30
- });
31
- }
32
- return installation;
33
- }
@@ -1,51 +0,0 @@
1
- import { customFieldDefinitionInputSchema, customFieldDefinitionListQuerySchema, customFieldValueListQuerySchema, updateCustomFieldDefinitionSchema, upsertCustomFieldValueSchema } from "@voyant-travel/custom-fields";
2
- import { z } from "zod";
3
- export declare const APP_API_VERSION = "2026-07-01";
4
- export declare const appApiVersionHeader = "voyant-app-api-version";
5
- export declare const appApiEntityReadQuerySchema: z.ZodObject<{
6
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
7
- offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
8
- }, z.core.$strip>;
9
- export declare const appApiFinanceDocumentQuerySchema: z.ZodObject<{
10
- invoiceId: z.ZodOptional<z.ZodString>;
11
- provider: z.ZodOptional<z.ZodString>;
12
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
13
- offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
14
- }, z.core.$strip>;
15
- export declare const appApiFinanceActionSchema: z.ZodObject<{
16
- action: z.ZodEnum<{
17
- issue: "issue";
18
- retry: "retry";
19
- reconcile: "reconcile";
20
- }>;
21
- invoiceId: z.ZodOptional<z.ZodString>;
22
- bookingId: z.ZodOptional<z.ZodString>;
23
- approvalId: z.ZodOptional<z.ZodString>;
24
- idempotencyKey: z.ZodString;
25
- payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
26
- }, z.core.$strict>;
27
- export declare const appApiWebhookReplaySchema: z.ZodObject<{
28
- deliveryId: z.ZodString;
29
- signingKeyId: z.ZodString;
30
- signingSecret: z.ZodString;
31
- }, z.core.$strict>;
32
- export declare const appApiAuditQuerySchema: z.ZodObject<{
33
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
34
- offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
35
- }, z.core.$strip>;
36
- export declare const appApiTokenExchangeSchema: z.ZodObject<{
37
- client_id: z.ZodString;
38
- client_secret: z.ZodOptional<z.ZodString>;
39
- viewer_id: z.ZodString;
40
- viewer_scopes: z.ZodArray<z.ZodString>;
41
- contextual_scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
42
- }, z.core.$strict>;
43
- export declare const appApiDefinitionNamespaceSchema: z.ZodObject<{
44
- namespace: z.ZodOptional<z.ZodString>;
45
- }, z.core.$strict>;
46
- export { customFieldDefinitionInputSchema as appApiCustomFieldDefinitionCreateSchema, customFieldDefinitionListQuerySchema as appApiCustomFieldDefinitionListQuerySchema, customFieldValueListQuerySchema as appApiCustomFieldValueListQuerySchema, updateCustomFieldDefinitionSchema as appApiCustomFieldDefinitionUpdateSchema, upsertCustomFieldValueSchema as appApiCustomFieldValueUpsertSchema, };
47
- export type AppApiEntityReadQuery = z.infer<typeof appApiEntityReadQuerySchema>;
48
- export type AppApiFinanceDocumentQuery = z.infer<typeof appApiFinanceDocumentQuerySchema>;
49
- export type AppApiFinanceActionInput = z.infer<typeof appApiFinanceActionSchema>;
50
- export type AppApiWebhookReplayInput = z.infer<typeof appApiWebhookReplaySchema>;
51
- export type AppApiAuditQuery = z.infer<typeof appApiAuditQuerySchema>;
@@ -1,50 +0,0 @@
1
- import { customFieldDefinitionInputSchema, customFieldDefinitionListQuerySchema, customFieldValueListQuerySchema, updateCustomFieldDefinitionSchema, upsertCustomFieldValueSchema, } from "@voyant-travel/custom-fields";
2
- import { z } from "zod";
3
- export const APP_API_VERSION = "2026-07-01";
4
- export const appApiVersionHeader = "voyant-app-api-version";
5
- export const appApiEntityReadQuerySchema = z.object({
6
- limit: z.coerce.number().int().min(1).max(100).default(25),
7
- offset: z.coerce.number().int().min(0).default(0),
8
- });
9
- export const appApiFinanceDocumentQuerySchema = z.object({
10
- invoiceId: z.string().min(1).optional(),
11
- provider: z.string().min(1).optional(),
12
- limit: z.coerce.number().int().min(1).max(100).default(25),
13
- offset: z.coerce.number().int().min(0).default(0),
14
- });
15
- export const appApiFinanceActionSchema = z
16
- .object({
17
- action: z.enum(["issue", "retry", "reconcile"]),
18
- invoiceId: z.string().min(1).optional(),
19
- bookingId: z.string().min(1).optional(),
20
- approvalId: z.string().min(1).optional(),
21
- idempotencyKey: z.string().min(1),
22
- payload: z.record(z.string(), z.unknown()).default({}),
23
- })
24
- .strict();
25
- export const appApiWebhookReplaySchema = z
26
- .object({
27
- deliveryId: z.string().min(1),
28
- signingKeyId: z.string().min(1),
29
- signingSecret: z.string().min(1),
30
- })
31
- .strict();
32
- export const appApiAuditQuerySchema = z.object({
33
- limit: z.coerce.number().int().min(1).max(100).default(25),
34
- offset: z.coerce.number().int().min(0).default(0),
35
- });
36
- export const appApiTokenExchangeSchema = z
37
- .object({
38
- client_id: z.string().min(1),
39
- client_secret: z.string().optional(),
40
- viewer_id: z.string().min(1),
41
- viewer_scopes: z.array(z.string().min(1)),
42
- contextual_scopes: z.array(z.string().min(1)).optional(),
43
- })
44
- .strict();
45
- export const appApiDefinitionNamespaceSchema = z
46
- .object({
47
- namespace: z.string().optional(),
48
- })
49
- .strict();
50
- export { customFieldDefinitionInputSchema as appApiCustomFieldDefinitionCreateSchema, customFieldDefinitionListQuerySchema as appApiCustomFieldDefinitionListQuerySchema, customFieldValueListQuerySchema as appApiCustomFieldValueListQuerySchema, updateCustomFieldDefinitionSchema as appApiCustomFieldDefinitionUpdateSchema, upsertCustomFieldValueSchema as appApiCustomFieldValueUpsertSchema, };
@@ -1,26 +0,0 @@
1
- import type { AccessCatalog } from "@voyant-travel/types/api-keys";
2
- import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
3
- import { Hono } from "hono";
4
- import { type AppApiServiceOptions } from "./app-api-service.js";
5
- type Env = {
6
- Variables: {
7
- db: PostgresJsDatabase;
8
- appId?: string;
9
- appInstallationId?: string;
10
- appReleaseId?: string;
11
- appTokenMode?: "offline" | "online";
12
- appViewerId?: string;
13
- callerType?: string;
14
- scopes?: string[];
15
- };
16
- };
17
- export interface AppsAppApiRouteOptions extends AppApiServiceOptions {
18
- oauth?: {
19
- accessCatalog: AccessCatalog;
20
- deploymentId: string;
21
- };
22
- deadlineMs?: number;
23
- maxPayloadBytes?: number;
24
- }
25
- export declare function createAppsAppApiRoutes(options?: AppsAppApiRouteOptions): Hono<Env, import("hono/types").BlankSchema, "/">;
26
- export {};