@palantir/pack.state.core 0.1.0 → 0.1.1

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.
Files changed (34) hide show
  1. package/.turbo/turbo-lint.log +1 -1
  2. package/.turbo/turbo-transpileBrowser.log +1 -1
  3. package/.turbo/turbo-transpileCjs.log +1 -1
  4. package/.turbo/turbo-transpileEsm.log +1 -1
  5. package/.turbo/turbo-transpileTypes.log +1 -1
  6. package/.turbo/turbo-typecheck.log +1 -1
  7. package/CHANGELOG.md +11 -0
  8. package/build/browser/index.js +25 -0
  9. package/build/browser/index.js.map +1 -1
  10. package/build/cjs/index.cjs +25 -0
  11. package/build/cjs/index.cjs.map +1 -1
  12. package/build/cjs/index.d.cts +93 -0
  13. package/build/esm/index.js +25 -0
  14. package/build/esm/index.js.map +1 -1
  15. package/build/types/service/BaseYjsDocumentService.d.ts +6 -0
  16. package/build/types/service/BaseYjsDocumentService.d.ts.map +1 -1
  17. package/build/types/types/DocumentRefImpl.d.ts +20 -0
  18. package/build/types/types/DocumentRefImpl.d.ts.map +1 -1
  19. package/build/types/types/DocumentService.d.ts +13 -0
  20. package/build/types/types/DocumentService.d.ts.map +1 -1
  21. package/build/types/types/RecordCollectionRefImpl.d.ts +23 -0
  22. package/build/types/types/RecordCollectionRefImpl.d.ts.map +1 -1
  23. package/build/types/types/RecordRefImpl.d.ts +25 -0
  24. package/build/types/types/RecordRefImpl.d.ts.map +1 -1
  25. package/build/types/types/StateModule.d.ts +12 -0
  26. package/build/types/types/StateModule.d.ts.map +1 -1
  27. package/package.json +4 -4
  28. package/src/service/BaseYjsDocumentService.ts +8 -0
  29. package/src/service/InMemoryDocumentService.ts +30 -0
  30. package/src/types/DocumentRefImpl.ts +20 -0
  31. package/src/types/DocumentService.ts +16 -0
  32. package/src/types/RecordCollectionRefImpl.ts +23 -0
  33. package/src/types/RecordRefImpl.ts +25 -0
  34. package/src/types/StateModule.ts +20 -0
@@ -1,4 +1,4 @@
1
1
 
2
- > @palantir/pack.state.core@0.1.0 lint /home/runner/work/pack/pack/packages/state/core
2
+ > @palantir/pack.state.core@0.1.1 lint /home/runner/work/pack/pack/packages/state/core
3
3
  > eslint ./src && dprint check --config $(find-up dprint.json) --allow-no-files
4
4
 
@@ -1,5 +1,5 @@
1
1
 
2
- > @palantir/pack.state.core@0.1.0 transpileBrowser /home/runner/work/pack/pack/packages/state/core
2
+ > @palantir/pack.state.core@0.1.1 transpileBrowser /home/runner/work/pack/pack/packages/state/core
3
3
  > monorepo-transpile -f esm -m bundle -t browser
4
4
 
5
5
  👍
@@ -1,5 +1,5 @@
1
1
 
2
- > @palantir/pack.state.core@0.1.0 transpileCjs /home/runner/work/pack/pack/packages/state/core
2
+ > @palantir/pack.state.core@0.1.1 transpileCjs /home/runner/work/pack/pack/packages/state/core
3
3
  > monorepo-transpile -f cjs -m bundle -t node
4
4
 
5
5
  👍
@@ -1,5 +1,5 @@
1
1
 
2
- > @palantir/pack.state.core@0.1.0 transpileEsm /home/runner/work/pack/pack/packages/state/core
2
+ > @palantir/pack.state.core@0.1.1 transpileEsm /home/runner/work/pack/pack/packages/state/core
3
3
  > monorepo-transpile -f esm -m bundle -t node
4
4
 
5
5
  👍
@@ -1,5 +1,5 @@
1
1
 
2
- > @palantir/pack.state.core@0.1.0 transpileTypes /home/runner/work/pack/pack/packages/state/core
2
+ > @palantir/pack.state.core@0.1.1 transpileTypes /home/runner/work/pack/pack/packages/state/core
3
3
  > monorepo-transpile -f esm -m types -t node
4
4
 
5
5
  👍
@@ -1,4 +1,4 @@
1
1
 
2
- > @palantir/pack.state.core@0.1.0 typecheck /home/runner/work/pack/pack/packages/state/core
2
+ > @palantir/pack.state.core@0.1.1 typecheck /home/runner/work/pack/pack/packages/state/core
3
3
  > tsc --noEmit --emitDeclarationOnly false
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @palantir/pack.state.core
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - eba27ae: Fix issues locating model metadata when multiple copies of the schema package are present
8
+ - 67df6e4: Documented public apis
9
+ - Updated dependencies [eba27ae]
10
+ - Updated dependencies [67df6e4]
11
+ - @palantir/pack.document-schema.model-types@0.1.1
12
+ - @palantir/pack.core@0.1.1
13
+
3
14
  ## 0.1.0
4
15
 
5
16
  ### Minor Changes
@@ -46,6 +46,9 @@ var StateModuleImpl = class {
46
46
  async createDocument(metadata, schema) {
47
47
  return this.documentService.createDocument(metadata, schema);
48
48
  }
49
+ async searchDocuments(documentTypeName, schema, options) {
50
+ return this.documentService.searchDocuments(documentTypeName, schema, options);
51
+ }
49
52
  async getDocumentSnapshot(docRef) {
50
53
  return this.documentService.getDocumentSnapshot(docRef);
51
54
  }
@@ -1250,6 +1253,28 @@ var InMemoryDocumentService = class extends BaseYjsDocumentService {
1250
1253
  this.getCreateInternalDoc(docRef, metadata, yDoc);
1251
1254
  return Promise.resolve(docRef);
1252
1255
  };
1256
+ searchDocuments = (documentTypeName, schema, options) => {
1257
+ const results = [];
1258
+ const {
1259
+ documentName,
1260
+ limit
1261
+ } = options ?? {};
1262
+ for (const [docId, internalDoc] of this.documents.entries()) {
1263
+ if (internalDoc.metadata?.documentTypeName === documentTypeName) {
1264
+ if (documentName && !internalDoc.metadata.name.includes(documentName)) {
1265
+ continue;
1266
+ }
1267
+ results.push({
1268
+ ...internalDoc.metadata,
1269
+ id: docId
1270
+ });
1271
+ if (limit && results.length >= limit) {
1272
+ break;
1273
+ }
1274
+ }
1275
+ }
1276
+ return Promise.resolve(results);
1277
+ };
1253
1278
  // Lifecycle method implementations
1254
1279
  onMetadataSubscriptionOpened(internalDoc, docRef) {
1255
1280
  this.updateMetadataStatus(internalDoc, docRef, {