@voyant-travel/apps 0.2.0 → 0.3.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.
- package/dist/access-boundary.d.ts +29 -0
- package/dist/access-boundary.js +33 -0
- package/dist/consent.d.ts +15 -0
- package/dist/consent.js +50 -0
- package/dist/consent.test.d.ts +1 -0
- package/dist/consent.test.js +80 -0
- package/dist/contracts.d.ts +79 -0
- package/dist/contracts.js +50 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -1
- package/dist/installation-reconciliation.d.ts +1 -1
- package/dist/installation-reconciliation.js +5 -1
- package/dist/installation-service.d.ts +12 -1
- package/dist/installation-service.js +22 -7
- package/dist/oauth-crypto.d.ts +8 -0
- package/dist/oauth-crypto.js +23 -0
- package/dist/oauth-crypto.test.d.ts +1 -0
- package/dist/oauth-crypto.test.js +11 -0
- package/dist/oauth-service.d.ts +66 -0
- package/dist/oauth-service.js +398 -0
- package/dist/oauth-service.test.d.ts +1 -0
- package/dist/oauth-service.test.js +60 -0
- package/dist/routes.d.ts +8 -1
- package/dist/routes.js +70 -1
- package/dist/schema.d.ts +536 -4
- package/dist/schema.js +52 -1
- package/dist/service.d.ts +16 -16
- package/migrations/20260717143000_app_oauth_authorization.sql +47 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +24 -3
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";
|
|
11
14
|
ownerId: string;
|
|
12
15
|
displayName: string;
|
|
13
16
|
slug: string;
|
|
14
|
-
createdBy: string;
|
|
15
|
-
distribution: "custom" | "marketplace";
|
|
16
|
-
id: string;
|
|
17
|
-
platformNamespace: string;
|
|
18
17
|
lifecycleState: "active" | "suspended" | "deleted";
|
|
18
|
+
createdBy: string;
|
|
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
|
-
releaseVersion: string;
|
|
54
|
-
apiCompatibility: {
|
|
55
|
-
min: string;
|
|
56
|
-
max: string;
|
|
57
|
-
};
|
|
58
|
-
createdBy: string;
|
|
59
53
|
id: string;
|
|
54
|
+
createdBy: string;
|
|
60
55
|
createdAt: Date;
|
|
61
56
|
appId: string;
|
|
57
|
+
releaseVersion: string;
|
|
62
58
|
manifestSchemaVersion: string;
|
|
63
59
|
manifestDigest: string;
|
|
64
60
|
manifestSnapshot: Record<string, unknown>;
|
|
65
61
|
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
|
-
releaseVersion: string;
|
|
76
|
-
apiCompatibility: {
|
|
77
|
-
min: string;
|
|
78
|
-
max: string;
|
|
79
|
-
};
|
|
80
|
-
createdBy: string;
|
|
81
75
|
id: string;
|
|
76
|
+
createdBy: string;
|
|
82
77
|
createdAt: Date;
|
|
83
78
|
appId: string;
|
|
79
|
+
releaseVersion: string;
|
|
84
80
|
manifestSchemaVersion: string;
|
|
85
81
|
manifestDigest: string;
|
|
86
82
|
manifestSnapshot: Record<string, unknown>;
|
|
87
83
|
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";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
ALTER TYPE "public"."app_audit_event_kind" ADD VALUE IF NOT EXISTS 'consent';--> statement-breakpoint
|
|
2
|
+
ALTER TYPE "public"."app_audit_event_kind" ADD VALUE IF NOT EXISTS 'token';--> statement-breakpoint
|
|
3
|
+
CREATE TYPE "public"."app_access_token_mode" AS ENUM('offline', 'online');--> statement-breakpoint
|
|
4
|
+
ALTER TABLE "app_installations" ADD COLUMN "credential_generation" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
|
5
|
+
ALTER TABLE "app_access_credentials" ADD COLUMN "token_mode" "app_access_token_mode" DEFAULT 'offline' NOT NULL;--> statement-breakpoint
|
|
6
|
+
ALTER TABLE "app_access_credentials" ADD COLUMN "actor_id" text;--> statement-breakpoint
|
|
7
|
+
ALTER TABLE "app_access_credentials" ADD COLUMN "viewer_id" text;--> statement-breakpoint
|
|
8
|
+
DROP INDEX "public"."uidx_app_access_credentials_generation";--> statement-breakpoint
|
|
9
|
+
CREATE INDEX "idx_app_access_credentials_generation" ON "app_access_credentials" USING btree ("installation_id","token_mode","generation");--> statement-breakpoint
|
|
10
|
+
CREATE TABLE "app_oauth_authorization_codes" (
|
|
11
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
12
|
+
"app_id" text NOT NULL,
|
|
13
|
+
"installation_id" text NOT NULL,
|
|
14
|
+
"release_id" text NOT NULL,
|
|
15
|
+
"deployment_id" text NOT NULL,
|
|
16
|
+
"code_hash" text NOT NULL,
|
|
17
|
+
"state_hash" text NOT NULL,
|
|
18
|
+
"redirect_uri" text NOT NULL,
|
|
19
|
+
"code_challenge" text NOT NULL,
|
|
20
|
+
"code_challenge_method" text NOT NULL,
|
|
21
|
+
"requested_scopes" jsonb NOT NULL,
|
|
22
|
+
"granted_scopes" jsonb NOT NULL,
|
|
23
|
+
"denied_optional_scopes" jsonb NOT NULL,
|
|
24
|
+
"actor_id" text NOT NULL,
|
|
25
|
+
"expires_at" timestamp with time zone NOT NULL,
|
|
26
|
+
"consumed_at" timestamp with time zone,
|
|
27
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
28
|
+
);--> statement-breakpoint
|
|
29
|
+
CREATE TABLE "app_oauth_refresh_tokens" (
|
|
30
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
31
|
+
"installation_id" text NOT NULL,
|
|
32
|
+
"token_hash" text NOT NULL,
|
|
33
|
+
"generation" integer NOT NULL,
|
|
34
|
+
"status" "app_access_credential_status" DEFAULT 'active' NOT NULL,
|
|
35
|
+
"rotated_from_id" text,
|
|
36
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
37
|
+
"expires_at" timestamp with time zone,
|
|
38
|
+
"revoked_at" timestamp with time zone
|
|
39
|
+
);--> statement-breakpoint
|
|
40
|
+
ALTER TABLE "app_oauth_authorization_codes" ADD CONSTRAINT "app_oauth_authorization_codes_app_id_apps_id_fk" FOREIGN KEY ("app_id") REFERENCES "public"."apps"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
41
|
+
ALTER TABLE "app_oauth_authorization_codes" ADD CONSTRAINT "app_oauth_authorization_codes_installation_id_app_installations_id_fk" FOREIGN KEY ("installation_id") REFERENCES "public"."app_installations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
42
|
+
ALTER TABLE "app_oauth_authorization_codes" ADD CONSTRAINT "app_oauth_authorization_codes_release_id_app_releases_id_fk" FOREIGN KEY ("release_id") REFERENCES "public"."app_releases"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
43
|
+
ALTER TABLE "app_oauth_refresh_tokens" ADD CONSTRAINT "app_oauth_refresh_tokens_installation_id_app_installations_id_fk" FOREIGN KEY ("installation_id") REFERENCES "public"."app_installations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
44
|
+
CREATE UNIQUE INDEX "uidx_app_oauth_codes_hash" ON "app_oauth_authorization_codes" USING btree ("code_hash");--> statement-breakpoint
|
|
45
|
+
CREATE INDEX "idx_app_oauth_codes_installation" ON "app_oauth_authorization_codes" USING btree ("installation_id","expires_at");--> statement-breakpoint
|
|
46
|
+
CREATE UNIQUE INDEX "uidx_app_oauth_refresh_tokens_hash" ON "app_oauth_refresh_tokens" USING btree ("token_hash");--> statement-breakpoint
|
|
47
|
+
CREATE INDEX "idx_app_oauth_refresh_tokens_installation" ON "app_oauth_refresh_tokens" USING btree ("installation_id","status");
|
|
@@ -22,6 +22,13 @@
|
|
|
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
|
|
25
32
|
}
|
|
26
33
|
]
|
|
27
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/apps",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"import": "./dist/index.js",
|
|
10
10
|
"default": "./dist/index.js"
|
|
11
11
|
},
|
|
12
|
+
"./access-boundary": {
|
|
13
|
+
"types": "./dist/access-boundary.d.ts",
|
|
14
|
+
"import": "./dist/access-boundary.js",
|
|
15
|
+
"default": "./dist/access-boundary.js"
|
|
16
|
+
},
|
|
12
17
|
"./api-runtime": {
|
|
13
18
|
"types": "./dist/api-runtime.d.ts",
|
|
14
19
|
"import": "./dist/api-runtime.js",
|
|
@@ -24,6 +29,11 @@
|
|
|
24
29
|
"import": "./dist/contracts.js",
|
|
25
30
|
"default": "./dist/contracts.js"
|
|
26
31
|
},
|
|
32
|
+
"./consent": {
|
|
33
|
+
"types": "./dist/consent.d.ts",
|
|
34
|
+
"import": "./dist/consent.js",
|
|
35
|
+
"default": "./dist/consent.js"
|
|
36
|
+
},
|
|
27
37
|
"./ingestion": {
|
|
28
38
|
"types": "./dist/ingestion.d.ts",
|
|
29
39
|
"import": "./dist/ingestion.js",
|
|
@@ -34,6 +44,16 @@
|
|
|
34
44
|
"import": "./dist/installation-service.js",
|
|
35
45
|
"default": "./dist/installation-service.js"
|
|
36
46
|
},
|
|
47
|
+
"./oauth-crypto": {
|
|
48
|
+
"types": "./dist/oauth-crypto.d.ts",
|
|
49
|
+
"import": "./dist/oauth-crypto.js",
|
|
50
|
+
"default": "./dist/oauth-crypto.js"
|
|
51
|
+
},
|
|
52
|
+
"./oauth-service": {
|
|
53
|
+
"types": "./dist/oauth-service.d.ts",
|
|
54
|
+
"import": "./dist/oauth-service.js",
|
|
55
|
+
"default": "./dist/oauth-service.js"
|
|
56
|
+
},
|
|
37
57
|
"./routes": {
|
|
38
58
|
"types": "./dist/routes.d.ts",
|
|
39
59
|
"import": "./dist/routes.js",
|
|
@@ -61,12 +81,13 @@
|
|
|
61
81
|
"hono": "^4.12.27",
|
|
62
82
|
"zod": "^4.4.3",
|
|
63
83
|
"@voyant-travel/admin": "^0.126.2",
|
|
84
|
+
"@voyant-travel/core": "^0.125.1",
|
|
64
85
|
"@voyant-travel/admin-extension-sdk": "^0.1.1",
|
|
65
|
-
"@voyant-travel/core": "^0.125.0",
|
|
66
86
|
"@voyant-travel/custom-fields": "^0.2.1",
|
|
67
87
|
"@voyant-travel/db": "^0.114.10",
|
|
88
|
+
"@voyant-travel/types": "^0.109.3",
|
|
68
89
|
"@voyant-travel/webhook-delivery": "^0.4.0",
|
|
69
|
-
"@voyant-travel/hono": "^0.128.
|
|
90
|
+
"@voyant-travel/hono": "^0.128.2"
|
|
70
91
|
},
|
|
71
92
|
"devDependencies": {
|
|
72
93
|
"@types/node": "^25.5.2",
|