@voyant-travel/apps 0.1.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 (64) hide show
  1. package/dist/access-boundary.d.ts +29 -0
  2. package/dist/access-boundary.js +33 -0
  3. package/dist/api-runtime.d.ts +10 -0
  4. package/dist/api-runtime.js +8 -0
  5. package/dist/app-api-contracts.d.ts +51 -0
  6. package/dist/app-api-contracts.js +50 -0
  7. package/dist/app-api-routes.d.ts +26 -0
  8. package/dist/app-api-routes.js +133 -0
  9. package/dist/app-api-service.d.ts +1263 -0
  10. package/dist/app-api-service.js +231 -0
  11. package/dist/app-api-service.test.d.ts +1 -0
  12. package/dist/app-api-service.test.js +105 -0
  13. package/dist/compiler.d.ts +38 -0
  14. package/dist/compiler.js +118 -0
  15. package/dist/compiler.test.d.ts +1 -0
  16. package/dist/compiler.test.js +99 -0
  17. package/dist/consent.d.ts +15 -0
  18. package/dist/consent.js +50 -0
  19. package/dist/consent.test.d.ts +1 -0
  20. package/dist/consent.test.js +80 -0
  21. package/dist/contracts.d.ts +263 -0
  22. package/dist/contracts.js +273 -0
  23. package/dist/index.d.ts +13 -0
  24. package/dist/index.js +12 -0
  25. package/dist/ingestion.d.ts +15 -0
  26. package/dist/ingestion.js +232 -0
  27. package/dist/ingestion.test.d.ts +1 -0
  28. package/dist/ingestion.test.js +47 -0
  29. package/dist/installation-reconciliation.d.ts +18 -0
  30. package/dist/installation-reconciliation.js +254 -0
  31. package/dist/installation-service.d.ts +351 -0
  32. package/dist/installation-service.js +328 -0
  33. package/dist/installation-state.d.ts +15 -0
  34. package/dist/installation-state.js +17 -0
  35. package/dist/installation-state.test.d.ts +1 -0
  36. package/dist/installation-state.test.js +38 -0
  37. package/dist/oauth-crypto.d.ts +8 -0
  38. package/dist/oauth-crypto.js +23 -0
  39. package/dist/oauth-crypto.test.d.ts +1 -0
  40. package/dist/oauth-crypto.test.js +11 -0
  41. package/dist/oauth-service.d.ts +65 -0
  42. package/dist/oauth-service.js +381 -0
  43. package/dist/oauth-service.test.d.ts +1 -0
  44. package/dist/oauth-service.test.js +8 -0
  45. package/dist/routes.d.ts +17 -0
  46. package/dist/routes.js +131 -0
  47. package/dist/schema.d.ts +2937 -0
  48. package/dist/schema.js +342 -0
  49. package/dist/service.d.ts +95 -0
  50. package/dist/service.js +172 -0
  51. package/dist/service.test.d.ts +1 -0
  52. package/dist/service.test.js +178 -0
  53. package/dist/test-fixtures.d.ts +80 -0
  54. package/dist/test-fixtures.js +78 -0
  55. package/dist/voyant.d.ts +2 -0
  56. package/dist/voyant.js +115 -0
  57. package/dist/webhook-delivery.d.ts +69 -0
  58. package/dist/webhook-delivery.js +262 -0
  59. package/migrations/20260717000100_app_registry_foundation.sql +87 -0
  60. package/migrations/20260717111938_breezy_karma.sql +136 -0
  61. package/migrations/20260717123000_app_webhook_delivery_health.sql +4 -0
  62. package/migrations/20260717143000_app_oauth_authorization.sql +47 -0
  63. package/migrations/meta/_journal.json +34 -0
  64. package/package.json +159 -0
