@osdk/widget.api 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +128 -0
- package/build/browser/config.js +41 -0
- package/build/browser/config.js.map +1 -0
- package/build/browser/config.test.js +243 -0
- package/build/browser/config.test.js.map +1 -0
- package/build/browser/index.js +22 -0
- package/build/browser/index.js.map +1 -0
- package/build/browser/manifest.js +18 -0
- package/build/browser/manifest.js.map +1 -0
- package/build/browser/manifest.test.js +57 -0
- package/build/browser/manifest.test.js.map +1 -0
- package/build/browser/messages/hostMessages.js +40 -0
- package/build/browser/messages/hostMessages.js.map +1 -0
- package/build/browser/messages/widgetMessages.js +37 -0
- package/build/browser/messages/widgetMessages.js.map +1 -0
- package/build/browser/messages/widgetMessages.test.js +94 -0
- package/build/browser/messages/widgetMessages.test.js.map +1 -0
- package/build/browser/metaTags.js +18 -0
- package/build/browser/metaTags.js.map +1 -0
- package/build/browser/parameters.js +23 -0
- package/build/browser/parameters.js.map +1 -0
- package/build/browser/parameters.test.js +38 -0
- package/build/browser/parameters.test.js.map +1 -0
- package/build/browser/utils/asyncValue.js +2 -0
- package/build/browser/utils/asyncValue.js.map +1 -0
- package/build/cjs/index.cjs +64 -0
- package/build/cjs/index.cjs.map +1 -0
- package/build/cjs/index.d.cts +289 -0
- package/build/esm/config.js +41 -0
- package/build/esm/config.js.map +1 -0
- package/build/esm/config.test.js +243 -0
- package/build/esm/config.test.js.map +1 -0
- package/build/esm/index.js +22 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/manifest.js +18 -0
- package/build/esm/manifest.js.map +1 -0
- package/build/esm/manifest.test.js +57 -0
- package/build/esm/manifest.test.js.map +1 -0
- package/build/esm/messages/hostMessages.js +40 -0
- package/build/esm/messages/hostMessages.js.map +1 -0
- package/build/esm/messages/widgetMessages.js +37 -0
- package/build/esm/messages/widgetMessages.js.map +1 -0
- package/build/esm/messages/widgetMessages.test.js +94 -0
- package/build/esm/messages/widgetMessages.test.js.map +1 -0
- package/build/esm/metaTags.js +18 -0
- package/build/esm/metaTags.js.map +1 -0
- package/build/esm/parameters.js +23 -0
- package/build/esm/parameters.js.map +1 -0
- package/build/esm/parameters.test.js +38 -0
- package/build/esm/parameters.test.js.map +1 -0
- package/build/esm/utils/asyncValue.js +2 -0
- package/build/esm/utils/asyncValue.js.map +1 -0
- package/build/types/config.d.ts +74 -0
- package/build/types/config.d.ts.map +1 -0
- package/build/types/config.test.d.ts +1 -0
- package/build/types/config.test.d.ts.map +1 -0
- package/build/types/index.d.ts +10 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/manifest.d.ts +64 -0
- package/build/types/manifest.d.ts.map +1 -0
- package/build/types/manifest.test.d.ts +1 -0
- package/build/types/manifest.test.d.ts.map +1 -0
- package/build/types/messages/hostMessages.d.ts +33 -0
- package/build/types/messages/hostMessages.d.ts.map +1 -0
- package/build/types/messages/widgetMessages.d.ts +36 -0
- package/build/types/messages/widgetMessages.d.ts.map +1 -0
- package/build/types/messages/widgetMessages.test.d.ts +1 -0
- package/build/types/messages/widgetMessages.test.d.ts.map +1 -0
- package/build/types/metaTags.d.ts +1 -0
- package/build/types/metaTags.d.ts.map +1 -0
- package/build/types/parameters.d.ts +43 -0
- package/build/types/parameters.d.ts.map +1 -0
- package/build/types/parameters.test.d.ts +1 -0
- package/build/types/parameters.test.d.ts.map +1 -0
- package/build/types/utils/asyncValue.d.ts +38 -0
- package/build/types/utils/asyncValue.d.ts.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Map of the name of the type to the corresponding JavaScript type.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Wire format of parameter values that will be sent through postMessage events to custom widgets.
|
|
21
|
+
*/
|
|
22
|
+
export let ParameterValue;
|
|
23
|
+
//# sourceMappingURL=parameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.js","names":["ParameterValue"],"sources":["parameters.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AsyncValue } from \"./utils/asyncValue.js\";\n\n/**\n * Map of the name of the type to the corresponding JavaScript type.\n */\ntype PrimitiveParameterTypes = {\n boolean: boolean;\n /** Formatted as an ISO date string, e.g. YYYY-MM-DD */\n date: string;\n number: number;\n string: string;\n /** Formatted as an ISO datetime string */\n timestamp: string;\n};\ntype PrimitiveParameterType = keyof PrimitiveParameterTypes;\n\nexport interface AbstractParameterValue<T extends PrimitiveParameterType> {\n type: T;\n value: AsyncValue<PrimitiveParameterTypes[T]>;\n}\n\nexport interface GenericArrayParameterValue<T extends PrimitiveParameterType> {\n type: \"array\";\n subType: T;\n value: AsyncValue<PrimitiveParameterTypes[T][]>;\n}\n\n/**\n * Wire format of parameter values that will be sent through postMessage events to custom widgets.\n */\nexport namespace ParameterValue {\n export type String = AbstractParameterValue<\"string\">;\n export type Number = AbstractParameterValue<\"number\">;\n export type Boolean = AbstractParameterValue<\"boolean\">;\n export type Date = AbstractParameterValue<\"date\">;\n export type Timestamp = AbstractParameterValue<\"timestamp\">;\n\n export type StringArray = GenericArrayParameterValue<\"string\">;\n export type NumberArray = GenericArrayParameterValue<\"number\">;\n export type BooleanArray = GenericArrayParameterValue<\"boolean\">;\n export type DateArray = GenericArrayParameterValue<\"date\">;\n export type TimestampArray = GenericArrayParameterValue<\"timestamp\">;\n export type Array =\n | StringArray\n | NumberArray\n | BooleanArray\n | DateArray\n | TimestampArray;\n\n export type Type = ParameterValue[\"type\"];\n export type PrimitiveType = PrimitiveParameterType;\n}\nexport type ParameterValue =\n | ParameterValue.String\n | ParameterValue.Number\n | ParameterValue.Boolean\n | ParameterValue.Date\n | ParameterValue.Timestamp\n | ParameterValue.Array;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AAuBA;AACA;AACA;AAFA,WAGiBA,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { describe, expectTypeOf, it } from "vitest";
|
|
18
|
+
describe("Parameters", () => {
|
|
19
|
+
describe("ArrayParameterValue", () => {
|
|
20
|
+
it("should be able to narrow the type of the array value", () => {
|
|
21
|
+
expectTypeOf(testStringTypeNarrowing({
|
|
22
|
+
type: "array",
|
|
23
|
+
subType: "string",
|
|
24
|
+
value: {
|
|
25
|
+
type: "loaded",
|
|
26
|
+
value: ["a", "b", "c"]
|
|
27
|
+
}
|
|
28
|
+
})).toEqualTypeOf();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
function testStringTypeNarrowing(array) {
|
|
33
|
+
if (array.subType === "string" && array.value.type === "loaded") {
|
|
34
|
+
return array.value.value;
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=parameters.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.test.js","names":["describe","expectTypeOf","it","testStringTypeNarrowing","type","subType","value","toEqualTypeOf","array","undefined"],"sources":["parameters.test.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expectTypeOf, it } from \"vitest\";\nimport type { ParameterValue } from \"./parameters.js\";\n\ndescribe(\"Parameters\", () => {\n describe(\"ArrayParameterValue\", () => {\n it(\"should be able to narrow the type of the array value\", () => {\n expectTypeOf(\n testStringTypeNarrowing({\n type: \"array\",\n subType: \"string\",\n value: { type: \"loaded\", value: [\"a\", \"b\", \"c\"] },\n }),\n ).toEqualTypeOf<string[] | undefined>();\n });\n });\n});\n\nfunction testStringTypeNarrowing(array: ParameterValue.Array) {\n if (array.subType === \"string\" && array.value.type === \"loaded\") {\n return array.value.value;\n }\n return undefined;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAGnDF,QAAQ,CAAC,YAAY,EAAE,MAAM;EAC3BA,QAAQ,CAAC,qBAAqB,EAAE,MAAM;IACpCE,EAAE,CAAC,sDAAsD,EAAE,MAAM;MAC/DD,YAAY,CACVE,uBAAuB,CAAC;QACtBC,IAAI,EAAE,OAAO;QACbC,OAAO,EAAE,QAAQ;QACjBC,KAAK,EAAE;UAAEF,IAAI,EAAE,QAAQ;UAAEE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG;QAAE;MAClD,CAAC,CACH,CAAC,CAACC,aAAa,CAAuB,CAAC;IACzC,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,SAASJ,uBAAuBA,CAACK,KAA2B,EAAE;EAC5D,IAAIA,KAAK,CAACH,OAAO,KAAK,QAAQ,IAAIG,KAAK,CAACF,KAAK,CAACF,IAAI,KAAK,QAAQ,EAAE;IAC/D,OAAOI,KAAK,CAACF,KAAK,CAACA,KAAK;EAC1B;EACA,OAAOG,SAAS;AAClB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncValue.js","names":[],"sources":["asyncValue.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface AsyncNotStartedLoadingValue {\n type: \"not-started\";\n value?: never;\n error?: never;\n}\n\nexport interface AsyncLoadingValue {\n type: \"loading\";\n value?: never;\n error?: never;\n}\n\nexport interface AsyncLoadedValue<V> {\n type: \"loaded\";\n value: V | undefined;\n error?: never;\n}\n\nexport interface AsyncReloadingValue<V> {\n type: \"reloading\";\n value: V | undefined;\n error?: never;\n}\n\nexport interface AsyncFailedValue<V, E = Error> {\n type: \"failed\";\n error: E;\n value: V | undefined;\n}\n\n/**\n * Represents a value that is loaded asynchronously.\n * This allows for type safe checking of what the value's loading state is.\n * The expected lifecycle is:\n * not-started -> loading -> loaded or failed -> reloading -> ....\n */\nexport type AsyncValue<V, E = Error> =\n | AsyncNotStartedLoadingValue\n | AsyncLoadingValue\n | AsyncLoadedValue<V>\n | AsyncReloadingValue<V>\n | AsyncFailedValue<V, E>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ParameterValue } from "./parameters.js";
|
|
2
|
+
import type { AsyncValue } from "./utils/asyncValue.js";
|
|
3
|
+
interface PrimitiveParameterDefinition<T extends ParameterValue.PrimitiveType> {
|
|
4
|
+
type: T;
|
|
5
|
+
displayName: string;
|
|
6
|
+
}
|
|
7
|
+
interface ArrayParameterDefinition<S extends ParameterValue.PrimitiveType> {
|
|
8
|
+
type: ParameterValue.Array["type"];
|
|
9
|
+
displayName: string;
|
|
10
|
+
subType: S;
|
|
11
|
+
}
|
|
12
|
+
export type ParameterDefinition = PrimitiveParameterDefinition<ParameterValue.PrimitiveType> | ArrayParameterDefinition<ParameterValue.PrimitiveType>;
|
|
13
|
+
export interface EventDefinition<P extends ParameterConfig> {
|
|
14
|
+
displayName: string;
|
|
15
|
+
parameterUpdateIds: Array<ParameterId<P>>;
|
|
16
|
+
}
|
|
17
|
+
export type ParameterConfig = Record<string, ParameterDefinition>;
|
|
18
|
+
export interface WidgetConfig<P extends ParameterConfig> {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
type: "workshop";
|
|
23
|
+
parameters: ParameterConfig;
|
|
24
|
+
events: {
|
|
25
|
+
[eventId: string]: EventDefinition<NoInfer<P>>
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Extracts the parameter ID strings as types from the given ParameterConfig.
|
|
30
|
+
*/
|
|
31
|
+
export type ParameterId<C extends ParameterConfig> = Extract<keyof C, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Extracts a map of parameter IDs to their async-wrapped value types from the given ParameterConfig.
|
|
34
|
+
*/
|
|
35
|
+
export type AsyncParameterValueMap<C extends WidgetConfig<C["parameters"]>> = { [K in ParameterId<C["parameters"]>] : C["parameters"][K] extends ArrayParameterDefinition<infer S> ? Extract<ParameterValue.Array, {
|
|
36
|
+
type: C["parameters"][K]["type"]
|
|
37
|
+
subType: S
|
|
38
|
+
}>["value"] extends AsyncValue<infer P> ? {
|
|
39
|
+
type: "array"
|
|
40
|
+
subType: S
|
|
41
|
+
value: AsyncValue<P>
|
|
42
|
+
} : never : Extract<ParameterValue, {
|
|
43
|
+
type: C["parameters"][K]["type"]
|
|
44
|
+
}>["value"] extends AsyncValue<infer P> ? {
|
|
45
|
+
type: C["parameters"][K]["type"]
|
|
46
|
+
value: AsyncValue<P>
|
|
47
|
+
} : never };
|
|
48
|
+
/**
|
|
49
|
+
* Extracts a map of parameter IDs to the raw parameter values from the given ParameterConfig.
|
|
50
|
+
*/
|
|
51
|
+
export type ParameterValueMap<C extends WidgetConfig<C["parameters"]>> = { [K in ParameterId<C["parameters"]>] : C["parameters"][K] extends ArrayParameterDefinition<infer S> ? Extract<ParameterValue.Array, {
|
|
52
|
+
type: C["parameters"][K]["type"]
|
|
53
|
+
subType: S
|
|
54
|
+
}>["value"] extends AsyncValue<infer P> ? P : never : Extract<ParameterValue, {
|
|
55
|
+
type: C["parameters"][K]["type"]
|
|
56
|
+
}>["value"] extends AsyncValue<infer P> ? P : never };
|
|
57
|
+
export type EventId<C extends WidgetConfig<C["parameters"]>> = keyof C["events"];
|
|
58
|
+
/**
|
|
59
|
+
* Extracts a list of strongly-typed parameter IDs from the given WidgetConfig for a given event ID.
|
|
60
|
+
* If a parameter ID is referenced by an event but does not exist, its type will be never
|
|
61
|
+
*/
|
|
62
|
+
export type EventParameterIdList<
|
|
63
|
+
C extends WidgetConfig<C["parameters"]>,
|
|
64
|
+
K extends EventId<C>
|
|
65
|
+
> = C["events"][K]["parameterUpdateIds"] extends Array<ParameterId<C["parameters"]>> ? C["events"][K]["parameterUpdateIds"] : never;
|
|
66
|
+
/**
|
|
67
|
+
* Extracts a map of event IDs to their raw parameter value types from the given WidgetConfig.
|
|
68
|
+
*/
|
|
69
|
+
export type EventParameterValueMap<
|
|
70
|
+
C extends WidgetConfig<C["parameters"]>,
|
|
71
|
+
K extends EventId<C>
|
|
72
|
+
> = { [P in EventParameterIdList<C, K>[number]] : ParameterValueMap<C>[P] };
|
|
73
|
+
export declare function defineConfig<const C extends WidgetConfig<any>>(c: C): C;
|
|
74
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,sBAAsB,iBAAkB;AACtD,cAAc,kBAAkB,uBAAwB;UAE9C,6BAA6B,UAAU,eAAe,eAAe;CAC7E,MAAM;CACN;AACD;UACS,yBAAyB,UAAU,eAAe,eAAe;CACzE,MAAM,eAAe,MAAM;CAC3B;CACA,SAAS;AACV;AACD,YAAY,sBACR,6BAA6B,eAAe,iBAC5C,yBAAyB,eAAe;AAE5C,iBAAiB,gBAAgB,UAAU,iBAAiB;CAC1D;CACA,oBAAoB,MAAM,YAAY;AACvC;AAED,YAAY,kBAAkB,eAAe;AAE7C,iBAAiB,aAAa,UAAU,iBAAiB;CACvD;CACA;CACA;CAEA,MAAM;CACN,YAAY;CACZ,QAAQ;qBAAqB,gBAAgB,QAAQ;CAAK;AAC3D;;;;AAKD,YAAY,YAAY,UAAU,mBAAmB,cAAc;;;;AAKnE,YAAY,uBAAuB,UAAU,aAAa,EAAE,qBAExD,KAAK,YACH,EAAE,kBAEH,EAAE,cAAc,WAAW,+BAA+B,KAEzD,QACA,eAAe,OACf;CAAE,MAAM,EAAE,cAAc,GAAG;CAAS,SAAS;AAAG,GAChD,iBAAiB,iBAAiB,KAAK;CACrC,MAAM;CACN,SAAS;CACT,OAAO,WAAW;AACnB,YAED,QACA,gBACA;CAAE,MAAM,EAAE,cAAc,GAAG;AAAS,GACpC,iBAAiB,iBAAiB,KAAK;CACrC,MAAM,EAAE,cAAc,GAAG;CACzB,OAAO,WAAW;AACnB;;;;AAOP,YAAY,kBAAkB,UAAU,aAAa,EAAE,qBAEnD,KAAK,YACH,EAAE,kBAEH,EAAE,cAAc,WAAW,+BAA+B,KAAK,QAC9D,eAAe,OACf;CAAE,MAAM,EAAE,cAAc,GAAG;CAAS,SAAS;AAAG,GAChD,iBAAiB,iBAAiB,KAAK,YAEvC,QACA,gBACA;CAAE,MAAM,EAAE,cAAc,GAAG;AAAS,GACpC,iBAAiB,iBAAiB,KAAK;AAI7C,YAAY,QAAQ,UAAU,aAAa,EAAE,wBACrC,EAAE;;;;;AAMV,YAAY;CACV,UAAU,aAAa,EAAE;CACzB,UAAU,QAAQ;IAChB,EAAE,UAAU,GAAG,8BACjB,MAAM,YAAY,EAAE,kBAAkB,EAAE,UAAU,GAAG;;;;AAMvD,YAAY;CACV,UAAU,aAAa,EAAE;CACzB,UAAU,QAAQ;OAEjB,KAAK,qBAAqB,GAAG,cAAa,kBAAkB,GAAG;AAGlE,OAAO,iBAAS,mBAAmB,UAAU,mBAAmBA,GAAG,IAAI","names":["c: C"],"sources":["../../src/config.ts"],"version":3,"file":"config.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../src/config.test.ts"],"version":3,"file":"config.test.d.ts"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { AsyncParameterValueMap, EventId, EventParameterValueMap, ParameterConfig, ParameterDefinition, ParameterValueMap, WidgetConfig } from "./config.js";
|
|
2
|
+
export { defineConfig } from "./config.js";
|
|
3
|
+
export type { WidgetManifestConfigV1 as WidgetManifestConfig, WidgetSetManifestV1 as WidgetSetManifest } from "./manifest.js";
|
|
4
|
+
export { MANIFEST_FILE_LOCATION } from "./manifest.js";
|
|
5
|
+
export { HostMessage, isHostParametersUpdatedMessage, visitHostMessage } from "./messages/hostMessages.js";
|
|
6
|
+
export { isWidgetEmitEventMessage, isWidgetReadyMessage, visitWidgetMessage } from "./messages/widgetMessages.js";
|
|
7
|
+
export type { WidgetMessage } from "./messages/widgetMessages.js";
|
|
8
|
+
export { META_TAG_HOST_ORIGIN } from "./metaTags.js";
|
|
9
|
+
export type { ParameterValue } from "./parameters.js";
|
|
10
|
+
export type { AsyncFailedValue, AsyncLoadedValue, AsyncLoadingValue, AsyncNotStartedLoadingValue, AsyncReloadingValue, AsyncValue } from "./utils/asyncValue.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cACE,wBACA,SACA,wBACA,iBACA,qBACA,mBACA,oBACK;AACP,SAAS,oBAAoB;AAC7B,cACE,0BAA0B,sBAC1B,uBAAuB,yBAClB;AACP,SAAS,8BAA8B;AACvC,SACE,aACA,gCACA,wBACK;AACP,SACE,0BACA,sBACA,0BACK;AACP,cAAc,qBAAqB;AACnC,SAAS,4BAA4B;AACrC,cAAc,sBAAsB;AACpC,cACE,kBACA,kBACA,mBACA,6BACA,qBACA,kBACK","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { EventDefinition, ParameterConfig, ParameterDefinition } from "./config.js";
|
|
2
|
+
export interface WidgetSetManifestV1 {
|
|
3
|
+
manifestVersion: "1.0.0";
|
|
4
|
+
widgetSet: WidgetSetManifestContentV1;
|
|
5
|
+
}
|
|
6
|
+
export interface WidgetSetManifestContentV1 {
|
|
7
|
+
/**
|
|
8
|
+
* RID of the widget set that this config corresponds to
|
|
9
|
+
*/
|
|
10
|
+
rid: string;
|
|
11
|
+
/**
|
|
12
|
+
* The version of the widget to publish as
|
|
13
|
+
*/
|
|
14
|
+
version: string;
|
|
15
|
+
/**
|
|
16
|
+
* Set of widgets that are available to be rendered.
|
|
17
|
+
* The key can be arbitrary, and is usually the name of your entrypoint, e.g. "main"
|
|
18
|
+
*/
|
|
19
|
+
widgets: Record<string, WidgetManifestConfigV1>;
|
|
20
|
+
}
|
|
21
|
+
export interface WidgetManifestConfigV1 {
|
|
22
|
+
/**
|
|
23
|
+
* The ID of this widget. Must be unique within the widget set
|
|
24
|
+
*/
|
|
25
|
+
id: string;
|
|
26
|
+
/**
|
|
27
|
+
* The user friendly name of this widget
|
|
28
|
+
*/
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* A user friendly description of this widget
|
|
32
|
+
*/
|
|
33
|
+
description?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The target Foundry UI that this widget is intended to be used in
|
|
36
|
+
*/
|
|
37
|
+
type: "workshopWidgetV1";
|
|
38
|
+
/**
|
|
39
|
+
* List of entrypoint JS files to be loaded, in order. These will be placed on the page in script tags
|
|
40
|
+
*/
|
|
41
|
+
entrypointJs: Array<{
|
|
42
|
+
/** Relative path of the JS file to load */
|
|
43
|
+
path: string
|
|
44
|
+
/** The type to use in the script tag when loading this JS file */
|
|
45
|
+
type: "module" | "text/javascript"
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Any CSS files to be loaded, in order.
|
|
49
|
+
* @optional
|
|
50
|
+
*/
|
|
51
|
+
entrypointCss?: Array<{
|
|
52
|
+
/** Relative path of the CSS file to load */
|
|
53
|
+
path: string
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* The map of parameter IDs to their definition
|
|
57
|
+
*/
|
|
58
|
+
parameters: Record<string, ParameterDefinition>;
|
|
59
|
+
/**
|
|
60
|
+
* The map of events to their definition. Any parameter IDs referenced must be defined in the `parameters` field
|
|
61
|
+
*/
|
|
62
|
+
events: Record<string, EventDefinition<ParameterConfig>>;
|
|
63
|
+
}
|
|
64
|
+
export declare const MANIFEST_FILE_LOCATION = ".palantir/widgets.config.json";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cACE,iBACA,iBACA,2BACK,aAAc;AAErB,iBAAiB,oBAAoB;CACnC,iBAAiB;CACjB,WAAW;AACZ;AAED,iBAAiB,2BAA2B;;;;CAI1C;;;;CAKA;;;;;CAMA,SAAS,eAAe;AACzB;AAED,iBAAiB,uBAAuB;;;;CAItC;;;;CAKA;;;;CAKA;;;;CAKA,MAAM;;;;CAKN,cAAc,MAAM;;EAElB;;EAGA,MAAM,WAAW;CAClB;;;;;CAMD,gBAAgB,MAAM;;EAEpB;CACD;;;;CAKD,YAAY,eAAe;;;;CAK3B,QAAQ,eAAe,gBAAgB;AACxC;AAED,OAAO,cAAM,yBAAyB","names":[],"sources":["../../src/manifest.ts"],"version":3,"file":"manifest.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../src/manifest.test.ts"],"version":3,"file":"manifest.test.d.ts"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AsyncParameterValueMap, WidgetConfig } from "../config.js";
|
|
2
|
+
interface HostBaseMessage<
|
|
3
|
+
T extends string,
|
|
4
|
+
P = unknown
|
|
5
|
+
> {
|
|
6
|
+
type: T;
|
|
7
|
+
payload: P;
|
|
8
|
+
}
|
|
9
|
+
export declare namespace HostMessage {
|
|
10
|
+
const Version = "1.0.0";
|
|
11
|
+
type Version = typeof Version;
|
|
12
|
+
namespace Payload {
|
|
13
|
+
interface UpdateParameters<C extends WidgetConfig<C["parameters"]>> {
|
|
14
|
+
parameters: AsyncParameterValueMap<C>;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
type Payload = Payload.UpdateParameters<any>;
|
|
18
|
+
interface UpdateParameters<C extends WidgetConfig<C["parameters"]>> extends HostBaseMessage<"host.update-parameters", Payload.UpdateParameters<C>> {}
|
|
19
|
+
}
|
|
20
|
+
export type HostMessage<C extends WidgetConfig<C["parameters"]>> = HostMessage.UpdateParameters<C>;
|
|
21
|
+
export declare function isHostParametersUpdatedMessage<C extends WidgetConfig<C["parameters"]>>(event: HostMessage<C>): event is HostMessage.UpdateParameters<C>;
|
|
22
|
+
type HostMessageVisitor<C extends WidgetConfig<C["parameters"]>> = { [T in HostMessage<C>["type"]] : (payload: Extract<HostMessage<C>, {
|
|
23
|
+
type: T
|
|
24
|
+
}> extends {
|
|
25
|
+
payload: infer P
|
|
26
|
+
} ? P : never) => void } & {
|
|
27
|
+
_unknown: (type: string) => void
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Strongly typed visitor to handle every type of host message
|
|
31
|
+
*/
|
|
32
|
+
export declare function visitHostMessage<C extends WidgetConfig<C["parameters"]>>(message: HostMessage<C>, visitor: HostMessageVisitor<C>): void;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,wBAAwB,oBAAoB,cAAe;UAG/D;CAAgB;CAAkB;EAAa;CACvD,MAAM;CACN,SAAS;AACV;AAED,yBAAiB;CACR,MAAM,UAAU;MACX,iBAAiB;WAEZ;YACE,iBAAiB,UAAU,aAAa,EAAE,gBAAgB;GACzE,YAAY,uBAAuB;EACpC;;MAGS,UAAU,QAAQ;WAEb,iBAAiB,UAAU,aAAa,EAAE,wBAEvD,gBACE,0BACA,QAAQ,iBAAiB,IAE/B,CAAE;;AAGJ,YAAY,YAAY,UAAU,aAAa,EAAE,kBAC/C,YAAY,iBAAiB;AAE/B,OAAO,iBAAS,+BACd,UAAU,aAAa,EAAE,gBACzBA,OAAO,YAAY,KAAK,SAAS,YAAY,iBAAiB;KAI3D,mBAAmB,UAAU,aAAa,EAAE,qBAE5C,KAAK,YAAY,GAAG,YACnBC,SAAS,QAAQ,YAAY,IAAI;CAAE,MAAM;AAAG,WAAU;CACpD,eAAe;AAChB,IAAG,uBAIN;CACA,WAAWC;AACZ;;;;AAKH,OAAO,iBAAS,iBAAiB,UAAU,aAAa,EAAE,gBACxDC,SAAS,YAAY,IACrBC,SAAS,mBAAmB","names":["event: HostMessage<C>","payload: Extract<HostMessage<C>, { type: T }> extends {\n payload: infer P;\n } ? P\n : never","type: string","message: HostMessage<C>","visitor: HostMessageVisitor<C>"],"sources":["../../../src/messages/hostMessages.ts"],"version":3,"file":"hostMessages.d.ts"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { EventId, EventParameterValueMap, WidgetConfig } from "../config.js";
|
|
2
|
+
import type { HostMessage } from "./hostMessages.js";
|
|
3
|
+
interface WidgetBaseMessage<
|
|
4
|
+
T extends string,
|
|
5
|
+
P = unknown
|
|
6
|
+
> {
|
|
7
|
+
type: T;
|
|
8
|
+
payload: P;
|
|
9
|
+
}
|
|
10
|
+
type EmitEventIdMap<C extends WidgetConfig<C["parameters"]>> = { [K in EventId<C>] : {
|
|
11
|
+
eventId: K
|
|
12
|
+
parameterUpdates: EventParameterValueMap<C, K>
|
|
13
|
+
} };
|
|
14
|
+
export declare namespace WidgetMessage {
|
|
15
|
+
namespace Payload {
|
|
16
|
+
interface Ready {
|
|
17
|
+
apiVersion: HostMessage.Version;
|
|
18
|
+
}
|
|
19
|
+
type EmitEvent<C extends WidgetConfig<C["parameters"]>> = EmitEventIdMap<C>[EventId<C>];
|
|
20
|
+
}
|
|
21
|
+
type Payload<C extends WidgetConfig<C["parameters"]>> = Payload.Ready | Payload.EmitEvent<C>;
|
|
22
|
+
interface Ready extends WidgetBaseMessage<"widget.ready", Payload.Ready> {}
|
|
23
|
+
interface EmitEvent<C extends WidgetConfig<C["parameters"]>> extends WidgetBaseMessage<"widget.emit-event", Payload.EmitEvent<C>> {}
|
|
24
|
+
}
|
|
25
|
+
export type WidgetMessage<C extends WidgetConfig<C["parameters"]>> = WidgetMessage.Ready | WidgetMessage.EmitEvent<C>;
|
|
26
|
+
export declare function isWidgetReadyMessage<C extends WidgetConfig<C["parameters"]>>(event: WidgetMessage<C>): event is WidgetMessage.Ready;
|
|
27
|
+
export declare function isWidgetEmitEventMessage<C extends WidgetConfig<C["parameters"]>>(event: WidgetMessage<C>): event is WidgetMessage.EmitEvent<C>;
|
|
28
|
+
type WidgetMessageVisitor<C extends WidgetConfig<C["parameters"]>> = { [T in WidgetMessage<C>["type"]] : (payload: Extract<WidgetMessage<C>, {
|
|
29
|
+
type: T
|
|
30
|
+
}> extends {
|
|
31
|
+
payload: infer P
|
|
32
|
+
} ? P : never) => void } & {
|
|
33
|
+
_unknown: (type: string) => void
|
|
34
|
+
};
|
|
35
|
+
export declare function visitWidgetMessage<C extends WidgetConfig<C["parameters"]>>(message: WidgetMessage<C>, visitor: WidgetMessageVisitor<C>): void;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cACE,SACA,wBACA,oBACK,cAAe;AACtB,cAAc,mBAAmB,mBAAoB;UAI3C;CAAkB;CAAkB;EAAa;CACzD,MAAM;CACN,SAAS;AACV;KAEI,eAAe,UAAU,aAAa,EAAE,qBAC1C,KAAK,QAAQ,MAAK;CACjB,SAAS;CACT,kBAAkB,uBAAuB,GAAG;AAC7C;AAGH,yBAAiB;WACE;YACE,MAAM;GACrB,YAAY,YAAY;EACzB;OAEW,UAAU,UAAU,aAAa,EAAE,kBAC7C,eAAe,GAAG,QAAQ;;MAGlB,QAAQ,UAAU,aAAa,EAAE,kBACzC,QAAQ,QACR,QAAQ,UAAU;WAKL,cACP,kBAAkB,gBAAgB,QAAQ,OACpD,CAAE;WAKe,UAAU,UAAU,aAAa,EAAE,wBAC1C,kBAAkB,qBAAqB,QAAQ,UAAU,IACnE,CAAE;;AAGJ,YAAY,cAAc,UAAU,aAAa,EAAE,kBAC/C,cAAc,QACd,cAAc,UAAU;AAE5B,OAAO,iBAAS,qBAAqB,UAAU,aAAa,EAAE,gBAC5DA,OAAO,cAAc,KACpB,SAAS,cAAc;AAI1B,OAAO,iBAAS,yBACd,UAAU,aAAa,EAAE,gBACzBA,OAAO,cAAc,KAAK,SAAS,cAAc,UAAU;KAIxD,qBAAqB,UAAU,aAAa,EAAE,qBAE9C,KAAK,cAAc,GAAG,YACrBC,SAAS,QAAQ,cAAc,IAAI;CAAE,MAAM;AAAG,WAAU;CACtD,eAAe;AAChB,IAAG,uBAIN;CACA,WAAWC;AACZ;AAEH,OAAO,iBAAS,mBAAmB,UAAU,aAAa,EAAE,gBAC1DC,SAAS,cAAc,IACvBC,SAAS,qBAAqB","names":["event: WidgetMessage<C>","payload: Extract<WidgetMessage<C>, { type: T }> extends {\n payload: infer P;\n } ? P\n : never","type: string","message: WidgetMessage<C>","visitor: WidgetMessageVisitor<C>"],"sources":["../../../src/messages/widgetMessages.ts"],"version":3,"file":"widgetMessages.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../../src/messages/widgetMessages.test.ts"],"version":3,"file":"widgetMessages.test.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const META_TAG_HOST_ORIGIN = "x-palantir-widgets-host-origin";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,OAAO,cAAM,uBAAuB","names":[],"sources":["../../src/metaTags.ts"],"version":3,"file":"metaTags.d.ts"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AsyncValue } from "./utils/asyncValue.js";
|
|
2
|
+
/**
|
|
3
|
+
* Map of the name of the type to the corresponding JavaScript type.
|
|
4
|
+
*/
|
|
5
|
+
type PrimitiveParameterTypes = {
|
|
6
|
+
boolean: boolean
|
|
7
|
+
/** Formatted as an ISO date string, e.g. YYYY-MM-DD */
|
|
8
|
+
date: string
|
|
9
|
+
number: number
|
|
10
|
+
string: string
|
|
11
|
+
/** Formatted as an ISO datetime string */
|
|
12
|
+
timestamp: string
|
|
13
|
+
};
|
|
14
|
+
type PrimitiveParameterType = keyof PrimitiveParameterTypes;
|
|
15
|
+
export interface AbstractParameterValue<T extends PrimitiveParameterType> {
|
|
16
|
+
type: T;
|
|
17
|
+
value: AsyncValue<PrimitiveParameterTypes[T]>;
|
|
18
|
+
}
|
|
19
|
+
export interface GenericArrayParameterValue<T extends PrimitiveParameterType> {
|
|
20
|
+
type: "array";
|
|
21
|
+
subType: T;
|
|
22
|
+
value: AsyncValue<PrimitiveParameterTypes[T][]>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Wire format of parameter values that will be sent through postMessage events to custom widgets.
|
|
26
|
+
*/
|
|
27
|
+
export declare namespace ParameterValue {
|
|
28
|
+
type String = AbstractParameterValue<"string">;
|
|
29
|
+
type Number = AbstractParameterValue<"number">;
|
|
30
|
+
type Boolean = AbstractParameterValue<"boolean">;
|
|
31
|
+
type Date = AbstractParameterValue<"date">;
|
|
32
|
+
type Timestamp = AbstractParameterValue<"timestamp">;
|
|
33
|
+
type StringArray = GenericArrayParameterValue<"string">;
|
|
34
|
+
type NumberArray = GenericArrayParameterValue<"number">;
|
|
35
|
+
type BooleanArray = GenericArrayParameterValue<"boolean">;
|
|
36
|
+
type DateArray = GenericArrayParameterValue<"date">;
|
|
37
|
+
type TimestampArray = GenericArrayParameterValue<"timestamp">;
|
|
38
|
+
type Array = StringArray | NumberArray | BooleanArray | DateArray | TimestampArray;
|
|
39
|
+
type Type = ParameterValue["type"];
|
|
40
|
+
type PrimitiveType = PrimitiveParameterType;
|
|
41
|
+
}
|
|
42
|
+
export type ParameterValue = ParameterValue.String | ParameterValue.Number | ParameterValue.Boolean | ParameterValue.Date | ParameterValue.Timestamp | ParameterValue.Array;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,kBAAkB,uBAAwB;;;;KAKnD,0BAA0B;CAC7B;;CAEA;CACA;CACA;;CAEA;AACD;KACI,+BAA+B;AAEpC,iBAAiB,uBAAuB,UAAU,wBAAwB;CACxE,MAAM;CACN,OAAO,WAAW,wBAAwB;AAC3C;AAED,iBAAiB,2BAA2B,UAAU,wBAAwB;CAC5E,MAAM;CACN,SAAS;CACT,OAAO,WAAW,wBAAwB;AAC3C;;;;AAKD,yBAAiB;MACH,SAAS,uBAAuB;MAChC,SAAS,uBAAuB;MAChC,UAAU,uBAAuB;MACjC,OAAO,uBAAuB;MAC9B,YAAY,uBAAuB;MAEnC,cAAc,2BAA2B;MACzC,cAAc,2BAA2B;MACzC,eAAe,2BAA2B;MAC1C,YAAY,2BAA2B;MACvC,iBAAiB,2BAA2B;MAC5C,QACR,cACA,cACA,eACA,YACA;MAEQ,OAAO,eAAe;MACtB,gBAAgB;;AAE9B,YAAY,iBACR,eAAe,SACf,eAAe,SACf,eAAe,UACf,eAAe,OACf,eAAe,YACf,eAAe","names":[],"sources":["../../src/parameters.ts"],"version":3,"file":"parameters.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"","names":[],"sources":["../../src/parameters.test.ts"],"version":3,"file":"parameters.test.d.ts"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface AsyncNotStartedLoadingValue {
|
|
2
|
+
type: "not-started";
|
|
3
|
+
value?: never;
|
|
4
|
+
error?: never;
|
|
5
|
+
}
|
|
6
|
+
export interface AsyncLoadingValue {
|
|
7
|
+
type: "loading";
|
|
8
|
+
value?: never;
|
|
9
|
+
error?: never;
|
|
10
|
+
}
|
|
11
|
+
export interface AsyncLoadedValue<V> {
|
|
12
|
+
type: "loaded";
|
|
13
|
+
value: V | undefined;
|
|
14
|
+
error?: never;
|
|
15
|
+
}
|
|
16
|
+
export interface AsyncReloadingValue<V> {
|
|
17
|
+
type: "reloading";
|
|
18
|
+
value: V | undefined;
|
|
19
|
+
error?: never;
|
|
20
|
+
}
|
|
21
|
+
export interface AsyncFailedValue<
|
|
22
|
+
V,
|
|
23
|
+
E = Error
|
|
24
|
+
> {
|
|
25
|
+
type: "failed";
|
|
26
|
+
error: E;
|
|
27
|
+
value: V | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Represents a value that is loaded asynchronously.
|
|
31
|
+
* This allows for type safe checking of what the value's loading state is.
|
|
32
|
+
* The expected lifecycle is:
|
|
33
|
+
* not-started -> loading -> loaded or failed -> reloading -> ....
|
|
34
|
+
*/
|
|
35
|
+
export type AsyncValue<
|
|
36
|
+
V,
|
|
37
|
+
E = Error
|
|
38
|
+
> = AsyncNotStartedLoadingValue | AsyncLoadingValue | AsyncLoadedValue<V> | AsyncReloadingValue<V> | AsyncFailedValue<V, E>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,iBAAiB,4BAA4B;CAC3C,MAAM;CACN;CACA;AACD;AAED,iBAAiB,kBAAkB;CACjC,MAAM;CACN;CACA;AACD;AAED,iBAAiB,iBAAiB,GAAG;CACnC,MAAM;CACN,OAAO;CACP;AACD;AAED,iBAAiB,oBAAoB,GAAG;CACtC,MAAM;CACN,OAAO;CACP;AACD;AAED,iBAAiB;CAAiB;CAAG,IAAI;EAAO;CAC9C,MAAM;CACN,OAAO;CACP,OAAO;AACR;;;;;;;AAQD,YAAY;CAAW;CAAG,IAAI;IAC1B,8BACA,oBACA,iBAAiB,KACjB,oBAAoB,KACpB,iBAAiB,GAAG","names":[],"sources":["../../../src/utils/asyncValue.ts"],"version":3,"file":"asyncValue.d.ts"}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@osdk/widget.api",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "API contract between Foundry UIs that can embed custom widgets and the custom widgets themselves",
|
|
5
|
+
"access": "public",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/palantir/osdk-ts.git"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"browser": "./build/browser/index.js",
|
|
14
|
+
"import": {
|
|
15
|
+
"types": "./build/types/index.d.ts",
|
|
16
|
+
"default": "./build/esm/index.js"
|
|
17
|
+
},
|
|
18
|
+
"require": "./build/cjs/index.cjs",
|
|
19
|
+
"default": "./build/browser/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./*": {
|
|
22
|
+
"browser": "./build/browser/public/*.js",
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./build/types/public/*.d.ts",
|
|
25
|
+
"default": "./build/esm/public/*.js"
|
|
26
|
+
},
|
|
27
|
+
"require": "./build/cjs/public/*.cjs",
|
|
28
|
+
"default": "./build/browser/public/*.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"ts-expect": "^1.3.0",
|
|
33
|
+
"typescript": "~5.5.4",
|
|
34
|
+
"vitest": "^3.0.5",
|
|
35
|
+
"@osdk/monorepo.api-extractor": "~0.1.0",
|
|
36
|
+
"@osdk/monorepo.tsconfig": "~0.1.0"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [],
|
|
42
|
+
"files": [
|
|
43
|
+
"build/cjs",
|
|
44
|
+
"build/esm",
|
|
45
|
+
"build/browser",
|
|
46
|
+
"build/types",
|
|
47
|
+
"CHANGELOG.md",
|
|
48
|
+
"package.json",
|
|
49
|
+
"templates",
|
|
50
|
+
"*.d.ts"
|
|
51
|
+
],
|
|
52
|
+
"main": "./build/cjs/index.cjs",
|
|
53
|
+
"module": "./build/esm/index.js",
|
|
54
|
+
"types": "./build/cjs/index.d.cts",
|
|
55
|
+
"type": "module",
|
|
56
|
+
"scripts": {
|
|
57
|
+
"check-attw": "attw --pack .",
|
|
58
|
+
"check-spelling": "cspell --quiet .",
|
|
59
|
+
"clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
|
|
60
|
+
"fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)",
|
|
61
|
+
"lint": "eslint . && dprint check --config $(find-up dprint.json)",
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"transpileBrowser": "monorepo.tool.transpile -f esm -m normal -t browser",
|
|
64
|
+
"transpileCjs": "monorepo.tool.transpile -f cjs -m bundle -t node",
|
|
65
|
+
"transpileEsm": "monorepo.tool.transpile -f esm -m normal -t node",
|
|
66
|
+
"transpileTypes": "monorepo.tool.transpile -f esm -m types -t node",
|
|
67
|
+
"typecheck": "tsc --noEmit --emitDeclarationOnly false"
|
|
68
|
+
}
|
|
69
|
+
}
|