@coasys/ad4m 0.12.0-rc1-dev.1 → 0.12.0-rc1-dev.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.
Files changed (124) hide show
  1. package/jest.config.js +8 -1
  2. package/lib/index.cjs +13793 -12854
  3. package/lib/index.js +13782 -12851
  4. package/lib/src/Ad4mClient.test.d.ts +1 -0
  5. package/lib/src/Ad4mClient.test.js +1204 -0
  6. package/lib/src/Literal.test.d.ts +1 -0
  7. package/lib/src/Literal.test.js +41 -0
  8. package/lib/src/model/Ad4mModel.d.ts +528 -101
  9. package/lib/src/model/Ad4mModel.js +1670 -748
  10. package/lib/src/model/Ad4mModel.test.js +140 -156
  11. package/lib/src/model/Subject.d.ts +3 -3
  12. package/lib/src/model/Subject.js +25 -25
  13. package/lib/src/model/decorators.d.ts +259 -247
  14. package/lib/src/model/decorators.js +379 -422
  15. package/lib/src/model/mutation.d.ts +81 -0
  16. package/lib/src/model/mutation.js +317 -0
  17. package/lib/src/model/parentUtils.d.ts +32 -0
  18. package/lib/src/model/parentUtils.js +64 -0
  19. package/lib/src/model/prolog/generatePrologFacts.d.ts +36 -0
  20. package/lib/src/model/prolog/generatePrologFacts.js +139 -0
  21. package/lib/src/model/prolog/index.d.ts +1 -0
  22. package/lib/src/model/prolog/index.js +1 -0
  23. package/lib/src/model/query/ModelQueryBuilder.d.ts +82 -0
  24. package/lib/src/model/query/ModelQueryBuilder.js +115 -0
  25. package/lib/src/model/query/QueryBuilder.d.ts +101 -0
  26. package/lib/src/model/query/QueryBuilder.js +193 -0
  27. package/lib/src/model/query/SurrealQueryBuilder.d.ts +48 -0
  28. package/lib/src/model/query/SurrealQueryBuilder.js +371 -0
  29. package/lib/src/model/query/fetchInstance.d.ts +24 -0
  30. package/lib/src/model/query/fetchInstance.js +144 -0
  31. package/lib/src/model/query/hydration.d.ts +54 -0
  32. package/lib/src/model/query/hydration.js +214 -0
  33. package/lib/src/model/query/operations.d.ts +59 -0
  34. package/lib/src/model/query/operations.js +384 -0
  35. package/lib/src/model/query/snapshot.d.ts +59 -0
  36. package/lib/src/model/query/snapshot.js +106 -0
  37. package/lib/src/model/query/surrealCompiler.d.ts +42 -0
  38. package/lib/src/model/query/surrealCompiler.js +304 -0
  39. package/lib/src/model/schema/fromJSONSchema.d.ts +67 -0
  40. package/lib/src/model/schema/fromJSONSchema.js +264 -0
  41. package/lib/src/model/schema/metadata.d.ts +15 -0
  42. package/lib/src/model/schema/metadata.js +112 -0
  43. package/lib/src/model/subscription.d.ts +47 -0
  44. package/lib/src/model/subscription.js +231 -0
  45. package/lib/src/model/transaction.d.ts +27 -0
  46. package/lib/src/model/transaction.js +32 -0
  47. package/lib/src/model/types.d.ts +195 -0
  48. package/lib/src/model/types.js +8 -0
  49. package/lib/src/model/util.d.ts +6 -6
  50. package/lib/src/model/util.js +22 -22
  51. package/lib/src/neighbourhood/NeighbourhoodClient.js +31 -12
  52. package/lib/src/perspectives/PerspectiveProxy.d.ts +9 -9
  53. package/lib/src/perspectives/PerspectiveProxy.js +63 -51
  54. package/lib/src/shacl/SHACLShape.d.ts +9 -0
  55. package/lib/src/shacl/SHACLShape.js +28 -4
  56. package/lib/src/shims/reflect-metadata.d.ts +0 -0
  57. package/lib/src/shims/type-graphql.d.ts +32 -0
  58. package/lib/src/src/Ad4mClient.d.ts +28 -0
  59. package/lib/src/src/Address.d.ts +1 -0
  60. package/lib/src/src/DID.d.ts +1 -0
  61. package/lib/src/src/Exception.d.ts +7 -0
  62. package/lib/src/src/Literal.d.ts +7 -0
  63. package/lib/src/src/PubSub.d.ts +17 -0
  64. package/lib/src/src/SmartLiteral.d.ts +12 -0
  65. package/lib/src/src/agent/Agent.d.ts +110 -0
  66. package/lib/src/src/agent/AgentClient.d.ts +62 -0
  67. package/lib/src/src/agent/AgentResolver.d.ts +30 -0
  68. package/lib/src/src/agent/AgentStatus.d.ts +8 -0
  69. package/lib/src/src/ai/AIClient.d.ts +32 -0
  70. package/lib/src/src/ai/AIResolver.d.ts +75 -0
  71. package/lib/src/src/ai/Tasks.d.ts +37 -0
  72. package/lib/src/src/buildSchema.d.ts +1 -0
  73. package/lib/src/src/expression/Expression.d.ts +28 -0
  74. package/lib/src/src/expression/ExpressionClient.d.ts +13 -0
  75. package/lib/src/src/expression/ExpressionRef.d.ts +9 -0
  76. package/lib/src/src/expression/ExpressionResolver.d.ts +10 -0
  77. package/lib/src/src/index.d.ts +35 -0
  78. package/lib/src/src/jestSetup.d.ts +1 -0
  79. package/lib/src/src/language/Icon.d.ts +4 -0
  80. package/lib/src/src/language/Language.d.ts +206 -0
  81. package/lib/src/src/language/LanguageClient.d.ts +17 -0
  82. package/lib/src/src/language/LanguageContext.d.ts +37 -0
  83. package/lib/src/src/language/LanguageHandle.d.ts +9 -0
  84. package/lib/src/src/language/LanguageMeta.d.ts +35 -0
  85. package/lib/src/src/language/LanguageRef.d.ts +6 -0
  86. package/lib/src/src/language/LanguageResolver.d.ts +19 -0
  87. package/lib/src/src/links/Links.d.ts +39 -0
  88. package/lib/src/src/links/Links.test.d.ts +1 -0
  89. package/lib/src/src/model/Ad4mModel.d.ts +1438 -0
  90. package/lib/src/src/model/Ad4mModel.test.d.ts +1 -0
  91. package/lib/src/src/model/Subject.d.ts +25 -0
  92. package/lib/src/src/model/decorators.d.ts +545 -0
  93. package/lib/src/src/model/util.d.ts +12 -0
  94. package/lib/src/src/neighbourhood/Neighbourhood.d.ts +10 -0
  95. package/lib/src/src/neighbourhood/NeighbourhoodClient.d.ts +25 -0
  96. package/lib/src/src/neighbourhood/NeighbourhoodProxy.d.ts +19 -0
  97. package/lib/src/src/neighbourhood/NeighbourhoodProxy.test.d.ts +1 -0
  98. package/lib/src/src/neighbourhood/NeighbourhoodResolver.d.ts +24 -0
  99. package/lib/src/src/perspectives/LinkQuery.d.ts +11 -0
  100. package/lib/src/src/perspectives/Perspective.d.ts +38 -0
  101. package/lib/src/src/perspectives/Perspective.test.d.ts +1 -0
  102. package/lib/src/src/perspectives/PerspectiveClient.d.ts +97 -0
  103. package/lib/src/src/perspectives/PerspectiveDiff.d.ts +9 -0
  104. package/lib/src/src/perspectives/PerspectiveHandle.d.ts +18 -0
  105. package/lib/src/src/perspectives/PerspectiveProxy.d.ts +865 -0
  106. package/lib/src/src/perspectives/PerspectiveResolver.d.ts +57 -0
  107. package/lib/src/src/runtime/RuntimeClient.d.ts +56 -0
  108. package/lib/src/src/runtime/RuntimeResolver.d.ts +132 -0
  109. package/lib/src/src/shacl/SHACLFlow.d.ts +171 -0
  110. package/lib/src/src/shacl/SHACLFlow.test.d.ts +1 -0
  111. package/lib/src/src/shacl/SHACLShape.d.ts +117 -0
  112. package/lib/src/src/shacl/SHACLShape.test.d.ts +1 -0
  113. package/lib/src/src/typeDefs.d.ts +1 -0
  114. package/lib/src/src/unwrapApolloResult.d.ts +2 -0
  115. package/lib/src/src/utils.d.ts +25 -0
  116. package/package.json +20 -24
  117. package/src/model/Ad4mModel.test.ts +132 -149
  118. package/src/model/Ad4mModel.ts +1930 -784
  119. package/src/model/Subject.ts +24 -24
  120. package/src/model/decorators.ts +626 -482
  121. package/src/model/util.ts +22 -22
  122. package/src/neighbourhood/NeighbourhoodClient.ts +32 -16
  123. package/src/perspectives/PerspectiveProxy.ts +69 -55
  124. package/src/shacl/SHACLShape.ts +33 -4
