@notatki/sync 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js.map +1 -1
- package/dist/report.js.map +1 -1
- package/dist/sync-options.js.map +1 -1
- package/dist/sync.js.map +1 -1
- package/package.json +6 -5
- package/src/index.ts +0 -3
- package/src/report.ts +0 -11
- package/src/sync-options.ts +0 -20
- package/src/sync.ts +0 -16
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./report.js\";\nexport * from \"./sync.js\";\nexport * from \"./sync-options.js\";\n"]}
|
package/dist/report.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,MAAM,eAAe,CAAC;AAEtD,MAAM,OAAO,QAAQ;IACnB,KAAK,KAAU,CAAC;IAEhB,SAAS,CAAC,KAAY,IAAS,CAAC;IAEhC,QAAQ,CAAC,IAAU,IAAS,CAAC;IAE7B,GAAG,KAAU,CAAC;CACf"}
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,MAAM,eAAe,CAAC;AAEtD,MAAM,OAAO,QAAQ;IACnB,KAAK,KAAU,CAAC;IAEhB,SAAS,CAAC,KAAY,IAAS,CAAC;IAEhC,QAAQ,CAAC,IAAU,IAAS,CAAC;IAE7B,GAAG,KAAU,CAAC;CACf","sourcesContent":["import { type Model, type Note } from \"@notatki/core\";\n\nexport class Reporter {\n start(): void {}\n\n syncModel(model: Model): void {}\n\n syncNote(note: Note): void {}\n\n end(): void {}\n}\n"]}
|
package/dist/sync-options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-options.js","sourceRoot":"","sources":["../src/sync-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAQvC,MAAM,UAAU,iBAAiB,CAAC,OAAuC;IACvE,MAAM,EACJ,QAAQ,GAAG,IAAI,QAAQ,EAAE,EAAE,EAAE;IAC7B,WAAW,GAAG,KAAK,EACnB,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC,MAAM,GACtC,GAAG,OAAO,CAAC;IACZ,OAAO;QACL,QAAQ,EAAE,EAAE;QACZ,WAAW;QACX,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"sync-options.js","sourceRoot":"","sources":["../src/sync-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAQvC,MAAM,UAAU,iBAAiB,CAAC,OAAuC;IACvE,MAAM,EACJ,QAAQ,GAAG,IAAI,QAAQ,EAAE,EAAE,EAAE;IAC7B,WAAW,GAAG,KAAK,EACnB,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC,MAAM,GACtC,GAAG,OAAO,CAAC;IACZ,OAAO;QACL,QAAQ,EAAE,EAAE;QACZ,WAAW;QACX,MAAM;KACP,CAAC;AACJ,CAAC","sourcesContent":["import { Reporter } from \"./report.js\";\n\nexport type SyncOptions = {\n reporter: Reporter;\n deleteNotes: boolean;\n signal: AbortSignal;\n};\n\nexport function expandSyncOptions(options: Partial<Readonly<SyncOptions>>): SyncOptions {\n const {\n reporter = new Reporter(), //\n deleteNotes = false,\n signal = new AbortController().signal,\n } = options;\n return {\n reporter, //\n deleteNotes,\n signal,\n };\n}\n"]}
|
package/dist/sync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAoB,MAAM,mBAAmB,CAAC;AAExE,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAAe,EAAE,UAA0C,EAAE;IAClG,MAAM,IAAI,YAAY,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,YAAY;IAChB,KAAK,CAAC,IAAI,CAAC,KAAe,EAAE,OAAoB;QAC9C,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QAE7B,QAAQ,CAAC,KAAK,EAAE,CAAC;QAEjB,QAAQ,CAAC,GAAG,EAAE,CAAC;IACjB,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAoB,MAAM,mBAAmB,CAAC;AAExE,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAAe,EAAE,UAA0C,EAAE;IAClG,MAAM,IAAI,YAAY,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,YAAY;IAChB,KAAK,CAAC,IAAI,CAAC,KAAe,EAAE,OAAoB;QAC9C,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QAE7B,QAAQ,CAAC,KAAK,EAAE,CAAC;QAEjB,QAAQ,CAAC,GAAG,EAAE,CAAC;IACjB,CAAC;CACF","sourcesContent":["import { type NoteList } from \"@notatki/core\";\nimport { expandSyncOptions, type SyncOptions } from \"./sync-options.js\";\n\nexport async function synchronizeNotes(notes: NoteList, options: Partial<Readonly<SyncOptions>> = {}): Promise<void> {\n await new Synchronizer().sync(notes, expandSyncOptions(options));\n}\n\nclass Synchronizer {\n async sync(notes: NoteList, options: SyncOptions): Promise<void> {\n const { reporter } = options;\n\n reporter.start();\n\n reporter.end();\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notatki/sync",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "A collection of tools for creating and syncing Anki notes from simple text files.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anki",
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
"type": "git",
|
|
16
16
|
"url": "git+https://github.com/aradzie/notatki.git"
|
|
17
17
|
},
|
|
18
|
+
"license": "MIT",
|
|
18
19
|
"type": "module",
|
|
19
20
|
"main": "dist/index.js",
|
|
20
21
|
"dependencies": {
|
|
21
|
-
"@notatki/core": "^0.0.
|
|
22
|
-
"@notatki/format": "^0.0.
|
|
23
|
-
"@notatki/parser": "^0.0.
|
|
22
|
+
"@notatki/core": "^0.0.4",
|
|
23
|
+
"@notatki/format": "^0.0.4",
|
|
24
|
+
"@notatki/parser": "^0.0.4"
|
|
24
25
|
},
|
|
25
26
|
"scripts": {
|
|
26
27
|
"compile": "rm -fr dist && tsc",
|
|
@@ -30,5 +31,5 @@
|
|
|
30
31
|
"publishConfig": {
|
|
31
32
|
"access": "public"
|
|
32
33
|
},
|
|
33
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "b2237839f8310ecbb0b05de29dcfe5571b1d786c"
|
|
34
35
|
}
|
package/src/index.ts
DELETED
package/src/report.ts
DELETED
package/src/sync-options.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Reporter } from "./report.js";
|
|
2
|
-
|
|
3
|
-
export type SyncOptions = {
|
|
4
|
-
reporter: Reporter;
|
|
5
|
-
deleteNotes: boolean;
|
|
6
|
-
signal: AbortSignal;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export function expandSyncOptions(options: Partial<Readonly<SyncOptions>>): SyncOptions {
|
|
10
|
-
const {
|
|
11
|
-
reporter = new Reporter(), //
|
|
12
|
-
deleteNotes = false,
|
|
13
|
-
signal = new AbortController().signal,
|
|
14
|
-
} = options;
|
|
15
|
-
return {
|
|
16
|
-
reporter, //
|
|
17
|
-
deleteNotes,
|
|
18
|
-
signal,
|
|
19
|
-
};
|
|
20
|
-
}
|
package/src/sync.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type NoteList } from "@notatki/core";
|
|
2
|
-
import { expandSyncOptions, type SyncOptions } from "./sync-options.js";
|
|
3
|
-
|
|
4
|
-
export async function synchronizeNotes(notes: NoteList, options: Partial<Readonly<SyncOptions>> = {}): Promise<void> {
|
|
5
|
-
await new Synchronizer().sync(notes, expandSyncOptions(options));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
class Synchronizer {
|
|
9
|
-
async sync(notes: NoteList, options: SyncOptions): Promise<void> {
|
|
10
|
-
const { reporter } = options;
|
|
11
|
-
|
|
12
|
-
reporter.start();
|
|
13
|
-
|
|
14
|
-
reporter.end();
|
|
15
|
-
}
|
|
16
|
-
}
|