Skip to content

Commit db5bdb8

Browse files
committed
docs: better docs
1 parent d9d8c20 commit db5bdb8

File tree

8 files changed

+47
-28
lines changed

8 files changed

+47
-28
lines changed

packages/h5p-mongos3/docs/mongo-s3-content-storage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const storage = new MongoS3ContentStorage(
6464

6565
- The function {@link initS3} creates an S3 client using the `aws-sdk` npm
6666
package.
67-
- The function {@link @lumieducation/h5p-server!initMongo} creates a MongoDB
67+
- The function {@link initMongo} creates a MongoDB
6868
client using the `mongodb` npm package.
6969
- You can pass credentials and other configuration values to `initS3` and
7070
`initMongo` through the function parameters. Alternatively you can use these

packages/h5p-mongos3/docs/s3-temporary-file-storage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ TEMPORARYSTORAGE=s3 AWS_ACCESS_KEY_ID=minioaccesskey AWS_SECRET_ACCESS_KEY=minio
9191
By default the storage implementation allows all users read access to all files
9292
and every use can create new temporary files! It is very possible that this is
9393
not something you want! You can add a function to the options object of the
94-
constructor of {@link S3TemporayStorage} to customize access restrictions:
94+
constructor of {@link S3TemporaryFileStorage} to customize access restrictions:
9595

9696
```typescript
9797
getPermissions: (

packages/h5p-react/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,9 @@ Note: You can also simply catch errors by wrapping the `save()` method in a `try
247247

248248
## Executing underlying H5P functionality
249249

250-
The {@link H5PPlayerComponent} offers properties and methods that can be used to
251-
do things with the underlying "core" H5P data structures and objects:
250+
The {@link @lumieducation/h5p-webcomponents!H5PPlayerComponent} offers
251+
properties and methods that can be used to do things with the underlying "core"
252+
H5P data structures and objects:
252253

253254
### h5pInstance
254255

packages/h5p-server/src/DependencyGetter.ts

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,27 @@ export default class DependencyGetter {
1616
/**
1717
* Gets all dependent libraries of the libraries in the list.
1818
* @param libraries the libraries whose dependencies should be retrieved
19-
* @param dynamic include dependencies that are part of the dynamicDependencies property or used in the content
20-
* @param editor include dependencies that are listed in editorDependencies
21-
* @param preloaded include regular dependencies that are included in preloadedDependencies
22-
* @param doNotAdd libraries in this list will not be added to the dependency list
19+
* @param options.dynamic include dependencies that are part of the
20+
* dynamicDependencies property or used in the content
21+
* @param options.editor include dependencies that are listed in
22+
* editorDependencies
23+
* @param options.preloaded include regular dependencies that are included
24+
* in preloadedDependencies
25+
* @param doNotAdd libraries in this list will not be added to the
26+
* dependency list
2327
* @returns a list of libraries
2428
*/
2529
public async getDependentLibraries(
2630
libraries: ILibraryName[],
27-
{
28-
dynamic = false,
29-
editor = false,
30-
preloaded = false
31-
}: { dynamic?: boolean; editor?: boolean; preloaded?: boolean },
31+
options: {
32+
dynamic?: boolean;
33+
editor?: boolean;
34+
preloaded?: boolean;
35+
} = {
36+
dynamic: false,
37+
editor: false,
38+
preloaded: false
39+
},
3240
doNotAdd?: ILibraryName[]
3341
): Promise<ILibraryName[]> {
3442
log.info(
@@ -51,7 +59,11 @@ export default class DependencyGetter {
5159
? Number.parseInt(library.minorVersion, 10)
5260
: library.minorVersion
5361
),
54-
{ preloaded, editor, dynamic },
62+
{
63+
preloaded: options?.preloaded,
64+
editor: options?.editor,
65+
dynamic: options?.dynamic
66+
},
5567
dependencies,
5668
doNotAdd
5769
);

packages/h5p-server/src/PackageImporter.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,25 @@ export default class PackageImporter {
7171
* disk
7272
* @param directoryPath The full path of the directory to which the package
7373
* should be extracted
74-
* @param includeLibraries If true, the library directories inside the
74+
* @param options.includeLibraries If true, the library directories inside
75+
* the package will be extracted.
76+
* @param options.includeContent If true, the content folder inside the
77+
* package will be extracted.
78+
* @param options.includeMetadata If true, the h5p.json file inside the
7579
* package will be extracted.
76-
* @param includeContent If true, the content folder inside the package will
77-
* be extracted.
78-
* @param includeMetadata If true, the h5p.json file inside the package will
79-
* be extracted.
8080
* @returns
8181
*/
8282
public static async extractPackage(
8383
packagePath: string,
8484
directoryPath: string,
85-
{
86-
includeLibraries = false,
87-
includeContent = false,
88-
includeMetadata = false
89-
}: {
85+
options: {
9086
includeContent: boolean;
9187
includeLibraries: boolean;
9288
includeMetadata: boolean;
89+
} = {
90+
includeLibraries: false,
91+
includeContent: false,
92+
includeMetadata: false
9393
}
9494
): Promise<void> {
9595
log.info(`extracting package ${packagePath} to ${directoryPath}`);
@@ -100,11 +100,12 @@ export default class PackageImporter {
100100
!entry.filename.endsWith('/') &&
101101
!basename.startsWith('.') &&
102102
!basename.startsWith('_') &&
103-
((includeContent && entry.filename.startsWith('content/')) ||
104-
(includeLibraries &&
103+
((options.includeContent &&
104+
entry.filename.startsWith('content/')) ||
105+
(options.includeLibraries &&
105106
entry.filename.includes('/') &&
106107
!entry.filename.startsWith('content/')) ||
107-
(includeMetadata && entry.filename === 'h5p.json'))
108+
(options.includeMetadata && entry.filename === 'h5p.json'))
108109
) {
109110
const readStream = await entry.openReadStream();
110111
const writePath = path.join(directoryPath, entry.filename);

packages/h5p-server/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import ContentUserDataManager from './ContentUserDataManager';
3232
import UrlGenerator from './UrlGenerator';
3333
import SimpleLockProvider from './implementation/SimpleLockProvider';
3434
import { LaissezFairePermissionSystem } from './implementation/LaissezFairePermissionSystem';
35+
import TemporaryFileManager from './TemporaryFileManager';
3536

3637
// Interfaces
3738
import {
@@ -113,6 +114,7 @@ export {
113114
LibraryName,
114115
Logger,
115116
PackageExporter,
117+
TemporaryFileManager,
116118
streamToString,
117119
// interfaces
118120
ContentId,

packages/h5p-shared-state-server/src/SharedStateServer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {
1313
GetLibraryFileAsJsonFunction,
1414
GetLibraryMetadataFunction,
1515
GetPermissionForUserFunction,
16+
ILogicalOperator,
17+
ILogicCheck,
1618
RequestToUserFunction
1719
} from './types';
1820
import checkPermissionsAndInjectContentContext from './middleware/checkPermissionsAndInjectContentContext';
@@ -178,3 +180,5 @@ export default class SharedStateServer {
178180
return '/shared-state';
179181
}
180182
}
183+
184+
export { ILogicCheck, ILogicalOperator };

packages/h5p-webcomponents/src/h5p-player.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ export class H5PPlayerComponent extends HTMLElement {
133133
/**
134134
* Indicates changes to which attributes should trigger calls to
135135
* attributeChangedCallback.
136-
* @memberof H5PPlayerComponent
137136
*/
138137
static get observedAttributes(): string[] {
139138
return ['content-id', 'context-id', 'as-user-id', 'read-only-state'];

0 commit comments

Comments
 (0)