New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pexip-engage-public/plugin-instance

Package Overview
Dependencies
Maintainers
1
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pexip-engage-public/plugin-instance - npm Package Compare versions

Comparing version 1.1.4-canary-20231025140910 to 1.1.4

src/hooks.ts

8

CHANGELOG.md
# @pexip-engage-public/plugin-instance
## 1.1.4-canary-20231025140910
## 1.1.4
### Patch Changes
- c49c5a4aa: SKED-11604: plugin-instance-hooks
- Updated dependencies [c49c5a4aa]
- Updated dependencies [d5413de87]
- @pexip-engage-public/plugin-state@1.2.2-canary-20231025140910
- @pexip-engage-public/plugin-events@1.0.30
- @pexip-engage-public/plugin-state@1.2.2
- @pexip-engage-public/plugin-configuration-parser@1.2.1
- @pexip-engage-public/plugin-events@1.0.30-canary-20231025140910
- @pexip-engage-public/plugin-utils@1.0.10

@@ -12,0 +14,0 @@

{
"name": "@pexip-engage-public/plugin-instance",
"version": "1.1.4-canary-20231025140910",
"version": "1.1.4",
"homepage": "https://github.com/skedify/frontend-mono/tree/develop/apps/plugin-remix/packages/plugin-instance#readme",

@@ -37,4 +37,4 @@ "bugs": {

"@pexip-engage-public/plugin-configuration-parser": "1.2.1",
"@pexip-engage-public/plugin-events": "1.0.30-canary-20231025140910",
"@pexip-engage-public/plugin-state": "1.2.2-canary-20231025140910",
"@pexip-engage-public/plugin-events": "1.0.30",
"@pexip-engage-public/plugin-state": "1.2.2",
"@pexip-engage-public/plugin-utils": "1.0.10"

@@ -45,3 +45,3 @@ },

"@pexip-engage/tsconfig": "0.0.9",
"eslint-config-pexip-engage": "0.0.41-canary-20231025140910"
"eslint-config-pexip-engage": "0.0.41"
},

@@ -48,0 +48,0 @@ "volta": {

@@ -15,2 +15,3 @@ import {

RequestEvent,
RequestEventMessage,
StateUpdateMessage,

@@ -26,2 +27,3 @@ } from "@pexip-engage-public/plugin-events";

import { dispatchEvent, PEXIP_ENGAGE_PLUGIN_EVENT, PluginCustomEvent } from "./dispatchEvent";
import type { PluginHooks } from "./hooks";
import { getPexipEngagePluginFrame } from "./PexipEngagePluginFrame";

@@ -37,3 +39,3 @@

#state: StateUpdateMessage["payload"] | null = null;
#meta: Record<string, unknown> | null = null;
#meta: Record<string, unknown> = {};
#status: "pending" | "success" | "error" | "disposed" = "pending";

@@ -167,6 +169,14 @@ #fallbackTimeoutId: number | null = null;

if (message.type === RequestEvent.REQUEST_METADATA) {
if (message.type === RequestEvent.PRE_APPOINTMENT_REQUEST) {
//@ts-expect-error we can reassign this because we check above.
let _message: RequestEventMessage<"PRE_APPOINTMENT_REQUEST"> = message;
this.#hooks.beforeAppointmentCreate?.({
data: _message.payload,
appointment: { meta: this.appointment.meta },
});
this.#instance.iFrameResizer.sendMessage({
type: RequestEvent.REQUEST_METADATA,
payload: this.#meta,
type: RequestEvent.PRE_APPOINTMENT_REQUEST,
payload: { meta: this.#meta },
});

@@ -241,2 +251,7 @@

#hooks: Partial<PluginHooks> = {};
setHook<T extends keyof PluginHooks>(type: T, callback: PluginHooks[T]) {
this.#hooks[type] = callback;
}
openDebugger = () => {

@@ -334,7 +349,5 @@ const searchParams = new URLSearchParams();

get: (key: string, defaultValue: unknown) => {
return this.#meta?.[key] ?? defaultValue;
return this.#meta[key] ?? defaultValue;
},
set: (key: string, value: unknown) => {
if (!this.#meta) this.#meta = {};
this.#meta[key] = value;

@@ -345,3 +358,3 @@

remove: (key: string) => {
delete this.#meta?.[key];
delete this.#meta[key];
},

@@ -348,0 +361,0 @@ },

@@ -5,2 +5,3 @@ import { parsePluginConfiguration } from "@pexip-engage-public/plugin-configuration-parser";

import { PluginCustomEvent } from "./dispatchEvent";
import type { PluginHooks } from "./hooks";
type PluginEventListener = (event: PluginCustomEvent) => unknown;

@@ -16,2 +17,3 @@ export declare class PluginInstance {

get hashConfig(): string;
setHook<T extends keyof PluginHooks>(type: T, callback: PluginHooks[T]): void;
openDebugger: () => string;

@@ -38,3 +40,3 @@ /** Destroy the instance */

meta: {
getAll: () => Record<string, unknown> | null;
getAll: () => Record<string, unknown>;
get: (key: string, defaultValue: unknown) => unknown;

@@ -112,3 +114,3 @@ set: (key: string, value: unknown) => Record<string, unknown>;

meta: {
getAll: () => Record<string, unknown> | null;
getAll: () => Record<string, unknown>;
get: (key: string, defaultValue: unknown) => unknown;

@@ -115,0 +117,0 @@ set: (key: string, value: unknown) => Record<string, unknown>;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc