Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions dev_docs/key_concepts/anatomy_of_a_plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ If you are developing in TypeScript (which we recommend), you will need to add a
core capabilities as an argument. It should return an instance of its plugin class for Kibana to load.

```ts
import type { PluginInitializerContext } from 'kibana/server';
import type { PluginInitializerContext } from '@kbn/core/server';
import { DemoPlugin } from './plugin';

export function plugin(initializerContext: PluginInitializerContext) {
Expand Down Expand Up @@ -156,7 +156,7 @@ Using the non-`type` variation will increase the bundle size unnecessarily and m
point, but all plugins at Elastic should be consistent in this way.

```ts
import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from 'kibana/server';
import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from '@kbn/core/server';

export class DemoPlugin implements Plugin {
constructor(initializerContext: PluginInitializerContext) {}
Expand Down Expand Up @@ -184,7 +184,7 @@ export class DemoPlugin implements Plugin {
`server/plugin.ts` is the server-side plugin definition. The shape of this plugin is the same as it’s client-side counter-part:

```ts
import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from 'kibana/server';
import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from '@kbn/core/server';

export class DemoPlugin implements Plugin {
constructor(initializerContext: PluginInitializerContext) {}
Expand Down Expand Up @@ -240,7 +240,7 @@ For example, the core http service exposes a function createRouter to all plugin
a plugin just accesses it off of the first argument:

```ts
import type { CoreSetup } from 'kibana/server';
import type { CoreSetup } from '@kbn/core/server';

export class DemoPlugin {
public setup(core: CoreSetup) {
Expand All @@ -260,7 +260,7 @@ dependency in it’s kibana.json manifest file.
** foobar plugin.ts: **

```ts
import type { Plugin } from 'kibana/server';
import type { Plugin } from '@kbn/core/server';
// [1]
export interface FoobarPluginSetup {
getFoo(): string;
Expand Down Expand Up @@ -306,7 +306,7 @@ export class MyPlugin implements Plugin<FoobarPluginSetup, FoobarPluginStart> {
With that specified in the plugin manifest, the appropriate interfaces are then available via the second argument of setup and/or start:

```ts
import type { CoreSetup, CoreStart } from 'kibana/server';
import type { CoreSetup, CoreStart } from '@kbn/core/server';
import type { FoobarPluginSetup, FoobarPluginStart } from '../../foobar/server';

// [1]
Expand Down
2 changes: 1 addition & 1 deletion dev_docs/key_concepts/performance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ some heavy-weight libraries that will also be removed from the initial
plugin bundle, therefore, reducing its size by a significant amount.

```ts
import type { Plugin, CoreSetup, AppMountParameters } from 'kibana/public';
import type { Plugin, CoreSetup, AppMountParameters } from '@kbn/core/public';
export class MyPlugin implements Plugin<MyPluginSetup> {
setup(core: CoreSetup, plugins: SetupDeps) {
core.application.register({
Expand Down
8 changes: 4 additions & 4 deletions dev_docs/tutorials/advanced_settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The following is a basic example for using the `uiSettings` service:

**src/plugins/charts/public/plugin.ts**
```ts
import { Plugin, CoreSetup } from 'kibana/public';
import { Plugin, CoreSetup } from '@kbn/core/public';
import { ExpressionsSetup } from '../../expressions/public';
import { palette, systemPalette } from '../common';

Expand Down Expand Up @@ -132,7 +132,7 @@ The example also shows how plugins can leverage the optional deprecation paramet
```ts
import { i18n } from '@kbn/i18n';
import { schema } from '@kbn/config-schema';
import { CoreSetup, Plugin } from 'kibana/server';
import { CoreSetup, Plugin } from '@kbn/core/server';
import { COLOR_MAPPING_SETTING, LEGACY_TIME_AXIS, palette, systemPalette } from '../common';
import { ExpressionsServerSetup } from '../../expressions/server';

Expand Down Expand Up @@ -192,7 +192,7 @@ For example, changing the time filter refresh interval triggers a prompt in the
```ts
import { i18n } from '@kbn/i18n';
import { schema } from '@kbn/config-schema';
import type { DocLinksServiceSetup, UiSettingsParams } from 'kibana/server';
import type { DocLinksServiceSetup, UiSettingsParams } from '@kbn/core/server';
import { DEFAULT_QUERY_LANGUAGE, UI_SETTINGS } from '../common';

export function getUiSettings(
Expand Down Expand Up @@ -231,7 +231,7 @@ For example, in 7.9.0, `siem` as renamed to `securitySolution`, and in 8.0.0, `t
**src/core/server/ui_settings/saved_objects/migrations.ts**

```ts
import { SavedObjectUnsanitizedDoc, SavedObjectSanitizedDoc } from 'kibana/server';
import { SavedObjectUnsanitizedDoc, SavedObjectSanitizedDoc } from '@kbn/core/server';

export const migrations = {
'7.9.0': (doc: SavedObjectUnsanitizedDoc<any>): SavedObjectSanitizedDoc<any> => ({
Expand Down
4 changes: 2 additions & 2 deletions dev_docs/tutorials/data/search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ However, the recommended and easiest way to search Elasticsearch is by using the
Here is a basic example for using the `data.search` service from a custom plugin:

```ts
import { CoreStart, Plugin } from 'kibana/public';
import { CoreStart, Plugin } from '@kbn/core/public';
import { DataPublicPluginStart, isCompleteResponse, isErrorResponse } from import { DataPublicPluginStart, isCompleteResponse, isErrorResponse } from '../../src/plugins/data';

export interface MyPluginStartDependencies {
Expand Down Expand Up @@ -189,7 +189,7 @@ export const mySearchStrategyProvider = (

```ts
// ./myPlugin/server/plugin.ts
import type { CoreSetup, CoreStart, Plugin } from 'kibana/server';
import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/server';

import { mySearchStrategyProvider } from './my_strategy';

Expand Down
26 changes: 13 additions & 13 deletions dev_docs/tutorials/endpoints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ the request.
The following snippet demonstrate how to create a basic `GET` endpoint on the `/api/my_plugin/get_object` path:

```ts
import type { CoreSetup, Plugin } from 'kibana/server';
import type { CoreSetup, Plugin } from '@kbn/core/server';

export class MyPlugin implements Plugin {
public setup(core: CoreSetup) {
Expand All @@ -86,7 +86,7 @@ export class MyPlugin implements Plugin {
consuming the endpoint from the client-side using core's `http` service would then look like:

```ts
import { HttpStart } from 'kibana/public';
import { HttpStart } from '@kbn/core/public';

interface ResponseType {
result: string;
Expand All @@ -105,7 +105,7 @@ of the route definition.

```ts
import { schema } from '@kbn/config-schema';
import type { CoreSetup, Plugin } from 'kibana/server';
import type { CoreSetup, Plugin } from '@kbn/core/server';

export class MyPlugin implements Plugin {
public setup(core: CoreSetup) {
Expand Down Expand Up @@ -135,7 +135,7 @@ export class MyPlugin implements Plugin {
consuming the endpoint from the client-side using core's `http` service would then look like:

```ts
import { HttpStart } from 'kibana/public';
import { HttpStart } from '@kbn/core/public';
import { MyObjectType } from '../common/types';

async function fetchData(http: HttpStart, id: string) {
Expand All @@ -150,7 +150,7 @@ must be provided when registering a `post` handler that will access the payload.

```ts
import { schema } from '@kbn/config-schema';
import type { CoreSetup, Plugin } from 'kibana/server';
import type { CoreSetup, Plugin } from '@kbn/core/server';

export class MyPlugin implements Plugin {
public setup(core: CoreSetup) {
Expand Down Expand Up @@ -182,7 +182,7 @@ export class MyPlugin implements Plugin {
consuming the endpoint from the client-side using core's `http` service would then look like:

```ts
import { HttpStart } from 'kibana/public';
import { HttpStart } from '@kbn/core/public';

interface ResponseType {
updated: boolean;
Expand All @@ -207,7 +207,7 @@ option of the route definition to be accessible from the handler.

```ts
import { schema } from '@kbn/config-schema';
import type { CoreSetup, Plugin } from 'kibana/server';
import type { CoreSetup, Plugin } from '@kbn/core/server';

export class MyPlugin implements Plugin {
public setup(core: CoreSetup) {
Expand Down Expand Up @@ -236,7 +236,7 @@ export class MyPlugin implements Plugin {
consuming the endpoint from the client-side using core's `http` service would then look like:

```ts
import { HttpStart } from 'kibana/public';
import { HttpStart } from '@kbn/core/public';
import { MyObjectType } from '../common/types';

interface ResponseType {
Expand Down Expand Up @@ -264,7 +264,7 @@ All APIs of the `response` parameter of the handler accept a `headers` property
to define headers to attach to the response.

```ts
import type { CoreSetup, Plugin } from 'kibana/server';
import type { CoreSetup, Plugin } from '@kbn/core/server';

export class MyPlugin implements Plugin {
public setup(core: CoreSetup) {
Expand Down Expand Up @@ -300,7 +300,7 @@ However, some of the less commonly used return codes don't have such helpers. In
and/or `response.customError` APIs should be used.

```ts
import type { CoreSetup, Plugin } from 'kibana/server';
import type { CoreSetup, Plugin } from '@kbn/core/server';

export class MyPlugin implements Plugin {
public setup(core: CoreSetup) {
Expand Down Expand Up @@ -332,7 +332,7 @@ These observables can either be used directly, or be used to control an `AbortCo

```ts
import { schema } from '@kbn/config-schema';
import type { CoreSetup, Plugin } from 'kibana/server';
import type { CoreSetup, Plugin } from '@kbn/core/server';

export class MyPlugin implements Plugin {
public setup(core: CoreSetup) {
Expand Down Expand Up @@ -371,7 +371,7 @@ and will return a `401 - Unauthorized` otherwise.
It is possible to disable this requirement using the `authRequired` option of the route.

```ts
import type { CoreSetup, Plugin } from 'kibana/server';
import type { CoreSetup, Plugin } from '@kbn/core/server';

export class MyPlugin implements Plugin {
public setup(core: CoreSetup) {
Expand Down Expand Up @@ -407,7 +407,7 @@ be achieved by using the `url` and `route` properties of the `request` parameter
request.url / request.route

```ts
import type { CoreSetup, Plugin } from 'kibana/server';
import type { CoreSetup, Plugin } from '@kbn/core/server';

export class MyPlugin implements Plugin {
public setup(core: CoreSetup) {
Expand Down
4 changes: 2 additions & 2 deletions dev_docs/tutorials/testing_plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ Objects client:
```typescript
// src/plugins/myplugin/server/lib/short_url_lookup.ts
import crypto from 'crypto';
import { SavedObjectsClientContract } from 'kibana/server';
import { SavedObjectsClientContract } from '@kbn/core/server';

export const shortUrlLookup = {
generateUrlId(url: string, savedObjectsClient: SavedObjectsClientContract) {
Expand Down Expand Up @@ -1025,7 +1025,7 @@ data.
```typescript
// src/plugins/myplugin/public/plugin.ts
import { METRIC_TYPE } from '@kbn/analytics';
import { CoreSetup, CoreStart, Plugin } from 'kibana/public';
import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public';
import { DataPublicPluginSetup, DataPublicPluginStart } from '../../data/public';
import { UsageCollectionSetup } from '../../usage_collection/public';
import { SuggestionsService } from './suggestions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NOTE: The Application service is only available client side.

[source,typescript]
----
import { AppMountParameters, CoreSetup, Plugin, DEFAULT_APP_CATEGORIES } from 'kibana/public';
import { AppMountParameters, CoreSetup, Plugin, DEFAULT_APP_CATEGORIES } from '@kbn/core/public';

export class MyPlugin implements Plugin {
public setup(core: CoreSetup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export type MyPluginConfigType = TypeOf<typeof config.schema>;
*my_plugin/server/index.ts*
[source,typescript]
----
import type { PluginInitializerContext } from 'kibana/server';
import type { PluginInitializerContext } from '@kbn/core/server';
export class MyPlugin {
constructor(initializerContext: PluginInitializerContext) {
this.config$ = initializerContext.config.create<MyPluginConfigType>();
Expand All @@ -57,7 +57,7 @@ allow-list property.
[source,typescript]
----
import { schema, TypeOf } from '@kbn/config-schema';
import type { PluginConfigDescriptor } from 'kibana/server';
import type { PluginConfigDescriptor } from '@kbn/core/server';

const configSchema = schema.object({
secret: schema.string({ defaultValue: 'Only on server' }),
Expand Down Expand Up @@ -115,7 +115,7 @@ configuration root.
[source,typescript]
----
import { schema, TypeOf } from '@kbn/config-schema';
import type { PluginConfigDescriptor } from 'kibana/server';
import type { PluginConfigDescriptor } from '@kbn/core/server';

const configSchema = schema.object({
newProperty: schema.string({ defaultValue: 'Some string' }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See <<scoped-services>> and <<development-security>>.

[source,typescript]
----
import { CoreStart, Plugin } from 'kibana/public';
import { CoreStart, Plugin } from '@kbn/core/public';

export class MyPlugin implements Plugin {
public start(core: CoreStart) {
Expand Down
4 changes: 2 additions & 2 deletions docs/developer/architecture/core/http-service.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ See {kib-repo}blob/{branch}/docs/development/core/server/kibana-plugin-core-serv
[source,typescript]
----
import { schema } from '@kbn/config-schema';
import type { CoreSetup, Plugin } from 'kibana/server';
import type { CoreSetup, Plugin } from '@kbn/core/server';

export class MyPlugin implements Plugin {
public setup(core: CoreSetup) {
Expand Down Expand Up @@ -54,7 +54,7 @@ The client-side HttpService is a preconfigured wrapper around `window.fetch` tha

[source,typescript]
----
import { CoreStart } from 'kibana/public';
import { CoreStart } from '@kbn/core/public';
interface ResponseType {…};
interface MyPluginData {…};
async function fetchData<ResponseType>(core: CoreStart) {
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/architecture/core/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ These API's are injected into your plugin's lifecycle methods and may be invoked

[source,typescript]
----
import type { PluginInitializerContext, CoreSetup, CoreStart } from 'kibana/server';
import type { PluginInitializerContext, CoreSetup, CoreStart } from '@kbn/core/server';

export class MyPlugin {
constructor(initializerContext: PluginInitializerContext) {}
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/architecture/core/logging-service.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NOTE: The Logging service is only available server side.

[source,typescript]
----
import type { PluginInitializerContext, CoreSetup, Plugin, Logger } from 'kibana/server';
import type { PluginInitializerContext, CoreSetup, Plugin, Logger } from '@kbn/core/server';

export class MyPlugin implements Plugin {
private readonly logger: Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ the request handler context:

[source,typescript]
----
import type { CoreSetup, RequestHandlerContext, IScopedClusterClient } from 'kibana/server';
import type { CoreSetup, RequestHandlerContext, IScopedClusterClient } from '@kbn/core/server';

interface MyRequestHandlerContext extends RequestHandlerContext {
myPlugin: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The following example shows how to {kib-repo}blob/{branch}/docs/development/core
[source,typescript]
----
import { schema } from '@kbn/config-schema';
import type { CoreSetup,Plugin } from 'kibana/server';
import type { CoreSetup,Plugin } from '@kbn/core/server';

export class MyPlugin implements Plugin {
public setup(core: CoreSetup) {
Expand Down
Loading