
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@hdt-edge-products/client-pinia-vue-sdk
Advanced tools
A wrapper of the client-entities interactions using Vue and its Pinia state management
This package is an adapter which binds the FRANk change feeds / change streams to Vue and Pinia stores to assist in UI development
The SDK exports 4 items:
Here is an example of how the sdk is instantiated:
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import { eventRuntimeApiSdk, EventRuntimePiniaVueSdk, useEventActivityStore, useItemBiddingStore } from '@hdt-edge-products/client-pinia-vue-sdk';
const BIDDING_SERVER_URL = 'http://localhost:4030';
const DELTA_SERVER_URL = 'ws://localhost:9001';
// NOTE: Pinia and the app must be attached prior to setup/initialization of the event runtime sdk
const pinia = createPinia();
const app = createApp(App, { BIDDING_SERVER_URL, DELTA_SERVER_URL });
app.use(pinia);
useEventActivityStore();
useItemBiddingStore();
const customAuthHeaderFn = async function(){
return Promise.resolve({Authorization: 'Bearer jwt.token.here'});
}
// The api sdk allows the user to set an async customHeader function which will be applied for REST Api calls into the sdk.
eventRuntimeApiSdk.customHeaderFn = customAuthHeaderFn;
eventRuntimeApiSdk.baseBiddingUri = BIDDING_SERVER_URL;
const sdk = new EventRuntimePiniaVueSdk(BIDDING_SERVER_URL, DELTA_SERVER_URL);
await sdk.initialize();
await sdk.watchEvents(['event-10000', 'event-20000', 'event-30000']);
app.mount('#app');
An example pinia item bidding store is below:
import { ref } from 'vue';
import { defineStore } from 'pinia';
import { applyPatch } from 'fast-json-patch';
export const useItemBiddingStore = defineStore('itemBiddingStore', () => {
const items = ref({});
function addItemBidding(itemBiddingModel) {
this.items[itemBiddingModel.id] = itemBiddingModel;
}
function updateItemBidding(id, itemBiddingModel) {
this.items[id] = itemBiddingModel;
}
function removeItemBidding(id) {
delete this.items[id];
}
function applyJsonPatch(id, jsonPatch) {
applyPatch(this.items[id], jsonPatch, false, true);
}
return {
items,
addItemBidding,
updateItemBidding,
removeItemBidding,
applyJsonPatch
}
})
Note that the contents of these stores match the datamodel that is in the database directly - no changes or mutation. The contents are also live updated/added as changes/inserts to the database are written.
FAQs
A wrapper of the client-entities interactions using Vue and its Pinia state management
The npm package @hdt-edge-products/client-pinia-vue-sdk receives a total of 0 weekly downloads. As such, @hdt-edge-products/client-pinia-vue-sdk popularity was classified as not popular.
We found that @hdt-edge-products/client-pinia-vue-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.