@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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may accept and charge a
167
+ fee for, the acceptance of support, warranty, indemnity, or
168
+ other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 PixelMakers Studio SRL
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -8,14 +8,14 @@ export declare const appOwnedCustomFieldDeclarationSchema: z.ZodObject<{
8
8
  label: z.ZodString;
9
9
  fieldType: z.ZodEnum<{
10
10
  boolean: "boolean";
11
- text: "text";
12
- date: "date";
13
- monetary: "monetary";
14
- json: "json";
15
11
  varchar: "varchar";
12
+ text: "text";
16
13
  double: "double";
14
+ monetary: "monetary";
15
+ date: "date";
17
16
  enum: "enum";
18
17
  set: "set";
18
+ json: "json";
19
19
  address: "address";
20
20
  phone: "phone";
21
21
  }>;
@@ -85,14 +85,14 @@ export declare const appManifestSchema: z.ZodPipe<z.ZodRecord<z.ZodString, z.Zod
85
85
  label: z.ZodString;
86
86
  fieldType: z.ZodEnum<{
87
87
  boolean: "boolean";
88
- text: "text";
89
- date: "date";
90
- monetary: "monetary";
91
- json: "json";
92
88
  varchar: "varchar";
89
+ text: "text";
93
90
  double: "double";
91
+ monetary: "monetary";
92
+ date: "date";
94
93
  enum: "enum";
95
94
  set: "set";
95
+ json: "json";
96
96
  address: "address";
97
97
  phone: "phone";
98
98
  }>;
@@ -176,88 +176,9 @@ export declare const appWebhookReplaySchema: z.ZodObject<{
176
176
  signingKeyId: z.ZodString;
177
177
  signingSecret: z.ZodString;
178
178
  }, z.core.$strict>;
179
- export declare const appOAuthAuthorizeQuerySchema: z.ZodObject<{
180
- response_type: z.ZodLiteral<"code">;
181
- client_id: z.ZodString;
182
- release_id: z.ZodString;
183
- redirect_uri: z.ZodString;
184
- state: z.ZodString;
185
- code_challenge: z.ZodString;
186
- code_challenge_method: z.ZodLiteral<"S256">;
187
- actor_id: z.ZodString;
188
- operator_scopes: z.ZodDefault<z.ZodString>;
189
- optional_scopes: z.ZodDefault<z.ZodString>;
190
- }, z.core.$strict>;
191
- export declare const appOAuthTokenSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
192
- grant_type: z.ZodLiteral<"authorization_code">;
193
- code: z.ZodString;
194
- redirect_uri: z.ZodString;
195
- code_verifier: z.ZodString;
196
- client_id: z.ZodString;
197
- client_secret: z.ZodOptional<z.ZodString>;
198
- }, z.core.$strip>, z.ZodObject<{
199
- grant_type: z.ZodLiteral<"refresh_token">;
200
- refresh_token: z.ZodString;
201
- client_id: z.ZodString;
202
- client_secret: z.ZodOptional<z.ZodString>;
203
- }, z.core.$strip>, z.ZodObject<{
204
- grant_type: z.ZodLiteral<"urn:voyant:params:oauth:grant-type:actor-token-exchange">;
205
- installation_id: z.ZodString;
206
- viewer_id: z.ZodString;
207
- viewer_scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
208
- contextual_scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
209
- client_id: z.ZodString;
210
- client_secret: z.ZodOptional<z.ZodString>;
211
- }, z.core.$strip>], "grant_type">, z.ZodTransform<{
212
- client_secret: string | undefined;
213
- grant_type: "authorization_code";
214
- code: string;
215
- redirect_uri: string;
216
- code_verifier: string;
217
- client_id: string;
218
- } | {
219
- client_secret: string | undefined;
220
- grant_type: "refresh_token";
221
- refresh_token: string;
222
- client_id: string;
223
- } | {
224
- client_secret: string | undefined;
225
- grant_type: "urn:voyant:params:oauth:grant-type:actor-token-exchange";
226
- installation_id: string;
227
- viewer_id: string;
228
- viewer_scopes: string[];
229
- client_id: string;
230
- contextual_scopes?: string[] | undefined;
231
- }, {
232
- grant_type: "authorization_code";
233
- code: string;
234
- redirect_uri: string;
235
- code_verifier: string;
236
- client_id: string;
237
- client_secret?: string | undefined;
238
- } | {
239
- grant_type: "refresh_token";
240
- refresh_token: string;
241
- client_id: string;
242
- client_secret?: string | undefined;
243
- } | {
244
- grant_type: "urn:voyant:params:oauth:grant-type:actor-token-exchange";
245
- installation_id: string;
246
- viewer_id: string;
247
- viewer_scopes: string[];
248
- client_id: string;
249
- contextual_scopes?: string[] | undefined;
250
- client_secret?: string | undefined;
251
- }>>;
252
- export declare const appCredentialRevocationSchema: z.ZodObject<{
253
- installationId: z.ZodString;
254
- actorId: z.ZodString;
255
- }, z.core.$strict>;
256
179
  export type AppManifest = z.infer<typeof appManifestSchema>;
