@datadog/apps-frontend 0.0.1 → 0.0.2
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/LICENSES-3rdparty.csv +5 -0
- package/dist/src/embedding/index.d.ts +6 -0
- package/dist/src/embedding/index.js +6 -0
- package/dist/src/embedding/index.js.map +7 -0
- package/dist/src/embedding/react/index.d.ts +8 -0
- package/dist/src/embedding/react/index.js +7 -0
- package/dist/src/embedding/react/index.js.map +7 -0
- package/dist/src/embedding/react/provider.d.ts +8 -0
- package/dist/src/embedding/react/use-datadog-app-embedding.d.ts +29 -0
- package/dist/src/embedding/types.d.ts +351 -0
- package/package.json +28 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0.
|
|
2
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
3
|
+
* Copyright 2019-Present Datadog, Inc.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ComponentType, PropsWithChildren } from 'react';
|
|
7
|
+
/** Owns the shared embedding connection for all descendant Datadog App hooks. */
|
|
8
|
+
export declare const DatadogAppProvider: ComponentType<PropsWithChildren>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0.
|
|
2
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
3
|
+
* Copyright 2019-Present Datadog, Inc.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { EmbeddingMetadata } from '../index.js';
|
|
7
|
+
export interface UseDatadogAppEmbeddingOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Suspend (throw a promise) while the connection is still settling
|
|
10
|
+
* (`connecting`/`reconnecting`), and throw an `Error` for a terminal
|
|
11
|
+
* failure (`rejected`/`closed`) so the nearest error boundary catches it.
|
|
12
|
+
* Only `connected`/`not-embedded` -- both legitimate states to render
|
|
13
|
+
* against -- are ever returned. Defaults to `false`.
|
|
14
|
+
*/
|
|
15
|
+
readonly suspense?: boolean;
|
|
16
|
+
}
|
|
17
|
+
type SettledEmbeddingMetadata = Extract<EmbeddingMetadata, {
|
|
18
|
+
state: 'connected' | 'not-embedded';
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Tracks this app's embedding connection: its lifecycle state, any connection
|
|
22
|
+
* error, and which product surface the host embedded it into. Must be called
|
|
23
|
+
* below `DatadogAppProvider`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useDatadogAppEmbedding(options: Readonly<{
|
|
26
|
+
suspense: true;
|
|
27
|
+
}>): SettledEmbeddingMetadata;
|
|
28
|
+
export declare function useDatadogAppEmbedding(options?: UseDatadogAppEmbeddingOptions): EmbeddingMetadata;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
/* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0.
|
|
2
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
3
|
+
* Copyright 2019-Present Datadog, Inc.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
7
|
+
export type Unsubscribe = () => void;
|
|
8
|
+
export type Result<TValue, TError> = Readonly<{
|
|
9
|
+
ok: true;
|
|
10
|
+
value: TValue;
|
|
11
|
+
}> | Readonly<{
|
|
12
|
+
ok: false;
|
|
13
|
+
error: TError;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* A synchronous, deterministic, validation-only Standard Schema.
|
|
17
|
+
*
|
|
18
|
+
* Both embedding peers validate independently. Schemas must therefore have
|
|
19
|
+
* identical input/output types and must not coerce or transform accepted
|
|
20
|
+
* values.
|
|
21
|
+
*/
|
|
22
|
+
export type ValueSchema<TValue> = StandardSchemaV1<TValue, TValue>;
|
|
23
|
+
export type AnySchema = StandardSchemaV1;
|
|
24
|
+
export type InferOf<TSchema extends AnySchema> = StandardSchemaV1.InferOutput<TSchema>;
|
|
25
|
+
export type ValidationOnlySchema<TSchema extends AnySchema> = StandardSchemaV1.InferInput<TSchema> extends StandardSchemaV1.InferOutput<TSchema> ? StandardSchemaV1.InferOutput<TSchema> extends StandardSchemaV1.InferInput<TSchema> ? TSchema : never : never;
|
|
26
|
+
export type ContractVersion = number;
|
|
27
|
+
export interface ValueField<TSchema extends AnySchema> {
|
|
28
|
+
readonly kind: 'value';
|
|
29
|
+
readonly schema: ValidationOnlySchema<TSchema>;
|
|
30
|
+
}
|
|
31
|
+
export interface FunctionField<TInputs extends Readonly<Record<string, AnySchema>>, TResult extends AnySchema> {
|
|
32
|
+
readonly kind: 'function';
|
|
33
|
+
readonly inputs: {
|
|
34
|
+
readonly [TName in keyof TInputs]: ValidationOnlySchema<TInputs[TName]>;
|
|
35
|
+
};
|
|
36
|
+
readonly result: ValidationOnlySchema<TResult>;
|
|
37
|
+
}
|
|
38
|
+
export type AnyFunctionField = FunctionField<Readonly<Record<string, AnySchema>>, AnySchema>;
|
|
39
|
+
export type AnyField = ValueField<AnySchema> | AnyFunctionField;
|
|
40
|
+
export interface Contract<TFields extends Record<string, AnyField>> {
|
|
41
|
+
readonly identifier: string;
|
|
42
|
+
readonly version: ContractVersion;
|
|
43
|
+
readonly fields: TFields;
|
|
44
|
+
}
|
|
45
|
+
export type AnyContract = Contract<Record<string, AnyField>>;
|
|
46
|
+
export interface LiveValue<TValue> {
|
|
47
|
+
get(): TValue;
|
|
48
|
+
subscribe(onChange: () => void): Unsubscribe;
|
|
49
|
+
}
|
|
50
|
+
export interface HostFunctionContext {
|
|
51
|
+
/**
|
|
52
|
+
* Aborts once the call is cancelled or its deadline passes. An async
|
|
53
|
+
* implementation should check or listen for this to stop early. A
|
|
54
|
+
* *synchronous* implementation has no way to observe it mid-call: JS
|
|
55
|
+
* can't preempt a running function, so a synchronous handler that blocks
|
|
56
|
+
* past the deadline still runs to completion and produces its value --
|
|
57
|
+
* the caller is simply told the call timed out and never sees that
|
|
58
|
+
* value, rather than the value being prevented from being computed.
|
|
59
|
+
*/
|
|
60
|
+
readonly signal: AbortSignal;
|
|
61
|
+
}
|
|
62
|
+
export interface HostFunction {
|
|
63
|
+
invoke(inputs: Readonly<Record<string, unknown>>, context: HostFunctionContext): unknown;
|
|
64
|
+
}
|
|
65
|
+
export type FunctionInputs<TInputs extends Readonly<Record<string, AnySchema>>> = {
|
|
66
|
+
readonly [TName in keyof TInputs]: InferOf<TInputs[TName]>;
|
|
67
|
+
};
|
|
68
|
+
/** Resolves a contract field to the plain value/callable shape a claimant receives, ignoring subscription. */
|
|
69
|
+
type FieldValue<TField extends AnyField> = TField extends ValueField<infer TSchema> ? InferOf<TSchema> : TField extends FunctionField<infer TInputs, infer TResult> ? (inputs: FunctionInputs<TInputs>) => Promise<InferOf<TResult>> : never;
|
|
70
|
+
type ClaimedField<TField extends AnyField> = TField extends ValueField<infer TSchema> ? LiveValue<InferOf<TSchema>> : FieldValue<TField>;
|
|
71
|
+
/** The live, per-field view of a claim: subscribable `LiveValue`s for value fields, callables for function fields. */
|
|
72
|
+
export type ClaimedFields<TContract extends AnyContract> = {
|
|
73
|
+
readonly [TKey in keyof TContract['fields']]: ClaimedField<TContract['fields'][TKey]>;
|
|
74
|
+
};
|
|
75
|
+
declare const hostModuleBrand: unique symbol;
|
|
76
|
+
/**
|
|
77
|
+
* One contract version, live and ready to serve claims. Nominally branded --
|
|
78
|
+
* `hostModuleBrand` is declared but never exported, so only this package can
|
|
79
|
+
* produce a `HostModule`, and only through `createHostModule()`. That is what
|
|
80
|
+
* keeps a host from assembling a module for one hand-picked version: the
|
|
81
|
+
* single supported way in is to provide an inputs definition, which mints a
|
|
82
|
+
* module for *every* version that definition still converts to. The brand has
|
|
83
|
+
* no runtime representation.
|
|
84
|
+
*/
|
|
85
|
+
export interface HostModule {
|
|
86
|
+
readonly [hostModuleBrand]: true;
|
|
87
|
+
readonly contract: AnyContract;
|
|
88
|
+
readonly implementation: Readonly<Record<string, LiveValue<unknown> | HostFunction>>;
|
|
89
|
+
readonly signal?: AbortSignal;
|
|
90
|
+
}
|
|
91
|
+
export interface Issue {
|
|
92
|
+
readonly message: string;
|
|
93
|
+
readonly path: readonly (string | number)[];
|
|
94
|
+
}
|
|
95
|
+
export type AnyError = Readonly<{
|
|
96
|
+
code: 'ORIGIN_REJECTED';
|
|
97
|
+
origin: string;
|
|
98
|
+
}> | Readonly<{
|
|
99
|
+
code: 'APP_PROTOCOL_TOO_OLD';
|
|
100
|
+
appProtocols: readonly number[];
|
|
101
|
+
hostProtocols: readonly number[];
|
|
102
|
+
}> | Readonly<{
|
|
103
|
+
code: 'HOST_PROTOCOL_TOO_OLD';
|
|
104
|
+
appProtocols: readonly number[];
|
|
105
|
+
hostProtocols: readonly number[];
|
|
106
|
+
}> | Readonly<{
|
|
107
|
+
code: 'PROTOCOL_INCOMPATIBLE';
|
|
108
|
+
appProtocols: readonly number[];
|
|
109
|
+
hostProtocols: readonly number[];
|
|
110
|
+
}> | Readonly<{
|
|
111
|
+
code: 'PEER_LACKS_MODULE';
|
|
112
|
+
identifier: string;
|
|
113
|
+
}> | Readonly<{
|
|
114
|
+
code: 'APP_MAJOR_TOO_OLD';
|
|
115
|
+
wanted: ContractVersion;
|
|
116
|
+
hostVersions: readonly ContractVersion[];
|
|
117
|
+
}> | Readonly<{
|
|
118
|
+
code: 'HOST_MAJOR_TOO_OLD';
|
|
119
|
+
wanted: ContractVersion;
|
|
120
|
+
hostVersions: readonly ContractVersion[];
|
|
121
|
+
}> | Readonly<{
|
|
122
|
+
code: 'CONTRACT_INCOMPATIBLE';
|
|
123
|
+
field: string;
|
|
124
|
+
}> | Readonly<{
|
|
125
|
+
code: 'INVALID_ARGUMENT';
|
|
126
|
+
issues: readonly Issue[];
|
|
127
|
+
}> | Readonly<{
|
|
128
|
+
code: 'FUNCTION_FAILED';
|
|
129
|
+
field: string;
|
|
130
|
+
}> | Readonly<{
|
|
131
|
+
code: 'INVALID_RESULT';
|
|
132
|
+
issues: readonly Issue[];
|
|
133
|
+
}> | Readonly<{
|
|
134
|
+
code: 'TIMED_OUT';
|
|
135
|
+
timeoutMs: number;
|
|
136
|
+
}> | Readonly<{
|
|
137
|
+
code: 'TRANSPORT_FAILED';
|
|
138
|
+
cause: unknown;
|
|
139
|
+
}> | Readonly<{
|
|
140
|
+
code: 'ABORTED';
|
|
141
|
+
}> | Readonly<{
|
|
142
|
+
code: 'DISCONNECTED';
|
|
143
|
+
}> | Readonly<{
|
|
144
|
+
code: 'UNRECOGNIZED';
|
|
145
|
+
rawCode: string;
|
|
146
|
+
raw: unknown;
|
|
147
|
+
}>;
|
|
148
|
+
export type ErrorOf<TCode extends AnyError['code']> = Extract<AnyError, {
|
|
149
|
+
code: TCode;
|
|
150
|
+
}>;
|
|
151
|
+
export type ConnectError = ErrorOf<'ORIGIN_REJECTED' | 'APP_PROTOCOL_TOO_OLD' | 'HOST_PROTOCOL_TOO_OLD' | 'PROTOCOL_INCOMPATIBLE' | 'TIMED_OUT' | 'TRANSPORT_FAILED' | 'ABORTED' | 'DISCONNECTED' | 'UNRECOGNIZED'>;
|
|
152
|
+
export type WireClaimError = ErrorOf<'PEER_LACKS_MODULE' | 'APP_MAJOR_TOO_OLD' | 'HOST_MAJOR_TOO_OLD' | 'CONTRACT_INCOMPATIBLE' | 'INVALID_RESULT' | 'TIMED_OUT' | 'ABORTED' | 'DISCONNECTED' | 'UNRECOGNIZED'>;
|
|
153
|
+
export type WireFunctionError = ErrorOf<'CONTRACT_INCOMPATIBLE' | 'INVALID_ARGUMENT' | 'FUNCTION_FAILED' | 'INVALID_RESULT' | 'TIMED_OUT' | 'ABORTED' | 'DISCONNECTED' | 'UNRECOGNIZED'>;
|
|
154
|
+
export type ClaimInvalidationError = ErrorOf<'INVALID_RESULT' | 'DISCONNECTED' | 'UNRECOGNIZED'>;
|
|
155
|
+
export interface Claimed<TContract extends AnyContract> {
|
|
156
|
+
readonly fields: ClaimedFields<TContract>;
|
|
157
|
+
release(): void;
|
|
158
|
+
onValuesChanged(listener: () => void): Unsubscribe;
|
|
159
|
+
onInvalidated(listener: (error: ClaimInvalidationError) => void): Unsubscribe;
|
|
160
|
+
}
|
|
161
|
+
export interface ClaimOptions {
|
|
162
|
+
readonly timeoutMs?: number;
|
|
163
|
+
readonly signal?: AbortSignal;
|
|
164
|
+
}
|
|
165
|
+
export interface AppConnection {
|
|
166
|
+
claim<TContract extends AnyContract>(contract: TContract, options?: ClaimOptions): Promise<Result<Claimed<TContract>, WireClaimError>>;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Identifies which product surface a Datadog App is embedded into (e.g. the
|
|
170
|
+
* Service Catalog side panel vs. IDP), so an app can render surface-specific
|
|
171
|
+
* content. Each value matches the `identifier` of the inputs schema that
|
|
172
|
+
* surface provides -- see `../inputs/schemas`. Sent host-to-app as part of
|
|
173
|
+
* the embedding connection handshake.
|
|
174
|
+
*/
|
|
175
|
+
/**
|
|
176
|
+
* Every surface, as a tuple rather than a bare union so it can also serve as a
|
|
177
|
+
* type: `DatadogAppInputsSchema` defaults its `surfaces` to this, which makes
|
|
178
|
+
* an IDE print the members in full on hover instead of collapsing them to the
|
|
179
|
+
* `SurfaceId` alias.
|
|
180
|
+
*/
|
|
181
|
+
export declare const EVERY_SURFACE: readonly [
|
|
182
|
+
'datadog.idp.homepage',
|
|
183
|
+
'datadog.idp.service-panel',
|
|
184
|
+
'datadog.idp.self-service',
|
|
185
|
+
'datadog.app-builder',
|
|
186
|
+
'datadog.appsec',
|
|
187
|
+
'datadog.notebook',
|
|
188
|
+
'datadog.dashboard'
|
|
189
|
+
];
|
|
190
|
+
/**
|
|
191
|
+
* Where an app is running. Derived from `EVERY_SURFACE`, so there is one
|
|
192
|
+
* list, but widened to arbitrary strings: it is inert metadata forwarded to
|
|
193
|
+
* `listen()`, never used to gate whether embedding connects, so a host is
|
|
194
|
+
* free to pass a value with no matching surface (e.g. an unmapped view
|
|
195
|
+
* context) rather than going without one.
|
|
196
|
+
*/
|
|
197
|
+
export type SurfaceId = (typeof EVERY_SURFACE)[number] | (string & {});
|
|
198
|
+
export type AppConnectionState = Readonly<{
|
|
199
|
+
state: 'connecting';
|
|
200
|
+
error?: ConnectError;
|
|
201
|
+
}> | Readonly<{
|
|
202
|
+
state: 'connected';
|
|
203
|
+
connection: AppConnection;
|
|
204
|
+
surfaceId?: SurfaceId;
|
|
205
|
+
}> | Readonly<{
|
|
206
|
+
state: 'reconnecting';
|
|
207
|
+
lastError: ConnectError;
|
|
208
|
+
}> | Readonly<{
|
|
209
|
+
state: 'rejected';
|
|
210
|
+
error: ConnectError;
|
|
211
|
+
}> | Readonly<{
|
|
212
|
+
state: 'not-embedded';
|
|
213
|
+
}> | Readonly<{
|
|
214
|
+
state: 'closed';
|
|
215
|
+
}>;
|
|
216
|
+
/**
|
|
217
|
+
* Public-safe view of `AppConnectionState`: the same lifecycle cases, minus
|
|
218
|
+
* the raw `AppConnection` a consumer would otherwise have no use for outside
|
|
219
|
+
* of claiming a contract.
|
|
220
|
+
*/
|
|
221
|
+
export type EmbeddingMetadata = Readonly<{
|
|
222
|
+
state: 'connecting';
|
|
223
|
+
error?: ConnectError;
|
|
224
|
+
}> | Readonly<{
|
|
225
|
+
state: 'connected';
|
|
226
|
+
surfaceId?: SurfaceId;
|
|
227
|
+
}> | Readonly<{
|
|
228
|
+
state: 'reconnecting';
|
|
229
|
+
lastError: ConnectError;
|
|
230
|
+
}> | Readonly<{
|
|
231
|
+
state: 'rejected';
|
|
232
|
+
error: ConnectError;
|
|
233
|
+
}> | Readonly<{
|
|
234
|
+
state: 'not-embedded';
|
|
235
|
+
}> | Readonly<{
|
|
236
|
+
state: 'closed';
|
|
237
|
+
}>;
|
|
238
|
+
export interface EmbeddingMetadataStore {
|
|
239
|
+
readonly getSnapshot: () => EmbeddingMetadata;
|
|
240
|
+
readonly subscribe: (onChange: () => void) => Unsubscribe;
|
|
241
|
+
}
|
|
242
|
+
export interface AppConnectionHandle {
|
|
243
|
+
getSnapshot(): AppConnectionState;
|
|
244
|
+
subscribe(onChange: () => void): Unsubscribe;
|
|
245
|
+
close(): void;
|
|
246
|
+
}
|
|
247
|
+
export interface AppConnectionFactory {
|
|
248
|
+
connect(): AppConnectionHandle;
|
|
249
|
+
}
|
|
250
|
+
export interface HostListenOptions {
|
|
251
|
+
/** Security boundary for the app-created bootstrap port. */
|
|
252
|
+
readonly peer: Readonly<{
|
|
253
|
+
frame: HTMLIFrameElement;
|
|
254
|
+
appOrigin: string;
|
|
255
|
+
/**
|
|
256
|
+
* Set when the iframe is intentionally configured with an opaque
|
|
257
|
+
* sandboxed origin, so the host should accept a `"null"` origin from
|
|
258
|
+
* it in place of an exact match against `appOrigin`.
|
|
259
|
+
*/
|
|
260
|
+
allowOpaqueOrigin?: boolean;
|
|
261
|
+
}>;
|
|
262
|
+
readonly modules: readonly HostModule[];
|
|
263
|
+
readonly surfaceId?: SurfaceId;
|
|
264
|
+
readonly timeoutMs?: number;
|
|
265
|
+
readonly signal?: AbortSignal;
|
|
266
|
+
}
|
|
267
|
+
export interface HostListener {
|
|
268
|
+
onError(listener: (error: ConnectError) => void): Unsubscribe;
|
|
269
|
+
close(): void;
|
|
270
|
+
}
|
|
271
|
+
export type EmbeddingError = Readonly<{
|
|
272
|
+
code: 'TIMED_OUT';
|
|
273
|
+
message: string;
|
|
274
|
+
action: 'retry';
|
|
275
|
+
}> | Readonly<{
|
|
276
|
+
code: 'ORIGIN_REJECTED';
|
|
277
|
+
message: string;
|
|
278
|
+
action: 'contact-support';
|
|
279
|
+
}> | Readonly<{
|
|
280
|
+
code: 'APP_PROTOCOL_TOO_OLD';
|
|
281
|
+
message: string;
|
|
282
|
+
action: 'update-app';
|
|
283
|
+
}> | Readonly<{
|
|
284
|
+
code: 'HOST_PROTOCOL_TOO_OLD' | 'PROTOCOL_INCOMPATIBLE';
|
|
285
|
+
message: string;
|
|
286
|
+
action: 'contact-support';
|
|
287
|
+
}> | Readonly<{
|
|
288
|
+
code: 'CONNECTION_LOST';
|
|
289
|
+
message: string;
|
|
290
|
+
action: 'retry';
|
|
291
|
+
}> | Readonly<{
|
|
292
|
+
code: 'UNKNOWN';
|
|
293
|
+
message: string;
|
|
294
|
+
action: 'contact-support';
|
|
295
|
+
}>;
|
|
296
|
+
export type ClaimError = EmbeddingError | Readonly<{
|
|
297
|
+
code: 'APP_MAJOR_TOO_OLD';
|
|
298
|
+
action: 'update-app';
|
|
299
|
+
requestedVersion: ContractVersion;
|
|
300
|
+
availableVersions: readonly ContractVersion[];
|
|
301
|
+
message: string;
|
|
302
|
+
}> | Readonly<{
|
|
303
|
+
code: 'HOST_MAJOR_TOO_OLD';
|
|
304
|
+
action: 'contact-support';
|
|
305
|
+
requestedVersion: ContractVersion;
|
|
306
|
+
availableVersions: readonly ContractVersion[];
|
|
307
|
+
message: string;
|
|
308
|
+
}>;
|
|
309
|
+
export type ClaimedValues<TContract extends AnyContract> = Readonly<{
|
|
310
|
+
[TKey in keyof TContract['fields']]: FieldValue<TContract['fields'][TKey]>;
|
|
311
|
+
}>;
|
|
312
|
+
export type ClaimState<TContract extends AnyContract> = Readonly<{
|
|
313
|
+
status: 'pending';
|
|
314
|
+
}> | Readonly<{
|
|
315
|
+
status: 'ready';
|
|
316
|
+
fields: ClaimedValues<TContract>;
|
|
317
|
+
}> | Readonly<{
|
|
318
|
+
status: 'unavailable';
|
|
319
|
+
}> | Readonly<{
|
|
320
|
+
status: 'failed';
|
|
321
|
+
error: ClaimError;
|
|
322
|
+
}>;
|
|
323
|
+
export interface ClaimStore<TContract extends AnyContract> {
|
|
324
|
+
readonly getSnapshot: () => ClaimState<TContract>;
|
|
325
|
+
readonly subscribe: (onChange: () => void) => Unsubscribe;
|
|
326
|
+
}
|
|
327
|
+
/** Framework-neutral claim capability consumed by feature modules. */
|
|
328
|
+
export interface AppClaims {
|
|
329
|
+
getClaim<TContract extends AnyContract>(contract: TContract): ClaimStore<TContract>;
|
|
330
|
+
}
|
|
331
|
+
/** Owns the lifecycle of one concrete embedding implementation. */
|
|
332
|
+
export interface AppEmbedding extends AppClaims {
|
|
333
|
+
start(): Unsubscribe;
|
|
334
|
+
getEmbeddingMetadata(): EmbeddingMetadataStore;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* One established connection, owned by the caller that opened it. These say
|
|
338
|
+
* nothing about which operational protocol produced them, so the connection
|
|
339
|
+
* lifecycle does not change when a protocol is added or retired.
|
|
340
|
+
*/
|
|
341
|
+
export type ManagedAppConnection = Readonly<{
|
|
342
|
+
connection: AppConnection;
|
|
343
|
+
surfaceId?: SurfaceId;
|
|
344
|
+
closeSignal: AbortSignal;
|
|
345
|
+
close(): void;
|
|
346
|
+
}>;
|
|
347
|
+
export type ManagedHostConnection = Readonly<{
|
|
348
|
+
closeSignal: AbortSignal;
|
|
349
|
+
close(): void;
|
|
350
|
+
}>;
|
|
351
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/apps-frontend",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "React inputs for Datadog Apps",
|
|
6
6
|
"homepage": "https://datadoghq.com",
|
|
@@ -20,6 +20,14 @@
|
|
|
20
20
|
".": {
|
|
21
21
|
"types": "./dist/src/index.d.ts",
|
|
22
22
|
"default": "./dist/src/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./embedding": {
|
|
25
|
+
"types": "./dist/src/embedding/index.d.ts",
|
|
26
|
+
"default": "./dist/src/embedding/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./embedding/react": {
|
|
29
|
+
"types": "./dist/src/embedding/react/index.d.ts",
|
|
30
|
+
"default": "./dist/src/embedding/react/index.js"
|
|
23
31
|
}
|
|
24
32
|
},
|
|
25
33
|
"publishConfig": {
|
|
@@ -27,6 +35,14 @@
|
|
|
27
35
|
".": {
|
|
28
36
|
"types": "./dist/src/index.d.ts",
|
|
29
37
|
"default": "./dist/src/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./embedding": {
|
|
40
|
+
"types": "./dist/src/embedding/index.d.ts",
|
|
41
|
+
"default": "./dist/src/embedding/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./embedding/react": {
|
|
44
|
+
"types": "./dist/src/embedding/react/index.d.ts",
|
|
45
|
+
"default": "./dist/src/embedding/react/index.js"
|
|
30
46
|
}
|
|
31
47
|
},
|
|
32
48
|
"access": "public"
|
|
@@ -37,12 +53,21 @@
|
|
|
37
53
|
"test-unit": "test-unit:workspace",
|
|
38
54
|
"typecheck": "typecheck:workspace"
|
|
39
55
|
},
|
|
40
|
-
"dependencies": {
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@standard-schema/spec": "1.1.0",
|
|
58
|
+
"penpal": "7.0.6"
|
|
59
|
+
},
|
|
41
60
|
"devDependencies": {
|
|
61
|
+
"@testing-library/react": "16.3.0",
|
|
42
62
|
"@types/datadog": "workspace:*",
|
|
43
63
|
"@types/node": "catalog:",
|
|
64
|
+
"@types/react": "catalog:",
|
|
65
|
+
"@types/react-dom": "catalog:",
|
|
44
66
|
"esbuild": "0.27.5",
|
|
45
|
-
"
|
|
67
|
+
"react": "catalog:",
|
|
68
|
+
"react-dom": "catalog:",
|
|
69
|
+
"typescript": "patch:typescript%40npm%3A6.0.2#~/.yarn/patches/typescript-npm-6.0.2-no-dts-errors.patch",
|
|
70
|
+
"zod": "4.3.6"
|
|
46
71
|
},
|
|
47
72
|
"peerDependencies": {
|
|
48
73
|
"react": "^18.0.0 || ^19.0.0"
|