@coasys/ad4m 0.10.0-rc6.fix3 → 0.10.0-rc7.fix.3

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/lib/index.cjs CHANGED
@@ -4900,7 +4900,14 @@ class PerspectiveProxy {
4900
4900
  */
4901
4901
  async isSubjectInstance(expression, subjectClass) {
4902
4902
  let className = await this.stringOrTemplateObjectToSubjectClass(subjectClass);
4903
- return await this.infer(`subject_class("${className}", C), instance(C, "${expression}")`);
4903
+ let isInstance = false;
4904
+ const maxAttempts = 5;
4905
+ let attempts = 0;
4906
+ while (attempts < maxAttempts && !isInstance) {
4907
+ isInstance = await this.infer(`subject_class("${className}", C), instance(C, "${expression}")`);
4908
+ attempts++;
4909
+ }
4910
+ return isInstance;
4904
4911
  }
4905
4912
  /** For an existing subject instance (existing in the perspective's links)
4906
4913
  * this function returns a proxy object that can be used to access the subject's
@@ -5006,7 +5013,10 @@ class PerspectiveProxy {
5006
5013
  // Collect all add functions of the object in a list
5007
5014
  let setCollectionFunctions = Object.getOwnPropertyNames(obj).filter(key => (Object.prototype.hasOwnProperty.call(obj, key) && typeof obj[key] === "function") && key.startsWith("setCollection"));
5008
5015
  // Add all add functions of the object's prototype to that list
5009
- setCollectionFunctions = setCollectionFunctions.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(obj)).filter(key => (Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(obj), key) && typeof Object.getPrototypeOf(obj)[key] === "function") && key.startsWith("setCollection")));
5016
+ setCollectionFunctions = setCollectionFunctions.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(obj)).filter(key => {
5017
+ const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(obj), key);
5018
+ return descriptor && typeof descriptor.value === "function" && key.startsWith("setCollection");
5019
+ }));
5010
5020
  // Construct query to find all subject classes that have the given properties and collections
5011
5021
  let query = `subject_class(Class, C)`;
5012
5022
  for (let property of properties) {
package/lib/index.js CHANGED
@@ -4896,7 +4896,14 @@ class PerspectiveProxy {
4896
4896
  */
4897
4897
  async isSubjectInstance(expression, subjectClass) {
4898
4898
  let className = await this.stringOrTemplateObjectToSubjectClass(subjectClass);
4899
- return await this.infer(`subject_class("${className}", C), instance(C, "${expression}")`);
4899
+ let isInstance = false;
4900
+ const maxAttempts = 5;
4901
+ let attempts = 0;
4902
+ while (attempts < maxAttempts && !isInstance) {
4903
+ isInstance = await this.infer(`subject_class("${className}", C), instance(C, "${expression}")`);
4904
+ attempts++;
4905
+ }
4906
+ return isInstance;
4900
4907
  }
4901
4908
  /** For an existing subject instance (existing in the perspective's links)
4902
4909
  * this function returns a proxy object that can be used to access the subject's
@@ -5002,7 +5009,10 @@ class PerspectiveProxy {
5002
5009
  // Collect all add functions of the object in a list
5003
5010
  let setCollectionFunctions = Object.getOwnPropertyNames(obj).filter(key => (Object.prototype.hasOwnProperty.call(obj, key) && typeof obj[key] === "function") && key.startsWith("setCollection"));
5004
5011
  // Add all add functions of the object's prototype to that list
5005
- setCollectionFunctions = setCollectionFunctions.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(obj)).filter(key => (Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(obj), key) && typeof Object.getPrototypeOf(obj)[key] === "function") && key.startsWith("setCollection")));
5012
+ setCollectionFunctions = setCollectionFunctions.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(obj)).filter(key => {
5013
+ const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(obj), key);
5014
+ return descriptor && typeof descriptor.value === "function" && key.startsWith("setCollection");
5015
+ }));
5006
5016
  // Construct query to find all subject classes that have the given properties and collections
5007
5017
  let query = `subject_class(Class, C)`;
5008
5018
  for (let property of properties) {
@@ -307,7 +307,14 @@ export class PerspectiveProxy {
307
307
  */
308
308
  async isSubjectInstance(expression, subjectClass) {
309
309
  let className = await this.stringOrTemplateObjectToSubjectClass(subjectClass);
310
- return await this.infer(`subject_class("${className}", C), instance(C, "${expression}")`);
310
+ let isInstance = false;
311
+ const maxAttempts = 5;
312
+ let attempts = 0;
313
+ while (attempts < maxAttempts && !isInstance) {
314
+ isInstance = await this.infer(`subject_class("${className}", C), instance(C, "${expression}")`);
315
+ attempts++;
316
+ }
317
+ return isInstance;
311
318
  }
312
319
  /** For an existing subject instance (existing in the perspective's links)
313
320
  * this function returns a proxy object that can be used to access the subject's
@@ -413,7 +420,10 @@ export class PerspectiveProxy {
413
420
  // Collect all add functions of the object in a list
414
421
  let setCollectionFunctions = Object.getOwnPropertyNames(obj).filter(key => (Object.prototype.hasOwnProperty.call(obj, key) && typeof obj[key] === "function") && key.startsWith("setCollection"));
415
422
  // Add all add functions of the object's prototype to that list
416
- setCollectionFunctions = setCollectionFunctions.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(obj)).filter(key => (Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(obj), key) && typeof Object.getPrototypeOf(obj)[key] === "function") && key.startsWith("setCollection")));
423
+ setCollectionFunctions = setCollectionFunctions.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(obj)).filter(key => {
424
+ const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(obj), key);
425
+ return descriptor && typeof descriptor.value === "function" && key.startsWith("setCollection");
426
+ }));
417
427
  // Construct query to find all subject classes that have the given properties and collections
418
428
  let query = `subject_class(Class, C)`;
419
429
  for (let property of properties) {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "module": "lib/index.js",
6
6
  "types": "lib/src/index.d.ts",
7
7
  "type": "module",
8
-
8
+ "private": false,
9
9
  "scripts": {
10
10
  "build": "patch-package && tsc && pnpm run buildSchema && pnpm run bundle",
11
11
  "buildSchema": "node --es-module-specifier-resolution=node lib/src/buildSchema.js",
@@ -60,7 +60,7 @@
60
60
  "@types/yargs": "*"
61
61
  },
62
62
  "patchedDependencies": {},
63
- "version": "0.10.0-rc6.fix3",
63
+ "version": "0.10.0-rc7.fix.3",
64
64
  "pnpm": {
65
65
  "patchedDependencies": {
66
66
  "graphql@15.7.2": "patches/graphql@15.7.2.patch"
@@ -365,7 +365,16 @@ export class PerspectiveProxy {
365
365
  */
366
366
  async isSubjectInstance<T>(expression: string, subjectClass: T): Promise<boolean> {
367
367
  let className = await this.stringOrTemplateObjectToSubjectClass(subjectClass)
368
- return await this.infer(`subject_class("${className}", C), instance(C, "${expression}")`)
368
+ let isInstance = false;
369
+ const maxAttempts = 5;
370
+ let attempts = 0;
371
+
372
+ while (attempts < maxAttempts && !isInstance) {
373
+ isInstance = await this.infer(`subject_class("${className}", C), instance(C, "${expression}")`);
374
+ attempts++;
375
+ }
376
+
377
+ return isInstance
369
378
  }
370
379
 
371
380
 
@@ -482,8 +491,10 @@ export class PerspectiveProxy {
482
491
  // Collect all add functions of the object in a list
483
492
  let setCollectionFunctions = Object.getOwnPropertyNames(obj).filter(key => (Object.prototype.hasOwnProperty.call(obj, key) && typeof obj[key] === "function") && key.startsWith("setCollection"))
484
493
  // Add all add functions of the object's prototype to that list
485
- setCollectionFunctions = setCollectionFunctions.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(obj)).filter(key => (Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(obj), key) && typeof Object.getPrototypeOf(obj)[key] === "function") && key.startsWith("setCollection")))
486
-
494
+ setCollectionFunctions = setCollectionFunctions.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(obj)).filter(key => {
495
+ const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(obj), key);
496
+ return descriptor && typeof descriptor.value === "function" && key.startsWith("setCollection");
497
+ }));
487
498
  // Construct query to find all subject classes that have the given properties and collections
