@fluidframework/odsp-client 2.73.0 → 2.74.0-368706
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/api-report/odsp-client.alpha.api.md +12 -2
- package/api-report/odsp-client.beta.api.md +12 -2
- package/dist/beta.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +39 -2
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/odspContainerServices.d.ts +9 -2
- package/dist/odspContainerServices.d.ts.map +1 -1
- package/dist/odspContainerServices.js +48 -0
- package/dist/odspContainerServices.js.map +1 -1
- package/lib/beta.d.ts +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/interfaces.d.ts +39 -2
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js.map +1 -1
- package/lib/odspContainerServices.d.ts +9 -2
- package/lib/odspContainerServices.d.ts.map +1 -1
- package/lib/odspContainerServices.js +48 -0
- package/lib/odspContainerServices.js.map +1 -1
- package/package.json +16 -15
- package/src/index.ts +1 -0
- package/src/interfaces.ts +42 -1
- package/src/odspContainerServices.ts +47 -1
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
// @beta
|
|
8
8
|
export type IOdspAudience = IServiceAudience<OdspMember>;
|
|
9
9
|
|
|
10
|
+
// @beta @sealed
|
|
11
|
+
export interface IOdspContainerServicesEvents {
|
|
12
|
+
readOnlyStateChanged: () => void;
|
|
13
|
+
sensitivityLabelsInfoChanged: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
// @beta
|
|
11
17
|
export interface IOdspFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IFluidContainer<TContainerSchema> {
|
|
12
18
|
attach(props?: ContainerAttachProps<OdspContainerAttachProps>): Promise<string>;
|
|
@@ -54,9 +60,13 @@ export interface OdspContainerAttachProps {
|
|
|
54
60
|
filePath: string | undefined;
|
|
55
61
|
}
|
|
56
62
|
|
|
57
|
-
// @beta
|
|
58
|
-
export interface OdspContainerServices {
|
|
63
|
+
// @beta @sealed
|
|
64
|
+
export interface OdspContainerServices extends IDisposable {
|
|
59
65
|
audience: IOdspAudience;
|
|
66
|
+
// (undocumented)
|
|
67
|
+
events: Listenable<IOdspContainerServicesEvents>;
|
|
68
|
+
getReadOnlyState(): boolean | undefined;
|
|
69
|
+
getSensitivityLabelsInfo(): string | undefined;
|
|
60
70
|
}
|
|
61
71
|
|
|
62
72
|
// @beta
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
// @beta
|
|
8
8
|
export type IOdspAudience = IServiceAudience<OdspMember>;
|
|
9
9
|
|
|
10
|
+
// @beta @sealed
|
|
11
|
+
export interface IOdspContainerServicesEvents {
|
|
12
|
+
readOnlyStateChanged: () => void;
|
|
13
|
+
sensitivityLabelsInfoChanged: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
// @beta
|
|
11
17
|
export interface IOdspFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IFluidContainer<TContainerSchema> {
|
|
12
18
|
attach(props?: ContainerAttachProps<OdspContainerAttachProps>): Promise<string>;
|
|
@@ -54,9 +60,13 @@ export interface OdspContainerAttachProps {
|
|
|
54
60
|
filePath: string | undefined;
|
|
55
61
|
}
|
|
56
62
|
|
|
57
|
-
// @beta
|
|
58
|
-
export interface OdspContainerServices {
|
|
63
|
+
// @beta @sealed
|
|
64
|
+
export interface OdspContainerServices extends IDisposable {
|
|
59
65
|
audience: IOdspAudience;
|
|
66
|
+
// (undocumented)
|
|
67
|
+
events: Listenable<IOdspContainerServicesEvents>;
|
|
68
|
+
getReadOnlyState(): boolean | undefined;
|
|
69
|
+
getSensitivityLabelsInfo(): string | undefined;
|
|
60
70
|
}
|
|
61
71
|
|
|
62
72
|
// @beta
|
package/dist/beta.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @packageDocumentation
|
|
13
13
|
*/
|
|
14
|
-
export type { IOdspAudience, IOdspFluidContainer, OdspClientProps, OdspConnectionConfig, OdspContainerAttachProps, OdspContainerServices, OdspMember, TokenResponse, } from "./interfaces.js";
|
|
14
|
+
export type { IOdspAudience, IOdspContainerServicesEvents, IOdspFluidContainer, OdspClientProps, OdspConnectionConfig, OdspContainerAttachProps, OdspContainerServices, OdspMember, TokenResponse, } from "./interfaces.js";
|
|
15
15
|
export { OdspClient } from "./odspClient.js";
|
|
16
16
|
export { type IOdspTokenProvider } from "./token.js";
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,YAAY,EACX,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,UAAU,EACV,aAAa,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,YAAY,EACX,aAAa,EACb,4BAA4B,EAC5B,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,UAAU,EACV,aAAa,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAuBH,iDAA6C;AAApC,2GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The odsp-client package provides a simple and powerful way to consume collaborative Fluid data with OneDrive/SharePoint (ODSP) storage.\n *\n * @remarks\n * Please note that odsp-client is currently an experimental package.\n * We'd love for you to try it out and provide feedback but it is not yet recommended or supported for production scenarios.\n *\n * @packageDocumentation\n */\n\nexport type {\n\tIOdspAudience,\n\tIOdspContainerServicesEvents,\n\tIOdspFluidContainer,\n\tOdspClientProps,\n\tOdspConnectionConfig,\n\tOdspContainerAttachProps,\n\tOdspContainerServices,\n\tOdspMember,\n\tTokenResponse,\n} from \"./interfaces.js\";\nexport { OdspClient } from \"./odspClient.js\";\nexport { type IOdspTokenProvider } from \"./token.js\";\n"]}
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type { IConfigProviderBase, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
5
|
+
import type { IConfigProviderBase, IDisposable, ITelemetryBaseLogger, Listenable } from "@fluidframework/core-interfaces";
|
|
6
6
|
import type { ContainerAttachProps, ContainerSchema, IFluidContainer, IMember, IServiceAudience } from "@fluidframework/fluid-static";
|
|
7
7
|
import type { IOdspTokenProvider } from "./token.js";
|
|
8
8
|
/**
|
|
@@ -59,6 +59,24 @@ export interface OdspContainerAttachProps {
|
|
|
59
59
|
*/
|
|
60
60
|
fileName: string | undefined;
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Events emitted by the ODSP container service to notify consumers of select
|
|
64
|
+
* container changes.
|
|
65
|
+
* @beta
|
|
66
|
+
* @sealed
|
|
67
|
+
*/
|
|
68
|
+
export interface IOdspContainerServicesEvents {
|
|
69
|
+
/**
|
|
70
|
+
* Emitted when the read-only state of the container changes.
|
|
71
|
+
* Consumers can call `OdspContainerServices.getReadOnlyState()` to get the updated value.
|
|
72
|
+
*/
|
|
73
|
+
readOnlyStateChanged: () => void;
|
|
74
|
+
/**
|
|
75
|
+
* Emitted when the sensitivity label of the container changes.
|
|
76
|
+
* Consumers can call `OdspContainerServices.getSensitivityLabelsInfo()` to get the updated value.
|
|
77
|
+
*/
|
|
78
|
+
sensitivityLabelsInfoChanged: () => void;
|
|
79
|
+
}
|
|
62
80
|
/**
|
|
63
81
|
* ODSP version of the IFluidContainer interface.
|
|
64
82
|
* @beta
|
|
@@ -83,12 +101,31 @@ export interface IOdspFluidContainer<TContainerSchema extends ContainerSchema =
|
|
|
83
101
|
* how the data is handled within the FluidContainer itself, i.e. which data objects or DDSes to
|
|
84
102
|
* use, will not be included here but rather on the FluidContainer class itself.
|
|
85
103
|
* @beta
|
|
104
|
+
* @sealed
|
|
86
105
|
*/
|
|
87
|
-
export interface OdspContainerServices {
|
|
106
|
+
export interface OdspContainerServices extends IDisposable {
|
|
107
|
+
events: Listenable<IOdspContainerServicesEvents>;
|
|
88
108
|
/**
|
|
89
109
|
* Provides an object that facilitates obtaining information about users present in the Fluid session, as well as listeners for roster changes triggered by users joining or leaving the session.
|
|
90
110
|
*/
|
|
91
111
|
audience: IOdspAudience;
|
|
112
|
+
/**
|
|
113
|
+
* Gets the read-only state of the container, if available.
|
|
114
|
+
* This is not available until the container is in the "Connected" state.
|
|
115
|
+
* @remarks
|
|
116
|
+
* In the case that the read-only state cannot be determined, wait for the "readOnlyStateChanged" event to be emitted.
|
|
117
|
+
* @returns The read-only state (true when readonly, false when editable), or undefined if not available.
|
|
118
|
+
*/
|
|
119
|
+
getReadOnlyState(): boolean | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Gets the sensitivity labels info of the container, if available.
|
|
122
|
+
* This is not available until the container is in the "Connected" state, and will only be available
|
|
123
|
+
* if sensitivity labels have been applied to the container.
|
|
124
|
+
* @remarks
|
|
125
|
+
* In the case that the sensitivity labels info are expected but cannot be determined, wait for the "sensitivityLabelChanged" event to be emitted.
|
|
126
|
+
* @returns The sensitivity labels info string, or undefined if not available.
|
|
127
|
+
*/
|
|
128
|
+
getSensitivityLabelsInfo(): string | undefined;
|
|
92
129
|
}
|
|
93
130
|
/**
|
|
94
131
|
* Since ODSP provides user names and email for all of its members, we extend the
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,aAAa,EAAE,kBAAkB,CAAC;IAElC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CACjB;AACD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC;IAE1C;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7B;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CACnC,gBAAgB,SAAS,eAAe,GAAG,eAAe,CACzD,SAAQ,eAAe,CAAC,gBAAgB,CAAC;IAC1C;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,oBAAoB,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChF;AAED
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,aAAa,EAAE,kBAAkB,CAAC;IAElC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CACjB;AACD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC;IAE1C;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7B;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;;OAGG;IACH,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC;;;OAGG;IACH,4BAA4B,EAAE,MAAM,IAAI,CAAC;CACzC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CACnC,gBAAgB,SAAS,eAAe,GAAG,eAAe,CACzD,SAAQ,eAAe,CAAC,gBAAgB,CAAC;IAC1C;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,oBAAoB,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChF;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACzD,MAAM,EAAE,UAAU,CAAC,4BAA4B,CAAC,CAAC;IACjD;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC;IAExB;;;;;;OAMG;IACH,gBAAgB,IAAI,OAAO,GAAG,SAAS,CAAC;IACxC;;;;;;;OAOG;IACH,wBAAwB,IAAI,MAAM,GAAG,SAAS,CAAC;CAC/C;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAW,SAAQ,OAAO;IAC1C;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
package/dist/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIConfigProviderBase,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tContainerAttachProps,\n\tContainerSchema,\n\tIFluidContainer,\n\tIMember,\n\tIServiceAudience,\n} from \"@fluidframework/fluid-static\";\n\nimport type { IOdspTokenProvider } from \"./token.js\";\n\n/**\n * Defines the necessary properties that will be applied to all containers\n * created by an OdspClient instance. This includes callbacks for the authentication tokens\n * required for ODSP.\n * @beta\n */\nexport interface OdspConnectionConfig {\n\t/**\n\t * Instance that provides AAD endpoint tokens for Push and SharePoint\n\t */\n\ttokenProvider: IOdspTokenProvider;\n\n\t/**\n\t * Site url representing ODSP resource location. It points to the specific SharePoint site where you can store and access the containers you create.\n\t */\n\tsiteUrl: string;\n\n\t/**\n\t * SharePoint Embedded Container Id of the tenant where Fluid containers are created\n\t */\n\tdriveId: string;\n\n\t/**\n\t * Specifies the file path where Fluid files are created. If passed an empty string, the Fluid files will be created at the root level.\n\t */\n\tfilePath: string;\n}\n/**\n * @beta\n */\nexport interface OdspClientProps {\n\t/**\n\t * Configuration for establishing a connection with the ODSP Fluid Service (Push).\n\t */\n\treadonly connection: OdspConnectionConfig;\n\n\t/**\n\t * Optional. A logger instance to receive diagnostic messages.\n\t */\n\treadonly logger?: ITelemetryBaseLogger;\n\n\t/**\n\t * Base interface for providing configurations to control experimental features. If unsure, leave this undefined.\n\t */\n\treadonly configProvider?: IConfigProviderBase;\n}\n\n/**\n * @beta\n */\nexport interface OdspContainerAttachProps {\n\t/**\n\t * The file path where Fluid containers are created. If undefined, the file is created at the root.\n\t */\n\tfilePath: string | undefined;\n\n\t/**\n\t * The file name of the Fluid file. If undefined, the file is named with a GUID.\n\t */\n\tfileName: string | undefined;\n}\n\n/**\n * ODSP version of the IFluidContainer interface.\n * @beta\n */\nexport interface IOdspFluidContainer<\n\tTContainerSchema extends ContainerSchema = ContainerSchema,\n> extends IFluidContainer<TContainerSchema> {\n\t/**\n\t * A newly created container starts detached from the collaborative service.\n\t * Calling `attach()` uploads the new container to the service and connects to the collaborative service.\n\t *\n\t * This function is the same as the IFluidContainer.attach function, but has ODSP specific function signatures.\n\t *\n\t * @param props - Optional properties to pass to the attach function.\n\t *\n\t * @returns A promise which resolves when the attach is complete, with the string identifier of the container.\n\t */\n\tattach(props?: ContainerAttachProps<OdspContainerAttachProps>): Promise<string>;\n}\n\n/**\n * OdspContainerServices is returned by the OdspClient alongside a FluidContainer. It holds the\n * functionality specifically tied to the ODSP service, and how the data stored in the\n * FluidContainer is persisted in the backend and consumed by users. Any functionality regarding\n * how the data is handled within the FluidContainer itself, i.e. which data objects or DDSes to\n * use, will not be included here but rather on the FluidContainer class itself.\n * @beta\n */\nexport interface OdspContainerServices {\n\t/**\n\t * Provides an object that facilitates obtaining information about users present in the Fluid session, as well as listeners for roster changes triggered by users joining or leaving the session.\n\t */\n\taudience: IOdspAudience;\n}\n\n/**\n * Since ODSP provides user names and email for all of its members, we extend the\n * {@link @fluidframework/fluid-static#IMember} interface to include this service-specific value.\n * It will be returned for all audience members connected.\n * @beta\n */\nexport interface OdspMember extends IMember {\n\t/**\n\t * The object ID (oid) for the user, unique among each individual user connecting to the session.\n\t */\n\tid: string;\n\t/**\n\t * The user's name\n\t */\n\tname: string;\n\t/**\n\t * The user's email\n\t */\n\temail: string;\n}\n\n/**\n * Audience object for ODSP containers\n * @beta\n */\nexport type IOdspAudience = IServiceAudience<OdspMember>;\n\n/**\n * Represents token response\n * @beta\n */\nexport interface TokenResponse {\n\t/**\n\t * Token value\n\t */\n\ttoken: string;\n\n\t/**\n\t * Whether or not the token was obtained from local cache.\n\t * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.\n\t */\n\tfromCache?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIConfigProviderBase,\n\tIDisposable,\n\tITelemetryBaseLogger,\n\tListenable,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tContainerAttachProps,\n\tContainerSchema,\n\tIFluidContainer,\n\tIMember,\n\tIServiceAudience,\n} from \"@fluidframework/fluid-static\";\n\nimport type { IOdspTokenProvider } from \"./token.js\";\n\n/**\n * Defines the necessary properties that will be applied to all containers\n * created by an OdspClient instance. This includes callbacks for the authentication tokens\n * required for ODSP.\n * @beta\n */\nexport interface OdspConnectionConfig {\n\t/**\n\t * Instance that provides AAD endpoint tokens for Push and SharePoint\n\t */\n\ttokenProvider: IOdspTokenProvider;\n\n\t/**\n\t * Site url representing ODSP resource location. It points to the specific SharePoint site where you can store and access the containers you create.\n\t */\n\tsiteUrl: string;\n\n\t/**\n\t * SharePoint Embedded Container Id of the tenant where Fluid containers are created\n\t */\n\tdriveId: string;\n\n\t/**\n\t * Specifies the file path where Fluid files are created. If passed an empty string, the Fluid files will be created at the root level.\n\t */\n\tfilePath: string;\n}\n/**\n * @beta\n */\nexport interface OdspClientProps {\n\t/**\n\t * Configuration for establishing a connection with the ODSP Fluid Service (Push).\n\t */\n\treadonly connection: OdspConnectionConfig;\n\n\t/**\n\t * Optional. A logger instance to receive diagnostic messages.\n\t */\n\treadonly logger?: ITelemetryBaseLogger;\n\n\t/**\n\t * Base interface for providing configurations to control experimental features. If unsure, leave this undefined.\n\t */\n\treadonly configProvider?: IConfigProviderBase;\n}\n\n/**\n * @beta\n */\nexport interface OdspContainerAttachProps {\n\t/**\n\t * The file path where Fluid containers are created. If undefined, the file is created at the root.\n\t */\n\tfilePath: string | undefined;\n\n\t/**\n\t * The file name of the Fluid file. If undefined, the file is named with a GUID.\n\t */\n\tfileName: string | undefined;\n}\n\n/**\n * Events emitted by the ODSP container service to notify consumers of select\n * container changes.\n * @beta\n * @sealed\n */\nexport interface IOdspContainerServicesEvents {\n\t/**\n\t * Emitted when the read-only state of the container changes.\n\t * Consumers can call `OdspContainerServices.getReadOnlyState()` to get the updated value.\n\t */\n\treadOnlyStateChanged: () => void;\n\t/**\n\t * Emitted when the sensitivity label of the container changes.\n\t * Consumers can call `OdspContainerServices.getSensitivityLabelsInfo()` to get the updated value.\n\t */\n\tsensitivityLabelsInfoChanged: () => void;\n}\n\n/**\n * ODSP version of the IFluidContainer interface.\n * @beta\n */\nexport interface IOdspFluidContainer<\n\tTContainerSchema extends ContainerSchema = ContainerSchema,\n> extends IFluidContainer<TContainerSchema> {\n\t/**\n\t * A newly created container starts detached from the collaborative service.\n\t * Calling `attach()` uploads the new container to the service and connects to the collaborative service.\n\t *\n\t * This function is the same as the IFluidContainer.attach function, but has ODSP specific function signatures.\n\t *\n\t * @param props - Optional properties to pass to the attach function.\n\t *\n\t * @returns A promise which resolves when the attach is complete, with the string identifier of the container.\n\t */\n\tattach(props?: ContainerAttachProps<OdspContainerAttachProps>): Promise<string>;\n}\n\n/**\n * OdspContainerServices is returned by the OdspClient alongside a FluidContainer. It holds the\n * functionality specifically tied to the ODSP service, and how the data stored in the\n * FluidContainer is persisted in the backend and consumed by users. Any functionality regarding\n * how the data is handled within the FluidContainer itself, i.e. which data objects or DDSes to\n * use, will not be included here but rather on the FluidContainer class itself.\n * @beta\n * @sealed\n */\nexport interface OdspContainerServices extends IDisposable {\n\tevents: Listenable<IOdspContainerServicesEvents>;\n\t/**\n\t * Provides an object that facilitates obtaining information about users present in the Fluid session, as well as listeners for roster changes triggered by users joining or leaving the session.\n\t */\n\taudience: IOdspAudience;\n\n\t/**\n\t * Gets the read-only state of the container, if available.\n\t * This is not available until the container is in the \"Connected\" state.\n\t * @remarks\n\t * In the case that the read-only state cannot be determined, wait for the \"readOnlyStateChanged\" event to be emitted.\n\t * @returns The read-only state (true when readonly, false when editable), or undefined if not available.\n\t */\n\tgetReadOnlyState(): boolean | undefined;\n\t/**\n\t * Gets the sensitivity labels info of the container, if available.\n\t * This is not available until the container is in the \"Connected\" state, and will only be available\n\t * if sensitivity labels have been applied to the container.\n\t * @remarks\n\t * In the case that the sensitivity labels info are expected but cannot be determined, wait for the \"sensitivityLabelChanged\" event to be emitted.\n\t * @returns The sensitivity labels info string, or undefined if not available.\n\t */\n\tgetSensitivityLabelsInfo(): string | undefined;\n}\n\n/**\n * Since ODSP provides user names and email for all of its members, we extend the\n * {@link @fluidframework/fluid-static#IMember} interface to include this service-specific value.\n * It will be returned for all audience members connected.\n * @beta\n */\nexport interface OdspMember extends IMember {\n\t/**\n\t * The object ID (oid) for the user, unique among each individual user connecting to the session.\n\t */\n\tid: string;\n\t/**\n\t * The user's name\n\t */\n\tname: string;\n\t/**\n\t * The user's email\n\t */\n\temail: string;\n}\n\n/**\n * Audience object for ODSP containers\n * @beta\n */\nexport type IOdspAudience = IServiceAudience<OdspMember>;\n\n/**\n * Represents token response\n * @beta\n */\nexport interface TokenResponse {\n\t/**\n\t * Token value\n\t */\n\ttoken: string;\n\n\t/**\n\t * Whether or not the token was obtained from local cache.\n\t * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.\n\t */\n\tfromCache?: boolean;\n}\n"]}
|
|
@@ -3,12 +3,19 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { IContainer } from "@fluidframework/container-definitions/internal";
|
|
6
|
-
import type {
|
|
6
|
+
import type { IDisposable, Listenable } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type { IOdspAudience, OdspContainerServices as IOdspContainerServices, IOdspContainerServicesEvents } from "./interfaces.js";
|
|
7
8
|
/**
|
|
8
9
|
* @internal
|
|
9
10
|
*/
|
|
10
|
-
export declare class OdspContainerServices implements IOdspContainerServices {
|
|
11
|
+
export declare class OdspContainerServices implements IOdspContainerServices, IDisposable {
|
|
12
|
+
#private;
|
|
11
13
|
readonly audience: IOdspAudience;
|
|
14
|
+
get events(): Listenable<IOdspContainerServicesEvents>;
|
|
12
15
|
constructor(container: IContainer);
|
|
16
|
+
get disposed(): boolean;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
getReadOnlyState(): boolean | undefined;
|
|
19
|
+
getSensitivityLabelsInfo(): string | undefined;
|
|
13
20
|
}
|
|
14
21
|
//# sourceMappingURL=odspContainerServices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspContainerServices.d.ts","sourceRoot":"","sources":["../src/odspContainerServices.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"odspContainerServices.d.ts","sourceRoot":"","sources":["../src/odspContainerServices.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG/E,OAAO,KAAK,EACX,aAAa,EACb,qBAAqB,IAAI,sBAAsB,EAC/C,4BAA4B,EAC5B,MAAM,iBAAiB,CAAC;AAGzB;;GAEG;AACH,qBAAa,qBAAsB,YAAW,sBAAsB,EAAE,WAAW;;IAIhF,SAAgB,QAAQ,EAAE,aAAa,CAAC;IAGxC,IAAW,MAAM,IAAI,UAAU,CAAC,4BAA4B,CAAC,CAE5D;gBAEkB,SAAS,EAAE,UAAU;IAoBxC,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAEM,OAAO,IAAI,IAAI;IAUf,gBAAgB,IAAI,OAAO,GAAG,SAAS;IAIvC,wBAAwB,IAAI,MAAM,GAAG,SAAS;CAGrD"}
|
|
@@ -3,20 +3,68 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
7
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
8
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
9
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
+
};
|
|
17
|
+
var _OdspContainerServices_disposed, _OdspContainerServices_container, _OdspContainerServices_events, _OdspContainerServices_readonlyEventHandler, _OdspContainerServices_metadataUpdateEventHandler;
|
|
6
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
19
|
exports.OdspContainerServices = void 0;
|
|
20
|
+
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
8
21
|
const internal_1 = require("@fluidframework/fluid-static/internal");
|
|
9
22
|
const odspAudience_js_1 = require("./odspAudience.js");
|
|
10
23
|
/**
|
|
11
24
|
* @internal
|
|
12
25
|
*/
|
|
13
26
|
class OdspContainerServices {
|
|
27
|
+
get events() {
|
|
28
|
+
return __classPrivateFieldGet(this, _OdspContainerServices_events, "f");
|
|
29
|
+
}
|
|
14
30
|
constructor(container) {
|
|
31
|
+
_OdspContainerServices_disposed.set(this, false);
|
|
32
|
+
_OdspContainerServices_container.set(this, void 0);
|
|
33
|
+
_OdspContainerServices_events.set(this, (0, client_utils_1.createEmitter)());
|
|
34
|
+
_OdspContainerServices_readonlyEventHandler.set(this, () => {
|
|
35
|
+
__classPrivateFieldGet(this, _OdspContainerServices_events, "f").emit("readOnlyStateChanged");
|
|
36
|
+
});
|
|
37
|
+
_OdspContainerServices_metadataUpdateEventHandler.set(this, (metadata) => {
|
|
38
|
+
if (metadata.sensitivityLabelsInfo !== undefined) {
|
|
39
|
+
__classPrivateFieldGet(this, _OdspContainerServices_events, "f").emit("sensitivityLabelsInfoChanged");
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
__classPrivateFieldSet(this, _OdspContainerServices_container, container, "f");
|
|
43
|
+
__classPrivateFieldGet(this, _OdspContainerServices_container, "f").on("readonly", __classPrivateFieldGet(this, _OdspContainerServices_readonlyEventHandler, "f"));
|
|
44
|
+
__classPrivateFieldGet(this, _OdspContainerServices_container, "f").on("metadataUpdate", __classPrivateFieldGet(this, _OdspContainerServices_metadataUpdateEventHandler, "f"));
|
|
15
45
|
this.audience = (0, internal_1.createServiceAudience)({
|
|
16
46
|
container,
|
|
17
47
|
createServiceMember: odspAudience_js_1.createOdspAudienceMember,
|
|
18
48
|
});
|
|
19
49
|
}
|
|
50
|
+
get disposed() {
|
|
51
|
+
return __classPrivateFieldGet(this, _OdspContainerServices_disposed, "f");
|
|
52
|
+
}
|
|
53
|
+
dispose() {
|
|
54
|
+
if (__classPrivateFieldGet(this, _OdspContainerServices_disposed, "f")) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
__classPrivateFieldSet(this, _OdspContainerServices_disposed, true, "f");
|
|
58
|
+
__classPrivateFieldGet(this, _OdspContainerServices_container, "f").off("readonly", __classPrivateFieldGet(this, _OdspContainerServices_readonlyEventHandler, "f"));
|
|
59
|
+
__classPrivateFieldGet(this, _OdspContainerServices_container, "f").off("metadataUpdate", __classPrivateFieldGet(this, _OdspContainerServices_metadataUpdateEventHandler, "f"));
|
|
60
|
+
}
|
|
61
|
+
getReadOnlyState() {
|
|
62
|
+
return __classPrivateFieldGet(this, _OdspContainerServices_container, "f").readOnlyInfo.readonly;
|
|
63
|
+
}
|
|
64
|
+
getSensitivityLabelsInfo() {
|
|
65
|
+
return __classPrivateFieldGet(this, _OdspContainerServices_container, "f").containerMetadata.sensitivityLabelsInfo;
|
|
66
|
+
}
|
|
20
67
|
}
|
|
21
68
|
exports.OdspContainerServices = OdspContainerServices;
|
|
69
|
+
_OdspContainerServices_disposed = new WeakMap(), _OdspContainerServices_container = new WeakMap(), _OdspContainerServices_events = new WeakMap(), _OdspContainerServices_readonlyEventHandler = new WeakMap(), _OdspContainerServices_metadataUpdateEventHandler = new WeakMap();
|
|
22
70
|
//# sourceMappingURL=odspContainerServices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspContainerServices.js","sourceRoot":"","sources":["../src/odspContainerServices.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"odspContainerServices.js","sourceRoot":"","sources":["../src/odspContainerServices.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAEH,+DAA6D;AAG7D,oEAA8E;AAO9E,uDAA6D;AAE7D;;GAEG;AACH,MAAa,qBAAqB;IAOjC,IAAW,MAAM;QAChB,OAAO,uBAAA,IAAI,qCAAQ,CAAC;IACrB,CAAC;IAED,YAAmB,SAAqB;QAVxC,0CAAY,KAAK,EAAC;QACT,mDAAuB;QAIvB,wCAAU,IAAA,4BAAa,GAAgC,EAAC;QAexD,sDAAwB,GAAS,EAAE;YAC3C,uBAAA,IAAI,qCAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAC3C,CAAC,EAAC;QAEO,4DAA8B,CAAC,QAAgC,EAAQ,EAAE;YACjF,IAAI,QAAQ,CAAC,qBAAqB,KAAK,SAAS,EAAE,CAAC;gBAClD,uBAAA,IAAI,qCAAQ,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;YACnD,CAAC;QACF,CAAC,EAAC;QAjBD,uBAAA,IAAI,oCAAc,SAAS,MAAA,CAAC;QAC5B,uBAAA,IAAI,wCAAW,CAAC,EAAE,CAAC,UAAU,EAAE,uBAAA,IAAI,mDAAsB,CAAC,CAAC;QAC3D,uBAAA,IAAI,wCAAW,CAAC,EAAE,CAAC,gBAAgB,EAAE,uBAAA,IAAI,yDAA4B,CAAC,CAAC;QACvE,IAAI,CAAC,QAAQ,GAAG,IAAA,gCAAqB,EAAC;YACrC,SAAS;YACT,mBAAmB,EAAE,0CAAwB;SAC7C,CAAC,CAAC;IACJ,CAAC;IAYD,IAAW,QAAQ;QAClB,OAAO,uBAAA,IAAI,uCAAU,CAAC;IACvB,CAAC;IAEM,OAAO;QACb,IAAI,uBAAA,IAAI,uCAAU,EAAE,CAAC;YACpB,OAAO;QACR,CAAC;QAED,uBAAA,IAAI,mCAAa,IAAI,MAAA,CAAC;QACtB,uBAAA,IAAI,wCAAW,CAAC,GAAG,CAAC,UAAU,EAAE,uBAAA,IAAI,mDAAsB,CAAC,CAAC;QAC5D,uBAAA,IAAI,wCAAW,CAAC,GAAG,CAAC,gBAAgB,EAAE,uBAAA,IAAI,yDAA4B,CAAC,CAAC;IACzE,CAAC;IAEM,gBAAgB;QACtB,OAAO,uBAAA,IAAI,wCAAW,CAAC,YAAY,CAAC,QAAQ,CAAC;IAC9C,CAAC;IAEM,wBAAwB;QAC9B,OAAO,uBAAA,IAAI,wCAAW,CAAC,iBAAiB,CAAC,qBAAqB,CAAC;IAChE,CAAC;CACD;AApDD,sDAoDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { IContainer } from \"@fluidframework/container-definitions/internal\";\nimport type { IDisposable, Listenable } from \"@fluidframework/core-interfaces\";\nimport { createServiceAudience } from \"@fluidframework/fluid-static/internal\";\n\nimport type {\n\tIOdspAudience,\n\tOdspContainerServices as IOdspContainerServices,\n\tIOdspContainerServicesEvents,\n} from \"./interfaces.js\";\nimport { createOdspAudienceMember } from \"./odspAudience.js\";\n\n/**\n * @internal\n */\nexport class OdspContainerServices implements IOdspContainerServices, IDisposable {\n\t#disposed = false;\n\treadonly #container: IContainer;\n\n\tpublic readonly audience: IOdspAudience;\n\n\treadonly #events = createEmitter<IOdspContainerServicesEvents>();\n\tpublic get events(): Listenable<IOdspContainerServicesEvents> {\n\t\treturn this.#events;\n\t}\n\n\tpublic constructor(container: IContainer) {\n\t\tthis.#container = container;\n\t\tthis.#container.on(\"readonly\", this.#readonlyEventHandler);\n\t\tthis.#container.on(\"metadataUpdate\", this.#metadataUpdateEventHandler);\n\t\tthis.audience = createServiceAudience({\n\t\t\tcontainer,\n\t\t\tcreateServiceMember: createOdspAudienceMember,\n\t\t});\n\t}\n\n\treadonly #readonlyEventHandler = (): void => {\n\t\tthis.#events.emit(\"readOnlyStateChanged\");\n\t};\n\n\treadonly #metadataUpdateEventHandler = (metadata: Record<string, string>): void => {\n\t\tif (metadata.sensitivityLabelsInfo !== undefined) {\n\t\t\tthis.#events.emit(\"sensitivityLabelsInfoChanged\");\n\t\t}\n\t};\n\n\tpublic get disposed(): boolean {\n\t\treturn this.#disposed;\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this.#disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#disposed = true;\n\t\tthis.#container.off(\"readonly\", this.#readonlyEventHandler);\n\t\tthis.#container.off(\"metadataUpdate\", this.#metadataUpdateEventHandler);\n\t}\n\n\tpublic getReadOnlyState(): boolean | undefined {\n\t\treturn this.#container.readOnlyInfo.readonly;\n\t}\n\n\tpublic getSensitivityLabelsInfo(): string | undefined {\n\t\treturn this.#container.containerMetadata.sensitivityLabelsInfo;\n\t}\n}\n"]}
|
package/lib/beta.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @packageDocumentation
|
|
13
13
|
*/
|
|
14
|
-
export type { IOdspAudience, IOdspFluidContainer, OdspClientProps, OdspConnectionConfig, OdspContainerAttachProps, OdspContainerServices, OdspMember, TokenResponse, } from "./interfaces.js";
|
|
14
|
+
export type { IOdspAudience, IOdspContainerServicesEvents, IOdspFluidContainer, OdspClientProps, OdspConnectionConfig, OdspContainerAttachProps, OdspContainerServices, OdspMember, TokenResponse, } from "./interfaces.js";
|
|
15
15
|
export { OdspClient } from "./odspClient.js";
|
|
16
16
|
export { type IOdspTokenProvider } from "./token.js";
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,YAAY,EACX,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,UAAU,EACV,aAAa,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,YAAY,EACX,aAAa,EACb,4BAA4B,EAC5B,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,UAAU,EACV,aAAa,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The odsp-client package provides a simple and powerful way to consume collaborative Fluid data with OneDrive/SharePoint (ODSP) storage.\n *\n * @remarks\n * Please note that odsp-client is currently an experimental package.\n * We'd love for you to try it out and provide feedback but it is not yet recommended or supported for production scenarios.\n *\n * @packageDocumentation\n */\n\nexport type {\n\tIOdspAudience,\n\tIOdspContainerServicesEvents,\n\tIOdspFluidContainer,\n\tOdspClientProps,\n\tOdspConnectionConfig,\n\tOdspContainerAttachProps,\n\tOdspContainerServices,\n\tOdspMember,\n\tTokenResponse,\n} from \"./interfaces.js\";\nexport { OdspClient } from \"./odspClient.js\";\nexport { type IOdspTokenProvider } from \"./token.js\";\n"]}
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type { IConfigProviderBase, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
5
|
+
import type { IConfigProviderBase, IDisposable, ITelemetryBaseLogger, Listenable } from "@fluidframework/core-interfaces";
|
|
6
6
|
import type { ContainerAttachProps, ContainerSchema, IFluidContainer, IMember, IServiceAudience } from "@fluidframework/fluid-static";
|
|
7
7
|
import type { IOdspTokenProvider } from "./token.js";
|
|
8
8
|
/**
|
|
@@ -59,6 +59,24 @@ export interface OdspContainerAttachProps {
|
|
|
59
59
|
*/
|
|
60
60
|
fileName: string | undefined;
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Events emitted by the ODSP container service to notify consumers of select
|
|
64
|
+
* container changes.
|
|
65
|
+
* @beta
|
|
66
|
+
* @sealed
|
|
67
|
+
*/
|
|
68
|
+
export interface IOdspContainerServicesEvents {
|
|
69
|
+
/**
|
|
70
|
+
* Emitted when the read-only state of the container changes.
|
|
71
|
+
* Consumers can call `OdspContainerServices.getReadOnlyState()` to get the updated value.
|
|
72
|
+
*/
|
|
73
|
+
readOnlyStateChanged: () => void;
|
|
74
|
+
/**
|
|
75
|
+
* Emitted when the sensitivity label of the container changes.
|
|
76
|
+
* Consumers can call `OdspContainerServices.getSensitivityLabelsInfo()` to get the updated value.
|
|
77
|
+
*/
|
|
78
|
+
sensitivityLabelsInfoChanged: () => void;
|
|
79
|
+
}
|
|
62
80
|
/**
|
|
63
81
|
* ODSP version of the IFluidContainer interface.
|
|
64
82
|
* @beta
|
|
@@ -83,12 +101,31 @@ export interface IOdspFluidContainer<TContainerSchema extends ContainerSchema =
|
|
|
83
101
|
* how the data is handled within the FluidContainer itself, i.e. which data objects or DDSes to
|
|
84
102
|
* use, will not be included here but rather on the FluidContainer class itself.
|
|
85
103
|
* @beta
|
|
104
|
+
* @sealed
|
|
86
105
|
*/
|
|
87
|
-
export interface OdspContainerServices {
|
|
106
|
+
export interface OdspContainerServices extends IDisposable {
|
|
107
|
+
events: Listenable<IOdspContainerServicesEvents>;
|
|
88
108
|
/**
|
|
89
109
|
* Provides an object that facilitates obtaining information about users present in the Fluid session, as well as listeners for roster changes triggered by users joining or leaving the session.
|
|
90
110
|
*/
|
|
91
111
|
audience: IOdspAudience;
|
|
112
|
+
/**
|
|
113
|
+
* Gets the read-only state of the container, if available.
|
|
114
|
+
* This is not available until the container is in the "Connected" state.
|
|
115
|
+
* @remarks
|
|
116
|
+
* In the case that the read-only state cannot be determined, wait for the "readOnlyStateChanged" event to be emitted.
|
|
117
|
+
* @returns The read-only state (true when readonly, false when editable), or undefined if not available.
|
|
118
|
+
*/
|
|
119
|
+
getReadOnlyState(): boolean | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Gets the sensitivity labels info of the container, if available.
|
|
122
|
+
* This is not available until the container is in the "Connected" state, and will only be available
|
|
123
|
+
* if sensitivity labels have been applied to the container.
|
|
124
|
+
* @remarks
|
|
125
|
+
* In the case that the sensitivity labels info are expected but cannot be determined, wait for the "sensitivityLabelChanged" event to be emitted.
|
|
126
|
+
* @returns The sensitivity labels info string, or undefined if not available.
|
|
127
|
+
*/
|
|
128
|
+
getSensitivityLabelsInfo(): string | undefined;
|
|
92
129
|
}
|
|
93
130
|
/**
|
|
94
131
|
* Since ODSP provides user names and email for all of its members, we extend the
|
package/lib/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,aAAa,EAAE,kBAAkB,CAAC;IAElC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CACjB;AACD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC;IAE1C;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7B;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CACnC,gBAAgB,SAAS,eAAe,GAAG,eAAe,CACzD,SAAQ,eAAe,CAAC,gBAAgB,CAAC;IAC1C;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,oBAAoB,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChF;AAED
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,aAAa,EAAE,kBAAkB,CAAC;IAElC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CACjB;AACD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC;IAE1C;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7B;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;;OAGG;IACH,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC;;;OAGG;IACH,4BAA4B,EAAE,MAAM,IAAI,CAAC;CACzC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CACnC,gBAAgB,SAAS,eAAe,GAAG,eAAe,CACzD,SAAQ,eAAe,CAAC,gBAAgB,CAAC;IAC1C;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,oBAAoB,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChF;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACzD,MAAM,EAAE,UAAU,CAAC,4BAA4B,CAAC,CAAC;IACjD;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC;IAExB;;;;;;OAMG;IACH,gBAAgB,IAAI,OAAO,GAAG,SAAS,CAAC;IACxC;;;;;;;OAOG;IACH,wBAAwB,IAAI,MAAM,GAAG,SAAS,CAAC;CAC/C;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAW,SAAQ,OAAO;IAC1C;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
package/lib/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIConfigProviderBase,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tContainerAttachProps,\n\tContainerSchema,\n\tIFluidContainer,\n\tIMember,\n\tIServiceAudience,\n} from \"@fluidframework/fluid-static\";\n\nimport type { IOdspTokenProvider } from \"./token.js\";\n\n/**\n * Defines the necessary properties that will be applied to all containers\n * created by an OdspClient instance. This includes callbacks for the authentication tokens\n * required for ODSP.\n * @beta\n */\nexport interface OdspConnectionConfig {\n\t/**\n\t * Instance that provides AAD endpoint tokens for Push and SharePoint\n\t */\n\ttokenProvider: IOdspTokenProvider;\n\n\t/**\n\t * Site url representing ODSP resource location. It points to the specific SharePoint site where you can store and access the containers you create.\n\t */\n\tsiteUrl: string;\n\n\t/**\n\t * SharePoint Embedded Container Id of the tenant where Fluid containers are created\n\t */\n\tdriveId: string;\n\n\t/**\n\t * Specifies the file path where Fluid files are created. If passed an empty string, the Fluid files will be created at the root level.\n\t */\n\tfilePath: string;\n}\n/**\n * @beta\n */\nexport interface OdspClientProps {\n\t/**\n\t * Configuration for establishing a connection with the ODSP Fluid Service (Push).\n\t */\n\treadonly connection: OdspConnectionConfig;\n\n\t/**\n\t * Optional. A logger instance to receive diagnostic messages.\n\t */\n\treadonly logger?: ITelemetryBaseLogger;\n\n\t/**\n\t * Base interface for providing configurations to control experimental features. If unsure, leave this undefined.\n\t */\n\treadonly configProvider?: IConfigProviderBase;\n}\n\n/**\n * @beta\n */\nexport interface OdspContainerAttachProps {\n\t/**\n\t * The file path where Fluid containers are created. If undefined, the file is created at the root.\n\t */\n\tfilePath: string | undefined;\n\n\t/**\n\t * The file name of the Fluid file. If undefined, the file is named with a GUID.\n\t */\n\tfileName: string | undefined;\n}\n\n/**\n * ODSP version of the IFluidContainer interface.\n * @beta\n */\nexport interface IOdspFluidContainer<\n\tTContainerSchema extends ContainerSchema = ContainerSchema,\n> extends IFluidContainer<TContainerSchema> {\n\t/**\n\t * A newly created container starts detached from the collaborative service.\n\t * Calling `attach()` uploads the new container to the service and connects to the collaborative service.\n\t *\n\t * This function is the same as the IFluidContainer.attach function, but has ODSP specific function signatures.\n\t *\n\t * @param props - Optional properties to pass to the attach function.\n\t *\n\t * @returns A promise which resolves when the attach is complete, with the string identifier of the container.\n\t */\n\tattach(props?: ContainerAttachProps<OdspContainerAttachProps>): Promise<string>;\n}\n\n/**\n * OdspContainerServices is returned by the OdspClient alongside a FluidContainer. It holds the\n * functionality specifically tied to the ODSP service, and how the data stored in the\n * FluidContainer is persisted in the backend and consumed by users. Any functionality regarding\n * how the data is handled within the FluidContainer itself, i.e. which data objects or DDSes to\n * use, will not be included here but rather on the FluidContainer class itself.\n * @beta\n */\nexport interface OdspContainerServices {\n\t/**\n\t * Provides an object that facilitates obtaining information about users present in the Fluid session, as well as listeners for roster changes triggered by users joining or leaving the session.\n\t */\n\taudience: IOdspAudience;\n}\n\n/**\n * Since ODSP provides user names and email for all of its members, we extend the\n * {@link @fluidframework/fluid-static#IMember} interface to include this service-specific value.\n * It will be returned for all audience members connected.\n * @beta\n */\nexport interface OdspMember extends IMember {\n\t/**\n\t * The object ID (oid) for the user, unique among each individual user connecting to the session.\n\t */\n\tid: string;\n\t/**\n\t * The user's name\n\t */\n\tname: string;\n\t/**\n\t * The user's email\n\t */\n\temail: string;\n}\n\n/**\n * Audience object for ODSP containers\n * @beta\n */\nexport type IOdspAudience = IServiceAudience<OdspMember>;\n\n/**\n * Represents token response\n * @beta\n */\nexport interface TokenResponse {\n\t/**\n\t * Token value\n\t */\n\ttoken: string;\n\n\t/**\n\t * Whether or not the token was obtained from local cache.\n\t * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.\n\t */\n\tfromCache?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIConfigProviderBase,\n\tIDisposable,\n\tITelemetryBaseLogger,\n\tListenable,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tContainerAttachProps,\n\tContainerSchema,\n\tIFluidContainer,\n\tIMember,\n\tIServiceAudience,\n} from \"@fluidframework/fluid-static\";\n\nimport type { IOdspTokenProvider } from \"./token.js\";\n\n/**\n * Defines the necessary properties that will be applied to all containers\n * created by an OdspClient instance. This includes callbacks for the authentication tokens\n * required for ODSP.\n * @beta\n */\nexport interface OdspConnectionConfig {\n\t/**\n\t * Instance that provides AAD endpoint tokens for Push and SharePoint\n\t */\n\ttokenProvider: IOdspTokenProvider;\n\n\t/**\n\t * Site url representing ODSP resource location. It points to the specific SharePoint site where you can store and access the containers you create.\n\t */\n\tsiteUrl: string;\n\n\t/**\n\t * SharePoint Embedded Container Id of the tenant where Fluid containers are created\n\t */\n\tdriveId: string;\n\n\t/**\n\t * Specifies the file path where Fluid files are created. If passed an empty string, the Fluid files will be created at the root level.\n\t */\n\tfilePath: string;\n}\n/**\n * @beta\n */\nexport interface OdspClientProps {\n\t/**\n\t * Configuration for establishing a connection with the ODSP Fluid Service (Push).\n\t */\n\treadonly connection: OdspConnectionConfig;\n\n\t/**\n\t * Optional. A logger instance to receive diagnostic messages.\n\t */\n\treadonly logger?: ITelemetryBaseLogger;\n\n\t/**\n\t * Base interface for providing configurations to control experimental features. If unsure, leave this undefined.\n\t */\n\treadonly configProvider?: IConfigProviderBase;\n}\n\n/**\n * @beta\n */\nexport interface OdspContainerAttachProps {\n\t/**\n\t * The file path where Fluid containers are created. If undefined, the file is created at the root.\n\t */\n\tfilePath: string | undefined;\n\n\t/**\n\t * The file name of the Fluid file. If undefined, the file is named with a GUID.\n\t */\n\tfileName: string | undefined;\n}\n\n/**\n * Events emitted by the ODSP container service to notify consumers of select\n * container changes.\n * @beta\n * @sealed\n */\nexport interface IOdspContainerServicesEvents {\n\t/**\n\t * Emitted when the read-only state of the container changes.\n\t * Consumers can call `OdspContainerServices.getReadOnlyState()` to get the updated value.\n\t */\n\treadOnlyStateChanged: () => void;\n\t/**\n\t * Emitted when the sensitivity label of the container changes.\n\t * Consumers can call `OdspContainerServices.getSensitivityLabelsInfo()` to get the updated value.\n\t */\n\tsensitivityLabelsInfoChanged: () => void;\n}\n\n/**\n * ODSP version of the IFluidContainer interface.\n * @beta\n */\nexport interface IOdspFluidContainer<\n\tTContainerSchema extends ContainerSchema = ContainerSchema,\n> extends IFluidContainer<TContainerSchema> {\n\t/**\n\t * A newly created container starts detached from the collaborative service.\n\t * Calling `attach()` uploads the new container to the service and connects to the collaborative service.\n\t *\n\t * This function is the same as the IFluidContainer.attach function, but has ODSP specific function signatures.\n\t *\n\t * @param props - Optional properties to pass to the attach function.\n\t *\n\t * @returns A promise which resolves when the attach is complete, with the string identifier of the container.\n\t */\n\tattach(props?: ContainerAttachProps<OdspContainerAttachProps>): Promise<string>;\n}\n\n/**\n * OdspContainerServices is returned by the OdspClient alongside a FluidContainer. It holds the\n * functionality specifically tied to the ODSP service, and how the data stored in the\n * FluidContainer is persisted in the backend and consumed by users. Any functionality regarding\n * how the data is handled within the FluidContainer itself, i.e. which data objects or DDSes to\n * use, will not be included here but rather on the FluidContainer class itself.\n * @beta\n * @sealed\n */\nexport interface OdspContainerServices extends IDisposable {\n\tevents: Listenable<IOdspContainerServicesEvents>;\n\t/**\n\t * Provides an object that facilitates obtaining information about users present in the Fluid session, as well as listeners for roster changes triggered by users joining or leaving the session.\n\t */\n\taudience: IOdspAudience;\n\n\t/**\n\t * Gets the read-only state of the container, if available.\n\t * This is not available until the container is in the \"Connected\" state.\n\t * @remarks\n\t * In the case that the read-only state cannot be determined, wait for the \"readOnlyStateChanged\" event to be emitted.\n\t * @returns The read-only state (true when readonly, false when editable), or undefined if not available.\n\t */\n\tgetReadOnlyState(): boolean | undefined;\n\t/**\n\t * Gets the sensitivity labels info of the container, if available.\n\t * This is not available until the container is in the \"Connected\" state, and will only be available\n\t * if sensitivity labels have been applied to the container.\n\t * @remarks\n\t * In the case that the sensitivity labels info are expected but cannot be determined, wait for the \"sensitivityLabelChanged\" event to be emitted.\n\t * @returns The sensitivity labels info string, or undefined if not available.\n\t */\n\tgetSensitivityLabelsInfo(): string | undefined;\n}\n\n/**\n * Since ODSP provides user names and email for all of its members, we extend the\n * {@link @fluidframework/fluid-static#IMember} interface to include this service-specific value.\n * It will be returned for all audience members connected.\n * @beta\n */\nexport interface OdspMember extends IMember {\n\t/**\n\t * The object ID (oid) for the user, unique among each individual user connecting to the session.\n\t */\n\tid: string;\n\t/**\n\t * The user's name\n\t */\n\tname: string;\n\t/**\n\t * The user's email\n\t */\n\temail: string;\n}\n\n/**\n * Audience object for ODSP containers\n * @beta\n */\nexport type IOdspAudience = IServiceAudience<OdspMember>;\n\n/**\n * Represents token response\n * @beta\n */\nexport interface TokenResponse {\n\t/**\n\t * Token value\n\t */\n\ttoken: string;\n\n\t/**\n\t * Whether or not the token was obtained from local cache.\n\t * @remarks `undefined` indicates that it could not be determined whether or not the token was obtained this way.\n\t */\n\tfromCache?: boolean;\n}\n"]}
|
|
@@ -3,12 +3,19 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { IContainer } from "@fluidframework/container-definitions/internal";
|
|
6
|
-
import type {
|
|
6
|
+
import type { IDisposable, Listenable } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type { IOdspAudience, OdspContainerServices as IOdspContainerServices, IOdspContainerServicesEvents } from "./interfaces.js";
|
|
7
8
|
/**
|
|
8
9
|
* @internal
|
|
9
10
|
*/
|
|
10
|
-
export declare class OdspContainerServices implements IOdspContainerServices {
|
|
11
|
+
export declare class OdspContainerServices implements IOdspContainerServices, IDisposable {
|
|
12
|
+
#private;
|
|
11
13
|
readonly audience: IOdspAudience;
|
|
14
|
+
get events(): Listenable<IOdspContainerServicesEvents>;
|
|
12
15
|
constructor(container: IContainer);
|
|
16
|
+
get disposed(): boolean;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
getReadOnlyState(): boolean | undefined;
|
|
19
|
+
getSensitivityLabelsInfo(): string | undefined;
|
|
13
20
|
}
|
|
14
21
|
//# sourceMappingURL=odspContainerServices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspContainerServices.d.ts","sourceRoot":"","sources":["../src/odspContainerServices.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"odspContainerServices.d.ts","sourceRoot":"","sources":["../src/odspContainerServices.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG/E,OAAO,KAAK,EACX,aAAa,EACb,qBAAqB,IAAI,sBAAsB,EAC/C,4BAA4B,EAC5B,MAAM,iBAAiB,CAAC;AAGzB;;GAEG;AACH,qBAAa,qBAAsB,YAAW,sBAAsB,EAAE,WAAW;;IAIhF,SAAgB,QAAQ,EAAE,aAAa,CAAC;IAGxC,IAAW,MAAM,IAAI,UAAU,CAAC,4BAA4B,CAAC,CAE5D;gBAEkB,SAAS,EAAE,UAAU;IAoBxC,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAEM,OAAO,IAAI,IAAI;IAUf,gBAAgB,IAAI,OAAO,GAAG,SAAS;IAIvC,wBAAwB,IAAI,MAAM,GAAG,SAAS;CAGrD"}
|
|
@@ -2,17 +2,65 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
6
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
8
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
9
|
+
};
|
|
10
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
11
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
14
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
15
|
+
};
|
|
16
|
+
var _OdspContainerServices_disposed, _OdspContainerServices_container, _OdspContainerServices_events, _OdspContainerServices_readonlyEventHandler, _OdspContainerServices_metadataUpdateEventHandler;
|
|
17
|
+
import { createEmitter } from "@fluid-internal/client-utils";
|
|
5
18
|
import { createServiceAudience } from "@fluidframework/fluid-static/internal";
|
|
6
19
|
import { createOdspAudienceMember } from "./odspAudience.js";
|
|
7
20
|
/**
|
|
8
21
|
* @internal
|
|
9
22
|
*/
|
|
10
23
|
export class OdspContainerServices {
|
|
24
|
+
get events() {
|
|
25
|
+
return __classPrivateFieldGet(this, _OdspContainerServices_events, "f");
|
|
26
|
+
}
|
|
11
27
|
constructor(container) {
|
|
28
|
+
_OdspContainerServices_disposed.set(this, false);
|
|
29
|
+
_OdspContainerServices_container.set(this, void 0);
|
|
30
|
+
_OdspContainerServices_events.set(this, createEmitter());
|
|
31
|
+
_OdspContainerServices_readonlyEventHandler.set(this, () => {
|
|
32
|
+
__classPrivateFieldGet(this, _OdspContainerServices_events, "f").emit("readOnlyStateChanged");
|
|
33
|
+
});
|
|
34
|
+
_OdspContainerServices_metadataUpdateEventHandler.set(this, (metadata) => {
|
|
35
|
+
if (metadata.sensitivityLabelsInfo !== undefined) {
|
|
36
|
+
__classPrivateFieldGet(this, _OdspContainerServices_events, "f").emit("sensitivityLabelsInfoChanged");
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
__classPrivateFieldSet(this, _OdspContainerServices_container, container, "f");
|
|
40
|
+
__classPrivateFieldGet(this, _OdspContainerServices_container, "f").on("readonly", __classPrivateFieldGet(this, _OdspContainerServices_readonlyEventHandler, "f"));
|
|
41
|
+
__classPrivateFieldGet(this, _OdspContainerServices_container, "f").on("metadataUpdate", __classPrivateFieldGet(this, _OdspContainerServices_metadataUpdateEventHandler, "f"));
|
|
12
42
|
this.audience = createServiceAudience({
|
|
13
43
|
container,
|
|
14
44
|
createServiceMember: createOdspAudienceMember,
|
|
15
45
|
});
|
|
16
46
|
}
|
|
47
|
+
get disposed() {
|
|
48
|
+
return __classPrivateFieldGet(this, _OdspContainerServices_disposed, "f");
|
|
49
|
+
}
|
|
50
|
+
dispose() {
|
|
51
|
+
if (__classPrivateFieldGet(this, _OdspContainerServices_disposed, "f")) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
__classPrivateFieldSet(this, _OdspContainerServices_disposed, true, "f");
|
|
55
|
+
__classPrivateFieldGet(this, _OdspContainerServices_container, "f").off("readonly", __classPrivateFieldGet(this, _OdspContainerServices_readonlyEventHandler, "f"));
|
|
56
|
+
__classPrivateFieldGet(this, _OdspContainerServices_container, "f").off("metadataUpdate", __classPrivateFieldGet(this, _OdspContainerServices_metadataUpdateEventHandler, "f"));
|
|
57
|
+
}
|
|
58
|
+
getReadOnlyState() {
|
|
59
|
+
return __classPrivateFieldGet(this, _OdspContainerServices_container, "f").readOnlyInfo.readonly;
|
|
60
|
+
}
|
|
61
|
+
getSensitivityLabelsInfo() {
|
|
62
|
+
return __classPrivateFieldGet(this, _OdspContainerServices_container, "f").containerMetadata.sensitivityLabelsInfo;
|
|
63
|
+
}
|
|
17
64
|
}
|
|
65
|
+
_OdspContainerServices_disposed = new WeakMap(), _OdspContainerServices_container = new WeakMap(), _OdspContainerServices_events = new WeakMap(), _OdspContainerServices_readonlyEventHandler = new WeakMap(), _OdspContainerServices_metadataUpdateEventHandler = new WeakMap();
|
|
18
66
|
//# sourceMappingURL=odspContainerServices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspContainerServices.js","sourceRoot":"","sources":["../src/odspContainerServices.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"odspContainerServices.js","sourceRoot":"","sources":["../src/odspContainerServices.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAO9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAOjC,IAAW,MAAM;QAChB,OAAO,uBAAA,IAAI,qCAAQ,CAAC;IACrB,CAAC;IAED,YAAmB,SAAqB;QAVxC,0CAAY,KAAK,EAAC;QACT,mDAAuB;QAIvB,wCAAU,aAAa,EAAgC,EAAC;QAexD,sDAAwB,GAAS,EAAE;YAC3C,uBAAA,IAAI,qCAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAC3C,CAAC,EAAC;QAEO,4DAA8B,CAAC,QAAgC,EAAQ,EAAE;YACjF,IAAI,QAAQ,CAAC,qBAAqB,KAAK,SAAS,EAAE,CAAC;gBAClD,uBAAA,IAAI,qCAAQ,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;YACnD,CAAC;QACF,CAAC,EAAC;QAjBD,uBAAA,IAAI,oCAAc,SAAS,MAAA,CAAC;QAC5B,uBAAA,IAAI,wCAAW,CAAC,EAAE,CAAC,UAAU,EAAE,uBAAA,IAAI,mDAAsB,CAAC,CAAC;QAC3D,uBAAA,IAAI,wCAAW,CAAC,EAAE,CAAC,gBAAgB,EAAE,uBAAA,IAAI,yDAA4B,CAAC,CAAC;QACvE,IAAI,CAAC,QAAQ,GAAG,qBAAqB,CAAC;YACrC,SAAS;YACT,mBAAmB,EAAE,wBAAwB;SAC7C,CAAC,CAAC;IACJ,CAAC;IAYD,IAAW,QAAQ;QAClB,OAAO,uBAAA,IAAI,uCAAU,CAAC;IACvB,CAAC;IAEM,OAAO;QACb,IAAI,uBAAA,IAAI,uCAAU,EAAE,CAAC;YACpB,OAAO;QACR,CAAC;QAED,uBAAA,IAAI,mCAAa,IAAI,MAAA,CAAC;QACtB,uBAAA,IAAI,wCAAW,CAAC,GAAG,CAAC,UAAU,EAAE,uBAAA,IAAI,mDAAsB,CAAC,CAAC;QAC5D,uBAAA,IAAI,wCAAW,CAAC,GAAG,CAAC,gBAAgB,EAAE,uBAAA,IAAI,yDAA4B,CAAC,CAAC;IACzE,CAAC;IAEM,gBAAgB;QACtB,OAAO,uBAAA,IAAI,wCAAW,CAAC,YAAY,CAAC,QAAQ,CAAC;IAC9C,CAAC;IAEM,wBAAwB;QAC9B,OAAO,uBAAA,IAAI,wCAAW,CAAC,iBAAiB,CAAC,qBAAqB,CAAC;IAChE,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { IContainer } from \"@fluidframework/container-definitions/internal\";\nimport type { IDisposable, Listenable } from \"@fluidframework/core-interfaces\";\nimport { createServiceAudience } from \"@fluidframework/fluid-static/internal\";\n\nimport type {\n\tIOdspAudience,\n\tOdspContainerServices as IOdspContainerServices,\n\tIOdspContainerServicesEvents,\n} from \"./interfaces.js\";\nimport { createOdspAudienceMember } from \"./odspAudience.js\";\n\n/**\n * @internal\n */\nexport class OdspContainerServices implements IOdspContainerServices, IDisposable {\n\t#disposed = false;\n\treadonly #container: IContainer;\n\n\tpublic readonly audience: IOdspAudience;\n\n\treadonly #events = createEmitter<IOdspContainerServicesEvents>();\n\tpublic get events(): Listenable<IOdspContainerServicesEvents> {\n\t\treturn this.#events;\n\t}\n\n\tpublic constructor(container: IContainer) {\n\t\tthis.#container = container;\n\t\tthis.#container.on(\"readonly\", this.#readonlyEventHandler);\n\t\tthis.#container.on(\"metadataUpdate\", this.#metadataUpdateEventHandler);\n\t\tthis.audience = createServiceAudience({\n\t\t\tcontainer,\n\t\t\tcreateServiceMember: createOdspAudienceMember,\n\t\t});\n\t}\n\n\treadonly #readonlyEventHandler = (): void => {\n\t\tthis.#events.emit(\"readOnlyStateChanged\");\n\t};\n\n\treadonly #metadataUpdateEventHandler = (metadata: Record<string, string>): void => {\n\t\tif (metadata.sensitivityLabelsInfo !== undefined) {\n\t\t\tthis.#events.emit(\"sensitivityLabelsInfoChanged\");\n\t\t}\n\t};\n\n\tpublic get disposed(): boolean {\n\t\treturn this.#disposed;\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this.#disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#disposed = true;\n\t\tthis.#container.off(\"readonly\", this.#readonlyEventHandler);\n\t\tthis.#container.off(\"metadataUpdate\", this.#metadataUpdateEventHandler);\n\t}\n\n\tpublic getReadOnlyState(): boolean | undefined {\n\t\treturn this.#container.readOnlyInfo.readonly;\n\t}\n\n\tpublic getSensitivityLabelsInfo(): string | undefined {\n\t\treturn this.#container.containerMetadata.sensitivityLabelsInfo;\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/odsp-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.74.0-368706",
|
|
4
4
|
"description": "A tool to enable creation and loading of Fluid containers using the ODSP service",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -69,28 +69,29 @@
|
|
|
69
69
|
"temp-directory": "nyc/.nyc_output"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@
|
|
73
|
-
"@fluidframework/container-
|
|
74
|
-
"@fluidframework/
|
|
75
|
-
"@fluidframework/core-
|
|
76
|
-
"@fluidframework/
|
|
77
|
-
"@fluidframework/
|
|
78
|
-
"@fluidframework/
|
|
79
|
-
"@fluidframework/
|
|
80
|
-
"@fluidframework/odsp-
|
|
81
|
-
"@fluidframework/odsp-driver
|
|
82
|
-
"@fluidframework/
|
|
72
|
+
"@fluid-internal/client-utils": "2.74.0-368706",
|
|
73
|
+
"@fluidframework/container-definitions": "2.74.0-368706",
|
|
74
|
+
"@fluidframework/container-loader": "2.74.0-368706",
|
|
75
|
+
"@fluidframework/core-interfaces": "2.74.0-368706",
|
|
76
|
+
"@fluidframework/core-utils": "2.74.0-368706",
|
|
77
|
+
"@fluidframework/driver-definitions": "2.74.0-368706",
|
|
78
|
+
"@fluidframework/fluid-static": "2.74.0-368706",
|
|
79
|
+
"@fluidframework/map": "2.74.0-368706",
|
|
80
|
+
"@fluidframework/odsp-doclib-utils": "2.74.0-368706",
|
|
81
|
+
"@fluidframework/odsp-driver": "2.74.0-368706",
|
|
82
|
+
"@fluidframework/odsp-driver-definitions": "2.74.0-368706",
|
|
83
|
+
"@fluidframework/telemetry-utils": "2.74.0-368706",
|
|
83
84
|
"uuid": "^11.1.0"
|
|
84
85
|
},
|
|
85
86
|
"devDependencies": {
|
|
86
87
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
87
88
|
"@biomejs/biome": "~1.9.3",
|
|
88
|
-
"@fluid-internal/mocha-test-setup": "
|
|
89
|
+
"@fluid-internal/mocha-test-setup": "2.74.0-368706",
|
|
89
90
|
"@fluid-tools/build-cli": "^0.60.0",
|
|
90
91
|
"@fluidframework/build-common": "^2.0.3",
|
|
91
92
|
"@fluidframework/build-tools": "^0.60.0",
|
|
92
|
-
"@fluidframework/eslint-config-fluid": "
|
|
93
|
-
"@fluidframework/test-utils": "
|
|
93
|
+
"@fluidframework/eslint-config-fluid": "2.74.0-368706",
|
|
94
|
+
"@fluidframework/test-utils": "2.74.0-368706",
|
|
94
95
|
"@microsoft/api-extractor": "7.52.11",
|
|
95
96
|
"@types/mocha": "^10.0.10",
|
|
96
97
|
"@types/node": "^18.19.0",
|
package/src/index.ts
CHANGED
package/src/interfaces.ts
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
import type {
|
|
7
7
|
IConfigProviderBase,
|
|
8
|
+
IDisposable,
|
|
8
9
|
ITelemetryBaseLogger,
|
|
10
|
+
Listenable,
|
|
9
11
|
} from "@fluidframework/core-interfaces";
|
|
10
12
|
import type {
|
|
11
13
|
ContainerAttachProps,
|
|
@@ -79,6 +81,25 @@ export interface OdspContainerAttachProps {
|
|
|
79
81
|
fileName: string | undefined;
|
|
80
82
|
}
|
|
81
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Events emitted by the ODSP container service to notify consumers of select
|
|
86
|
+
* container changes.
|
|
87
|
+
* @beta
|
|
88
|
+
* @sealed
|
|
89
|
+
*/
|
|
90
|
+
export interface IOdspContainerServicesEvents {
|
|
91
|
+
/**
|
|
92
|
+
* Emitted when the read-only state of the container changes.
|
|
93
|
+
* Consumers can call `OdspContainerServices.getReadOnlyState()` to get the updated value.
|
|
94
|
+
*/
|
|
95
|
+
readOnlyStateChanged: () => void;
|
|
96
|
+
/**
|
|
97
|
+
* Emitted when the sensitivity label of the container changes.
|
|
98
|
+
* Consumers can call `OdspContainerServices.getSensitivityLabelsInfo()` to get the updated value.
|
|
99
|
+
*/
|
|
100
|
+
sensitivityLabelsInfoChanged: () => void;
|
|
101
|
+
}
|
|
102
|
+
|
|
82
103
|
/**
|
|
83
104
|
* ODSP version of the IFluidContainer interface.
|
|
84
105
|
* @beta
|
|
@@ -106,12 +127,32 @@ export interface IOdspFluidContainer<
|
|
|
106
127
|
* how the data is handled within the FluidContainer itself, i.e. which data objects or DDSes to
|
|
107
128
|
* use, will not be included here but rather on the FluidContainer class itself.
|
|
108
129
|
* @beta
|
|
130
|
+
* @sealed
|
|
109
131
|
*/
|
|
110
|
-
export interface OdspContainerServices {
|
|
132
|
+
export interface OdspContainerServices extends IDisposable {
|
|
133
|
+
events: Listenable<IOdspContainerServicesEvents>;
|
|
111
134
|
/**
|
|
112
135
|
* Provides an object that facilitates obtaining information about users present in the Fluid session, as well as listeners for roster changes triggered by users joining or leaving the session.
|
|
113
136
|
*/
|
|
114
137
|
audience: IOdspAudience;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Gets the read-only state of the container, if available.
|
|
141
|
+
* This is not available until the container is in the "Connected" state.
|
|
142
|
+
* @remarks
|
|
143
|
+
* In the case that the read-only state cannot be determined, wait for the "readOnlyStateChanged" event to be emitted.
|
|
144
|
+
* @returns The read-only state (true when readonly, false when editable), or undefined if not available.
|
|
145
|
+
*/
|
|
146
|
+
getReadOnlyState(): boolean | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Gets the sensitivity labels info of the container, if available.
|
|
149
|
+
* This is not available until the container is in the "Connected" state, and will only be available
|
|
150
|
+
* if sensitivity labels have been applied to the container.
|
|
151
|
+
* @remarks
|
|
152
|
+
* In the case that the sensitivity labels info are expected but cannot be determined, wait for the "sensitivityLabelChanged" event to be emitted.
|
|
153
|
+
* @returns The sensitivity labels info string, or undefined if not available.
|
|
154
|
+
*/
|
|
155
|
+
getSensitivityLabelsInfo(): string | undefined;
|
|
115
156
|
}
|
|
116
157
|
|
|
117
158
|
/**
|
|
@@ -3,25 +3,71 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { createEmitter } from "@fluid-internal/client-utils";
|
|
6
7
|
import type { IContainer } from "@fluidframework/container-definitions/internal";
|
|
8
|
+
import type { IDisposable, Listenable } from "@fluidframework/core-interfaces";
|
|
7
9
|
import { createServiceAudience } from "@fluidframework/fluid-static/internal";
|
|
8
10
|
|
|
9
11
|
import type {
|
|
10
12
|
IOdspAudience,
|
|
11
13
|
OdspContainerServices as IOdspContainerServices,
|
|
14
|
+
IOdspContainerServicesEvents,
|
|
12
15
|
} from "./interfaces.js";
|
|
13
16
|
import { createOdspAudienceMember } from "./odspAudience.js";
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* @internal
|
|
17
20
|
*/
|
|
18
|
-
export class OdspContainerServices implements IOdspContainerServices {
|
|
21
|
+
export class OdspContainerServices implements IOdspContainerServices, IDisposable {
|
|
22
|
+
#disposed = false;
|
|
23
|
+
readonly #container: IContainer;
|
|
24
|
+
|
|
19
25
|
public readonly audience: IOdspAudience;
|
|
20
26
|
|
|
27
|
+
readonly #events = createEmitter<IOdspContainerServicesEvents>();
|
|
28
|
+
public get events(): Listenable<IOdspContainerServicesEvents> {
|
|
29
|
+
return this.#events;
|
|
30
|
+
}
|
|
31
|
+
|
|
21
32
|
public constructor(container: IContainer) {
|
|
33
|
+
this.#container = container;
|
|
34
|
+
this.#container.on("readonly", this.#readonlyEventHandler);
|
|
35
|
+
this.#container.on("metadataUpdate", this.#metadataUpdateEventHandler);
|
|
22
36
|
this.audience = createServiceAudience({
|
|
23
37
|
container,
|
|
24
38
|
createServiceMember: createOdspAudienceMember,
|
|
25
39
|
});
|
|
26
40
|
}
|
|
41
|
+
|
|
42
|
+
readonly #readonlyEventHandler = (): void => {
|
|
43
|
+
this.#events.emit("readOnlyStateChanged");
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
readonly #metadataUpdateEventHandler = (metadata: Record<string, string>): void => {
|
|
47
|
+
if (metadata.sensitivityLabelsInfo !== undefined) {
|
|
48
|
+
this.#events.emit("sensitivityLabelsInfoChanged");
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
public get disposed(): boolean {
|
|
53
|
+
return this.#disposed;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public dispose(): void {
|
|
57
|
+
if (this.#disposed) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
this.#disposed = true;
|
|
62
|
+
this.#container.off("readonly", this.#readonlyEventHandler);
|
|
63
|
+
this.#container.off("metadataUpdate", this.#metadataUpdateEventHandler);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public getReadOnlyState(): boolean | undefined {
|
|
67
|
+
return this.#container.readOnlyInfo.readonly;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public getSensitivityLabelsInfo(): string | undefined {
|
|
71
|
+
return this.#container.containerMetadata.sensitivityLabelsInfo;
|
|
72
|
+
}
|
|
27
73
|
}
|