@@ -0,0 +1,1263 @@
1
+ import type { CustomFieldValueLifecycleRuntime, CustomFieldValueOperationsRuntime } from "@voyant-travel/core/runtime-port";
2
+ import { type CustomFieldDefinitionOwner, createCustomFieldsService } from "@voyant-travel/custom-fields";
3
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
4
+ import type { AppApiAuditQuery, AppApiEntityReadQuery, AppApiFinanceActionInput, AppApiFinanceDocumentQuery } from "./app-api-contracts.js";
5
+ export interface AppApiAccessContext {
6
+ appId: string;
7
+ installationId: string;
8
+ releaseId: string;
9
+ tokenMode: "offline" | "online";
10
+ viewerId?: string;
11
+ scopes: readonly string[];
12
+ apiVersion?: string;
13
+ }
14
+ export interface AppApiEntityReader {
15
+ list(db: PostgresJsDatabase, query: AppApiEntityReadQuery): Promise<unknown>;
16
+ }
17
+ export interface AppApiFinanceRuntime {
18
+ listDocuments(db: PostgresJsDatabase, query: AppApiFinanceDocumentQuery): Promise<unknown>;
19
+ executeAction(db: PostgresJsDatabase, input: AppApiFinanceActionInput): Promise<unknown>;
20
+ }
21
+ export interface AppApiRateLimitPolicy {
22
+ installationLimit: number;
23
+ appLimit: number;
24
+ windowMs: number;
25
+ }
26
+ export interface AppApiServiceOptions {
27
+ entityReaders?: Readonly<Record<string, AppApiEntityReader>>;
28
+ finance?: AppApiFinanceRuntime;
29
+ customFieldTargets?: Parameters<typeof createCustomFieldsService>[0];
30
+ customFieldValueLifecycles?: readonly CustomFieldValueLifecycleRuntime[];
31
+ customFieldValueOperations?: readonly CustomFieldValueOperationsRuntime[];
32
+ rateLimit?: AppApiRateLimitPolicy;
33
+ now?: () => Date;
34
+ }
35
+ export declare function createAppApiService(options?: AppApiServiceOptions): {
36
+ introspect: (db: PostgresJsDatabase, context: AppApiAccessContext) => Promise<{
37
+ data: {
38
+ installation: {
39
+ id: string;
40
+ appId: string;
41
+ status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
42
+ namespace: string;
43
+ deploymentId: string;
44
+ };
45
+ release: {
46
+ id: string;
47
+ version: string;
48
+ apiCompatibility: {
49
+ min: string;
50
+ max: string;
51
+ };
52
+ };
53
+ grants: {
54
+ scope: string;
55
+ status: "optional" | "revoked" | "requested" | "granted";
56
+ optional: boolean;
57
+ }[];
58
+ };
59
+ }>;
60
+ listEntities: (db: PostgresJsDatabase, context: AppApiAccessContext, entity: string, query: AppApiEntityReadQuery) => Promise<{
61
+ data: unknown;
62
+ }>;
63
+ listFinanceDocuments: (db: PostgresJsDatabase, context: AppApiAccessContext, query: AppApiFinanceDocumentQuery) => Promise<{
64
+ data: unknown;
65
+ }>;
66
+ executeFinanceAction: (db: PostgresJsDatabase, context: AppApiAccessContext, input: AppApiFinanceActionInput) => Promise<{
67
+ data: unknown;
68
+ }>;
69
+ listCustomFieldDefinitions: (db: PostgresJsDatabase, context: AppApiAccessContext, query: Parameters<NonNullable<{
70
+ list(db: PostgresJsDatabase, query: import("@voyant-travel/custom-fields").CustomFieldDefinitionListQuery): Promise<{
71
+ data: {
72
+ id: string;
73
+ entityType: string;
74
+ namespace: string;
75
+ ownerKind: "platform" | "operator" | "app";
76
+ ownerId: string | null;
77
+ lifecycleState: "active" | "inactive" | "deprecated";
78
+ provenance: Record<string, unknown>;
79
+ key: string;
80
+ label: string;
81
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
82
+ isRequired: boolean;
83
+ isSearchable: boolean;
84
+ isExportable: boolean;
85
+ isInvoiceable: boolean;
86
+ options: {
87
+ label: string;
88
+ value: string;
89
+ }[] | null;
90
+ createdAt: Date;
91
+ updatedAt: Date;
92
+ }[];
93
+ total: number;
94
+ limit: number;
95
+ offset: number;
96
+ }>;
97
+ get(db: PostgresJsDatabase, id: string): Promise<{
98
+ id: string;
99
+ entityType: string;
100
+ namespace: string;
101
+ ownerKind: "platform" | "operator" | "app";
102
+ ownerId: string | null;
103
+ lifecycleState: "active" | "inactive" | "deprecated";
104
+ provenance: Record<string, unknown>;
105
+ key: string;
106
+ label: string;
107
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
108
+ isRequired: boolean;
109
+ isSearchable: boolean;
110
+ isExportable: boolean;
111
+ isInvoiceable: boolean;
112
+ options: {
113
+ label: string;
114
+ value: string;
115
+ }[] | null;
116
+ createdAt: Date;
117
+ updatedAt: Date;
118
+ } | null>;
119
+ create(db: PostgresJsDatabase, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionInput): Promise<{
120
+ id: string;
121
+ namespace: string;
122
+ label: string;
123
+ entityType: string;
124
+ ownerKind: "platform" | "operator" | "app";
125
+ ownerId: string | null;
126
+ lifecycleState: "active" | "inactive" | "deprecated";
127
+ provenance: Record<string, unknown>;
128
+ key: string;
129
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
130
+ isRequired: boolean;
131
+ isSearchable: boolean;
132
+ isExportable: boolean;
133
+ isInvoiceable: boolean;
134
+ options: {
135
+ label: string;
136
+ value: string;
137
+ }[] | null;
138
+ createdAt: Date;
139
+ updatedAt: Date;
140
+ }>;
141
+ update(db: PostgresJsDatabase, id: string, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionUpdate): Promise<{
142
+ id: string;
143
+ entityType: string;
144
+ namespace: string;
145
+ ownerKind: "platform" | "operator" | "app";
146
+ ownerId: string | null;
147
+ lifecycleState: "active" | "inactive" | "deprecated";
148
+ provenance: Record<string, unknown>;
149
+ key: string;
150
+ label: string;
151
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
152
+ isRequired: boolean;
153
+ isSearchable: boolean;
154
+ isExportable: boolean;
155
+ isInvoiceable: boolean;
156
+ options: {
157
+ label: string;
158
+ value: string;
159
+ }[] | null;
160
+ createdAt: Date;
161
+ updatedAt: Date;
162
+ } | null>;
163
+ remove(db: PostgresJsDatabase, id: string): Promise<{
164
+ id: string;
165
+ } | null>;
166
+ listForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, query: import("@voyant-travel/custom-fields").CustomFieldDefinitionListQuery): Promise<{
167
+ data: {
168
+ id: string;
169
+ entityType: string;
170
+ namespace: string;
171
+ ownerKind: "platform" | "operator" | "app";
172
+ ownerId: string | null;
173
+ lifecycleState: "active" | "inactive" | "deprecated";
174
+ provenance: Record<string, unknown>;
175
+ key: string;
176
+ label: string;
177
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
178
+ isRequired: boolean;
179
+ isSearchable: boolean;
180
+ isExportable: boolean;
181
+ isInvoiceable: boolean;
182
+ options: {
183
+ label: string;
184
+ value: string;
185
+ }[] | null;
186
+ createdAt: Date;
187
+ updatedAt: Date;
188
+ }[];
189
+ total: number;
190
+ limit: number;
191
+ offset: number;
192
+ }>;
193
+ getForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string): Promise<{
194
+ id: string;
195
+ entityType: string;
196
+ namespace: string;
197
+ ownerKind: "platform" | "operator" | "app";
198
+ ownerId: string | null;
199
+ lifecycleState: "active" | "inactive" | "deprecated";
200
+ provenance: Record<string, unknown>;
201
+ key: string;
202
+ label: string;
203
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
204
+ isRequired: boolean;
205
+ isSearchable: boolean;
206
+ isExportable: boolean;
207
+ isInvoiceable: boolean;
208
+ options: {
209
+ label: string;
210
+ value: string;
211
+ }[] | null;
212
+ createdAt: Date;
213
+ updatedAt: Date;
214
+ } | null>;
215
+ createForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionInput): Promise<{
216
+ id: string;
217
+ namespace: string;
218
+ label: string;
219
+ entityType: string;
220
+ ownerKind: "platform" | "operator" | "app";
221
+ ownerId: string | null;
222
+ lifecycleState: "active" | "inactive" | "deprecated";
223
+ provenance: Record<string, unknown>;
224
+ key: string;
225
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
226
+ isRequired: boolean;
227
+ isSearchable: boolean;
228
+ isExportable: boolean;
229
+ isInvoiceable: boolean;
230
+ options: {
231
+ label: string;
232
+ value: string;
233
+ }[] | null;
234
+ createdAt: Date;
235
+ updatedAt: Date;
236
+ }>;
237
+ updateForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionUpdate): Promise<{
238
+ id: string;
239
+ entityType: string;
240
+ namespace: string;
241
+ ownerKind: "platform" | "operator" | "app";
242
+ ownerId: string | null;
243
+ lifecycleState: "active" | "inactive" | "deprecated";
244
+ provenance: Record<string, unknown>;
245
+ key: string;
246
+ label: string;
247
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
248
+ isRequired: boolean;
249
+ isSearchable: boolean;
250
+ isExportable: boolean;
251
+ isInvoiceable: boolean;
252
+ options: {
253
+ label: string;
254
+ value: string;
255
+ }[] | null;
256
+ createdAt: Date;
257
+ updatedAt: Date;
258
+ } | null>;
259
+ removeForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string): Promise<{
260
+ id: string;
261
+ } | null>;
262
+ values: {
263
+ listForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, query: import("@voyant-travel/custom-fields").CustomFieldValueListQuery) => Promise<{
264
+ data: import("@voyant-travel/custom-fields").CustomFieldValueRow[];
265
+ total: number;
266
+ limit: number;
267
+ offset: number;
268
+ }>;
269
+ upsertForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, definitionId: string, input: import("@voyant-travel/custom-fields").UpsertCustomFieldValueInput) => Promise<import("@voyant-travel/custom-fields").CustomFieldValueRow>;
270
+ deleteForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string) => Promise<{
271
+ id: string;
272
+ } | null>;
273
+ };
274
+ } | undefined>["listForOwner"]>[2]) => Promise<{
275
+ data: {
276
+ id: string;
277
+ entityType: string;
278
+ namespace: string;
279
+ ownerKind: "platform" | "operator" | "app";
280
+ ownerId: string | null;
281
+ lifecycleState: "active" | "inactive" | "deprecated";
282
+ provenance: Record<string, unknown>;
283
+ key: string;
284
+ label: string;
285
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
286
+ isRequired: boolean;
287
+ isSearchable: boolean;
288
+ isExportable: boolean;
289
+ isInvoiceable: boolean;
290
+ options: {
291
+ label: string;
292
+ value: string;
293
+ }[] | null;
294
+ createdAt: Date;
295
+ updatedAt: Date;
296
+ }[];
297
+ total: number;
298
+ limit: number;
299
+ offset: number;
300
+ }>;
301
+ createCustomFieldDefinition: (db: PostgresJsDatabase, context: AppApiAccessContext, namespace: string | undefined, input: Parameters<NonNullable<{
302
+ list(db: PostgresJsDatabase, query: import("@voyant-travel/custom-fields").CustomFieldDefinitionListQuery): Promise<{
303
+ data: {
304
+ id: string;
305
+ entityType: string;
306
+ namespace: string;
307
+ ownerKind: "platform" | "operator" | "app";
308
+ ownerId: string | null;
309
+ lifecycleState: "active" | "inactive" | "deprecated";
310
+ provenance: Record<string, unknown>;
311
+ key: string;
312
+ label: string;
313
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
314
+ isRequired: boolean;
315
+ isSearchable: boolean;
316
+ isExportable: boolean;
317
+ isInvoiceable: boolean;
318
+ options: {
319
+ label: string;
320
+ value: string;
321
+ }[] | null;
322
+ createdAt: Date;
323
+ updatedAt: Date;
324
+ }[];
325
+ total: number;
326
+ limit: number;
327
+ offset: number;
328
+ }>;
329
+ get(db: PostgresJsDatabase, id: string): Promise<{
330
+ id: string;
331
+ entityType: string;
332
+ namespace: string;
333
+ ownerKind: "platform" | "operator" | "app";
334
+ ownerId: string | null;
335
+ lifecycleState: "active" | "inactive" | "deprecated";
336
+ provenance: Record<string, unknown>;
337
+ key: string;
338
+ label: string;
339
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
340
+ isRequired: boolean;
341
+ isSearchable: boolean;
342
+ isExportable: boolean;
343
+ isInvoiceable: boolean;
344
+ options: {
345
+ label: string;
346
+ value: string;
347
+ }[] | null;
348
+ createdAt: Date;
349
+ updatedAt: Date;
350
+ } | null>;
351
+ create(db: PostgresJsDatabase, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionInput): Promise<{
352
+ id: string;
353
+ namespace: string;
354
+ label: string;
355
+ entityType: string;
356
+ ownerKind: "platform" | "operator" | "app";
357
+ ownerId: string | null;
358
+ lifecycleState: "active" | "inactive" | "deprecated";
359
+ provenance: Record<string, unknown>;
360
+ key: string;
361
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
362
+ isRequired: boolean;
363
+ isSearchable: boolean;
364
+ isExportable: boolean;
365
+ isInvoiceable: boolean;
366
+ options: {
367
+ label: string;
368
+ value: string;
369
+ }[] | null;
370
+ createdAt: Date;
371
+ updatedAt: Date;
372
+ }>;
373
+ update(db: PostgresJsDatabase, id: string, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionUpdate): Promise<{
374
+ id: string;
375
+ entityType: string;
376
+ namespace: string;
377
+ ownerKind: "platform" | "operator" | "app";
378
+ ownerId: string | null;
379
+ lifecycleState: "active" | "inactive" | "deprecated";
380
+ provenance: Record<string, unknown>;
381
+ key: string;
382
+ label: string;
383
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
384
+ isRequired: boolean;
385
+ isSearchable: boolean;
386
+ isExportable: boolean;
387
+ isInvoiceable: boolean;
388
+ options: {
389
+ label: string;
390
+ value: string;
391
+ }[] | null;
392
+ createdAt: Date;
393
+ updatedAt: Date;
394
+ } | null>;
395
+ remove(db: PostgresJsDatabase, id: string): Promise<{
396
+ id: string;
397
+ } | null>;
398
+ listForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, query: import("@voyant-travel/custom-fields").CustomFieldDefinitionListQuery): Promise<{
399
+ data: {
400
+ id: string;
401
+ entityType: string;
402
+ namespace: string;
403
+ ownerKind: "platform" | "operator" | "app";
404
+ ownerId: string | null;
405
+ lifecycleState: "active" | "inactive" | "deprecated";
406
+ provenance: Record<string, unknown>;
407
+ key: string;
408
+ label: string;
409
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
410
+ isRequired: boolean;
411
+ isSearchable: boolean;
412
+ isExportable: boolean;
413
+ isInvoiceable: boolean;
414
+ options: {
415
+ label: string;
416
+ value: string;
417
+ }[] | null;
418
+ createdAt: Date;
419
+ updatedAt: Date;
420
+ }[];
421
+ total: number;
422
+ limit: number;
423
+ offset: number;
424
+ }>;
425
+ getForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string): Promise<{
426
+ id: string;
427
+ entityType: string;
428
+ namespace: string;
429
+ ownerKind: "platform" | "operator" | "app";
430
+ ownerId: string | null;
431
+ lifecycleState: "active" | "inactive" | "deprecated";
432
+ provenance: Record<string, unknown>;
433
+ key: string;
434
+ label: string;
435
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
436
+ isRequired: boolean;
437
+ isSearchable: boolean;
438
+ isExportable: boolean;
439
+ isInvoiceable: boolean;
440
+ options: {
441
+ label: string;
442
+ value: string;
443
+ }[] | null;
444
+ createdAt: Date;
445
+ updatedAt: Date;
446
+ } | null>;
447
+ createForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionInput): Promise<{
448
+ id: string;
449
+ namespace: string;
450
+ label: string;
451
+ entityType: string;
452
+ ownerKind: "platform" | "operator" | "app";
453
+ ownerId: string | null;
454
+ lifecycleState: "active" | "inactive" | "deprecated";
455
+ provenance: Record<string, unknown>;
456
+ key: string;
457
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
458
+ isRequired: boolean;
459
+ isSearchable: boolean;
460
+ isExportable: boolean;
461
+ isInvoiceable: boolean;
462
+ options: {
463
+ label: string;
464
+ value: string;
465
+ }[] | null;
466
+ createdAt: Date;
467
+ updatedAt: Date;
468
+ }>;
469
+ updateForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionUpdate): Promise<{
470
+ id: string;
471
+ entityType: string;
472
+ namespace: string;
473
+ ownerKind: "platform" | "operator" | "app";
474
+ ownerId: string | null;
475
+ lifecycleState: "active" | "inactive" | "deprecated";
476
+ provenance: Record<string, unknown>;
477
+ key: string;
478
+ label: string;
479
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
480
+ isRequired: boolean;
481
+ isSearchable: boolean;
482
+ isExportable: boolean;
483
+ isInvoiceable: boolean;
484
+ options: {
485
+ label: string;
486
+ value: string;
487
+ }[] | null;
488
+ createdAt: Date;
489
+ updatedAt: Date;
490
+ } | null>;
491
+ removeForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string): Promise<{
492
+ id: string;
493
+ } | null>;
494
+ values: {
495
+ listForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, query: import("@voyant-travel/custom-fields").CustomFieldValueListQuery) => Promise<{
496
+ data: import("@voyant-travel/custom-fields").CustomFieldValueRow[];
497
+ total: number;
498
+ limit: number;
499
+ offset: number;
500
+ }>;
501
+ upsertForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, definitionId: string, input: import("@voyant-travel/custom-fields").UpsertCustomFieldValueInput) => Promise<import("@voyant-travel/custom-fields").CustomFieldValueRow>;
502
+ deleteForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string) => Promise<{
503
+ id: string;
504
+ } | null>;
505
+ };
506
+ } | undefined>["createForOwner"]>[2]) => Promise<{
507
+ data: {
508
+ id: string;
509
+ namespace: string;
510
+ label: string;
511
+ entityType: string;
512
+ ownerKind: "platform" | "operator" | "app";
513
+ ownerId: string | null;
514
+ lifecycleState: "active" | "inactive" | "deprecated";
515
+ provenance: Record<string, unknown>;
516
+ key: string;
517
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
518
+ isRequired: boolean;
519
+ isSearchable: boolean;
520
+ isExportable: boolean;
521
+ isInvoiceable: boolean;
522
+ options: {
523
+ label: string;
524
+ value: string;
525
+ }[] | null;
526
+ createdAt: Date;
527
+ updatedAt: Date;
528
+ };
529
+ }>;
530
+ updateCustomFieldDefinition: (db: PostgresJsDatabase, context: AppApiAccessContext, id: string, namespace: string | undefined, input: Parameters<NonNullable<{
531
+ list(db: PostgresJsDatabase, query: import("@voyant-travel/custom-fields").CustomFieldDefinitionListQuery): Promise<{
532
+ data: {
533
+ id: string;
534
+ entityType: string;
535
+ namespace: string;
536
+ ownerKind: "platform" | "operator" | "app";
537
+ ownerId: string | null;
538
+ lifecycleState: "active" | "inactive" | "deprecated";
539
+ provenance: Record<string, unknown>;
540
+ key: string;
541
+ label: string;
542
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
543
+ isRequired: boolean;
544
+ isSearchable: boolean;
545
+ isExportable: boolean;
546
+ isInvoiceable: boolean;
547
+ options: {
548
+ label: string;
549
+ value: string;
550
+ }[] | null;
551
+ createdAt: Date;
552
+ updatedAt: Date;
553
+ }[];
554
+ total: number;
555
+ limit: number;
556
+ offset: number;
557
+ }>;
558
+ get(db: PostgresJsDatabase, id: string): Promise<{
559
+ id: string;
560
+ entityType: string;
561
+ namespace: string;
562
+ ownerKind: "platform" | "operator" | "app";
563
+ ownerId: string | null;
564
+ lifecycleState: "active" | "inactive" | "deprecated";
565
+ provenance: Record<string, unknown>;
566
+ key: string;
567
+ label: string;
568
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
569
+ isRequired: boolean;
570
+ isSearchable: boolean;
571
+ isExportable: boolean;
572
+ isInvoiceable: boolean;
573
+ options: {
574
+ label: string;
575
+ value: string;
576
+ }[] | null;
577
+ createdAt: Date;
578
+ updatedAt: Date;
579
+ } | null>;
580
+ create(db: PostgresJsDatabase, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionInput): Promise<{
581
+ id: string;
582
+ namespace: string;
583
+ label: string;
584
+ entityType: string;
585
+ ownerKind: "platform" | "operator" | "app";
586
+ ownerId: string | null;
587
+ lifecycleState: "active" | "inactive" | "deprecated";
588
+ provenance: Record<string, unknown>;
589
+ key: string;
590
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
591
+ isRequired: boolean;
592
+ isSearchable: boolean;
593
+ isExportable: boolean;
594
+ isInvoiceable: boolean;
595
+ options: {
596
+ label: string;
597
+ value: string;
598
+ }[] | null;
599
+ createdAt: Date;
600
+ updatedAt: Date;
601
+ }>;
602
+ update(db: PostgresJsDatabase, id: string, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionUpdate): Promise<{
603
+ id: string;
604
+ entityType: string;
605
+ namespace: string;
606
+ ownerKind: "platform" | "operator" | "app";
607
+ ownerId: string | null;
608
+ lifecycleState: "active" | "inactive" | "deprecated";
609
+ provenance: Record<string, unknown>;
610
+ key: string;
611
+ label: string;
612
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
613
+ isRequired: boolean;
614
+ isSearchable: boolean;
615
+ isExportable: boolean;
616
+ isInvoiceable: boolean;
617
+ options: {
618
+ label: string;
619
+ value: string;
620
+ }[] | null;
621
+ createdAt: Date;
622
+ updatedAt: Date;
623
+ } | null>;
624
+ remove(db: PostgresJsDatabase, id: string): Promise<{
625
+ id: string;
626
+ } | null>;
627
+ listForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, query: import("@voyant-travel/custom-fields").CustomFieldDefinitionListQuery): Promise<{
628
+ data: {
629
+ id: string;
630
+ entityType: string;
631
+ namespace: string;
632
+ ownerKind: "platform" | "operator" | "app";
633
+ ownerId: string | null;
634
+ lifecycleState: "active" | "inactive" | "deprecated";
635
+ provenance: Record<string, unknown>;
636
+ key: string;
637
+ label: string;
638
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
639
+ isRequired: boolean;
640
+ isSearchable: boolean;
641
+ isExportable: boolean;
642
+ isInvoiceable: boolean;
643
+ options: {
644
+ label: string;
645
+ value: string;
646
+ }[] | null;
647
+ createdAt: Date;
648
+ updatedAt: Date;
649
+ }[];
650
+ total: number;
651
+ limit: number;
652
+ offset: number;
653
+ }>;
654
+ getForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string): Promise<{
655
+ id: string;
656
+ entityType: string;
657
+ namespace: string;
658
+ ownerKind: "platform" | "operator" | "app";
659
+ ownerId: string | null;
660
+ lifecycleState: "active" | "inactive" | "deprecated";
661
+ provenance: Record<string, unknown>;
662
+ key: string;
663
+ label: string;
664
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
665
+ isRequired: boolean;
666
+ isSearchable: boolean;
667
+ isExportable: boolean;
668
+ isInvoiceable: boolean;
669
+ options: {
670
+ label: string;
671
+ value: string;
672
+ }[] | null;
673
+ createdAt: Date;
674
+ updatedAt: Date;
675
+ } | null>;
676
+ createForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionInput): Promise<{
677
+ id: string;
678
+ namespace: string;
679
+ label: string;
680
+ entityType: string;
681
+ ownerKind: "platform" | "operator" | "app";
682
+ ownerId: string | null;
683
+ lifecycleState: "active" | "inactive" | "deprecated";
684
+ provenance: Record<string, unknown>;
685
+ key: string;
686
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
687
+ isRequired: boolean;
688
+ isSearchable: boolean;
689
+ isExportable: boolean;
690
+ isInvoiceable: boolean;
691
+ options: {
692
+ label: string;
693
+ value: string;
694
+ }[] | null;
695
+ createdAt: Date;
696
+ updatedAt: Date;
697
+ }>;
698
+ updateForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionUpdate): Promise<{
699
+ id: string;
700
+ entityType: string;
701
+ namespace: string;
702
+ ownerKind: "platform" | "operator" | "app";
703
+ ownerId: string | null;
704
+ lifecycleState: "active" | "inactive" | "deprecated";
705
+ provenance: Record<string, unknown>;
706
+ key: string;
707
+ label: string;
708
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
709
+ isRequired: boolean;
710
+ isSearchable: boolean;
711
+ isExportable: boolean;
712
+ isInvoiceable: boolean;
713
+ options: {
714
+ label: string;
715
+ value: string;
716
+ }[] | null;
717
+ createdAt: Date;
718
+ updatedAt: Date;
719
+ } | null>;
720
+ removeForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string): Promise<{
721
+ id: string;
722
+ } | null>;
723
+ values: {
724
+ listForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, query: import("@voyant-travel/custom-fields").CustomFieldValueListQuery) => Promise<{
725
+ data: import("@voyant-travel/custom-fields").CustomFieldValueRow[];
726
+ total: number;
727
+ limit: number;
728
+ offset: number;
729
+ }>;
730
+ upsertForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, definitionId: string, input: import("@voyant-travel/custom-fields").UpsertCustomFieldValueInput) => Promise<import("@voyant-travel/custom-fields").CustomFieldValueRow>;
731
+ deleteForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string) => Promise<{
732
+ id: string;
733
+ } | null>;
734
+ };
735
+ } | undefined>["updateForOwner"]>[3]) => Promise<{
736
+ data: {
737
+ id: string;
738
+ entityType: string;
739
+ namespace: string;
740
+ ownerKind: "platform" | "operator" | "app";
741
+ ownerId: string | null;
742
+ lifecycleState: "active" | "inactive" | "deprecated";
743
+ provenance: Record<string, unknown>;
744
+ key: string;
745
+ label: string;
746
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
747
+ isRequired: boolean;
748
+ isSearchable: boolean;
749
+ isExportable: boolean;
750
+ isInvoiceable: boolean;
751
+ options: {
752
+ label: string;
753
+ value: string;
754
+ }[] | null;
755
+ createdAt: Date;
756
+ updatedAt: Date;
757
+ };
758
+ }>;
759
+ listCustomFieldValues: (db: PostgresJsDatabase, context: AppApiAccessContext, query: Parameters<NonNullable<{
760
+ list(db: PostgresJsDatabase, query: import("@voyant-travel/custom-fields").CustomFieldDefinitionListQuery): Promise<{
761
+ data: {
762
+ id: string;
763
+ entityType: string;
764
+ namespace: string;
765
+ ownerKind: "platform" | "operator" | "app";
766
+ ownerId: string | null;
767
+ lifecycleState: "active" | "inactive" | "deprecated";
768
+ provenance: Record<string, unknown>;
769
+ key: string;
770
+ label: string;
771
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
772
+ isRequired: boolean;
773
+ isSearchable: boolean;
774
+ isExportable: boolean;
775
+ isInvoiceable: boolean;
776
+ options: {
777
+ label: string;
778
+ value: string;
779
+ }[] | null;
780
+ createdAt: Date;
781
+ updatedAt: Date;
782
+ }[];
783
+ total: number;
784
+ limit: number;
785
+ offset: number;
786
+ }>;
787
+ get(db: PostgresJsDatabase, id: string): Promise<{
788
+ id: string;
789
+ entityType: string;
790
+ namespace: string;
791
+ ownerKind: "platform" | "operator" | "app";
792
+ ownerId: string | null;
793
+ lifecycleState: "active" | "inactive" | "deprecated";
794
+ provenance: Record<string, unknown>;
795
+ key: string;
796
+ label: string;
797
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
798
+ isRequired: boolean;
799
+ isSearchable: boolean;
800
+ isExportable: boolean;
801
+ isInvoiceable: boolean;
802
+ options: {
803
+ label: string;
804
+ value: string;
805
+ }[] | null;
806
+ createdAt: Date;
807
+ updatedAt: Date;
808
+ } | null>;
809
+ create(db: PostgresJsDatabase, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionInput): Promise<{
810
+ id: string;
811
+ namespace: string;
812
+ label: string;
813
+ entityType: string;
814
+ ownerKind: "platform" | "operator" | "app";
815
+ ownerId: string | null;
816
+ lifecycleState: "active" | "inactive" | "deprecated";
817
+ provenance: Record<string, unknown>;
818
+ key: string;
819
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
820
+ isRequired: boolean;
821
+ isSearchable: boolean;
822
+ isExportable: boolean;
823
+ isInvoiceable: boolean;
824
+ options: {
825
+ label: string;
826
+ value: string;
827
+ }[] | null;
828
+ createdAt: Date;
829
+ updatedAt: Date;
830
+ }>;
831
+ update(db: PostgresJsDatabase, id: string, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionUpdate): Promise<{
832
+ id: string;
833
+ entityType: string;
834
+ namespace: string;
835
+ ownerKind: "platform" | "operator" | "app";
836
+ ownerId: string | null;
837
+ lifecycleState: "active" | "inactive" | "deprecated";
838
+ provenance: Record<string, unknown>;
839
+ key: string;
840
+ label: string;
841
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
842
+ isRequired: boolean;
843
+ isSearchable: boolean;
844
+ isExportable: boolean;
845
+ isInvoiceable: boolean;
846
+ options: {
847
+ label: string;
848
+ value: string;
849
+ }[] | null;
850
+ createdAt: Date;
851
+ updatedAt: Date;
852
+ } | null>;
853
+ remove(db: PostgresJsDatabase, id: string): Promise<{
854
+ id: string;
855
+ } | null>;
856
+ listForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, query: import("@voyant-travel/custom-fields").CustomFieldDefinitionListQuery): Promise<{
857
+ data: {
858
+ id: string;
859
+ entityType: string;
860
+ namespace: string;
861
+ ownerKind: "platform" | "operator" | "app";
862
+ ownerId: string | null;
863
+ lifecycleState: "active" | "inactive" | "deprecated";
864
+ provenance: Record<string, unknown>;
865
+ key: string;
866
+ label: string;
867
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
868
+ isRequired: boolean;
869
+ isSearchable: boolean;
870
+ isExportable: boolean;
871
+ isInvoiceable: boolean;
872
+ options: {
873
+ label: string;
874
+ value: string;
875
+ }[] | null;
876
+ createdAt: Date;
877
+ updatedAt: Date;
878
+ }[];
879
+ total: number;
880
+ limit: number;
881
+ offset: number;
882
+ }>;
883
+ getForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string): Promise<{
884
+ id: string;
885
+ entityType: string;
886
+ namespace: string;
887
+ ownerKind: "platform" | "operator" | "app";
888
+ ownerId: string | null;
889
+ lifecycleState: "active" | "inactive" | "deprecated";
890
+ provenance: Record<string, unknown>;
891
+ key: string;
892
+ label: string;
893
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
894
+ isRequired: boolean;
895
+ isSearchable: boolean;
896
+ isExportable: boolean;
897
+ isInvoiceable: boolean;
898
+ options: {
899
+ label: string;
900
+ value: string;
901
+ }[] | null;
902
+ createdAt: Date;
903
+ updatedAt: Date;
904
+ } | null>;
905
+ createForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionInput): Promise<{
906
+ id: string;
907
+ namespace: string;
908
+ label: string;
909
+ entityType: string;
910
+ ownerKind: "platform" | "operator" | "app";
911
+ ownerId: string | null;
912
+ lifecycleState: "active" | "inactive" | "deprecated";
913
+ provenance: Record<string, unknown>;
914
+ key: string;
915
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
916
+ isRequired: boolean;
917
+ isSearchable: boolean;
918
+ isExportable: boolean;
919
+ isInvoiceable: boolean;
920
+ options: {
921
+ label: string;
922
+ value: string;
923
+ }[] | null;
924
+ createdAt: Date;
925
+ updatedAt: Date;
926
+ }>;
927
+ updateForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionUpdate): Promise<{
928
+ id: string;
929
+ entityType: string;
930
+ namespace: string;
931
+ ownerKind: "platform" | "operator" | "app";
932
+ ownerId: string | null;
933
+ lifecycleState: "active" | "inactive" | "deprecated";
934
+ provenance: Record<string, unknown>;
935
+ key: string;
936
+ label: string;
937
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
938
+ isRequired: boolean;
939
+ isSearchable: boolean;
940
+ isExportable: boolean;
941
+ isInvoiceable: boolean;
942
+ options: {
943
+ label: string;
944
+ value: string;
945
+ }[] | null;
946
+ createdAt: Date;
947
+ updatedAt: Date;
948
+ } | null>;
949
+ removeForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string): Promise<{
950
+ id: string;
951
+ } | null>;
952
+ values: {
953
+ listForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, query: import("@voyant-travel/custom-fields").CustomFieldValueListQuery) => Promise<{
954
+ data: import("@voyant-travel/custom-fields").CustomFieldValueRow[];
955
+ total: number;
956
+ limit: number;
957
+ offset: number;
958
+ }>;
959
+ upsertForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, definitionId: string, input: import("@voyant-travel/custom-fields").UpsertCustomFieldValueInput) => Promise<import("@voyant-travel/custom-fields").CustomFieldValueRow>;
960
+ deleteForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string) => Promise<{
961
+ id: string;
962
+ } | null>;
963
+ };
964
+ } | undefined>["values"]["listForOwner"]>[2]) => Promise<{
965
+ data: import("@voyant-travel/custom-fields").CustomFieldValueRow[];
966
+ total: number;
967
+ limit: number;
968
+ offset: number;
969
+ }>;
970
+ upsertCustomFieldValue: (db: PostgresJsDatabase, context: AppApiAccessContext, definitionId: string, input: Parameters<NonNullable<{
971
+ list(db: PostgresJsDatabase, query: import("@voyant-travel/custom-fields").CustomFieldDefinitionListQuery): Promise<{
972
+ data: {
973
+ id: string;
974
+ entityType: string;
975
+ namespace: string;
976
+ ownerKind: "platform" | "operator" | "app";
977
+ ownerId: string | null;
978
+ lifecycleState: "active" | "inactive" | "deprecated";
979
+ provenance: Record<string, unknown>;
980
+ key: string;
981
+ label: string;
982
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
983
+ isRequired: boolean;
984
+ isSearchable: boolean;
985
+ isExportable: boolean;
986
+ isInvoiceable: boolean;
987
+ options: {
988
+ label: string;
989
+ value: string;
990
+ }[] | null;
991
+ createdAt: Date;
992
+ updatedAt: Date;
993
+ }[];
994
+ total: number;
995
+ limit: number;
996
+ offset: number;
997
+ }>;
998
+ get(db: PostgresJsDatabase, id: string): Promise<{
999
+ id: string;
1000
+ entityType: string;
1001
+ namespace: string;
1002
+ ownerKind: "platform" | "operator" | "app";
1003
+ ownerId: string | null;
1004
+ lifecycleState: "active" | "inactive" | "deprecated";
1005
+ provenance: Record<string, unknown>;
1006
+ key: string;
1007
+ label: string;
1008
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
1009
+ isRequired: boolean;
1010
+ isSearchable: boolean;
1011
+ isExportable: boolean;
1012
+ isInvoiceable: boolean;
1013
+ options: {
1014
+ label: string;
1015
+ value: string;
1016
+ }[] | null;
1017
+ createdAt: Date;
1018
+ updatedAt: Date;
1019
+ } | null>;
1020
+ create(db: PostgresJsDatabase, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionInput): Promise<{
1021
+ id: string;
1022
+ namespace: string;
1023
+ label: string;
1024
+ entityType: string;
1025
+ ownerKind: "platform" | "operator" | "app";
1026
+ ownerId: string | null;
1027
+ lifecycleState: "active" | "inactive" | "deprecated";
1028
+ provenance: Record<string, unknown>;
1029
+ key: string;
1030
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
1031
+ isRequired: boolean;
1032
+ isSearchable: boolean;
1033
+ isExportable: boolean;
1034
+ isInvoiceable: boolean;
1035
+ options: {
1036
+ label: string;
1037
+ value: string;
1038
+ }[] | null;
1039
+ createdAt: Date;
1040
+ updatedAt: Date;
1041
+ }>;
1042
+ update(db: PostgresJsDatabase, id: string, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionUpdate): Promise<{
1043
+ id: string;
1044
+ entityType: string;
1045
+ namespace: string;
1046
+ ownerKind: "platform" | "operator" | "app";
1047
+ ownerId: string | null;
1048
+ lifecycleState: "active" | "inactive" | "deprecated";
1049
+ provenance: Record<string, unknown>;
1050
+ key: string;
1051
+ label: string;
1052
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
1053
+ isRequired: boolean;
1054
+ isSearchable: boolean;
1055
+ isExportable: boolean;
1056
+ isInvoiceable: boolean;
1057
+ options: {
1058
+ label: string;
1059
+ value: string;
1060
+ }[] | null;
1061
+ createdAt: Date;
1062
+ updatedAt: Date;
1063
+ } | null>;
1064
+ remove(db: PostgresJsDatabase, id: string): Promise<{
1065
+ id: string;
1066
+ } | null>;
1067
+ listForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, query: import("@voyant-travel/custom-fields").CustomFieldDefinitionListQuery): Promise<{
1068
+ data: {
1069
+ id: string;
1070
+ entityType: string;
1071
+ namespace: string;
1072
+ ownerKind: "platform" | "operator" | "app";
1073
+ ownerId: string | null;
1074
+ lifecycleState: "active" | "inactive" | "deprecated";
1075
+ provenance: Record<string, unknown>;
1076
+ key: string;
1077
+ label: string;
1078
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
1079
+ isRequired: boolean;
1080
+ isSearchable: boolean;
1081
+ isExportable: boolean;
1082
+ isInvoiceable: boolean;
1083
+ options: {
1084
+ label: string;
1085
+ value: string;
1086
+ }[] | null;
1087
+ createdAt: Date;
1088
+ updatedAt: Date;
1089
+ }[];
1090
+ total: number;
1091
+ limit: number;
1092
+ offset: number;
1093
+ }>;
1094
+ getForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string): Promise<{
1095
+ id: string;
1096
+ entityType: string;
1097
+ namespace: string;
1098
+ ownerKind: "platform" | "operator" | "app";
1099
+ ownerId: string | null;
1100
+ lifecycleState: "active" | "inactive" | "deprecated";
1101
+ provenance: Record<string, unknown>;
1102
+ key: string;
1103
+ label: string;
1104
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
1105
+ isRequired: boolean;
1106
+ isSearchable: boolean;
1107
+ isExportable: boolean;
1108
+ isInvoiceable: boolean;
1109
+ options: {
1110
+ label: string;
1111
+ value: string;
1112
+ }[] | null;
1113
+ createdAt: Date;
1114
+ updatedAt: Date;
1115
+ } | null>;
1116
+ createForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionInput): Promise<{
1117
+ id: string;
1118
+ namespace: string;
1119
+ label: string;
1120
+ entityType: string;
1121
+ ownerKind: "platform" | "operator" | "app";
1122
+ ownerId: string | null;
1123
+ lifecycleState: "active" | "inactive" | "deprecated";
1124
+ provenance: Record<string, unknown>;
1125
+ key: string;
1126
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
1127
+ isRequired: boolean;
1128
+ isSearchable: boolean;
1129
+ isExportable: boolean;
1130
+ isInvoiceable: boolean;
1131
+ options: {
1132
+ label: string;
1133
+ value: string;
1134
+ }[] | null;
1135
+ createdAt: Date;
1136
+ updatedAt: Date;
1137
+ }>;
1138
+ updateForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string, input: import("@voyant-travel/custom-fields").CustomFieldDefinitionUpdate): Promise<{
1139
+ id: string;
1140
+ entityType: string;
1141
+ namespace: string;
1142
+ ownerKind: "platform" | "operator" | "app";
1143
+ ownerId: string | null;
1144
+ lifecycleState: "active" | "inactive" | "deprecated";
1145
+ provenance: Record<string, unknown>;
1146
+ key: string;
1147
+ label: string;
1148
+ fieldType: "boolean" | "varchar" | "text" | "double" | "monetary" | "date" | "enum" | "set" | "json" | "address" | "phone";
1149
+ isRequired: boolean;
1150
+ isSearchable: boolean;
1151
+ isExportable: boolean;
1152
+ isInvoiceable: boolean;
1153
+ options: {
1154
+ label: string;
1155
+ value: string;
1156
+ }[] | null;
1157
+ createdAt: Date;
1158
+ updatedAt: Date;
1159
+ } | null>;
1160
+ removeForOwner(db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string): Promise<{
1161
+ id: string;
1162
+ } | null>;
1163
+ values: {
1164
+ listForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, query: import("@voyant-travel/custom-fields").CustomFieldValueListQuery) => Promise<{
1165
+ data: import("@voyant-travel/custom-fields").CustomFieldValueRow[];
1166
+ total: number;
1167
+ limit: number;
1168
+ offset: number;
1169
+ }>;
1170
+ upsertForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, definitionId: string, input: import("@voyant-travel/custom-fields").UpsertCustomFieldValueInput) => Promise<import("@voyant-travel/custom-fields").CustomFieldValueRow>;
1171
+ deleteForOwner: (db: PostgresJsDatabase, owner: CustomFieldDefinitionOwner, id: string) => Promise<{
1172
+ id: string;
1173
+ } | null>;
1174
+ };
1175
+ } | undefined>["values"]["upsertForOwner"]>[3]) => Promise<{
1176
+ data: import("@voyant-travel/custom-fields").CustomFieldValueRow;
1177
+ }>;
1178
+ listWebhookHealth: (db: PostgresJsDatabase, context: AppApiAccessContext) => Promise<{
1179
+ data: {
1180
+ id: string;
1181
+ installationId: string;
1182
+ releaseId: string;
1183
+ eventType: string;
1184
+ eventVersion: string;
1185
+ endpointUrl: string;
1186
+ status: "active" | "inactive" | "failed";
1187
+ externalSubscriptionId: string | null;
1188
+ signingKeyId: string | null;
1189
+ lastDeliveryAt: Date | null;
1190
+ failureCount: number;
1191
+ pausedAt: Date | null;
1192
+ installedAt: Date;
1193
+ deactivatedAt: Date | null;
1194
+ }[];
1195
+ }>;
1196
+ listAuditHistory: (db: PostgresJsDatabase, context: AppApiAccessContext, query: AppApiAuditQuery) => Promise<{
1197
+ data: {
1198
+ id: string;
1199
+ installationId: string | null;
1200
+ appId: string;
1201
+ deploymentId: string;
1202
+ actorId: string;
1203
+ kind: "lifecycle" | "grant" | "consent" | "credential" | "token" | "reconciliation" | "purge";
1204
+ action: string;
1205
+ details: Record<string, unknown>;
1206
+ createdAt: Date;
1207
+ }[];
1208
+ total: number;
1209
+ limit: number;
1210
+ offset: number;
1211
+ }>;
1212
+ requireAccess: (db: PostgresJsDatabase, context: AppApiAccessContext, requiredScopes: readonly string[]) => Promise<{
1213
+ installation: {
1214
+ id: string;
1215
+ appId: string;
1216
+ deploymentId: string;
1217
+ releaseId: string;
1218
+ status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
1219
+ namespace: string;
1220
+ installedBy: string;
1221
+ credentialGeneration: number;
1222
+ updatePolicy: "manual" | "compatible" | "patch" | "pinned";
1223
+ lastCompatibleReleaseCheckAt: Date | null;
1224
+ pendingReleaseId: string | null;
1225
+ pendingReason: string | null;
1226
+ installedAt: Date;
1227
+ authorizedAt: Date | null;
1228
+ activatedAt: Date | null;
1229
+ pausedAt: Date | null;
1230
+ degradedAt: Date | null;
1231
+ revokedAt: Date | null;
1232
+ uninstalledAt: Date | null;
1233
+ purgedAt: Date | null;
1234
+ createdAt: Date;
1235
+ updatedAt: Date;
1236
+ };
1237
+ release: {
1238
+ id: string;
1239
+ appId: string;
1240
+ releaseVersion: string;
1241
+ manifestSchemaVersion: string;
1242
+ manifestDigest: string;
1243
+ manifestSnapshot: Record<string, unknown>;
1244
+ normalizedRecord: Record<string, unknown>;
1245
+ apiCompatibility: {
1246
+ min: string;
1247
+ max: string;
1248
+ };
1249
+ defaultLocale: string;
1250
+ supportedLocales: string[];
1251
+ state: "suspended" | "available" | "yanked";
1252
+ createdBy: string;
1253
+ createdAt: Date;
1254
+ };
1255
+ }>;
1256
+ enforceRateLimit: (context: AppApiAccessContext) => void;
1257
+ };
1258
+ export declare function assertAppNamespaceAlias(namespace: string | undefined): void;
1259
+ export declare function assertCompatibleVersion(requested: string, range: {
1260
+ min: string;
1261
+ max: string;
1262
+ }): void;
1263
+ export declare function withAppApiDeadline<T>(promise: Promise<T>, timeoutMs?: number): Promise<T>;