488
499
  let query = `subject_class(Class, C)`
489
500
 
package/yarn-error.log DELETED
@@ -1,90 +0,0 @@
1
- Arguments:
2
- /Users/nicolasluck/.nvm/versions/node/v18.16.1/bin/node /Users/nicolasluck/.nvm/versions/node/v18.16.1/bin/yarn install
3
-
4
- PATH:
5
- /Users/nicolasluck/Library/pnpm:/Users/nicolasluck/.nvm/versions/node/v18.16.1/bin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/Users/nicolasluck/.cargo/bin
6
-
7
- Yarn version:
8
- 1.22.19
9
-
10
- Node version:
11
- 18.16.1
12
-
13
- Platform:
14
- darwin arm64
15
-
16
- Trace:
17
- Error: ENOENT: no such file or directory, copyfile '/Users/nicolasluck/Library/Caches/Yarn/v6/npm-has-flag-3.0.0-b5d454dc2199ae225699f3467e5a07f3b955bafd-integrity/node_modules/has-flag/index.js' -> '/Users/nicolasluck/Coasys/code/ad4m/node_modules/@changesets/cli/node_modules/has-flag/index.js'
18
-
19
- npm manifest:
20
- {
21
- "name": "@coasys/ad4m",
22
- "description": "*The Agent-Centric Distributed Application Meta-ontology* or just: *Agent-Centric DApp Meta-ontology* * A new meta-ontology for interoperable, decentralized application design * A spanning-layer to enable seamless integration between Holochain DNAs, blockchains, linked-data structures/ontologies and centralized back-ends * The basis for turning distinct, monolithic and siloed apps into a global, open and interoperable sense-making network",
23
- "main": "lib/index.cjs",
24
- "module": "lib/index.js",
25
- "types": "lib/src/index.d.ts",
26
- "type": "module",
27
- "private": true,
28
- "scripts": {
29
- "build": "patch-package && tsc && pnpm run buildSchema && pnpm run bundle",
30
- "buildSchema": "node --es-module-specifier-resolution=node lib/src/buildSchema.js",
31
- "bundle": "rollup -c rollup.config.js",
32
- "test": "jest --forceExit"
33
- },
34
- "repository": {
35
- "type": "git",
36
- "url": "git+https://github.com/perspect3vism/ad4m.git"
37
- },
38
- "author": {
39
- "name": "Nicolas Luck",
40
- "email": "nicolas@lucksus.eu"
41
- },
42
- "contributors": [
43
- {
44
- "name": "Joshua Parkin",
45
- "email": "joshuadparkin@gmail.com"
46
- }
47
- ],
48
- "license": "CAL-1.0",
49
- "bugs": {
50
- "url": "https://github.com/perspect3vism/ad4m/issues"
51
- },
52
- "homepage": "https://ad4m.dev",
53
- "dependencies": {
54
- "@apollo/client": "3.7.10",
55
- "@holochain/client": "0.16.0",
56
- "@types/jest": "^26.0.14",
57
- "class-validator": "^0.13.1",
58
- "express": "4.18.2",
59
- "graphql": "15.7.2",
60
- "reflect-metadata": "^0.1.13",
61
- "type-graphql": "1.1.1"
62
- },
63
- "devDependencies": {
64
- "@apollo/server": "^4.9.4",
65
- "@rollup/plugin-alias": "^3.1.5",
66
- "@rollup/plugin-commonjs": "^20.0.0",
67
- "@rollup/plugin-node-resolve": "^13.0.4",
68
- "concat-md": "^0.5.0",
69
- "cross-fetch": "^3.1.4",
70
- "graphql-ws": "5.12.0",
71
- "honkit": "^4.0.0",
72
- "jest": "^26.6.0",
73
- "patch-package": "^8.0.0",
74
- "rollup": "^2.56.3",
75
- "ts-jest": "^26.5.6",
76
- "typescript": "^4.6.2",
77
- "ws": "8.13.0",
78
- "@types/node": "*",
79
- "@types/yargs": "*"
80
- },
81
- "patchedDependencies": {},
82
- "version": "0.9.1-prerelease"
83
-
84
- }
85
-
86
- yarn manifest:
87
- No manifest
88
-
89
- Lockfile:
90
- No lockfile