257
180
  export type CreateCustomAppRegistrationInput = z.infer<typeof createCustomAppRegistrationSchema>;
258
181
  export type ReleaseManifestUploadInput = z.infer<typeof releaseManifestUploadSchema>;
259
182
  export type ReleaseManifestFetchInput = z.infer<typeof releaseManifestFetchSchema>;
260
183
  export type AppListQuery = z.infer<typeof appListQuerySchema>;
261
184
  export type AppWebhookReplayInput = z.infer<typeof appWebhookReplaySchema>;
262
- export type AppOAuthAuthorizeQuery = z.infer<typeof appOAuthAuthorizeQuerySchema>;
263
- export type AppOAuthTokenInput = z.infer<typeof appOAuthTokenSchema>;
package/dist/contracts.js CHANGED
@@ -221,53 +221,3 @@ export const appWebhookReplaySchema = z
221
221
  signingSecret: z.string().min(32),
222
222
  })
223
223
  .strict();
224
- export const appOAuthAuthorizeQuerySchema = z
225
- .object({
226
- response_type: z.literal("code"),
227
- client_id: z.string().trim().min(1),
228
- release_id: z.string().trim().min(1),
229
- redirect_uri: z.string().url(),
230
- state: z.string().trim().min(1),
231
- code_challenge: z.string().trim().min(1),
232
- code_challenge_method: z.literal("S256"),
233
- actor_id: z.string().trim().min(1),
234
- operator_scopes: z.string().trim().default(""),
235
- optional_scopes: z.string().trim().default(""),
236
- })
237
- .strict();
238
- export const appOAuthTokenSchema = z
239
- .discriminatedUnion("grant_type", [
240
- z.object({
241
- grant_type: z.literal("authorization_code"),
242
- code: z.string().trim().min(1),
243
- redirect_uri: z.string().url(),
244
- code_verifier: z.string().trim().min(43).max(128),
245
- client_id: z.string().trim().min(1),
246
- client_secret: z.string().trim().optional(),
247
- }),
248
- z.object({
249
- grant_type: z.literal("refresh_token"),
250
- refresh_token: z.string().trim().min(1),
251
- client_id: z.string().trim().min(1),
252
- client_secret: z.string().trim().optional(),
253
- }),
254
- z.object({
255
- grant_type: z.literal("urn:voyant:params:oauth:grant-type:actor-token-exchange"),
256
- installation_id: z.string().trim().min(1),
257
- viewer_id: z.string().trim().min(1),
258
- viewer_scopes: z.array(scopeSchema).default([]),
259
- contextual_scopes: z.array(scopeSchema).optional(),
260
- client_id: z.string().trim().min(1),
261
- client_secret: z.string().trim().optional(),
262
- }),
263
- ])
264
- .transform((input) => ({
265
- ...input,
266
- client_secret: input.client_secret?.trim() || undefined,
267
- }));
268
- export const appCredentialRevocationSchema = z
269
- .object({
270
- installationId: z.string().trim().min(1),
271
- actorId: z.string().trim().min(1),
272
- })
273
- .strict();
package/dist/index.d.ts CHANGED
@@ -1,13 +1,9 @@
1
- export * from "./access-boundary.js";
2
1
  export * from "./compiler.js";
