@juhuu/sdk-ts 1.2.236 → 1.2.238
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/dist/index.d.mts +59 -3
- package/dist/index.d.ts +59 -3
- package/dist/index.js +49 -0
- package/dist/index.mjs +49 -0
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -1048,7 +1048,7 @@ interface EndCustomBlock extends BaseBlock {
|
|
|
1048
1048
|
in: Record<string, DataEdgeConnection>;
|
|
1049
1049
|
out: Record<string, never>;
|
|
1050
1050
|
data: {
|
|
1051
|
-
|
|
1051
|
+
outputParamDefinitionArray: ParamDefinition[];
|
|
1052
1052
|
};
|
|
1053
1053
|
}
|
|
1054
1054
|
type FlowBlock = StartCustomBlock | StartQuickActionLocationBlock | StartSessionUpdateBlock | StartLocationUpdateBlock | StartParameterUpdateBlock | ConstNumberBlock | ConstTextBlock | ConstBooleanBlock | MathAddBlock | MathSubtractBlock | MathMultiplyBlock | MathDivideBlock | MapDestructureBlock | ParameterRetrieveBlock | PropertyRetrieveBlock | LocationRetrieveBlock | SessionRetrieveBlock | DeviceRetrieveBlock | UserRetrieveBlock | ParameterUpdateBlock | DeviceUpdateBlock | LocationUpdateBlock | PropertyUpdateBlock | SessionTerminateBlock | IfBlock | HttpPatchBlock | HttpGetBlock | HttpPostBlock | HttpDeleteBlock | HttpPutBlock | MqttSendBlock | HttpPatchBlock | EndCustomBlock;
|
|
@@ -1291,6 +1291,11 @@ declare class ProductService extends Service {
|
|
|
1291
1291
|
delete(ProductDeleteParams: JUHUU.Product.Delete.Params, ProductDeleteOptions?: JUHUU.Product.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Product.Delete.Response>>;
|
|
1292
1292
|
}
|
|
1293
1293
|
|
|
1294
|
+
declare class WebsocketsService extends Service {
|
|
1295
|
+
constructor(config: JUHUU.SetupConfig);
|
|
1296
|
+
connect(WebsocketConnectOptions?: JUHUU.Websocket.Connect.Options): JUHUU.Websocket.Connect.Response;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1294
1299
|
declare class SettingsService extends Service {
|
|
1295
1300
|
constructor(config: JUHUU.SetupConfig);
|
|
1296
1301
|
retrieve(): Promise<JUHUU.HttpResponse<Settings>>;
|
|
@@ -1508,6 +1513,7 @@ declare class Juhuu {
|
|
|
1508
1513
|
readonly terms: TermsService;
|
|
1509
1514
|
readonly tariffs: TariffsService;
|
|
1510
1515
|
readonly products: ProductService;
|
|
1516
|
+
readonly websockets: WebsocketsService;
|
|
1511
1517
|
readonly settings: SettingsService;
|
|
1512
1518
|
readonly accountingAreas: AccountingAreasService;
|
|
1513
1519
|
readonly payouts: PayoutsService;
|
|
@@ -3393,10 +3399,10 @@ declare namespace JUHUU {
|
|
|
3393
3399
|
name?: string;
|
|
3394
3400
|
address?: Partial<Address>;
|
|
3395
3401
|
deviceIdArray?: string[];
|
|
3396
|
-
deviceId?: string;
|
|
3402
|
+
deviceId?: string | null;
|
|
3397
3403
|
maximumConcurrentSessions?: number;
|
|
3398
3404
|
surveyEnabled?: boolean;
|
|
3399
|
-
accountingAreaId?: string;
|
|
3405
|
+
accountingAreaId?: string | null;
|
|
3400
3406
|
latitude?: number;
|
|
3401
3407
|
longitude?: number;
|
|
3402
3408
|
purposeArray?: Purpose[];
|
|
@@ -3404,6 +3410,8 @@ declare namespace JUHUU {
|
|
|
3404
3410
|
rentOfferArray?: Offer[];
|
|
3405
3411
|
reservationOfferArray?: Offer[];
|
|
3406
3412
|
disabled?: boolean;
|
|
3413
|
+
rentableDeviceGroupLocationId?: string | null;
|
|
3414
|
+
termId?: string | null;
|
|
3407
3415
|
};
|
|
3408
3416
|
type Options = JUHUU.RequestOptions;
|
|
3409
3417
|
type Response = {
|
|
@@ -4573,6 +4581,54 @@ declare namespace JUHUU {
|
|
|
4573
4581
|
type Response = JUHUU.ConnectorMessage.Object[];
|
|
4574
4582
|
}
|
|
4575
4583
|
}
|
|
4584
|
+
namespace Websocket {
|
|
4585
|
+
namespace Connect {
|
|
4586
|
+
type Params = {};
|
|
4587
|
+
type Options = JUHUU.RequestOptions;
|
|
4588
|
+
type Response = {
|
|
4589
|
+
subscribe: (rooms: string[]) => void;
|
|
4590
|
+
unsubscribe: (rooms: string[]) => void;
|
|
4591
|
+
subscribeQuery: (payload: JUHUU.Websocket.SubscribeQuery.Params) => void;
|
|
4592
|
+
unsubscribeQuery: (payload: JUHUU.Websocket.UnsubscribeQuery.Params) => void;
|
|
4593
|
+
rpc: (payload: JUHUU.Websocket.Rpc.Params) => Promise<JUHUU.Websocket.Rpc.Response>;
|
|
4594
|
+
onQueryUpdate: (callback: (message: JUHUU.Websocket.QueryUpdate) => void) => void;
|
|
4595
|
+
close: () => void;
|
|
4596
|
+
};
|
|
4597
|
+
}
|
|
4598
|
+
namespace SubscribeQuery {
|
|
4599
|
+
type Params = {
|
|
4600
|
+
subId: string;
|
|
4601
|
+
method: "GET";
|
|
4602
|
+
path: string;
|
|
4603
|
+
query?: Record<string, unknown>;
|
|
4604
|
+
};
|
|
4605
|
+
}
|
|
4606
|
+
namespace UnsubscribeQuery {
|
|
4607
|
+
type Params = {
|
|
4608
|
+
subId: string;
|
|
4609
|
+
};
|
|
4610
|
+
}
|
|
4611
|
+
namespace Rpc {
|
|
4612
|
+
type Params = {
|
|
4613
|
+
id: string;
|
|
4614
|
+
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
4615
|
+
path: string;
|
|
4616
|
+
query?: Record<string, unknown>;
|
|
4617
|
+
body?: unknown;
|
|
4618
|
+
headers?: Record<string, unknown>;
|
|
4619
|
+
};
|
|
4620
|
+
type Response = {
|
|
4621
|
+
id: string;
|
|
4622
|
+
status: number;
|
|
4623
|
+
data?: unknown;
|
|
4624
|
+
error?: unknown;
|
|
4625
|
+
};
|
|
4626
|
+
}
|
|
4627
|
+
type QueryUpdate = {
|
|
4628
|
+
subId: string;
|
|
4629
|
+
data: unknown;
|
|
4630
|
+
};
|
|
4631
|
+
}
|
|
4576
4632
|
}
|
|
4577
4633
|
|
|
4578
4634
|
export { type AccessControlListElement, type Address, type ApiKeyScope, type ApiKeyStatus, type AutoRenewMode, type BaseBlock, type BusinessType, type Capability, type Category, type Circumstance, type Color, type ColorScheme, type Command, type Condition, ConditionType, type ConstBooleanBlock, type ConstNumberBlock, type ConstTextBlock, type ControlEdgeConnection, type CountryCode, CountryCodeArray, type CurrencyCode, CurrencyCodeArray, type CustomClaims, type DataEdgeConnection, type DeepNullable, type DevicePermission, type DeviceRetrieveBlock, type DeviceRetrieveBlockInputs, type DeviceStatus, type DeviceType, type DeviceUpdateBlock, type DeviceUpdateBlockInputs, type EndCustomBlock, type Environment, type EnvironmentSettings, type ExtractType, type FlowBlock, type FlowBlockInput, type FlowControlEdge, type FlowDataEdge, type FlowEdge, type FlowExecutionEnvironment, type FlowLog, type FlowStatus, type Frontend, type GeneralSettings, type GeoPoint, type GraphNode, type HttpDeleteBlock, type HttpDeleteBlockInputs, type HttpGetBlock, type HttpGetBlockInputs, type HttpPatchBlock, type HttpPostBlock, type HttpPostBlockInputs, type HttpPutBlock, type HttpPutBlockInputs, type HttpsPatchBlockInputs, type IfBlock, JUHUU, type JsonLogic, Juhuu, type LanguageCode, LanguageCodeArray, Layout, type LayoutBlock, type License, type LicenseTariffIdMap, type LinkType, type LocaleString, type LocationRetrieveBlock, type LocationRetrieveBlockInputs, type LocationUpdateBlock, type LocationUpdateBlockInputs, type MapDestructureBlock, type MapDestructureBlockInputs, type MapFilter, type MathAddBlock, type MathAddBlockInputs, type MathDivideBlock, type MathDivideBlockInputs, type MathMultiplyBlock, type MathMultiplyBlockInputs, type MathSubtractBlock, type MathSubtractBlockInputs, type Modality, type MqttSendBlock, type MqttSendBlockInputs, type Offer, type OfferTime, type ParamDefinition, type ParamType, type ParameterRetrieveBlock, type ParameterRetrieveBlockInputs, type ParameterUpdateBlock, type ParameterUpdateBlockInputs, type Party, type PaymentMethod, type PaymentReason, type PaymentRefundReason, type PaymentRefundStatus, type PaymentServiceProvider, type PaymentStatus, type PayoutSettings, type PayoutStatus, type PermissionTypes, type Person, type Platform, type PlatformString, type PostingRow, type PropertyRetrieveBlock, type PropertyRetrieveBlockInputs, type PropertyUpdateBlock, type PropertyUpdateBlockInputs, type Purpose, type PushToken, type QuickAction, ReadonlyCategoryArray, ReadonlyModalityArray, ReadonlySectorArray, type RefundStatus, type Sector, type SessionCannotTerminateReason, type SessionRetrieveBlock, type SessionRetrieveBlockInputs, type SessionSettings, type SessionStatus, type SessionTerminateBlock, type SessionTerminateBlockInputs, type SessionTerminatedByType, type SessionType, Settings, type SimStatus, type StarRating, type StartCustomBlock, type StartLocationUpdateBlock, type StartParameterUpdateBlock, type StartQuickActionLocationBlock, type StartSessionUpdateBlock, type TarifType, type TaxCode, type TimeZone, type Unit, type UserGroup, type UserRetrieveBlock, type UserRetrieveBlockInputs, type UserType, type Utilization, type VeloBrushDeviceDocumentUserManualStep, type Viewport, type ViewportPolygon, type VisualPriority, type hexColor };
|
package/dist/index.d.ts
CHANGED
|
@@ -1048,7 +1048,7 @@ interface EndCustomBlock extends BaseBlock {
|
|
|
1048
1048
|
in: Record<string, DataEdgeConnection>;
|
|
1049
1049
|
out: Record<string, never>;
|
|
1050
1050
|
data: {
|
|
1051
|
-
|
|
1051
|
+
outputParamDefinitionArray: ParamDefinition[];
|
|
1052
1052
|
};
|
|
1053
1053
|
}
|
|
1054
1054
|
type FlowBlock = StartCustomBlock | StartQuickActionLocationBlock | StartSessionUpdateBlock | StartLocationUpdateBlock | StartParameterUpdateBlock | ConstNumberBlock | ConstTextBlock | ConstBooleanBlock | MathAddBlock | MathSubtractBlock | MathMultiplyBlock | MathDivideBlock | MapDestructureBlock | ParameterRetrieveBlock | PropertyRetrieveBlock | LocationRetrieveBlock | SessionRetrieveBlock | DeviceRetrieveBlock | UserRetrieveBlock | ParameterUpdateBlock | DeviceUpdateBlock | LocationUpdateBlock | PropertyUpdateBlock | SessionTerminateBlock | IfBlock | HttpPatchBlock | HttpGetBlock | HttpPostBlock | HttpDeleteBlock | HttpPutBlock | MqttSendBlock | HttpPatchBlock | EndCustomBlock;
|
|
@@ -1291,6 +1291,11 @@ declare class ProductService extends Service {
|
|
|
1291
1291
|
delete(ProductDeleteParams: JUHUU.Product.Delete.Params, ProductDeleteOptions?: JUHUU.Product.Delete.Options): Promise<JUHUU.HttpResponse<JUHUU.Product.Delete.Response>>;
|
|
1292
1292
|
}
|
|
1293
1293
|
|
|
1294
|
+
declare class WebsocketsService extends Service {
|
|
1295
|
+
constructor(config: JUHUU.SetupConfig);
|
|
1296
|
+
connect(WebsocketConnectOptions?: JUHUU.Websocket.Connect.Options): JUHUU.Websocket.Connect.Response;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1294
1299
|
declare class SettingsService extends Service {
|
|
1295
1300
|
constructor(config: JUHUU.SetupConfig);
|
|
1296
1301
|
retrieve(): Promise<JUHUU.HttpResponse<Settings>>;
|
|
@@ -1508,6 +1513,7 @@ declare class Juhuu {
|
|
|
1508
1513
|
readonly terms: TermsService;
|
|
1509
1514
|
readonly tariffs: TariffsService;
|
|
1510
1515
|
readonly products: ProductService;
|
|
1516
|
+
readonly websockets: WebsocketsService;
|
|
1511
1517
|
readonly settings: SettingsService;
|
|
1512
1518
|
readonly accountingAreas: AccountingAreasService;
|
|
1513
1519
|
readonly payouts: PayoutsService;
|
|
@@ -3393,10 +3399,10 @@ declare namespace JUHUU {
|
|
|
3393
3399
|
name?: string;
|
|
3394
3400
|
address?: Partial<Address>;
|
|
3395
3401
|
deviceIdArray?: string[];
|
|
3396
|
-
deviceId?: string;
|
|
3402
|
+
deviceId?: string | null;
|
|
3397
3403
|
maximumConcurrentSessions?: number;
|
|
3398
3404
|
surveyEnabled?: boolean;
|
|
3399
|
-
accountingAreaId?: string;
|
|
3405
|
+
accountingAreaId?: string | null;
|
|
3400
3406
|
latitude?: number;
|
|
3401
3407
|
longitude?: number;
|
|
3402
3408
|
purposeArray?: Purpose[];
|
|
@@ -3404,6 +3410,8 @@ declare namespace JUHUU {
|
|
|
3404
3410
|
rentOfferArray?: Offer[];
|
|
3405
3411
|
reservationOfferArray?: Offer[];
|
|
3406
3412
|
disabled?: boolean;
|
|
3413
|
+
rentableDeviceGroupLocationId?: string | null;
|
|
3414
|
+
termId?: string | null;
|
|
3407
3415
|
};
|
|
3408
3416
|
type Options = JUHUU.RequestOptions;
|
|
3409
3417
|
type Response = {
|
|
@@ -4573,6 +4581,54 @@ declare namespace JUHUU {
|
|
|
4573
4581
|
type Response = JUHUU.ConnectorMessage.Object[];
|
|
4574
4582
|
}
|
|
4575
4583
|
}
|
|
4584
|
+
namespace Websocket {
|
|
4585
|
+
namespace Connect {
|
|
4586
|
+
type Params = {};
|
|
4587
|
+
type Options = JUHUU.RequestOptions;
|
|
4588
|
+
type Response = {
|
|
4589
|
+
subscribe: (rooms: string[]) => void;
|
|
4590
|
+
unsubscribe: (rooms: string[]) => void;
|
|
4591
|
+
subscribeQuery: (payload: JUHUU.Websocket.SubscribeQuery.Params) => void;
|
|
4592
|
+
unsubscribeQuery: (payload: JUHUU.Websocket.UnsubscribeQuery.Params) => void;
|
|
4593
|
+
rpc: (payload: JUHUU.Websocket.Rpc.Params) => Promise<JUHUU.Websocket.Rpc.Response>;
|
|
4594
|
+
onQueryUpdate: (callback: (message: JUHUU.Websocket.QueryUpdate) => void) => void;
|
|
4595
|
+
close: () => void;
|
|
4596
|
+
};
|
|
4597
|
+
}
|
|
4598
|
+
namespace SubscribeQuery {
|
|
4599
|
+
type Params = {
|
|
4600
|
+
subId: string;
|
|
4601
|
+
method: "GET";
|
|
4602
|
+
path: string;
|
|
4603
|
+
query?: Record<string, unknown>;
|
|
4604
|
+
};
|
|
4605
|
+
}
|
|
4606
|
+
namespace UnsubscribeQuery {
|
|
4607
|
+
type Params = {
|
|
4608
|
+
subId: string;
|
|
4609
|
+
};
|
|
4610
|
+
}
|
|
4611
|
+
namespace Rpc {
|
|
4612
|
+
type Params = {
|
|
4613
|
+
id: string;
|
|
4614
|
+
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
4615
|
+
path: string;
|
|
4616
|
+
query?: Record<string, unknown>;
|
|
4617
|
+
body?: unknown;
|
|
4618
|
+
headers?: Record<string, unknown>;
|
|
4619
|
+
};
|
|
4620
|
+
type Response = {
|
|
4621
|
+
id: string;
|
|
4622
|
+
status: number;
|
|
4623
|
+
data?: unknown;
|
|
4624
|
+
error?: unknown;
|
|
4625
|
+
};
|
|
4626
|
+
}
|
|
4627
|
+
type QueryUpdate = {
|
|
4628
|
+
subId: string;
|
|
4629
|
+
data: unknown;
|
|
4630
|
+
};
|
|
4631
|
+
}
|
|
4576
4632
|
}
|
|
4577
4633
|
|
|
4578
4634
|
export { type AccessControlListElement, type Address, type ApiKeyScope, type ApiKeyStatus, type AutoRenewMode, type BaseBlock, type BusinessType, type Capability, type Category, type Circumstance, type Color, type ColorScheme, type Command, type Condition, ConditionType, type ConstBooleanBlock, type ConstNumberBlock, type ConstTextBlock, type ControlEdgeConnection, type CountryCode, CountryCodeArray, type CurrencyCode, CurrencyCodeArray, type CustomClaims, type DataEdgeConnection, type DeepNullable, type DevicePermission, type DeviceRetrieveBlock, type DeviceRetrieveBlockInputs, type DeviceStatus, type DeviceType, type DeviceUpdateBlock, type DeviceUpdateBlockInputs, type EndCustomBlock, type Environment, type EnvironmentSettings, type ExtractType, type FlowBlock, type FlowBlockInput, type FlowControlEdge, type FlowDataEdge, type FlowEdge, type FlowExecutionEnvironment, type FlowLog, type FlowStatus, type Frontend, type GeneralSettings, type GeoPoint, type GraphNode, type HttpDeleteBlock, type HttpDeleteBlockInputs, type HttpGetBlock, type HttpGetBlockInputs, type HttpPatchBlock, type HttpPostBlock, type HttpPostBlockInputs, type HttpPutBlock, type HttpPutBlockInputs, type HttpsPatchBlockInputs, type IfBlock, JUHUU, type JsonLogic, Juhuu, type LanguageCode, LanguageCodeArray, Layout, type LayoutBlock, type License, type LicenseTariffIdMap, type LinkType, type LocaleString, type LocationRetrieveBlock, type LocationRetrieveBlockInputs, type LocationUpdateBlock, type LocationUpdateBlockInputs, type MapDestructureBlock, type MapDestructureBlockInputs, type MapFilter, type MathAddBlock, type MathAddBlockInputs, type MathDivideBlock, type MathDivideBlockInputs, type MathMultiplyBlock, type MathMultiplyBlockInputs, type MathSubtractBlock, type MathSubtractBlockInputs, type Modality, type MqttSendBlock, type MqttSendBlockInputs, type Offer, type OfferTime, type ParamDefinition, type ParamType, type ParameterRetrieveBlock, type ParameterRetrieveBlockInputs, type ParameterUpdateBlock, type ParameterUpdateBlockInputs, type Party, type PaymentMethod, type PaymentReason, type PaymentRefundReason, type PaymentRefundStatus, type PaymentServiceProvider, type PaymentStatus, type PayoutSettings, type PayoutStatus, type PermissionTypes, type Person, type Platform, type PlatformString, type PostingRow, type PropertyRetrieveBlock, type PropertyRetrieveBlockInputs, type PropertyUpdateBlock, type PropertyUpdateBlockInputs, type Purpose, type PushToken, type QuickAction, ReadonlyCategoryArray, ReadonlyModalityArray, ReadonlySectorArray, type RefundStatus, type Sector, type SessionCannotTerminateReason, type SessionRetrieveBlock, type SessionRetrieveBlockInputs, type SessionSettings, type SessionStatus, type SessionTerminateBlock, type SessionTerminateBlockInputs, type SessionTerminatedByType, type SessionType, Settings, type SimStatus, type StarRating, type StartCustomBlock, type StartLocationUpdateBlock, type StartParameterUpdateBlock, type StartQuickActionLocationBlock, type StartSessionUpdateBlock, type TarifType, type TaxCode, type TimeZone, type Unit, type UserGroup, type UserRetrieveBlock, type UserRetrieveBlockInputs, type UserType, type Utilization, type VeloBrushDeviceDocumentUserManualStep, type Viewport, type ViewportPolygon, type VisualPriority, type hexColor };
|
package/dist/index.js
CHANGED
|
@@ -1838,6 +1838,53 @@ var ProductService = class extends Service {
|
|
|
1838
1838
|
}
|
|
1839
1839
|
};
|
|
1840
1840
|
|
|
1841
|
+
// src/websockets/websockets.service.ts
|
|
1842
|
+
var WebsocketsService = class extends Service {
|
|
1843
|
+
constructor(config) {
|
|
1844
|
+
super(config);
|
|
1845
|
+
}
|
|
1846
|
+
connect(WebsocketConnectOptions) {
|
|
1847
|
+
const socket = super.connectToWebsocket({ url: "websocket" });
|
|
1848
|
+
const pendingRpcResponses = /* @__PURE__ */ new Map();
|
|
1849
|
+
socket.on("rpc.response", (message) => {
|
|
1850
|
+
const resolver = pendingRpcResponses.get(message.id);
|
|
1851
|
+
if (resolver !== void 0) {
|
|
1852
|
+
resolver(message);
|
|
1853
|
+
pendingRpcResponses.delete(message.id);
|
|
1854
|
+
}
|
|
1855
|
+
});
|
|
1856
|
+
const onQueryUpdate = (callback) => {
|
|
1857
|
+
socket.on("query.update", (message) => {
|
|
1858
|
+
callback(message);
|
|
1859
|
+
});
|
|
1860
|
+
};
|
|
1861
|
+
return {
|
|
1862
|
+
subscribe: (rooms) => {
|
|
1863
|
+
socket.emit("subscribe", { rooms });
|
|
1864
|
+
},
|
|
1865
|
+
unsubscribe: (rooms) => {
|
|
1866
|
+
socket.emit("unsubscribe", { rooms });
|
|
1867
|
+
},
|
|
1868
|
+
subscribeQuery: (payload) => {
|
|
1869
|
+
socket.emit("subscribeQuery", payload);
|
|
1870
|
+
},
|
|
1871
|
+
unsubscribeQuery: (payload) => {
|
|
1872
|
+
socket.emit("unsubscribeQuery", payload);
|
|
1873
|
+
},
|
|
1874
|
+
rpc: async (payload) => {
|
|
1875
|
+
return await new Promise((resolve) => {
|
|
1876
|
+
pendingRpcResponses.set(payload.id, resolve);
|
|
1877
|
+
socket.emit("rpc", payload);
|
|
1878
|
+
});
|
|
1879
|
+
},
|
|
1880
|
+
onQueryUpdate,
|
|
1881
|
+
close: () => {
|
|
1882
|
+
socket.close();
|
|
1883
|
+
}
|
|
1884
|
+
};
|
|
1885
|
+
}
|
|
1886
|
+
};
|
|
1887
|
+
|
|
1841
1888
|
// src/settings/settings.service.ts
|
|
1842
1889
|
var SettingsService = class extends Service {
|
|
1843
1890
|
constructor(config) {
|
|
@@ -3805,6 +3852,7 @@ var Juhuu = class {
|
|
|
3805
3852
|
this.terms = new TermsService(config);
|
|
3806
3853
|
this.tariffs = new TariffsService(config);
|
|
3807
3854
|
this.products = new ProductService(config);
|
|
3855
|
+
this.websockets = new WebsocketsService(config);
|
|
3808
3856
|
this.settings = new SettingsService(config);
|
|
3809
3857
|
this.accountingAreas = new AccountingAreasService(config);
|
|
3810
3858
|
this.payouts = new PayoutsService(config);
|
|
@@ -3846,6 +3894,7 @@ var Juhuu = class {
|
|
|
3846
3894
|
terms;
|
|
3847
3895
|
tariffs;
|
|
3848
3896
|
products;
|
|
3897
|
+
websockets;
|
|
3849
3898
|
settings;
|
|
3850
3899
|
accountingAreas;
|
|
3851
3900
|
payouts;
|
package/dist/index.mjs
CHANGED
|
@@ -1794,6 +1794,53 @@ var ProductService = class extends Service {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
};
|
|
1796
1796
|
|
|
1797
|
+
// src/websockets/websockets.service.ts
|
|
1798
|
+
var WebsocketsService = class extends Service {
|
|
1799
|
+
constructor(config) {
|
|
1800
|
+
super(config);
|
|
1801
|
+
}
|
|
1802
|
+
connect(WebsocketConnectOptions) {
|
|
1803
|
+
const socket = super.connectToWebsocket({ url: "websocket" });
|
|
1804
|
+
const pendingRpcResponses = /* @__PURE__ */ new Map();
|
|
1805
|
+
socket.on("rpc.response", (message) => {
|
|
1806
|
+
const resolver = pendingRpcResponses.get(message.id);
|
|
1807
|
+
if (resolver !== void 0) {
|
|
1808
|
+
resolver(message);
|
|
1809
|
+
pendingRpcResponses.delete(message.id);
|
|
1810
|
+
}
|
|
1811
|
+
});
|
|
1812
|
+
const onQueryUpdate = (callback) => {
|
|
1813
|
+
socket.on("query.update", (message) => {
|
|
1814
|
+
callback(message);
|
|
1815
|
+
});
|
|
1816
|
+
};
|
|
1817
|
+
return {
|
|
1818
|
+
subscribe: (rooms) => {
|
|
1819
|
+
socket.emit("subscribe", { rooms });
|
|
1820
|
+
},
|
|
1821
|
+
unsubscribe: (rooms) => {
|
|
1822
|
+
socket.emit("unsubscribe", { rooms });
|
|
1823
|
+
},
|
|
1824
|
+
subscribeQuery: (payload) => {
|
|
1825
|
+
socket.emit("subscribeQuery", payload);
|
|
1826
|
+
},
|
|
1827
|
+
unsubscribeQuery: (payload) => {
|
|
1828
|
+
socket.emit("unsubscribeQuery", payload);
|
|
1829
|
+
},
|
|
1830
|
+
rpc: async (payload) => {
|
|
1831
|
+
return await new Promise((resolve) => {
|
|
1832
|
+
pendingRpcResponses.set(payload.id, resolve);
|
|
1833
|
+
socket.emit("rpc", payload);
|
|
1834
|
+
});
|
|
1835
|
+
},
|
|
1836
|
+
onQueryUpdate,
|
|
1837
|
+
close: () => {
|
|
1838
|
+
socket.close();
|
|
1839
|
+
}
|
|
1840
|
+
};
|
|
1841
|
+
}
|
|
1842
|
+
};
|
|
1843
|
+
|
|
1797
1844
|
// src/settings/settings.service.ts
|
|
1798
1845
|
var SettingsService = class extends Service {
|
|
1799
1846
|
constructor(config) {
|
|
@@ -3761,6 +3808,7 @@ var Juhuu = class {
|
|
|
3761
3808
|
this.terms = new TermsService(config);
|
|
3762
3809
|
this.tariffs = new TariffsService(config);
|
|
3763
3810
|
this.products = new ProductService(config);
|
|
3811
|
+
this.websockets = new WebsocketsService(config);
|
|
3764
3812
|
this.settings = new SettingsService(config);
|
|
3765
3813
|
this.accountingAreas = new AccountingAreasService(config);
|
|
3766
3814
|
this.payouts = new PayoutsService(config);
|
|
@@ -3802,6 +3850,7 @@ var Juhuu = class {
|
|
|
3802
3850
|
terms;
|
|
3803
3851
|
tariffs;
|
|
3804
3852
|
products;
|
|
3853
|
+
websockets;
|
|
3805
3854
|
settings;
|
|
3806
3855
|
accountingAreas;
|
|
3807
3856
|
payouts;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juhuu/sdk-ts",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.238",
|
|
4
4
|
"description": "Typescript wrapper for JUHUU services",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"typescript": "^5.4.5"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@types/node": "^24.1.0",
|
|
33
34
|
"socket.io-client": "^4.7.5"
|
|
34
35
|
}
|
|
35
36
|
}
|