@antcde/connect-ts 0.4.26 → 0.4.27-rc.10
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/README.md +67 -3
- package/build/AntConnect.d.ts +8 -0
- package/build/AntConnect.d.ts.map +1 -1
- package/build/AntConnect.js +8 -0
- package/build/AntHttpClient.d.ts +0 -5
- package/build/AntHttpClient.d.ts.map +1 -1
- package/build/AntHttpClient.js +0 -5
- package/build/ai/index.d.ts +5 -0
- package/build/ai/index.d.ts.map +1 -0
- package/build/ai/index.js +3 -0
- package/build/ai/mutationDescriptors.d.ts +3 -0
- package/build/ai/mutationDescriptors.d.ts.map +1 -0
- package/build/ai/mutationDescriptors.js +207 -0
- package/build/ai/mutationTargets.d.ts +21 -0
- package/build/ai/mutationTargets.d.ts.map +1 -0
- package/build/ai/mutationTargets.js +72 -0
- package/build/ai/queryDescriptors.d.ts +3 -0
- package/build/ai/queryDescriptors.d.ts.map +1 -0
- package/build/ai/queryDescriptors.js +174 -0
- package/build/ai/types.d.ts +35 -0
- package/build/ai/types.d.ts.map +1 -0
- package/build/comms/client.d.ts.map +1 -1
- package/build/comms/client.js +39 -41
- package/build/comms/connection.d.ts +32 -0
- package/build/comms/connection.d.ts.map +1 -0
- package/build/comms/connection.js +159 -0
- package/build/comms/handshake.d.ts +16 -0
- package/build/comms/handshake.d.ts.map +1 -0
- package/build/comms/handshake.js +73 -0
- package/build/comms/host.d.ts.map +1 -1
- package/build/comms/host.js +22 -26
- package/build/comms/hostAPI.js +1 -1
- package/build/comms/hostSlot.d.ts +23 -0
- package/build/comms/hostSlot.d.ts.map +1 -0
- package/build/comms/hostSlot.js +55 -0
- package/build/comms/models.d.ts +31 -2
- package/build/comms/models.d.ts.map +1 -1
- package/build/comms/signalChangeTypes.d.ts +27 -1
- package/build/comms/signalChangeTypes.d.ts.map +1 -1
- package/build/comms/signalChangeTypes.js +7 -0
- package/build/comms/signalTypes.d.ts +21 -3
- package/build/comms/signalTypes.d.ts.map +1 -1
- package/build/comms/transport.d.ts +18 -2
- package/build/comms/transport.d.ts.map +1 -1
- package/build/comms/transport.js +25 -10
- package/build/index.d.ts +8 -35
- package/build/index.d.ts.map +1 -1
- package/build/index.js +8 -3
- package/build/service-runtime.d.ts +9 -0
- package/build/service-runtime.d.ts.map +1 -0
- package/build/service-runtime.js +10 -0
- package/build/service-types-app.d.ts +2 -0
- package/build/service-types-app.d.ts.map +1 -0
- package/build/service-types-app.js +3 -0
- package/build/service-types.d.ts +37 -0
- package/build/service-types.d.ts.map +1 -0
- package/build/service-types.js +7 -0
- package/build/services/AiService.d.ts +18 -0
- package/build/services/AiService.d.ts.map +1 -0
- package/build/services/AiService.js +9 -0
- package/build/services/AppService/factory/accessRequests.d.ts +19 -0
- package/build/services/AppService/factory/accessRequests.d.ts.map +1 -0
- package/build/services/AppService/factory/accessRequests.js +17 -0
- package/build/services/AppService/factory/assignments.d.ts +57 -0
- package/build/services/AppService/factory/assignments.d.ts.map +1 -0
- package/build/services/AppService/factory/assignments.js +30 -0
- package/build/services/AppService/factory/categories.d.ts +30 -0
- package/build/services/AppService/factory/categories.d.ts.map +1 -0
- package/build/services/AppService/factory/categories.js +11 -0
- package/build/services/AppService/factory/channels.d.ts +35 -0
- package/build/services/AppService/factory/channels.d.ts.map +1 -0
- package/build/services/AppService/factory/channels.js +18 -0
- package/build/services/AppService/factory/formData.d.ts +14 -0
- package/build/services/AppService/factory/formData.d.ts.map +1 -0
- package/build/services/AppService/factory/formData.js +50 -0
- package/build/services/AppService/factory/media.d.ts +17 -0
- package/build/services/AppService/factory/media.d.ts.map +1 -0
- package/build/services/AppService/factory/media.js +10 -0
- package/build/services/AppService/factory/resourceAccess.d.ts +21 -0
- package/build/services/AppService/factory/resourceAccess.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceAccess.js +49 -0
- package/build/services/AppService/factory/resourceAssignments.d.ts +66 -0
- package/build/services/AppService/factory/resourceAssignments.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceAssignments.js +12 -0
- package/build/services/AppService/factory/resourceChannels.d.ts +89 -0
- package/build/services/AppService/factory/resourceChannels.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceChannels.js +19 -0
- package/build/services/AppService/factory/resourceCommerce.d.ts +52 -0
- package/build/services/AppService/factory/resourceCommerce.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceCommerce.js +18 -0
- package/build/services/AppService/factory/resourceSnapshot.d.ts +75 -0
- package/build/services/AppService/factory/resourceSnapshot.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceSnapshot.js +55 -0
- package/build/services/AppService/factory/resourceUploads.d.ts +37 -0
- package/build/services/AppService/factory/resourceUploads.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceUploads.js +8 -0
- package/build/services/AppService/factory/resources.d.ts +167 -0
- package/build/services/AppService/factory/resources.d.ts.map +1 -0
- package/build/services/AppService/factory/resources.js +45 -0
- package/build/services/AppService/factory/subscriptions.d.ts +73 -0
- package/build/services/AppService/factory/subscriptions.d.ts.map +1 -0
- package/build/services/AppService/factory/subscriptions.js +39 -0
- package/build/services/AppService/factory/taxonomy.d.ts +25 -0
- package/build/services/AppService/factory/taxonomy.d.ts.map +1 -0
- package/build/services/AppService/factory/taxonomy.js +5 -0
- package/build/services/AppService/index.d.ts +58 -0
- package/build/services/AppService/index.d.ts.map +1 -0
- package/build/services/AppService/index.js +74 -0
- package/build/services/AppService/types/accessRequests.d.ts +164 -0
- package/build/services/AppService/types/accessRequests.d.ts.map +1 -0
- package/build/services/AppService/types/app.d.ts +124 -0
- package/build/services/AppService/types/app.d.ts.map +1 -0
- package/build/services/AppService/types/app.js +6 -0
- package/build/services/AppService/types/appCategories.d.ts +44 -0
- package/build/services/AppService/types/appCategories.d.ts.map +1 -0
- package/build/services/AppService/types/appCategories.js +1 -0
- package/build/services/AppService/types/appChangelog.d.ts +31 -0
- package/build/services/AppService/types/appChangelog.d.ts.map +1 -0
- package/build/services/AppService/types/appChangelog.js +1 -0
- package/build/services/AppService/types/appConfigStatus.d.ts +68 -0
- package/build/services/AppService/types/appConfigStatus.d.ts.map +1 -0
- package/build/services/AppService/types/appConfigStatus.js +11 -0
- package/build/services/AppService/types/appList.d.ts +211 -0
- package/build/services/AppService/types/appList.d.ts.map +1 -0
- package/build/services/AppService/types/appList.js +1 -0
- package/build/services/AppService/types/appManifest.d.ts +100 -0
- package/build/services/AppService/types/appManifest.d.ts.map +1 -0
- package/build/services/AppService/types/appManifest.js +4 -0
- package/build/services/AppService/types/appMedia.d.ts +136 -0
- package/build/services/AppService/types/appMedia.d.ts.map +1 -0
- package/build/services/AppService/types/appMedia.js +1 -0
- package/build/services/AppService/types/appRequests.d.ts +126 -0
- package/build/services/AppService/types/appRequests.d.ts.map +1 -0
- package/build/services/AppService/types/appRequests.js +1 -0
- package/build/services/AppService/types/appScopes.d.ts +165 -0
- package/build/services/AppService/types/appScopes.d.ts.map +1 -0
- package/build/services/AppService/types/appScopes.js +1 -0
- package/build/services/AppService/types/channels.d.ts +45 -0
- package/build/services/AppService/types/channels.d.ts.map +1 -0
- package/build/services/AppService/types/channels.js +1 -0
- package/build/services/AppService/types/pricingTiers.d.ts +111 -0
- package/build/services/AppService/types/pricingTiers.d.ts.map +1 -0
- package/build/services/AppService/types/pricingTiers.js +1 -0
- package/build/services/AppService/types/publisherStats.d.ts +20 -0
- package/build/services/AppService/types/publisherStats.d.ts.map +1 -0
- package/build/services/AppService/types/publisherStats.js +1 -0
- package/build/services/AppService/types/releaseChannels.d.ts +127 -0
- package/build/services/AppService/types/releaseChannels.d.ts.map +1 -0
- package/build/services/AppService/types/releaseChannels.js +1 -0
- package/build/services/AppService/types/resourceAssignments.d.ts +38 -0
- package/build/services/AppService/types/resourceAssignments.d.ts.map +1 -0
- package/build/services/AppService/types/resourceAssignments.js +10 -0
- package/build/services/AppService/types/resourceEntitlements.d.ts +118 -0
- package/build/services/AppService/types/resourceEntitlements.d.ts.map +1 -0
- package/build/services/AppService/types/resourceEntitlements.js +1 -0
- package/build/services/AppService/types/resourceReleases.d.ts +230 -0
- package/build/services/AppService/types/resourceReleases.d.ts.map +1 -0
- package/build/services/AppService/types/resourceReleases.js +1 -0
- package/build/services/AppService/types/resourceRequests.d.ts +115 -0
- package/build/services/AppService/types/resourceRequests.d.ts.map +1 -0
- package/build/services/AppService/types/resourceRequests.js +1 -0
- package/build/services/AppService/types/seats.d.ts +220 -0
- package/build/services/AppService/types/seats.d.ts.map +1 -0
- package/build/services/AppService/types/seats.js +4 -0
- package/build/services/AppService/types/sellableResources.d.ts +231 -0
- package/build/services/AppService/types/sellableResources.d.ts.map +1 -0
- package/build/services/AppService/types/sellableResources.js +1 -0
- package/build/services/AppService/types/snapshotFileSource.d.ts +110 -0
- package/build/services/AppService/types/snapshotFileSource.d.ts.map +1 -0
- package/build/services/AppService/types/snapshotFileSource.js +8 -0
- package/build/services/AppService/types/snapshotPayload.d.ts +166 -0
- package/build/services/AppService/types/snapshotPayload.d.ts.map +1 -0
- package/build/services/AppService/types/snapshotPayload.js +19 -0
- package/build/services/AppService/types/snapshotSources.d.ts +116 -0
- package/build/services/AppService/types/snapshotSources.d.ts.map +1 -0
- package/build/services/AppService/types/snapshotSources.js +7 -0
- package/build/services/AppService/types/snapshotUploads.d.ts +109 -0
- package/build/services/AppService/types/snapshotUploads.d.ts.map +1 -0
- package/build/services/AppService/types/snapshotUploads.js +20 -0
- package/build/services/AppService/types/subscriptions.d.ts +182 -0
- package/build/services/AppService/types/subscriptions.d.ts.map +1 -0
- package/build/services/AppService/types/subscriptions.js +1 -0
- package/build/services/AppService/types/taxonomy.d.ts +76 -0
- package/build/services/AppService/types/taxonomy.d.ts.map +1 -0
- package/build/services/AppService/types/taxonomy.js +1 -0
- package/build/services/AppService/types.d.ts +27 -0
- package/build/services/AppService/types.d.ts.map +1 -0
- package/build/services/AppService/types.js +29 -0
- package/build/services/DmsService.d.ts +6 -151
- package/build/services/DmsService.d.ts.map +1 -1
- package/build/services/DmsService.types.d.ts +169 -0
- package/build/services/DmsService.types.d.ts.map +1 -0
- package/build/services/DmsService.types.js +1 -0
- package/build/services/DmsServiceImpl.d.ts.map +1 -1
- package/build/services/DmsServiceImpl.js +8 -0
- package/build/services/LicenseService.d.ts +1 -1
- package/build/services/LicenseService.d.ts.map +1 -1
- package/build/services/LicenseService.js +1 -1
- package/build/services/OAuthClientService.d.ts +20 -0
- package/build/services/OAuthClientService.d.ts.map +1 -0
- package/build/services/OAuthClientService.js +12 -0
- package/build/services/OAuthClientService.types.d.ts +37 -0
- package/build/services/OAuthClientService.types.d.ts.map +1 -0
- package/build/services/OAuthClientService.types.js +4 -0
- package/build/services/ProjectService.d.ts +21 -0
- package/build/services/ProjectService.d.ts.map +1 -1
- package/build/services/ProjectService.js +1 -0
- package/build/services/ReleaseService.d.ts +1 -0
- package/build/services/ReleaseService.d.ts.map +1 -1
- package/build/services/SecretService.d.ts +22 -0
- package/build/services/SecretService.d.ts.map +1 -0
- package/build/services/SecretService.js +21 -0
- package/build/services/SecretService.types.d.ts +147 -0
- package/build/services/SecretService.types.d.ts.map +1 -0
- package/build/services/SecretService.types.js +1 -0
- package/build/services/SecretSharing.types.d.ts +112 -0
- package/build/services/SecretSharing.types.d.ts.map +1 -0
- package/build/services/SecretSharing.types.js +1 -0
- package/build/services/TableService.js +7 -7
- package/build/services/TaskService.d.ts +3 -3
- package/build/services/TaskService.d.ts.map +1 -1
- package/build/services/TaskService.js +1 -1
- package/build/services/TaskService.requests.d.ts +61 -0
- package/build/services/TaskService.requests.d.ts.map +1 -0
- package/build/services/TaskService.requests.js +1 -0
- package/build/services/TaskService.types.d.ts +21 -53
- package/build/services/TaskService.types.d.ts.map +1 -1
- package/build/services/TaskServiceQueries.d.ts +2 -0
- package/build/services/TaskServiceQueries.d.ts.map +1 -1
- package/build/services/TaskServiceQueries.js +13 -2
- package/build/services/TaskTemplate.types.d.ts +74 -1
- package/build/services/TaskTemplate.types.d.ts.map +1 -1
- package/build/services/TokenService.d.ts +5 -1
- package/build/services/TokenService.d.ts.map +1 -1
- package/build/services/TokenService.js +1 -2
- package/build/services/UserService.d.ts +3 -0
- package/build/services/UserService.d.ts.map +1 -1
- package/build/services/UserService.js +4 -4
- package/build/services/Webhook/EventService.d.ts +7 -0
- package/build/services/Webhook/EventService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerHistoryService.d.ts +1 -1
- package/build/services/Webhook/TriggerHistoryService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerSecretService.d.ts +88 -0
- package/build/services/Webhook/TriggerSecretService.d.ts.map +1 -0
- package/build/services/Webhook/TriggerSecretService.js +9 -0
- package/build/services/Webhook/TriggerService.d.ts +108 -0
- package/build/services/Webhook/TriggerService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerService.js +25 -0
- package/build/services/Websockets/StoreEvents.d.ts +44 -0
- package/build/services/Websockets/StoreEvents.d.ts.map +1 -0
- package/build/services/Websockets/StoreEvents.js +5 -0
- package/build/services/userPreferences.d.ts +47 -0
- package/build/services/userPreferences.d.ts.map +1 -0
- package/build/services/userPreferences.js +42 -0
- package/package.json +8 -7
- package/schemas/app-config.schema.json +85 -8
- package/build/services/AppManifest.d.ts +0 -39
- package/build/services/AppManifest.d.ts.map +0 -1
- package/build/services/AppService.d.ts +0 -57
- package/build/services/AppService.d.ts.map +0 -1
- package/build/services/AppService.js +0 -47
- package/build/services/AppService.types.d.ts +0 -173
- package/build/services/AppService.types.d.ts.map +0 -1
- /package/build/{services/AppManifest.js → ai/types.js} +0 -0
- /package/build/services/{AppService.types.js → AppService/types/accessRequests.js} +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { DataWrapper } from '../../types';
|
|
2
|
+
import type { SecretType } from '../SecretService';
|
|
3
|
+
import type { TriggerableType } from './TriggerService';
|
|
4
|
+
import type { AntHttpClient } from "../../AntHttpClient";
|
|
5
|
+
/**
|
|
6
|
+
* Where a bound secret is injected into the outbound trigger request. Mirrors
|
|
7
|
+
* the backend `App\Modules\Vault\Enums\Placement` enum; the credential value is
|
|
8
|
+
* resolved at dispatch, never stored on — nor returned by — the binding.
|
|
9
|
+
*/
|
|
10
|
+
export type SecretPlacement = 'header' | 'bearer' | 'query' | 'body';
|
|
11
|
+
/**
|
|
12
|
+
* The safe projection of the bound secret that a binding exposes. Only the
|
|
13
|
+
* secret's identity and a non-reversible `masked_hint` (≤ last 4 chars) are
|
|
14
|
+
* surfaced when the relation is loaded — the credential is never serialized.
|
|
15
|
+
*/
|
|
16
|
+
export interface TriggerSecretBindingSecret {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
/** The secret's kind — lets a UI flag a per-user (`oauth2_authorization_code`) binding. */
|
|
20
|
+
type: SecretType;
|
|
21
|
+
masked_hint: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A trigger ↔ secret binding (TriggerSecretResource). Carries only placement
|
|
25
|
+
* metadata plus a reference to the secret; no credential material.
|
|
26
|
+
*/
|
|
27
|
+
export interface TriggerSecretBinding {
|
|
28
|
+
id: string;
|
|
29
|
+
trigger_id: string;
|
|
30
|
+
secret_id: string;
|
|
31
|
+
placement: SecretPlacement;
|
|
32
|
+
/**
|
|
33
|
+
* The concrete key the placement targets: header name, query parameter, or
|
|
34
|
+
* body JSON-path. Unused for `bearer`.
|
|
35
|
+
*/
|
|
36
|
+
name: string;
|
|
37
|
+
/** Optional wrapping template applied to the resolved value, e.g. `Bearer {{value}}`. */
|
|
38
|
+
format: string | null;
|
|
39
|
+
/** Present only when the API loads the relation (index + store both do). */
|
|
40
|
+
secret?: TriggerSecretBindingSecret;
|
|
41
|
+
created_at: string | null;
|
|
42
|
+
updated_at: string | null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* POST body — binds an existing Vault secret to a trigger by reference. The
|
|
46
|
+
* secret must live in the trigger's own context or its parent license (422 otherwise).
|
|
47
|
+
*/
|
|
48
|
+
export interface CreateTriggerSecretBindingBody {
|
|
49
|
+
secret_id: string;
|
|
50
|
+
placement: SecretPlacement;
|
|
51
|
+
name: string;
|
|
52
|
+
format?: string | null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The coarse failure category of a dry-run binding test. `null` in a result
|
|
56
|
+
* means the binding resolved and passed every gate. Mirrors the backend
|
|
57
|
+
* `App\Modules\Vault\Enums\BindingTestReason`; it never carries the credential
|
|
58
|
+
* nor the offending host.
|
|
59
|
+
*/
|
|
60
|
+
export type BindingTestReason = 'missing' | 'expired' | 'egress_disallowed' | 'oauth_failed' | 'external_failed' | 'undecryptable';
|
|
61
|
+
/**
|
|
62
|
+
* The per-binding outcome of the read-only resolvability dry-run (Vault v2,
|
|
63
|
+
* Phase 13). It exposes ONLY non-sensitive metadata — the secret's identity,
|
|
64
|
+
* the placement, an `ok` flag and a coarse `reason` — never any plaintext.
|
|
65
|
+
* `ok`/`reason` are a function of the secret and the trigger's target, so every
|
|
66
|
+
* binding of the same secret shares one result.
|
|
67
|
+
*/
|
|
68
|
+
export interface BindingTestResult {
|
|
69
|
+
/** Present even when the bound secret was deleted (the binding still holds it). */
|
|
70
|
+
secret_id: string | null;
|
|
71
|
+
/** Null only when the bound secret no longer exists. */
|
|
72
|
+
secret_name: string | null;
|
|
73
|
+
placement: SecretPlacement;
|
|
74
|
+
ok: boolean;
|
|
75
|
+
reason: BindingTestReason | null;
|
|
76
|
+
}
|
|
77
|
+
export interface TriggerSecretService {
|
|
78
|
+
listBindings: (triggerableType: TriggerableType, triggerableId: string, triggerId: string) => Promise<DataWrapper<TriggerSecretBinding[]>>;
|
|
79
|
+
bind: (triggerableType: TriggerableType, triggerableId: string, triggerId: string, body: CreateTriggerSecretBindingBody) => Promise<DataWrapper<TriggerSecretBinding>>;
|
|
80
|
+
unbind: (triggerableType: TriggerableType, triggerableId: string, triggerId: string, bindingId: string) => Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Read-only diagnostic: probes whether each binding's secret would resolve and
|
|
83
|
+
* inject cleanly at dispatch, without sending the real request or revealing any value.
|
|
84
|
+
*/
|
|
85
|
+
testBindings: (triggerableType: TriggerableType, triggerableId: string, triggerId: string) => Promise<DataWrapper<BindingTestResult[]>>;
|
|
86
|
+
}
|
|
87
|
+
export declare function createTriggerSecretService(httpClient: AntHttpClient): TriggerSecretService;
|
|
88
|
+
//# sourceMappingURL=TriggerSecretService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TriggerSecretService.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerSecretService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAuB;AAEpD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;AAEpE;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,2FAA2F;IAC3F,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,eAAe,CAAA;IAC1B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,yFAAyF;IACzF,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,0BAA0B,CAAA;IACnC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,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EAAE,CAAC,CAAC,CAAA;CACxI;AAED,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,aAAa,GAAG,oBAAoB,CAiB1F"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function createTriggerSecretService(httpClient) {
|
|
2
|
+
const base = (triggerableType, triggerableId, triggerId) => `/webhook/${triggerableType}/${triggerableId}/triggers/${triggerId}/secrets`;
|
|
3
|
+
return {
|
|
4
|
+
listBindings: (triggerableType, triggerableId, triggerId) => httpClient.get(base(triggerableType, triggerableId, triggerId)),
|
|
5
|
+
bind: (triggerableType, triggerableId, triggerId, body) => httpClient.post(base(triggerableType, triggerableId, triggerId), body),
|
|
6
|
+
unbind: (triggerableType, triggerableId, triggerId, bindingId) => httpClient.delete(`${base(triggerableType, triggerableId, triggerId)}/${bindingId}`),
|
|
7
|
+
testBindings: (triggerableType, triggerableId, triggerId) => httpClient.post(`${base(triggerableType, triggerableId, triggerId)}/test`),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { DataWrapper, PaginatedResponse } from '../../types';
|
|
2
|
+
import type { ResourceAccessReason } from '../AppService/types/resourceEntitlements';
|
|
2
3
|
import type { LabelFilterParams } from '../LabelService';
|
|
3
4
|
import type { AuthType, HTTPMethod } from './ConfigService';
|
|
4
5
|
import type { Event } from './EventService';
|
|
5
6
|
import type { TriggerExecutionHistoryDetail } from './TriggerHistoryService';
|
|
7
|
+
import type { CreateTriggerSecretBindingBody } from './TriggerSecretService';
|
|
6
8
|
import type { AntHttpClient } from "../../AntHttpClient";
|
|
7
9
|
import type { ResourceLabel } from "../LabelService";
|
|
8
10
|
export type TriggerableType = 'licenses' | 'projects';
|
|
@@ -29,6 +31,34 @@ export interface Trigger {
|
|
|
29
31
|
custom_path?: string | null;
|
|
30
32
|
close_task_after_execution: boolean;
|
|
31
33
|
labels: ResourceLabel[];
|
|
34
|
+
/**
|
|
35
|
+
* Caller must have a relationship to the triggerable, and payload target ids are
|
|
36
|
+
* locked to it (AAD-897). Defaults to false server-side, including for triggers
|
|
37
|
+
* created before it existed.
|
|
38
|
+
*/
|
|
39
|
+
authorization_enforced: boolean;
|
|
40
|
+
/** Rejects any event whose `access_mode` is `write` (AAD-897). */
|
|
41
|
+
read_only: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Per-trigger burst limit. Null is not "unlimited" — it means no per-trigger
|
|
44
|
+
* override, so the server default (`triggers.rate_limit.per_second`) applies. That
|
|
45
|
+
* default currently ships as null, which is what makes null behave as unlimited
|
|
46
|
+
* today; raise the default and every null-limit trigger inherits it.
|
|
47
|
+
*/
|
|
48
|
+
rate_limit_per_second: number | null;
|
|
49
|
+
/** Per-trigger sustained limit. Same null semantics as `rate_limit_per_second`. */
|
|
50
|
+
rate_limit_per_minute: number | null;
|
|
51
|
+
/**
|
|
52
|
+
* Payload keys the caller cannot override (AAD-970). Applied AFTER the
|
|
53
|
+
* `payload < URL params < request body` merge, which is the point — a stored
|
|
54
|
+
* payload value is a default the caller can replace, a pinned one is not.
|
|
55
|
+
*
|
|
56
|
+
* Top-level keys only, and a pin REPLACES rather than deep-merges, whatever the
|
|
57
|
+
* value's type.
|
|
58
|
+
*/
|
|
59
|
+
payload_pins: Record<string, any> | null;
|
|
60
|
+
/** Resolved from the event class, not stored. Tells you whether `read_only` is even an option. */
|
|
61
|
+
access_mode: 'read' | 'write' | null;
|
|
32
62
|
}
|
|
33
63
|
export interface TriggerBase extends Pick<Trigger, 'id' | 'name' | 'is_active' | 'close_task_after_execution'> {
|
|
34
64
|
event: Pick<Event, 'id' | 'name' | 'code' | 'description'>;
|
|
@@ -46,6 +76,21 @@ export interface TriggerRequestBody {
|
|
|
46
76
|
is_active?: boolean;
|
|
47
77
|
debug_mode?: boolean;
|
|
48
78
|
custom_path?: string | null;
|
|
79
|
+
/**
|
|
80
|
+
* Optional Vault-secret bindings created atomically with the trigger (create
|
|
81
|
+
* only). Each references an existing secret by id plus placement metadata; the
|
|
82
|
+
* backend creates the trigger and all bindings in one transaction, so a
|
|
83
|
+
* rejected binding (out-of-context / missing `use`) rolls the whole create back.
|
|
84
|
+
*/
|
|
85
|
+
secret_bindings?: CreateTriggerSecretBindingBody[];
|
|
86
|
+
authorization_enforced?: boolean;
|
|
87
|
+
read_only?: boolean;
|
|
88
|
+
/** Null clears any per-trigger override, handing the field back to the server default. */
|
|
89
|
+
rate_limit_per_second?: number | null;
|
|
90
|
+
/** Null clears any per-trigger override, handing the field back to the server default. */
|
|
91
|
+
rate_limit_per_minute?: number | null;
|
|
92
|
+
/** See `Trigger.payload_pins`. Null or `{}` clears every pin. */
|
|
93
|
+
payload_pins?: Record<string, any> | null;
|
|
49
94
|
}
|
|
50
95
|
export interface TriggerExecutionResult {
|
|
51
96
|
trigger: {
|
|
@@ -82,6 +127,68 @@ export interface TriggerSearchParams {
|
|
|
82
127
|
[key: string]: any;
|
|
83
128
|
};
|
|
84
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* The actionable response a dispatch returns when a bound per-user
|
|
132
|
+
* (`oauth2_authorization_code`) secret has no token yet for the signed-in user.
|
|
133
|
+
* The OS host opens `authorize_url` in a consent popup and re-dispatches. This is
|
|
134
|
+
* NOT an error — the backend returns it with HTTP 200.
|
|
135
|
+
*/
|
|
136
|
+
export interface AuthorizationRequiredResult {
|
|
137
|
+
authorization_required: true;
|
|
138
|
+
authorize_url: string;
|
|
139
|
+
secret_id: string;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* A trigger that consumes a purchased store resource was refused (AAD-940).
|
|
143
|
+
*
|
|
144
|
+
* ⚠️ This arrives as a NON-2xx response, so it surfaces as a rejected request —
|
|
145
|
+
* read it off the error body, not the resolved value. It is wrapped in the
|
|
146
|
+
* dispatch envelope: `error.response.data.response`.
|
|
147
|
+
*
|
|
148
|
+
* **Branch on `reason`, never on the HTTP status** — several reasons share 403.
|
|
149
|
+
* `reason` is a {@link ResourceAccessReason} (`not_entitled`,
|
|
150
|
+
* `entitlement_revoked`, `subscription_expired`, `version_withdrawn`, …) or one
|
|
151
|
+
* of the trigger-side reasons below, which describe the trigger's own
|
|
152
|
+
* configuration rather than the licence's entitlement:
|
|
153
|
+
*
|
|
154
|
+
* | reason | status | what it means |
|
|
155
|
+
* | --- | --- | --- |
|
|
156
|
+
* | `resource_not_configured` | 422 | the trigger names no resource — send the user to edit it |
|
|
157
|
+
* | `resource_not_found` | 404 | the configured listing is gone |
|
|
158
|
+
* | `no_license_context` | 409 | the trigger resolves to no owning licence |
|
|
159
|
+
* | `store_resources_disabled` | 404 | the resource surface is off for this deployment |
|
|
160
|
+
*
|
|
161
|
+
* ⚠️ **Never render this as an empty result.** "Not entitled" and "this dataset
|
|
162
|
+
* has no rows" look identical to a user and call for opposite actions, which is
|
|
163
|
+
* exactly why the refusal is a populated body rather than an empty one.
|
|
164
|
+
*/
|
|
165
|
+
export interface ResourceAccessDeniedResult {
|
|
166
|
+
resource_access_denied: true;
|
|
167
|
+
reason: ResourceAccessReason | TriggerResourceReason;
|
|
168
|
+
message: string;
|
|
169
|
+
/** The status the response carried. Informational — branch on `reason`. */
|
|
170
|
+
status_code: number;
|
|
171
|
+
}
|
|
172
|
+
/** Refusals that are about the trigger's configuration, not the entitlement. */
|
|
173
|
+
export type TriggerResourceReason = 'resource_not_configured' | 'resource_not_found' | 'no_license_context' | 'store_resources_disabled';
|
|
174
|
+
/**
|
|
175
|
+
* A dispatch returns either the trigger's own response payload or, for an
|
|
176
|
+
* unconsented per-user OAuth2 binding, an {@link AuthorizationRequiredResult}.
|
|
177
|
+
* Narrow with {@link isAuthorizationRequired}.
|
|
178
|
+
*
|
|
179
|
+
* A refused resource-consuming trigger does NOT appear here — it is a non-2xx
|
|
180
|
+
* response; see {@link ResourceAccessDeniedResult}.
|
|
181
|
+
*/
|
|
182
|
+
export type TriggerDispatchResult = AuthorizationRequiredResult | unknown;
|
|
183
|
+
/** Type guard: is this dispatch result the "user must authorize" envelope? */
|
|
184
|
+
export declare function isAuthorizationRequired(result: unknown): result is AuthorizationRequiredResult;
|
|
185
|
+
/**
|
|
186
|
+
* Type guard: is this a refused resource-consuming dispatch?
|
|
187
|
+
*
|
|
188
|
+
* Accepts either the dispatch envelope or the inner body, so it can be pointed
|
|
189
|
+
* straight at `error.response?.data` without unwrapping first.
|
|
190
|
+
*/
|
|
191
|
+
export declare function isResourceAccessDenied(result: unknown): result is ResourceAccessDeniedResult;
|
|
85
192
|
export interface TriggerService {
|
|
86
193
|
fetchTriggers: (triggerableType: TriggerableType, triggerableId: string, params?: TriggerSearchParams) => Promise<PaginatedResponse<Trigger>>;
|
|
87
194
|
createTrigger: (triggerableType: TriggerableType, triggerableId: string, data: TriggerRequestBody) => Promise<DataWrapper<Trigger>>;
|
|
@@ -89,6 +196,7 @@ export interface TriggerService {
|
|
|
89
196
|
updateTrigger: (triggerableType: TriggerableType, triggerableId: string, triggerId: string, data: TriggerRequestBody) => Promise<DataWrapper<Trigger>>;
|
|
90
197
|
deleteTrigger: (triggerableType: TriggerableType, triggerableId: string, triggerId: string) => Promise<DataWrapper<Trigger>>;
|
|
91
198
|
testTrigger: (triggerId: string) => Promise<TriggerExecutionHistoryDetail>;
|
|
199
|
+
dispatch: (triggerableType: TriggerableType, triggerableId: string, triggerId: string, body?: Record<string, unknown>) => Promise<TriggerDispatchResult>;
|
|
92
200
|
}
|
|
93
201
|
export declare function createTriggerService(httpClient: AntHttpClient): TriggerService;
|
|
94
202
|
//# sourceMappingURL=TriggerService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerService.d.ts","sourceRoot":"","sources":["../../../src/services/Webhook/TriggerService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,C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M,EAAE,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;IACtJ,aAAa,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;IAC5H,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,6BAA6B,CAAC,CAAA;IAG1E,QAAQ,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAA;CACzJ;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,aAAa,GAAG,cAAc,CAuB9E"}
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/** Type guard: is this dispatch result the "user must authorize" envelope? */
|
|
2
|
+
export function isAuthorizationRequired(result) {
|
|
3
|
+
if (typeof result !== 'object' || result === null)
|
|
4
|
+
return false;
|
|
5
|
+
const record = result;
|
|
6
|
+
return record.authorization_required === true
|
|
7
|
+
&& typeof record.authorize_url === 'string'
|
|
8
|
+
&& typeof record.secret_id === 'string';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Type guard: is this a refused resource-consuming dispatch?
|
|
12
|
+
*
|
|
13
|
+
* Accepts either the dispatch envelope or the inner body, so it can be pointed
|
|
14
|
+
* straight at `error.response?.data` without unwrapping first.
|
|
15
|
+
*/
|
|
16
|
+
export function isResourceAccessDenied(result) {
|
|
17
|
+
if (typeof result !== 'object' || result === null)
|
|
18
|
+
return false;
|
|
19
|
+
const envelope = result;
|
|
20
|
+
const body = (typeof envelope.response === 'object' && envelope.response !== null)
|
|
21
|
+
? envelope.response
|
|
22
|
+
: envelope;
|
|
23
|
+
return body.resource_access_denied === true && typeof body.reason === 'string';
|
|
24
|
+
}
|
|
1
25
|
export function createTriggerService(httpClient) {
|
|
2
26
|
return {
|
|
3
27
|
fetchTriggers: (triggerableType, triggerableId, params) => httpClient.get(`/webhook/${triggerableType}/${triggerableId}/triggers`, { params }),
|
|
@@ -6,5 +30,6 @@ export function createTriggerService(httpClient) {
|
|
|
6
30
|
updateTrigger: (triggerableType, triggerableId, triggerId, data) => httpClient.put(`/webhook/${triggerableType}/${triggerableId}/triggers/${triggerId}`, data),
|
|
7
31
|
deleteTrigger: (triggerableType, triggerableId, triggerId) => httpClient.delete(`/webhook/${triggerableType}/${triggerableId}/triggers/${triggerId}`),
|
|
8
32
|
testTrigger: (triggerId) => httpClient.post(`/webhook/triggers/${triggerId}/test`),
|
|
33
|
+
dispatch: (triggerableType, triggerableId, triggerId, body) => httpClient.post(`/webhook/${triggerableType}/${triggerableId}/triggers/${triggerId}/dispatch`, body ?? {}),
|
|
9
34
|
};
|
|
10
35
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface AppVersionPublishedEvent {
|
|
2
|
+
type: 'appVersionPublished';
|
|
3
|
+
app: {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
};
|
|
7
|
+
app_version: {
|
|
8
|
+
id: string;
|
|
9
|
+
version: string;
|
|
10
|
+
};
|
|
11
|
+
release_channel_id: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface AppVersionUnpublishedEvent {
|
|
14
|
+
type: 'appVersionUnpublished';
|
|
15
|
+
app: {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string | null;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The version that was pulled — on a rollback, the version rolled back FROM
|
|
21
|
+
* (i.e. the one you were running, not the one you are now on). Null if the
|
|
22
|
+
* channel was already empty.
|
|
23
|
+
*/
|
|
24
|
+
app_version: {
|
|
25
|
+
id: string;
|
|
26
|
+
version: string;
|
|
27
|
+
} | null;
|
|
28
|
+
release_channel_id: string | null;
|
|
29
|
+
}
|
|
30
|
+
export interface ResourceVersionPublishedEvent {
|
|
31
|
+
type: 'resourceVersionPublished';
|
|
32
|
+
resource: {
|
|
33
|
+
id: string;
|
|
34
|
+
title: string | null;
|
|
35
|
+
};
|
|
36
|
+
resource_version: {
|
|
37
|
+
id: string;
|
|
38
|
+
version: string;
|
|
39
|
+
};
|
|
40
|
+
/** The channel the version was published onto. */
|
|
41
|
+
release_channel_id: string | null;
|
|
42
|
+
}
|
|
43
|
+
export type StoreWebSocketEvent = AppVersionPublishedEvent | AppVersionUnpublishedEvent | ResourceVersionPublishedEvent;
|
|
44
|
+
//# sourceMappingURL=StoreEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoreEvents.d.ts","sourceRoot":"","sources":["../../../src/services/Websockets/StoreEvents.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,qBAAqB,CAAA;IAC3B,GAAG,EAAE;QACH,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,WAAW,EAAE;QACX,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AA8BD,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,uBAAuB,CAAA;IAC7B,GAAG,EAAE;QACH,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KACrB,CAAA;IACD;;;;OAIG;IACH,WAAW,EAAE;QACX,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,EAAE,MAAM,CAAA;KAChB,GAAG,IAAI,CAAA;IACR,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AA+BD,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,0BAA0B,CAAA;IAChC,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KACrB,CAAA;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,kDAAkD;IAClD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC;AAID,MAAM,MAAM,mBAAmB,GAAG,wBAAwB,GAAG,0BAA0B,GAAG,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface AiPreferences {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
/** Browser-side loop only (no backend needed) — the endpoint the tab calls directly. */
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
/** Model for the browser-side loop. Pairs with `baseUrl`. */
|
|
7
|
+
model: string;
|
|
8
|
+
/**
|
|
9
|
+
* Extra request headers for the browser-side loop — auth for endpoints that
|
|
10
|
+
* need it (a bearer key, Cloudflare Access service tokens). Pairs with
|
|
11
|
+
* `baseUrl` and is never sent to the hosted gateway, which has its own auth.
|
|
12
|
+
*
|
|
13
|
+
* Stored PLAINTEXT: it round-trips through the users API like every other
|
|
14
|
+
* preference. A developer-mode convenience, not a secret store.
|
|
15
|
+
*/
|
|
16
|
+
headers: Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Which server-side model the gateway should use for this user's chats.
|
|
19
|
+
*
|
|
20
|
+
* A KEY into `ai.gateway.dev_endpoints`, never a URL: the server dereferences
|
|
21
|
+
* this, and a user-supplied address would be a read SSRF. Empty means the
|
|
22
|
+
* server default. An unknown key also falls back to the default.
|
|
23
|
+
*/
|
|
24
|
+
endpoint: string;
|
|
25
|
+
}
|
|
26
|
+
export interface DevModePreferences {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
ai: AiPreferences;
|
|
29
|
+
}
|
|
30
|
+
export interface UserPreferences {
|
|
31
|
+
devMode: DevModePreferences;
|
|
32
|
+
}
|
|
33
|
+
export declare const userPreferencesSchema: z.ZodObject<{
|
|
34
|
+
devMode: z.ZodCatch<z.ZodObject<{
|
|
35
|
+
enabled: z.ZodCatch<z.ZodBoolean>;
|
|
36
|
+
ai: z.ZodCatch<z.ZodObject<{
|
|
37
|
+
enabled: z.ZodCatch<z.ZodBoolean>;
|
|
38
|
+
baseUrl: z.ZodCatch<z.ZodString>;
|
|
39
|
+
model: z.ZodCatch<z.ZodString>;
|
|
40
|
+
headers: z.ZodCatch<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
41
|
+
endpoint: z.ZodCatch<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export declare const defaultUserPreferences: UserPreferences;
|
|
46
|
+
export declare function parseUserPreferences(raw: unknown): UserPreferences;
|
|
47
|
+
//# sourceMappingURL=userPreferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userPreferences.d.ts","sourceRoot":"","sources":["../../src/services/userPreferences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,wFAAwF;IACxF,OAAO,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,EAAE,EAAE,aAAa,CAAA;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,kBAAkB,CAAA;CAC5B;AAiBD,eAAO,MAAM,qBAAqB;;;;;;;;;;;iBAEhC,CAAA;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAKpC,CAAA;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAoBlE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const defaultAiPreferences = { enabled: false, baseUrl: '', model: '', headers: {}, endpoint: '' };
|
|
3
|
+
const aiPreferencesSchema = z.object({
|
|
4
|
+
enabled: z.boolean().catch(false),
|
|
5
|
+
baseUrl: z.string().catch(''),
|
|
6
|
+
model: z.string().catch(''),
|
|
7
|
+
headers: z.record(z.string(), z.string()).catch({}),
|
|
8
|
+
endpoint: z.string().catch(''),
|
|
9
|
+
}).catch(defaultAiPreferences);
|
|
10
|
+
const devModePreferencesSchema = z.object({
|
|
11
|
+
enabled: z.boolean().catch(false),
|
|
12
|
+
ai: aiPreferencesSchema,
|
|
13
|
+
}).catch({ enabled: false, ai: defaultAiPreferences });
|
|
14
|
+
export const userPreferencesSchema = z.object({
|
|
15
|
+
devMode: devModePreferencesSchema,
|
|
16
|
+
});
|
|
17
|
+
export const defaultUserPreferences = {
|
|
18
|
+
devMode: {
|
|
19
|
+
enabled: false,
|
|
20
|
+
ai: { ...defaultAiPreferences },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export function parseUserPreferences(raw) {
|
|
24
|
+
const result = userPreferencesSchema.safeParse(raw);
|
|
25
|
+
if (!result.success)
|
|
26
|
+
return structuredClone(defaultUserPreferences);
|
|
27
|
+
// Normalize explicitly: zod's catch() output is typed optional under
|
|
28
|
+
// non-strict tsconfigs (the codegen one), so ?? the defaults per field.
|
|
29
|
+
const devMode = result.data.devMode;
|
|
30
|
+
return {
|
|
31
|
+
devMode: {
|
|
32
|
+
enabled: devMode?.enabled ?? false,
|
|
33
|
+
ai: {
|
|
34
|
+
enabled: devMode?.ai?.enabled ?? false,
|
|
35
|
+
baseUrl: devMode?.ai?.baseUrl ?? '',
|
|
36
|
+
model: devMode?.ai?.model ?? '',
|
|
37
|
+
headers: devMode?.ai?.headers ?? {},
|
|
38
|
+
endpoint: devMode?.ai?.endpoint ?? '',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antcde/connect-ts",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.27-rc.10",
|
|
4
4
|
"description": "Helper to connect to the ANT api",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -35,21 +35,22 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"axios": "^1.
|
|
38
|
+
"axios": "^1.20.0",
|
|
39
39
|
"comlink": "^4.4.2",
|
|
40
40
|
"post-robot": "10.0.46",
|
|
41
|
-
"qs": "^6.
|
|
42
|
-
"rxjs": "^7.8.2"
|
|
41
|
+
"qs": "^6.16.0",
|
|
42
|
+
"rxjs": "^7.8.2",
|
|
43
|
+
"zod": "^4.5.4"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@faker-js/faker": "^9.9.0",
|
|
46
|
-
"@types/node": "^22.
|
|
47
|
+
"@types/node": "^22.20.1",
|
|
47
48
|
"@types/qs": "^6.15.1",
|
|
48
|
-
"happy-dom": "^20.
|
|
49
|
+
"happy-dom": "^20.12.0",
|
|
49
50
|
"ts-json-schema-generator": "^2.9.0",
|
|
50
51
|
"ts-patch": "^3.3.0",
|
|
51
52
|
"typescript": "~6.0.3",
|
|
52
53
|
"typescript-transform-paths": "^3.5.6",
|
|
53
|
-
"vitest": "^4.1.
|
|
54
|
+
"vitest": "^4.1.11"
|
|
54
55
|
}
|
|
55
56
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://antcde.io/schemas/app-config.schema.json",
|
|
4
4
|
"title": "ANT App Manifest",
|
|
5
|
-
"description": "Shape of app-config.json shipped inside an ANT app's distribution. Read by ant-os and the App Store to discover what an app declares about itself.",
|
|
5
|
+
"description": "Shape of app-config.json shipped inside an ANT app's distribution. Read by ant-os and the App Store to discover what an app declares about itself. Deliberately lenient: no level sets additionalProperties, so an app may ship keys this schema does not know (a field added to the types before the schema catches up, or an app-private extension) without the manifest going invalid. Declared values are still checked — types, enums and the dropdown/options_value rule all hold. Do not re-close it without a reason: unknown keys are tolerated on purpose.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"required": ["version"],
|
|
8
8
|
"properties": {
|
|
@@ -32,13 +32,87 @@
|
|
|
32
32
|
"description": "Generic topic pub/sub capabilities keyed by topic name.",
|
|
33
33
|
"patternProperties": {
|
|
34
34
|
"^[A-Za-z0-9_-]+$": { "$ref": "#/$defs/topicEntry" }
|
|
35
|
-
}
|
|
36
|
-
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"capabilities": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"description": "What the app can be driven to do via the URL. Consumed by the AI overlay to build per-app tools and by the host to validate app-state snapshots.",
|
|
42
|
+
"properties": {
|
|
43
|
+
"queryParams": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"description": "Query params the app understands, keyed by param name.",
|
|
46
|
+
"patternProperties": {
|
|
47
|
+
"^[A-Za-z0-9_-]+$": { "$ref": "#/$defs/queryParamEntry" }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"intents": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"description": "Named actions the app can be deep-linked into.",
|
|
53
|
+
"items": { "$ref": "#/$defs/intentEntry" }
|
|
37
54
|
}
|
|
38
55
|
}
|
|
39
56
|
}
|
|
40
57
|
},
|
|
41
58
|
"$defs": {
|
|
59
|
+
"queryParamEntry": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"description": "A single query param the app understands.",
|
|
62
|
+
"required": ["type"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"type": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"enum": ["string", "number", "boolean", "date", "time", "datetime"],
|
|
67
|
+
"description": "Value type. On the URL everything is a string; number/boolean/date/time/datetime are rendering + validation hints."
|
|
68
|
+
},
|
|
69
|
+
"description": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"description": "What the param does. Surfaced to the AI as tool-parameter help."
|
|
72
|
+
},
|
|
73
|
+
"enum": {
|
|
74
|
+
"type": "array",
|
|
75
|
+
"items": { "type": "string" },
|
|
76
|
+
"description": "Allowed values. Becomes an enum constraint for the AI."
|
|
77
|
+
},
|
|
78
|
+
"multiple": {
|
|
79
|
+
"type": "boolean",
|
|
80
|
+
"default": false,
|
|
81
|
+
"description": "Accept several values (multi-select / CSV on the wire)."
|
|
82
|
+
},
|
|
83
|
+
"required": {
|
|
84
|
+
"type": "boolean",
|
|
85
|
+
"default": false,
|
|
86
|
+
"description": "Whether the param must be supplied to invoke the app."
|
|
87
|
+
},
|
|
88
|
+
"access": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"enum": ["read", "write", "readwrite"],
|
|
91
|
+
"default": "readwrite",
|
|
92
|
+
"description": "Who may drive the param. 'read' only REFLECTS app state on the URL — the AI and the confirm form show it but never set it. 'write'/'readwrite' are commandable. Defaults to 'readwrite'."
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"intentEntry": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"description": "A named action the app can be deep-linked into.",
|
|
99
|
+
"required": ["id", "description"],
|
|
100
|
+
"properties": {
|
|
101
|
+
"id": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"description": "Stable intent identifier."
|
|
104
|
+
},
|
|
105
|
+
"description": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"description": "What the intent does. Read by the AI to match user requests."
|
|
108
|
+
},
|
|
109
|
+
"params": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"items": { "type": "string" },
|
|
112
|
+
"description": "Names of queryParams this intent uses."
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
42
116
|
"tableEntry": {
|
|
43
117
|
"type": "object",
|
|
44
118
|
"description": "A table the app declares. Columns are created when the app is added to a project.",
|
|
@@ -48,6 +122,12 @@
|
|
|
48
122
|
"type": "string",
|
|
49
123
|
"description": "Table name. Must be unique within the app."
|
|
50
124
|
},
|
|
125
|
+
"context": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"enum": ["project", "license"],
|
|
128
|
+
"default": "project",
|
|
129
|
+
"description": "Where the table is generated. 'project' creates it in the project when the app is installed there; 'license' creates it at the license level. Defaults to 'project' if omitted."
|
|
130
|
+
},
|
|
51
131
|
"master_table": {
|
|
52
132
|
"type": "boolean",
|
|
53
133
|
"default": false,
|
|
@@ -59,8 +139,7 @@
|
|
|
59
139
|
"items": { "$ref": "#/$defs/columnEntry" },
|
|
60
140
|
"minItems": 1
|
|
61
141
|
}
|
|
62
|
-
}
|
|
63
|
-
"additionalProperties": false
|
|
142
|
+
}
|
|
64
143
|
},
|
|
65
144
|
"columnEntry": {
|
|
66
145
|
"type": "object",
|
|
@@ -121,7 +200,6 @@
|
|
|
121
200
|
"description": "Display name for the column in the UI."
|
|
122
201
|
}
|
|
123
202
|
},
|
|
124
|
-
"additionalProperties": false,
|
|
125
203
|
"if": {
|
|
126
204
|
"properties": { "type": { "const": "dropdown" } }
|
|
127
205
|
},
|
|
@@ -158,8 +236,7 @@
|
|
|
158
236
|
"$ref": "https://json-schema.org/draft/2020-12/schema",
|
|
159
237
|
"description": "JSON Schema describing the topic payload shape."
|
|
160
238
|
}
|
|
161
|
-
}
|
|
162
|
-
"additionalProperties": false
|
|
239
|
+
}
|
|
163
240
|
}
|
|
164
241
|
}
|
|
165
242
|
}
|