@shopify/app-bridge
Advanced tools
Comparing version 1.3.1-alpha.3 to 1.3.1-alpha.4
@@ -22,3 +22,3 @@ import { MetaAction } from './types'; | ||
*/ | ||
export declare function isPermitted(features: FeaturesAvailable | undefined, { group, type }: MetaAction, permissionType: PermissionType): boolean; | ||
export declare function isPermitted(features: FeaturesAvailable, { group, type }: MetaAction, permissionType: PermissionType): boolean; | ||
/** | ||
@@ -25,0 +25,0 @@ * Predicate to determine if an event originated from an application. |
@@ -40,3 +40,2 @@ "use strict"; | ||
function isPermitted(features, _a, permissionType) { | ||
if (features === void 0) { features = {}; } | ||
var group = _a.group, type = _a.type; | ||
@@ -43,0 +42,0 @@ if (!group || !features.hasOwnProperty(group)) { |
@@ -6,2 +6,13 @@ # Change Log | ||
## [1.3.1-alpha.4](https://github.com/Shopify/app-bridge/compare/v1.3.1-alpha.3...v1.3.1-alpha.4) (2019-05-17) | ||
### Bug Fixes | ||
* **message-transport:** add `frameWindow` to identify source of dispatch ([#885](https://github.com/Shopify/app-bridge/issues/885)) ([4558215](https://github.com/Shopify/app-bridge/commit/4558215)) | ||
## [1.3.1-alpha.3](https://github.com/Shopify/app-bridge/compare/v1.3.1-alpha.2...v1.3.1-alpha.3) (2019-05-15) | ||
@@ -8,0 +19,0 @@ |
@@ -33,10 +33,8 @@ import { ActionCallback, ActionSetInterface, ActionSetOptions, AnyAction, Dispatch, ErrorSubscriber, Group, MetaAction, Unsubscribe } from '../actions/types'; | ||
*/ | ||
export declare type FeaturesAvailable = { | ||
[key in Group]?: FeaturesAction; | ||
}; | ||
export declare type FeaturesAvailable<T extends Group = Group> = Record<T, FeaturesAction>; | ||
/** | ||
* @internal | ||
*/ | ||
export declare type FeaturesState = { | ||
[key in Context]?: FeaturesAvailable; | ||
export declare type FeaturesState<T = FeaturesAvailable> = { | ||
[key in Context]?: T; | ||
}; | ||
@@ -53,3 +51,4 @@ /** | ||
getState(query?: string): Promise<S>; | ||
featuresAvailable(features?: Group[]): Promise<FeaturesAvailable>; | ||
featuresAvailable(): Promise<FeaturesAvailable<Group>>; | ||
featuresAvailable<T extends Group[]>(...features: T): Promise<FeaturesAvailable<typeof features[number]>>; | ||
subscribe(callback: ActionCallback, id?: string): Unsubscribe; | ||
@@ -56,0 +55,0 @@ subscribe(eventNameSpace: string, callback: ActionCallback, id?: string): Unsubscribe; |
@@ -15,2 +15,3 @@ import { AnyAction } from './actions/types'; | ||
/** | ||
* @deprecated Not to be used, use regular `MessageEvent` instead. | ||
* @internal | ||
@@ -24,3 +25,3 @@ */ | ||
*/ | ||
export declare type Handler = (event: HandlerData) => void; | ||
export declare type Handler = (event: MessageEvent) => void; | ||
/** | ||
@@ -37,2 +38,3 @@ * @internal | ||
context: Context; | ||
frameWindow: Window | null; | ||
dispatch(message: any): void; | ||
@@ -39,0 +41,0 @@ } |
@@ -36,2 +36,3 @@ "use strict"; | ||
localOrigin: localOrigin, | ||
frameWindow: frame.contentWindow, | ||
hostFrame: parent, | ||
@@ -38,0 +39,0 @@ dispatch: function (message) { |
{ | ||
"name": "@shopify/app-bridge", | ||
"version": "1.3.1-alpha.3", | ||
"version": "1.3.1-alpha.4", | ||
"types": "index.d.ts", | ||
@@ -53,3 +53,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "dad198b0a9b010c07c9e62de21046baadf012d6a" | ||
"gitHead": "cbcd89171547f8602a2c61eda909bc6a17b8f761" | ||
} |
@@ -25,10 +25,12 @@ # `@shopify/app-bridge` | ||
In the following example, you need to store `shopOrigin` during the authentication process and then retrieve it for the code to work properly. To learn more about this process, see [Getting and storing the shop origin](https://help.shopify.com/en/api/embedded-apps/shop-origin). | ||
Import the library from the `@shopify/app-bridge` package and provide a configuration: | ||
``` ts | ||
import createApp, {getShopOrigin} from '@shopify/app-bridge'; | ||
import createApp from '@shopify/app-bridge'; | ||
const app = createApp({ | ||
apiKey: 'API key from Shopify Partner Dashboard', | ||
shopOrigin: getShopOrigin(), | ||
shopOrigin: shopOrigin, | ||
}); | ||
@@ -35,0 +37,0 @@ ``` |
import { MetaAction } from '../../actions'; | ||
import { Indexable } from '../type-validate'; | ||
import { ActionType } from '../../actions/Modal'; | ||
export declare function validateProps(props: Indexable, localOrigin: string): { | ||
export declare function validateProps(props: Indexable, localOrigin?: string): { | ||
path: string | undefined; | ||
@@ -10,3 +10,3 @@ error: string; | ||
}[] | undefined; | ||
export declare function validateAction(action: MetaAction, localOrigin: string): import("../type-validate").ValidationError[] | undefined; | ||
export declare function validateAction(action: MetaAction, localOrigin?: string): import("../type-validate").ValidationError[] | undefined; | ||
export { ActionType }; |
@@ -75,3 +75,3 @@ "use strict"; | ||
]; | ||
}, function (value) { return matchesSafeOrigin(value, localOrigin); }), | ||
}, function (value) { return (localOrigin ? matchesSafeOrigin(value, localOrigin) : undefined); }), | ||
}); | ||
@@ -78,0 +78,0 @@ return type_validate_1.composeSchemas(baseModalSchema, urlSchema); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
433472
6663
106