3
- export * from "./consent.js";
4
2
  export * from "./contracts.js";
5
3
  export * from "./ingestion.js";
6
4
  export * from "./installation-service.js";
7
- export * from "./oauth-crypto.js";
8
- export * from "./oauth-service.js";
9
5
  export { createAppsAdminRoutes } from "./routes.js";
10
- export { appAccessCredentialStatusEnum, appAccessCredentials, appAccessTokenModeEnum, appAuditEventKindEnum, appAuditEvents, appCredentialKindEnum, appCredentials, appDistributionEnum, appExtensionInstallations, appGrantStatusEnum, appGrants, appInstallationRegistrationStatusEnum, appInstallationSettings, appInstallationStatusEnum, appInstallations, appInstallationUpdatePolicyEnum, appLifecycleStateEnum, appOAuthAuthorizationCodes, appOAuthRefreshTokens, appRedirectUris, appReleaseArtifactStateEnum, appReleaseArtifacts, appReleaseLocalizations, appReleaseStateEnum, appReleases, appSecretReferences, apps, appWebhookSubscriptionStatusEnum, appWebhookSubscriptions, } from "./schema.js";
6
+ export { appAccessCredentialStatusEnum, appAccessCredentials, appAuditEventKindEnum, appAuditEvents, appCredentialKindEnum, appCredentials, appDistributionEnum, appExtensionInstallations, appGrantStatusEnum, appGrants, appInstallationRegistrationStatusEnum, appInstallationSettings, appInstallationStatusEnum, appInstallations, appInstallationUpdatePolicyEnum, appLifecycleStateEnum, appRedirectUris, appReleaseArtifactStateEnum, appReleaseArtifacts, appReleaseLocalizations, appReleaseStateEnum, appReleases, appSecretReferences, apps, appWebhookSubscriptionStatusEnum, appWebhookSubscriptions, } from "./schema.js";
11
7
  export { createAppsService } from "./service.js";
12
8
  export type { AppWebhookDeliveryOptions } from "./webhook-delivery.js";
13
9
  export { createAppWebhookDeliveryStore, createAppWebhookEventQueue, enqueueAppWebhookEvent, listAppWebhookHealth, replayAppWebhookDelivery, } from "./webhook-delivery.js";
package/dist/index.js CHANGED
@@ -1,12 +1,8 @@
1
- export * from "./access-boundary.js";
2
1
  export * from "./compiler.js";
3
- export * from "./consent.js";
4
2
  export * from "./contracts.js";
5
3
  export * from "./ingestion.js";
6
4
  export * from "./installation-service.js";
7
- export * from "./oauth-crypto.js";
8
- export * from "./oauth-service.js";
9
5
  export { createAppsAdminRoutes } from "./routes.js";
10
- export { appAccessCredentialStatusEnum, appAccessCredentials, appAccessTokenModeEnum, appAuditEventKindEnum, appAuditEvents, appCredentialKindEnum, appCredentials, appDistributionEnum, appExtensionInstallations, appGrantStatusEnum, appGrants, appInstallationRegistrationStatusEnum, appInstallationSettings, appInstallationStatusEnum, appInstallations, appInstallationUpdatePolicyEnum, appLifecycleStateEnum, appOAuthAuthorizationCodes, appOAuthRefreshTokens, appRedirectUris, appReleaseArtifactStateEnum, appReleaseArtifacts, appReleaseLocalizations, appReleaseStateEnum, appReleases, appSecretReferences, apps, appWebhookSubscriptionStatusEnum, appWebhookSubscriptions, } from "./schema.js";
6
+ export { appAccessCredentialStatusEnum, appAccessCredentials, appAuditEventKindEnum, appAuditEvents, appCredentialKindEnum, appCredentials, appDistributionEnum, appExtensionInstallations, appGrantStatusEnum, appGrants, appInstallationRegistrationStatusEnum, appInstallationSettings, appInstallationStatusEnum, appInstallations, appInstallationUpdatePolicyEnum, appLifecycleStateEnum, appRedirectUris, appReleaseArtifactStateEnum, appReleaseArtifacts, appReleaseLocalizations, appReleaseStateEnum, appReleases, appSecretReferences, apps, appWebhookSubscriptionStatusEnum, appWebhookSubscriptions, } from "./schema.js";
11
7
  export { createAppsService } from "./service.js";
