@fluidframework/driver-base
Advanced tools
Comparing version 2.3.0-288113 to 2.3.0
# @fluidframework/driver-base | ||
## 2.3.0 | ||
Dependency updates only. | ||
## 2.2.0 | ||
@@ -4,0 +8,0 @@ |
@@ -7,3 +7,3 @@ /*! | ||
import { ConnectionMode } from "@fluidframework/driver-definitions"; | ||
import { IAnyDriverError, IDocumentDeltaConnection, IDocumentDeltaConnectionEvents, IClientConfiguration, IConnect, IConnected, IDocumentMessage, ISignalClient, ITokenClaims, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/driver-definitions/internal"; | ||
import { IAnyDriverError, IDocumentDeltaConnection, IDocumentDeltaConnectionEvents, IClientConfiguration, IConnect, IConnected, IDocumentMessage, type ISentSignalMessage, ISignalClient, ITokenClaims, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/driver-definitions/internal"; | ||
import { ITelemetryLoggerExt, EventEmitterWithErrorHandling } from "@fluidframework/telemetry-utils/internal"; | ||
@@ -119,5 +119,17 @@ import type { Socket } from "socket.io-client"; | ||
get initialClients(): ISignalClient[]; | ||
/** | ||
* Emits 'submitOp' messages. | ||
* @param type - Must be 'submitOp'. | ||
* @param messages - An array of document messages to submit. | ||
*/ | ||
protected emitMessages(type: "submitOp", messages: IDocumentMessage[][]): void; | ||
protected emitMessages(type: "submitSignal", messages: string[][]): void; | ||
/** | ||
* Emits 'submitSignal' messages. | ||
* | ||
* **Note:** When using `ISentSignalMessage[]`, the service must support the `submit_signals_v2` feature. | ||
* @param type - Must be 'submitSignal'. | ||
* @param messages - An array of signals to submit. Can be either `string[][]` or `ISentSignalMessage[]`. | ||
*/ | ||
protected emitMessages(type: "submitSignal", messages: string[][] | ISentSignalMessage[]): void; | ||
/** | ||
* Submits a new delta operation to the server | ||
@@ -124,0 +136,0 @@ * |
@@ -15,2 +15,3 @@ "use strict"; | ||
const packageVersion_js_1 = require("./packageVersion.js"); | ||
const feature_submit_signals_v2 = "submit_signals_v2"; | ||
/** | ||
@@ -257,6 +258,16 @@ * Represents a connection to a stream of delta updates. | ||
this.checkNotDisposed(); | ||
if (targetClientId && this.details.supportedFeatures?.submit_signals_v2 !== true) { | ||
throw new internal_3.UsageError("Sending signals to specific client ids is not supported."); | ||
// Check for server-side support of v2 signals | ||
if (this.details.supportedFeatures?.submit_signals_v2 === true) { | ||
const signal = { content }; | ||
if (targetClientId !== undefined) { | ||
signal.targetClientId = targetClientId; | ||
} | ||
this.emitMessages("submitSignal", [signal]); | ||
} | ||
this.emitMessages("submitSignal", [[content]]); | ||
else if (targetClientId !== undefined) { | ||
throw new internal_3.UsageError("Sending signals to specific client ids is not supported with this service."); | ||
} | ||
else { | ||
this.emitMessages("submitSignal", [[content]]); | ||
} | ||
} | ||
@@ -330,2 +341,6 @@ /** | ||
this.earlyOpHandlerAttached = true; | ||
connectMessage.supportedFeatures = { | ||
...connectMessage.supportedFeatures, | ||
[feature_submit_signals_v2]: true, | ||
}; | ||
// Socket.io's reconnect_attempt event is unreliable, so we track connect_error count instead. | ||
@@ -332,0 +347,0 @@ let internalSocketConnectionFailureCount = 0; |
@@ -107,8 +107,4 @@ "use strict"; | ||
if (messages.length !== 0) { | ||
// Non null asserting here because of the length check above | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const start = messages[0].sequenceNumber; | ||
const length = messages.length; | ||
// Non null asserting here because of the length check above | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const last = messages[length - 1].sequenceNumber; | ||
@@ -124,7 +120,3 @@ if (last + 1 !== from + length) { | ||
while (validOpsCount < messages.length && | ||
// TODO Why are we non null asserting here | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
messages[validOpsCount].sequenceNumber === | ||
// TODO Why are we non null asserting here | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
messages[validOpsCount - 1].sequenceNumber + 1) { | ||
@@ -144,7 +136,3 @@ validOpsCount++; | ||
validLength: messages.length, | ||
lastValidOpSeqNumber: messages.length > 0 | ||
? // Non null asserting here because of the length check | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
messages[messages.length - 1].sequenceNumber | ||
: undefined, | ||
lastValidOpSeqNumber: messages.length > 0 ? messages[messages.length - 1].sequenceNumber : undefined, | ||
strict, | ||
@@ -151,0 +139,0 @@ }), |
@@ -8,3 +8,3 @@ /*! | ||
export declare const pkgName = "@fluidframework/driver-base"; | ||
export declare const pkgVersion = "2.3.0-288113"; | ||
export declare const pkgVersion = "2.3.0"; | ||
//# sourceMappingURL=packageVersion.d.ts.map |
@@ -11,3 +11,3 @@ "use strict"; | ||
exports.pkgName = "@fluidframework/driver-base"; | ||
exports.pkgVersion = "2.3.0-288113"; | ||
exports.pkgVersion = "2.3.0"; | ||
//# sourceMappingURL=packageVersion.js.map |
@@ -7,3 +7,3 @@ /*! | ||
import { ConnectionMode } from "@fluidframework/driver-definitions"; | ||
import { IAnyDriverError, IDocumentDeltaConnection, IDocumentDeltaConnectionEvents, IClientConfiguration, IConnect, IConnected, IDocumentMessage, ISignalClient, ITokenClaims, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/driver-definitions/internal"; | ||
import { IAnyDriverError, IDocumentDeltaConnection, IDocumentDeltaConnectionEvents, IClientConfiguration, IConnect, IConnected, IDocumentMessage, type ISentSignalMessage, ISignalClient, ITokenClaims, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/driver-definitions/internal"; | ||
import { ITelemetryLoggerExt, EventEmitterWithErrorHandling } from "@fluidframework/telemetry-utils/internal"; | ||
@@ -119,5 +119,17 @@ import type { Socket } from "socket.io-client"; | ||
get initialClients(): ISignalClient[]; | ||
/** | ||
* Emits 'submitOp' messages. | ||
* @param type - Must be 'submitOp'. | ||
* @param messages - An array of document messages to submit. | ||
*/ | ||
protected emitMessages(type: "submitOp", messages: IDocumentMessage[][]): void; | ||
protected emitMessages(type: "submitSignal", messages: string[][]): void; | ||
/** | ||
* Emits 'submitSignal' messages. | ||
* | ||
* **Note:** When using `ISentSignalMessage[]`, the service must support the `submit_signals_v2` feature. | ||
* @param type - Must be 'submitSignal'. | ||
* @param messages - An array of signals to submit. Can be either `string[][]` or `ISentSignalMessage[]`. | ||
*/ | ||
protected emitMessages(type: "submitSignal", messages: string[][] | ISentSignalMessage[]): void; | ||
/** | ||
* Submits a new delta operation to the server | ||
@@ -124,0 +136,0 @@ * |
@@ -12,2 +12,3 @@ /*! | ||
import { pkgVersion as driverVersion } from "./packageVersion.js"; | ||
const feature_submit_signals_v2 = "submit_signals_v2"; | ||
/** | ||
@@ -254,6 +255,16 @@ * Represents a connection to a stream of delta updates. | ||
this.checkNotDisposed(); | ||
if (targetClientId && this.details.supportedFeatures?.submit_signals_v2 !== true) { | ||
throw new UsageError("Sending signals to specific client ids is not supported."); | ||
// Check for server-side support of v2 signals | ||
if (this.details.supportedFeatures?.submit_signals_v2 === true) { | ||
const signal = { content }; | ||
if (targetClientId !== undefined) { | ||
signal.targetClientId = targetClientId; | ||
} | ||
this.emitMessages("submitSignal", [signal]); | ||
} | ||
this.emitMessages("submitSignal", [[content]]); | ||
else if (targetClientId !== undefined) { | ||
throw new UsageError("Sending signals to specific client ids is not supported with this service."); | ||
} | ||
else { | ||
this.emitMessages("submitSignal", [[content]]); | ||
} | ||
} | ||
@@ -327,2 +338,6 @@ /** | ||
this.earlyOpHandlerAttached = true; | ||
connectMessage.supportedFeatures = { | ||
...connectMessage.supportedFeatures, | ||
[feature_submit_signals_v2]: true, | ||
}; | ||
// Socket.io's reconnect_attempt event is unreliable, so we track connect_error count instead. | ||
@@ -329,0 +344,0 @@ let internalSocketConnectionFailureCount = 0; |
@@ -102,8 +102,4 @@ /*! | ||
if (messages.length !== 0) { | ||
// Non null asserting here because of the length check above | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const start = messages[0].sequenceNumber; | ||
const length = messages.length; | ||
// Non null asserting here because of the length check above | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const last = messages[length - 1].sequenceNumber; | ||
@@ -119,7 +115,3 @@ if (last + 1 !== from + length) { | ||
while (validOpsCount < messages.length && | ||
// TODO Why are we non null asserting here | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
messages[validOpsCount].sequenceNumber === | ||
// TODO Why are we non null asserting here | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
messages[validOpsCount - 1].sequenceNumber + 1) { | ||
@@ -139,7 +131,3 @@ validOpsCount++; | ||
validLength: messages.length, | ||
lastValidOpSeqNumber: messages.length > 0 | ||
? // Non null asserting here because of the length check | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
messages[messages.length - 1].sequenceNumber | ||
: undefined, | ||
lastValidOpSeqNumber: messages.length > 0 ? messages[messages.length - 1].sequenceNumber : undefined, | ||
strict, | ||
@@ -146,0 +134,0 @@ }), |
@@ -8,3 +8,3 @@ /*! | ||
export declare const pkgName = "@fluidframework/driver-base"; | ||
export declare const pkgVersion = "2.3.0-288113"; | ||
export declare const pkgVersion = "2.3.0"; | ||
//# sourceMappingURL=packageVersion.d.ts.map |
@@ -8,3 +8,3 @@ /*! | ||
export const pkgName = "@fluidframework/driver-base"; | ||
export const pkgVersion = "2.3.0-288113"; | ||
export const pkgVersion = "2.3.0"; | ||
//# sourceMappingURL=packageVersion.js.map |
@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard. | ||
"packageName": "@microsoft/api-extractor", | ||
"packageVersion": "7.45.1" | ||
"packageVersion": "7.47.8" | ||
} | ||
] | ||
} |
{ | ||
"name": "@fluidframework/driver-base", | ||
"version": "2.3.0-288113", | ||
"version": "2.3.0", | ||
"description": "Shared driver code for Fluid driver implementations", | ||
@@ -60,8 +60,8 @@ "homepage": "https://fluidframework.com", | ||
"dependencies": { | ||
"@fluid-internal/client-utils": "2.3.0-288113", | ||
"@fluidframework/core-interfaces": "2.3.0-288113", | ||
"@fluidframework/core-utils": "2.3.0-288113", | ||
"@fluidframework/driver-definitions": "2.3.0-288113", | ||
"@fluidframework/driver-utils": "2.3.0-288113", | ||
"@fluidframework/telemetry-utils": "2.3.0-288113" | ||
"@fluid-internal/client-utils": "~2.3.0", | ||
"@fluidframework/core-interfaces": "~2.3.0", | ||
"@fluidframework/core-utils": "~2.3.0", | ||
"@fluidframework/driver-definitions": "~2.3.0", | ||
"@fluidframework/driver-utils": "~2.3.0", | ||
"@fluidframework/telemetry-utils": "~2.3.0" | ||
}, | ||
@@ -71,9 +71,9 @@ "devDependencies": { | ||
"@biomejs/biome": "~1.8.3", | ||
"@fluid-internal/mocha-test-setup": "2.3.0-288113", | ||
"@fluid-tools/build-cli": "^0.43.0", | ||
"@fluid-internal/mocha-test-setup": "~2.3.0", | ||
"@fluid-tools/build-cli": "^0.46.0", | ||
"@fluidframework/build-common": "^2.0.3", | ||
"@fluidframework/build-tools": "^0.43.0", | ||
"@fluidframework/build-tools": "^0.46.0", | ||
"@fluidframework/driver-base-previous": "npm:@fluidframework/driver-base@2.2.0", | ||
"@fluidframework/eslint-config-fluid": "^5.3.0", | ||
"@microsoft/api-extractor": "^7.45.1", | ||
"@fluidframework/eslint-config-fluid": "^5.4.0", | ||
"@microsoft/api-extractor": "7.47.8", | ||
"@types/mocha": "^9.1.1", | ||
@@ -96,3 +96,4 @@ "@types/node": "^18.19.0", | ||
"typeValidation": { | ||
"broken": {} | ||
"broken": {}, | ||
"entrypoint": "internal" | ||
}, | ||
@@ -99,0 +100,0 @@ "scripts": { |
@@ -21,2 +21,3 @@ /*! | ||
IDocumentMessage, | ||
type ISentSignalMessage, | ||
ISignalClient, | ||
@@ -43,2 +44,4 @@ ITokenClaims, | ||
const feature_submit_signals_v2 = "submit_signals_v2"; | ||
/** | ||
@@ -317,5 +320,20 @@ * Represents a connection to a stream of delta updates. | ||
} | ||
/** | ||
* Emits 'submitOp' messages. | ||
* @param type - Must be 'submitOp'. | ||
* @param messages - An array of document messages to submit. | ||
*/ | ||
protected emitMessages(type: "submitOp", messages: IDocumentMessage[][]): void; | ||
protected emitMessages(type: "submitOp", messages: IDocumentMessage[][]): void; | ||
protected emitMessages(type: "submitSignal", messages: string[][]): void; | ||
/** | ||
* Emits 'submitSignal' messages. | ||
* | ||
* **Note:** When using `ISentSignalMessage[]`, the service must support the `submit_signals_v2` feature. | ||
* @param type - Must be 'submitSignal'. | ||
* @param messages - An array of signals to submit. Can be either `string[][]` or `ISentSignalMessage[]`. | ||
*/ | ||
protected emitMessages( | ||
type: "submitSignal", | ||
messages: string[][] | ISentSignalMessage[], | ||
): void; | ||
protected emitMessages(type: string, messages: unknown): void { | ||
@@ -349,7 +367,16 @@ // Although the implementation here disconnects the socket and does not reuse it, other subclasses | ||
if (targetClientId && this.details.supportedFeatures?.submit_signals_v2 !== true) { | ||
throw new UsageError("Sending signals to specific client ids is not supported."); | ||
// Check for server-side support of v2 signals | ||
if (this.details.supportedFeatures?.submit_signals_v2 === true) { | ||
const signal: ISentSignalMessage = { content }; | ||
if (targetClientId !== undefined) { | ||
signal.targetClientId = targetClientId; | ||
} | ||
this.emitMessages("submitSignal", [signal]); | ||
} else if (targetClientId !== undefined) { | ||
throw new UsageError( | ||
"Sending signals to specific client ids is not supported with this service.", | ||
); | ||
} else { | ||
this.emitMessages("submitSignal", [[content]]); | ||
} | ||
this.emitMessages("submitSignal", [[content]]); | ||
} | ||
@@ -440,2 +467,7 @@ | ||
connectMessage.supportedFeatures = { | ||
...connectMessage.supportedFeatures, | ||
[feature_submit_signals_v2]: true, | ||
}; | ||
// Socket.io's reconnect_attempt event is unreliable, so we track connect_error count instead. | ||
@@ -442,0 +474,0 @@ let internalSocketConnectionFailureCount: number = 0; |
@@ -120,9 +120,5 @@ /*! | ||
if (messages.length !== 0) { | ||
// Non null asserting here because of the length check above | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const start = messages[0]!.sequenceNumber; | ||
const start = messages[0].sequenceNumber; | ||
const length = messages.length; | ||
// Non null asserting here because of the length check above | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const last = messages[length - 1]!.sequenceNumber; | ||
const last = messages[length - 1].sequenceNumber; | ||
if (last + 1 !== from + length) { | ||
@@ -137,8 +133,4 @@ // If not strict, then return the first consecutive sub-block. If strict or start | ||
validOpsCount < messages.length && | ||
// TODO Why are we non null asserting here | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
messages[validOpsCount]!.sequenceNumber === | ||
// TODO Why are we non null asserting here | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
messages[validOpsCount - 1]!.sequenceNumber + 1 | ||
messages[validOpsCount].sequenceNumber === | ||
messages[validOpsCount - 1].sequenceNumber + 1 | ||
) { | ||
@@ -159,7 +151,3 @@ validOpsCount++; | ||
lastValidOpSeqNumber: | ||
messages.length > 0 | ||
? // Non null asserting here because of the length check | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
messages[messages.length - 1]!.sequenceNumber | ||
: undefined, | ||
messages.length > 0 ? messages[messages.length - 1].sequenceNumber : undefined, | ||
strict, | ||
@@ -166,0 +154,0 @@ }), |
@@ -9,2 +9,2 @@ /*! | ||
export const pkgName = "@fluidframework/driver-base"; | ||
export const pkgVersion = "2.3.0-288113"; | ||
export const pkgVersion = "2.3.0"; |
@@ -9,3 +9,4 @@ { | ||
"exactOptionalPropertyTypes": false, | ||
"noUncheckedIndexedAccess": false, | ||
}, | ||
} |
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
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
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
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
270452
2929
0
+ Added@fluid-internal/client-utils@2.3.1(transitive)
+ Added@fluidframework/core-interfaces@2.3.1(transitive)
+ Added@fluidframework/core-utils@2.3.1(transitive)
+ Added@fluidframework/driver-definitions@2.3.1(transitive)
+ Added@fluidframework/driver-utils@2.3.1(transitive)
+ Added@fluidframework/telemetry-utils@2.3.1(transitive)
- Removed@fluid-internal/client-utils@2.3.0-288113(transitive)
- Removed@fluidframework/core-interfaces@2.3.0-288113(transitive)
- Removed@fluidframework/core-utils@2.3.0-288113(transitive)
- Removed@fluidframework/driver-definitions@2.3.0-288113(transitive)
- Removed@fluidframework/driver-utils@2.3.0-288113(transitive)
- Removed@fluidframework/telemetry-utils@2.3.0-288113(transitive)