@@ -0,0 +1,35 @@
1
+ export declare class LanguageMeta {
2
+ name: string;
3
+ address: string;
4
+ description: string;
5
+ author: string;
6
+ templated: boolean;
7
+ templateSourceLanguageAddress?: string;
8
+ templateAppliedParams?: string;
9
+ possibleTemplateParams?: string[];
10
+ sourceCodeLink?: string;
11
+ }
12
+ export declare class LanguageMetaInput {
13
+ name: string;
14
+ description: string;
15
+ possibleTemplateParams?: string[];
16
+ sourceCodeLink?: string;
17
+ constructor(name?: string, description?: string);
18
+ }
19
+ export declare class LanguageMetaInternal {
20
+ name: string;
21
+ address: string;
22
+ description: string;
23
+ templateSourceLanguageAddress?: string;
24
+ templateAppliedParams?: string;
25
+ possibleTemplateParams?: string[];
26
+ sourceCodeLink?: string;
27
+ }
28
+ declare const LanguageExpression_base: any;
29
+ export declare class LanguageExpression extends LanguageExpression_base {
30
+ }
31
+ export declare class LanguageLanguageInput {
32
+ bundle: string;
33
+ meta: LanguageMetaInternal;
34
+ }
35
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { Address } from '../Address';
2
+ export declare class LanguageRef {
3
+ address: Address;
4
+ name: string;
5
+ constructor(address?: Address, name?: string);
6
+ }
@@ -0,0 +1,19 @@
1
+ import { LanguageHandle } from "./LanguageHandle";
2
+ import { LanguageMeta, LanguageMetaInput } from "./LanguageMeta";
3
+ import { LanguageRef } from "./LanguageRef";
4
+ /**
5
+ * Resolver classes are used here to define the GraphQL schema
6
+ * (through the type-graphql annotations)
7
+ * and are spawned in the client tests in Ad4mClient.test.ts.
8
+ * For the latter, they return test fixtures.
9
+ */
10
+ export default class LanguageResolver {
11
+ language(address: string): LanguageHandle;
12
+ languages(filter: string): LanguageHandle[];
13
+ languageWriteSettings(languageAddress: string, settings: string): Boolean;
14
+ languageApplyTemplateAndPublish(sourceLanguageHash: string, templateData: string): LanguageRef;
15
+ languagePublish(languagePath: string, languageMeta: LanguageMetaInput): LanguageMeta;
16
+ languageMeta(address: string): LanguageMeta;
17
+ languageSource(address: string): string;
18
+ languageRemove(address: string): Boolean;
19
+ }
@@ -0,0 +1,39 @@
1
+ import { LinkStatus } from "../perspectives/PerspectiveProxy";
2
+ export declare class Link {
3
+ source: string;
4
+ target: string;
5
+ predicate?: string;
6
+ constructor(obj: any);
7
+ }
8
+ export declare class LinkMutations {
9
+ additions: LinkInput[];
10
+ removals: LinkExpressionInput[];
11
+ }
12
+ export declare class LinkExpressionMutations {
13
+ additions: LinkExpression[];
14
+ removals: LinkExpression[];
15
+ constructor(additions: LinkExpression[], removals: LinkExpression[]);
16
+ }
17
+ export declare class LinkInput {
18
+ source: string;
19
+ target: string;
20
+ predicate?: string;
21
+ }
22
+ declare const LinkExpression_base: any;
23
+ export declare class LinkExpression extends LinkExpression_base {
24
+ hash(): number;
25
+ status?: LinkStatus;
26
+ }
27
+ declare const LinkExpressionInput_base: any;
28
+ export declare class LinkExpressionInput extends LinkExpressionInput_base {
29
+ hash: () => number;
30
+ status?: LinkStatus;
31
+ }
32
+ export declare function linkEqual(l1: LinkExpression, l2: LinkExpression): boolean;
33
+ export declare function isLink(l: any): boolean;
34
+ export declare class LinkExpressionUpdated {
35
+ oldLink: LinkExpression;
36
+ newLink: LinkExpression;
37
+ constructor(oldLink: LinkExpression, newLink: LinkExpression);
38
+ }
39
+ export {};
@@ -0,0 +1 @@
1
+ export {};