12
8
  export { createAppWebhookDeliveryStore, createAppWebhookEventQueue, enqueueAppWebhookEvent, listAppWebhookHealth, replayAppWebhookDelivery, } from "./webhook-delivery.js";
@@ -14,5 +14,5 @@ export declare function deactivateRuntimeState(db: PostgresJsDatabase, installat
14
14
  export declare function deactivateResolvedRegistrations(db: PostgresJsDatabase, installation: AppInstallation): Promise<void>;
15
15
  export declare function markAppDefinitionsInactive(db: PostgresJsDatabase, installation: AppInstallation, actorId: string): Promise<void>;
16
16
  export declare function countInstallationRows(db: PostgresJsDatabase, table: typeof appGrants | typeof appAccessCredentials | typeof appExtensionInstallations | typeof appWebhookSubscriptions, installationId: string): Promise<number>;
17
- export declare function audit(db: PostgresJsDatabase, installation: AppInstallation, actorId: string, kind: "lifecycle" | "grant" | "consent" | "credential" | "token" | "reconciliation" | "purge", action: string, details: Record<string, unknown>): Promise<void>;
17
+ export declare function audit(db: PostgresJsDatabase, installation: AppInstallation, actorId: string, kind: "lifecycle" | "grant" | "credential" | "reconciliation" | "purge", action: string, details: Record<string, unknown>): Promise<void>;
18
18
  export {};
@@ -1,7 +1,7 @@
1
1
  import { createAppCustomFieldDefinitionOwner, customFieldDefinitions, } from "@voyant-travel/custom-fields";
2
2
  import { ApiHttpError } from "@voyant-travel/hono";
3
3
  import { and, eq, sql } from "drizzle-orm";
4
- import { appAccessCredentials, appAuditEvents, appExtensionInstallations, appGrants, appOAuthRefreshTokens, appWebhookSubscriptions, } from "./schema.js";
4
+ import { appAccessCredentials, appAuditEvents, appExtensionInstallations, appGrants, appWebhookSubscriptions, } from "./schema.js";
5
5
  export async function reconcileRelease(db, installation, release, actorId, action, options) {
6
6
  const normalized = parseNormalizedRelease(release.normalizedRecord);
7
7
  await reconcileCustomFields(db, installation, release, normalized, actorId, options);
@@ -78,10 +78,6 @@ export async function deactivateRuntimeState(db, installation) {
78
78
  .update(appAccessCredentials)
79
79
  .set({ status: "inactive", deactivatedAt: now })
80
80
  .where(eq(appAccessCredentials.installationId, installation.id));
81
- await db
82
- .update(appOAuthRefreshTokens)
83
- .set({ status: "revoked", revokedAt: now })
84
- .where(eq(appOAuthRefreshTokens.installationId, installation.id));
85
81
  await deactivateResolvedRegistrations(db, installation);
86
82
  }
87
83
  export async function deactivateResolvedRegistrations(db, installation) {
@@ -58,8 +58,7 @@ export declare function createAppInstallationService(options?: AppInstallationSe
58
58
  status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
59
59
  namespace: string;
60
60
  installedBy: string;
61
- credentialGeneration: number;
62
- updatePolicy: "patch" | "manual" | "compatible" | "pinned";
61
+ updatePolicy: "manual" | "compatible" | "patch" | "pinned";
63
62
  lastCompatibleReleaseCheckAt: Date | null;
64
63
  pendingReleaseId: string | null;
65
64
  pendingReason: string | null;
@@ -77,17 +76,16 @@ export declare function createAppInstallationService(options?: AppInstallationSe
77
76
  outcome: "unchanged";
78
77
  } | {
79
78
  installation: {
80
- appId: string;
81
- deploymentId: string;
79
+ status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
82
80
  id: string;
83
81
  createdAt: Date;
84
82
  updatedAt: Date;
83
+ appId: string;
85
84
  releaseId: string;
86
- status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
85
+ deploymentId: string;
87
86
  namespace: string;
88
87
  installedBy: string;
89
- credentialGeneration: number;
90
- updatePolicy: "patch" | "manual" | "compatible" | "pinned";
88
+ updatePolicy: "manual" | "compatible" | "patch" | "pinned";
91
89
  lastCompatibleReleaseCheckAt: Date | null;
92
90
  pendingReleaseId: string | null;
93
91
  pendingReason: string | null;
@@ -111,8 +109,7 @@ export declare function createAppInstallationService(options?: AppInstallationSe
111
109
  status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
112
110
  namespace: string;
113
111
  installedBy: string;
114
- credentialGeneration: number;
115
- updatePolicy: "patch" | "manual" | "compatible" | "pinned";
112
+ updatePolicy: "manual" | "compatible" | "patch" | "pinned";
116
113
  lastCompatibleReleaseCheckAt: Date | null;
117
114
  pendingReleaseId: string | null;
118
115
  pendingReason: string | null;
@@ -138,8 +135,7 @@ export declare function createAppInstallationService(options?: AppInstallationSe
138
135
  status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
139
136
  namespace: string;
140
137
  installedBy: string;
141
- credentialGeneration: number;
142
- updatePolicy: "patch" | "manual" | "compatible" | "pinned";
138
+ updatePolicy: "manual" | "compatible" | "patch" | "pinned";
143
139
  lastCompatibleReleaseCheckAt: Date | null;
144
140
  pendingReleaseId: string | null;
145
141
  pendingReason: string | null;
@@ -166,8 +162,7 @@ export declare function createAppInstallationService(options?: AppInstallationSe
166
162
  status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
167
163
  namespace: string;
168
164
  installedBy: string;
169
- credentialGeneration: number;
170
- updatePolicy: "patch" | "manual" | "compatible" | "pinned";
165
+ updatePolicy: "manual" | "compatible" | "patch" | "pinned";
171
166
  lastCompatibleReleaseCheckAt: Date | null;
172
167
  pendingReleaseId: string | null;
173
168
  pendingReason: string | null;
@@ -192,8 +187,7 @@ export declare function createAppInstallationService(options?: AppInstallationSe
192
187
  status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
193
188
  namespace: string;
194
189
  installedBy: string;
195
- credentialGeneration: number;
196
- updatePolicy: "patch" | "manual" | "compatible" | "pinned";
190
+ updatePolicy: "manual" | "compatible" | "patch" | "pinned";
197
191
  lastCompatibleReleaseCheckAt: Date | null;
198
192
  pendingReleaseId: string | null;
199
193
  pendingReason: string | null;
@@ -219,8 +213,7 @@ export declare function createAppInstallationService(options?: AppInstallationSe
219
213
  status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
220
214
  namespace: string;
221
215
  installedBy: string;
222
- credentialGeneration: number;
223
- updatePolicy: "patch" | "manual" | "compatible" | "pinned";
216
+ updatePolicy: "manual" | "compatible" | "patch" | "pinned";
224
217
  lastCompatibleReleaseCheckAt: Date | null;
225
218
  pendingReleaseId: string | null;
226
219
  pendingReason: string | null;
@@ -245,8 +238,7 @@ export declare function createAppInstallationService(options?: AppInstallationSe
245
238
  status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
246
239
  namespace: string;
247
240
  installedBy: string;
248
- credentialGeneration: number;
249
- updatePolicy: "patch" | "manual" | "compatible" | "pinned";
241
+ updatePolicy: "manual" | "compatible" | "patch" | "pinned";
250
242
  lastCompatibleReleaseCheckAt: Date | null;
251
243
  pendingReleaseId: string | null;
252
244
  pendingReason: string | null;
@@ -272,8 +264,7 @@ export declare function createAppInstallationService(options?: AppInstallationSe
272
264
  status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
273
265
  namespace: string;
274
266
  installedBy: string;
275
- credentialGeneration: number;
276
- updatePolicy: "patch" | "manual" | "compatible" | "pinned";
267
+ updatePolicy: "manual" | "compatible" | "patch" | "pinned";
277
268
  lastCompatibleReleaseCheckAt: Date | null;
278
269
  pendingReleaseId: string | null;
279
270
  pendingReason: string | null;
@@ -298,8 +289,7 @@ export declare function createAppInstallationService(options?: AppInstallationSe
298
289
  status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
299
290
  namespace: string;
300
291
  installedBy: string;
301
- credentialGeneration: number;
302
- updatePolicy: "patch" | "manual" | "compatible" | "pinned";
292
+ updatePolicy: "manual" | "compatible" | "patch" | "pinned";
303
293
  lastCompatibleReleaseCheckAt: Date | null;
304
294
  pendingReleaseId: string | null;
305
295
  pendingReason: string | null;
@@ -325,8 +315,7 @@ export declare function createAppInstallationService(options?: AppInstallationSe
325
315
  status: "active" | "pending" | "authorizing" | "paused" | "degraded" | "revoked" | "uninstalled";
326
316
  namespace: string;
327
317
  installedBy: string;
328
- credentialGeneration: number;
329
- updatePolicy: "patch" | "manual" | "compatible" | "pinned";
318
+ updatePolicy: "manual" | "compatible" | "patch" | "pinned";
330
319
  lastCompatibleReleaseCheckAt: Date | null;
331
320
  pendingReleaseId: string | null;
332
321
  pendingReason: string | null;
@@ -1,5 +1,5 @@
1
1
  import { ApiHttpError } from "@voyant-travel/hono";
2
- import { and, eq, sql } from "drizzle-orm";
2
+ import { and, eq } from "drizzle-orm";
3
3
  import { audit, countInstallationRows, deactivateResolvedRegistrations, deactivateRuntimeState, markAppDefinitionsInactive, newlyRequiredScopes, reconcileGrants, reconcileRelease, rotateCredential, } from "./installation-reconciliation.js";
4
4
  import { canInstallOver, invalidTransition, planLifecycleTransition } from "./installation-state.js";
5
5
  import { appAccessCredentials, appExtensionInstallations, appGrants, appInstallations, appReleases, apps, appWebhookSubscriptions, } from "./schema.js";
@@ -295,29 +295,14 @@ function lifecyclePatch(to, now) {
295
295
  const base = { status: to, updatedAt: now };
296
296
  if (to === "active")
297
297
  return { ...base, activatedAt: now };
298
- if (to === "paused") {
299
- return {
300
- ...base,
301
- pausedAt: now,
302
- credentialGeneration: sql `${appInstallations.credentialGeneration} + 1`,
303
- };
304
- }
298
+ if (to === "paused")
299
+ return { ...base, pausedAt: now };
305
300
  if (to === "degraded")
306
301
  return { ...base, degradedAt: now };
307
- if (to === "revoked") {
308
- return {
309
- ...base,
310
- revokedAt: now,
311
- credentialGeneration: sql `${appInstallations.credentialGeneration} + 1`,
312
- };
313
- }
314
- if (to === "uninstalled") {
315
- return {
316
- ...base,
317
- uninstalledAt: now,
318
- credentialGeneration: sql `${appInstallations.credentialGeneration} + 1`,
319
- };
320
- }
302
+ if (to === "revoked")
303
+ return { ...base, revokedAt: now };
304
+ if (to === "uninstalled")
305
+ return { ...base, uninstalledAt: now };
321
306
  return base;
322
307
  }
323
308
  function writeFailed() {
package/dist/routes.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type { AccessCatalog } from "@voyant-travel/types/api-keys";
2
1
  import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
3
2
  import { Hono } from "hono";
4
3
  import { type AppsServiceOptions } from "./service.js";
@@ -7,11 +6,5 @@ type Env = {
7
6
  db: PostgresJsDatabase;
8
7
  };
9
8
  };
10
- export interface AppsAdminRouteOptions extends AppsServiceOptions {
11
- oauth?: {
12
- accessCatalog: AccessCatalog;
13
- deploymentId: string;
14
- };
15
- }
16
- export declare function createAppsAdminRoutes(options?: AppsAdminRouteOptions): Hono<Env, import("hono/types").BlankSchema, "/">;
9
+ export declare function createAppsAdminRoutes(options?: AppsServiceOptions): Hono<Env, import("hono/types").BlankSchema, "/">;
17
10
  export {};