@webiny/app 5.31.0-beta.0 → 5.32.0-beta.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/index.d.ts +4 -0
- package/index.js +37 -0
- package/index.js.map +1 -0
- package/package.json +9 -9
- package/plugins/ApolloCacheObjectIdPlugin.d.ts +2 -2
- package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
- package/plugins/ApolloLinkPlugin.d.ts +1 -2
- package/plugins/ApolloLinkPlugin.js.map +1 -1
- package/types.d.ts +0 -13
- package/types.js.map +1 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { AddQuerySelectionPlugin } from "./plugins/AddQuerySelectionPlugin";
|
|
2
|
+
export { ApolloLinkPlugin } from "./plugins/ApolloLinkPlugin";
|
|
3
|
+
export { RoutePlugin } from "./plugins/RoutePlugin";
|
|
4
|
+
export { ApolloCacheObjectIdPlugin } from "./plugins/ApolloCacheObjectIdPlugin";
|
package/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AddQuerySelectionPlugin", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _AddQuerySelectionPlugin.AddQuerySelectionPlugin;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ApolloCacheObjectIdPlugin", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _ApolloCacheObjectIdPlugin.ApolloCacheObjectIdPlugin;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "ApolloLinkPlugin", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _ApolloLinkPlugin.ApolloLinkPlugin;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "RoutePlugin", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _RoutePlugin.RoutePlugin;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
var _AddQuerySelectionPlugin = require("./plugins/AddQuerySelectionPlugin");
|
|
32
|
+
|
|
33
|
+
var _ApolloLinkPlugin = require("./plugins/ApolloLinkPlugin");
|
|
34
|
+
|
|
35
|
+
var _RoutePlugin = require("./plugins/RoutePlugin");
|
|
36
|
+
|
|
37
|
+
var _ApolloCacheObjectIdPlugin = require("./plugins/ApolloCacheObjectIdPlugin");
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { AddQuerySelectionPlugin } from \"./plugins/AddQuerySelectionPlugin\";\nexport { ApolloLinkPlugin } from \"./plugins/ApolloLinkPlugin\";\nexport { RoutePlugin } from \"./plugins/RoutePlugin\";\nexport { ApolloCacheObjectIdPlugin } from \"./plugins/ApolloCacheObjectIdPlugin\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.32.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"@emotion/styled": "10.3.0",
|
|
20
20
|
"@types/react": "17.0.39",
|
|
21
21
|
"@types/web": "0.0.61",
|
|
22
|
-
"@webiny/i18n": "5.
|
|
23
|
-
"@webiny/i18n-react": "5.
|
|
24
|
-
"@webiny/plugins": "5.
|
|
25
|
-
"@webiny/react-router": "5.
|
|
26
|
-
"@webiny/ui": "5.
|
|
22
|
+
"@webiny/i18n": "5.32.0-beta.0",
|
|
23
|
+
"@webiny/i18n-react": "5.32.0-beta.0",
|
|
24
|
+
"@webiny/plugins": "5.32.0-beta.0",
|
|
25
|
+
"@webiny/react-router": "5.32.0-beta.0",
|
|
26
|
+
"@webiny/ui": "5.32.0-beta.0",
|
|
27
27
|
"apollo-cache": "1.3.5",
|
|
28
28
|
"apollo-cache-inmemory": "1.6.6",
|
|
29
29
|
"apollo-client": "2.6.10",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"@babel/preset-react": "^7.16.0",
|
|
50
50
|
"@babel/preset-typescript": "^7.16.0",
|
|
51
51
|
"@types/warning": "^3.0.0",
|
|
52
|
-
"@webiny/cli": "^5.
|
|
53
|
-
"@webiny/project-utils": "^5.
|
|
52
|
+
"@webiny/cli": "^5.32.0-beta.0",
|
|
53
|
+
"@webiny/project-utils": "^5.32.0-beta.0",
|
|
54
54
|
"babel-plugin-lodash": "^3.3.4",
|
|
55
55
|
"rimraf": "^3.0.2",
|
|
56
56
|
"typescript": "4.7.4"
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
]
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "01b97900303977e0b418d60aa1c789fad71f5cef"
|
|
75
75
|
}
|
|
@@ -4,12 +4,12 @@ export interface ApolloCacheObject {
|
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
}
|
|
6
6
|
interface ApolloCacheObjectIdPluginCallable<T> {
|
|
7
|
-
(data: T): string | null;
|
|
7
|
+
(data: T): string | null | undefined;
|
|
8
8
|
}
|
|
9
9
|
export declare class ApolloCacheObjectIdPlugin<T extends ApolloCacheObject = ApolloCacheObject> extends Plugin {
|
|
10
10
|
static readonly type: string;
|
|
11
11
|
private readonly _getObjectId?;
|
|
12
12
|
constructor(getObjectId?: ApolloCacheObjectIdPluginCallable<T>);
|
|
13
|
-
getObjectId(data: T): string | null;
|
|
13
|
+
getObjectId(data: T): string | null | undefined;
|
|
14
14
|
}
|
|
15
15
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ApolloCacheObjectIdPlugin","getObjectId","_getObjectId","data","Error","Plugin"],"sources":["ApolloCacheObjectIdPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloCacheObject {\n __typename?: string;\n [key: string]: any;\n}\n\ninterface ApolloCacheObjectIdPluginCallable<T> {\n (data: T): string | null;\n}\n\nexport class ApolloCacheObjectIdPlugin<\n T extends ApolloCacheObject = ApolloCacheObject\n> extends Plugin {\n public static override readonly type: string = \"cache-get-object-id\";\n private readonly _getObjectId?: ApolloCacheObjectIdPluginCallable<T>;\n\n public constructor(getObjectId?: ApolloCacheObjectIdPluginCallable<T>) {\n super();\n this._getObjectId = getObjectId;\n }\n\n public getObjectId(data: T) {\n if (typeof this._getObjectId !== \"function\") {\n throw Error(\n `You must provide a \"getObjectId\" callable to the plugin constructor or extend the ApolloCacheObjectIdPlugin.`\n );\n }\n\n return this._getObjectId(data);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"names":["ApolloCacheObjectIdPlugin","getObjectId","_getObjectId","data","Error","Plugin"],"sources":["ApolloCacheObjectIdPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloCacheObject {\n __typename?: string;\n [key: string]: any;\n}\n\ninterface ApolloCacheObjectIdPluginCallable<T> {\n // A value for `id`, null to prevent normalization, or undefined to continue with defaults.\n (data: T): string | null | undefined;\n}\n\nexport class ApolloCacheObjectIdPlugin<\n T extends ApolloCacheObject = ApolloCacheObject\n> extends Plugin {\n public static override readonly type: string = \"cache-get-object-id\";\n private readonly _getObjectId?: ApolloCacheObjectIdPluginCallable<T>;\n\n public constructor(getObjectId?: ApolloCacheObjectIdPluginCallable<T>) {\n super();\n this._getObjectId = getObjectId;\n }\n\n public getObjectId(data: T) {\n if (typeof this._getObjectId !== \"function\") {\n throw Error(\n `You must provide a \"getObjectId\" callable to the plugin constructor or extend the ApolloCacheObjectIdPlugin.`\n );\n }\n\n return this._getObjectId(data);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;IAYaA,yB;;;;;EAMT,mCAAmBC,WAAnB,EAAuE;IAAA;;IAAA;IACnE;IADmE;IAEnE,MAAKC,YAAL,GAAoBD,WAApB;IAFmE;EAGtE;;;;WAED,qBAAmBE,IAAnB,EAA4B;MACxB,IAAI,OAAO,KAAKD,YAAZ,KAA6B,UAAjC,EAA6C;QACzC,MAAME,KAAK,kHAAX;MAGH;;MAED,OAAO,KAAKF,YAAL,CAAkBC,IAAlB,CAAP;IACH;;;EAjBKE,e;;;8BAFGL,yB,UAGsC,qB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApolloLink } from "apollo-link";
|
|
2
2
|
import { Plugin } from "@webiny/plugins";
|
|
3
|
-
interface ApolloLinkFactory {
|
|
3
|
+
export interface ApolloLinkFactory {
|
|
4
4
|
(): ApolloLink;
|
|
5
5
|
}
|
|
6
6
|
export declare class ApolloLinkPlugin extends Plugin {
|
|
@@ -11,4 +11,3 @@ export declare class ApolloLinkPlugin extends Plugin {
|
|
|
11
11
|
constructor(factory?: ApolloLinkFactory);
|
|
12
12
|
createLink(): ApolloLink;
|
|
13
13
|
}
|
|
14
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ApolloLinkPlugin","factory","cacheKey","nanoid","cache","Error","name","Plugin"],"sources":["ApolloLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { nanoid } from \"nanoid\";\nimport { Plugin } from \"@webiny/plugins\";\n\
|
|
1
|
+
{"version":3,"names":["ApolloLinkPlugin","factory","cacheKey","nanoid","cache","Error","name","Plugin"],"sources":["ApolloLinkPlugin.ts"],"sourcesContent":["import { ApolloLink } from \"apollo-link\";\nimport { nanoid } from \"nanoid\";\nimport { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloLinkFactory {\n (): ApolloLink;\n}\n\nexport class ApolloLinkPlugin extends Plugin {\n public static override readonly type: string = \"apollo-link\";\n public readonly cacheKey;\n private readonly factory?: ApolloLinkFactory;\n private cache?: ApolloLink;\n\n constructor(factory?: ApolloLinkFactory) {\n super();\n this.factory = factory;\n this.cacheKey = nanoid();\n }\n\n public createLink(): ApolloLink {\n if (this.cache) {\n return this.cache;\n }\n\n if (typeof this.factory === \"function\") {\n this.cache = this.factory();\n\n return this.cache;\n }\n\n throw Error(\n `Missing ApolloLinkFactory in plugin \"${this.name}\"! Either pass a factory to ApolloLinkPlugin constructor or extend the class and override the \"createLink\" method.`\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;IAMaA,gB;;;;;EAMT,0BAAYC,OAAZ,EAAyC;IAAA;;IAAA;IACrC;IADqC;IAAA;IAAA;IAErC,MAAKA,OAAL,GAAeA,OAAf;IACA,MAAKC,QAAL,GAAgB,IAAAC,cAAA,GAAhB;IAHqC;EAIxC;;;;WAED,sBAAgC;MAC5B,IAAI,KAAKC,KAAT,EAAgB;QACZ,OAAO,KAAKA,KAAZ;MACH;;MAED,IAAI,OAAO,KAAKH,OAAZ,KAAwB,UAA5B,EAAwC;QACpC,KAAKG,KAAL,GAAa,KAAKH,OAAL,EAAb;QAEA,OAAO,KAAKG,KAAZ;MACH;;MAED,MAAMC,KAAK,iDACiC,KAAKC,IADtC,2HAAX;IAGH;;;EA1BiCC,e;;;8BAAzBP,gB,UACsC,a"}
|
package/types.d.ts
CHANGED
|
@@ -16,10 +16,6 @@ export interface FileItem {
|
|
|
16
16
|
};
|
|
17
17
|
[key: string]: any;
|
|
18
18
|
}
|
|
19
|
-
export declare type WebinyInitPlugin = Plugin & {
|
|
20
|
-
type: "webiny-init";
|
|
21
|
-
init(): void;
|
|
22
|
-
};
|
|
23
19
|
export declare type UploadOptions = {
|
|
24
20
|
apolloClient: ApolloClient<object>;
|
|
25
21
|
};
|
|
@@ -72,12 +68,3 @@ export declare type RoutePlugin = Plugin & {
|
|
|
72
68
|
type: "route";
|
|
73
69
|
route: React.ReactElement;
|
|
74
70
|
};
|
|
75
|
-
interface CacheGetObjectIdPluginObj {
|
|
76
|
-
__typename: string;
|
|
77
|
-
modelId: string;
|
|
78
|
-
[key: string]: any;
|
|
79
|
-
}
|
|
80
|
-
export declare type CacheGetObjectIdPlugin = Plugin & {
|
|
81
|
-
type: "cache-get-object-id";
|
|
82
|
-
getObjectId(obj: CacheGetObjectIdPluginObj): string | undefined;
|
|
83
|
-
};
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import * as React from \"react\";\nimport { Plugin } from \"@webiny/plugins/types\";\nimport { ApolloClient } from \"apollo-client\";\nimport { CSSProperties } from \"react\";\n\nexport interface FileItem {\n id: string;\n name: string;\n key: string;\n src: string;\n size: number;\n type: string;\n tags: string[];\n createdOn: string;\n createdBy: {\n id: string;\n };\n [key: string]: any;\n}\n\nexport type
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import * as React from \"react\";\nimport { Plugin } from \"@webiny/plugins/types\";\nimport { ApolloClient } from \"apollo-client\";\nimport { CSSProperties } from \"react\";\n\nexport interface FileItem {\n id: string;\n name: string;\n key: string;\n src: string;\n size: number;\n type: string;\n tags: string[];\n createdOn: string;\n createdBy: {\n id: string;\n };\n [key: string]: any;\n}\n\nexport type UploadOptions = {\n apolloClient: ApolloClient<object>;\n};\n\nexport type UiStatePlugin = Plugin & {\n type: \"ui-state\";\n render(): React.ReactElement;\n};\n\nexport type FileUploaderPlugin = Plugin & {\n type: \"file-uploader\";\n // TODO: @adrian define type for the returned object\n upload(file: FileItem, options: UploadOptions): Promise<any>;\n};\n\nexport type AppFileManagerStoragePlugin = Plugin & {\n type: \"app-file-manager-storage\";\n // TODO: @adrian define type for the returned object\n upload(file: FileItem, options: UploadOptions): Promise<any>;\n};\n\nexport { Plugin };\n\nexport interface ImageProps {\n src: string;\n preset?: string;\n transform?: {\n [key: string]: any;\n };\n // \"auto\" is a special keyword - if present, plugins insert their own srcSet.\n srcSet?: { [key: string]: any } | \"auto\";\n className?: string;\n title?: string;\n alt?: string;\n style?: CSSProperties;\n width?: string | number;\n height?: string | number;\n}\n\n/**\n * \"getImageSrc\" has to be defined as a separate property, so its functionality can be reused outside of\n * the Image component. This is ideal in cases where manual creation of image src is needed.\n */\nexport type ImageComponentPlugin = Plugin & {\n type: \"image-component\";\n render: (props: ImageProps) => React.ReactElement;\n getImageSrc: (props?: Record<string, any>) => string;\n presets: { [key: string]: any };\n};\n\n/**\n * Enables registering new routes.\n * @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#route\n */\nexport type RoutePlugin = Plugin & {\n type: \"route\";\n route: React.ReactElement;\n};\n"],"mappings":";;;;;;;;;;;;AACA"}
|