@coasys/ad4m 0.8.0

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 (114) hide show
  1. package/README.md +229 -0
  2. package/jest-setup.ts +1 -0
  3. package/jest.config.js +6 -0
  4. package/jsdoc.json +28 -0
  5. package/lib/index.cjs +8144 -0
  6. package/lib/shims/reflect-metadata.d.ts +0 -0
  7. package/lib/shims/type-graphql.d.ts +32 -0
  8. package/lib/src/Ad4mClient.d.ts +26 -0
  9. package/lib/src/Address.d.ts +1 -0
  10. package/lib/src/DID.d.ts +1 -0
  11. package/lib/src/Exception.d.ts +6 -0
  12. package/lib/src/Literal.d.ts +7 -0
  13. package/lib/src/PubSub.d.ts +14 -0
  14. package/lib/src/SmartLiteral.d.ts +12 -0
  15. package/lib/src/agent/Agent.d.ts +104 -0
  16. package/lib/src/agent/AgentClient.d.ts +57 -0
  17. package/lib/src/agent/AgentResolver.d.ts +30 -0
  18. package/lib/src/agent/AgentStatus.d.ts +8 -0
  19. package/lib/src/buildSchema.d.ts +1 -0
  20. package/lib/src/expression/Expression.d.ts +28 -0
  21. package/lib/src/expression/ExpressionClient.d.ts +13 -0
  22. package/lib/src/expression/ExpressionRef.d.ts +9 -0
  23. package/lib/src/expression/ExpressionResolver.d.ts +10 -0
  24. package/lib/src/index.d.ts +30 -0
  25. package/lib/src/jestSetup.d.ts +1 -0
  26. package/lib/src/language/Icon.d.ts +4 -0
  27. package/lib/src/language/Language.d.ts +195 -0
  28. package/lib/src/language/LanguageClient.d.ts +17 -0
  29. package/lib/src/language/LanguageContext.d.ts +37 -0
  30. package/lib/src/language/LanguageHandle.d.ts +9 -0
  31. package/lib/src/language/LanguageMeta.d.ts +35 -0
  32. package/lib/src/language/LanguageRef.d.ts +6 -0
  33. package/lib/src/language/LanguageResolver.d.ts +19 -0
  34. package/lib/src/links/Links.d.ts +39 -0
  35. package/lib/src/links/Links.test.d.ts +1 -0
  36. package/lib/src/neighbourhood/Neighbourhood.d.ts +10 -0
  37. package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +25 -0
  38. package/lib/src/neighbourhood/NeighbourhoodProxy.d.ts +19 -0
  39. package/lib/src/neighbourhood/NeighbourhoodResolver.d.ts +24 -0
  40. package/lib/src/perspectives/LinkQuery.d.ts +11 -0
  41. package/lib/src/perspectives/Perspective.d.ts +38 -0
  42. package/lib/src/perspectives/Perspective.test.d.ts +1 -0
  43. package/lib/src/perspectives/PerspectiveClient.d.ts +54 -0
  44. package/lib/src/perspectives/PerspectiveDiff.d.ts +9 -0
  45. package/lib/src/perspectives/PerspectiveHandle.d.ts +16 -0
  46. package/lib/src/perspectives/PerspectiveProxy.d.ts +178 -0
  47. package/lib/src/perspectives/PerspectiveResolver.d.ts +37 -0
  48. package/lib/src/runtime/RuntimeClient.d.ts +33 -0
  49. package/lib/src/runtime/RuntimeResolver.d.ts +47 -0
  50. package/lib/src/schema.gql +382 -0
  51. package/lib/src/subject/SDNADecorators.d.ts +45 -0
  52. package/lib/src/subject/Subject.d.ts +7 -0
  53. package/lib/src/subject/SubjectEntity.d.ts +31 -0
  54. package/lib/src/subject/util.d.ts +12 -0
  55. package/lib/src/typeDefs.d.ts +1 -0
  56. package/lib/src/unwrapApolloResult.d.ts +2 -0
  57. package/lib/src/utils.d.ts +2 -0
  58. package/package.json +60 -0
  59. package/rollup.config.js +27 -0
  60. package/shims/reflect-metadata.ts +0 -0
  61. package/shims/type-graphql.ts +75 -0
  62. package/src/Ad4mClient.test.ts +1085 -0
  63. package/src/Ad4mClient.ts +63 -0
  64. package/src/Address.ts +1 -0
  65. package/src/DID.ts +1 -0
  66. package/src/Exception.ts +6 -0
  67. package/src/Literal.test.ts +31 -0
  68. package/src/Literal.ts +81 -0
  69. package/src/PubSub.ts +14 -0
  70. package/src/SmartLiteral.ts +75 -0
  71. package/src/agent/Agent.ts +293 -0
  72. package/src/agent/AgentClient.ts +531 -0
  73. package/src/agent/AgentResolver.ts +263 -0
  74. package/src/agent/AgentStatus.ts +44 -0
  75. package/src/buildSchema.ts +41 -0
  76. package/src/expression/Expression.ts +99 -0
  77. package/src/expression/ExpressionClient.ts +99 -0
  78. package/src/expression/ExpressionRef.ts +63 -0
  79. package/src/expression/ExpressionResolver.ts +64 -0
  80. package/src/index.ts +30 -0
  81. package/src/jestSetup.ts +1 -0
  82. package/src/language/Icon.ts +11 -0
  83. package/src/language/Language.ts +266 -0
  84. package/src/language/LanguageClient.ts +160 -0
  85. package/src/language/LanguageContext.ts +37 -0
  86. package/src/language/LanguageHandle.ts +23 -0
  87. package/src/language/LanguageMeta.ts +70 -0
  88. package/src/language/LanguageRef.ts +18 -0
  89. package/src/language/LanguageResolver.ts +98 -0
  90. package/src/links/Links.test.ts +40 -0
  91. package/src/links/Links.ts +107 -0
  92. package/src/neighbourhood/Neighbourhood.ts +22 -0
  93. package/src/neighbourhood/NeighbourhoodClient.ts +276 -0
  94. package/src/neighbourhood/NeighbourhoodProxy.ts +58 -0
  95. package/src/neighbourhood/NeighbourhoodResolver.ts +100 -0
  96. package/src/perspectives/LinkQuery.ts +66 -0
  97. package/src/perspectives/Perspective.test.ts +23 -0
  98. package/src/perspectives/Perspective.ts +118 -0
  99. package/src/perspectives/PerspectiveClient.ts +444 -0
  100. package/src/perspectives/PerspectiveDiff.ts +15 -0
  101. package/src/perspectives/PerspectiveHandle.ts +39 -0
  102. package/src/perspectives/PerspectiveProxy.ts +611 -0
  103. package/src/perspectives/PerspectiveResolver.ts +220 -0
  104. package/src/runtime/RuntimeClient.ts +283 -0
  105. package/src/runtime/RuntimeResolver.ts +193 -0
  106. package/src/subject/SDNADecorators.ts +334 -0
  107. package/src/subject/Subject.ts +153 -0
  108. package/src/subject/SubjectEntity.ts +292 -0
  109. package/src/subject/util.ts +85 -0
  110. package/src/typeDefs.ts +6 -0
  111. package/src/unwrapApolloResult.ts +14 -0
  112. package/src/utils.ts +25 -0
  113. package/tsconfig-browser.json +82 -0
  114. package/tsconfig.json +80 -0
@@ -0,0 +1,47 @@
1
+ import { Perspective, PerspectiveExpression, PerspectiveInput } from "../perspectives/Perspective";
2
+ import { ExceptionType } from "../Exception";
3
+ export declare class SentMessage {
4
+ recipient: string;
5
+ message: PerspectiveExpression;
6
+ }
7
+ export declare class RuntimeInfo {
8
+ ad4mExecutorVersion: string;
9
+ isInitialized: Boolean;
10
+ isUnlocked: Boolean;
11
+ }
12
+ export declare class ExceptionInfo {
13
+ title: string;
14
+ message: string;
15
+ type: ExceptionType;
16
+ addon?: string;
17
+ }
18
+ /**
19
+ * Resolver classes are used here to define the GraphQL schema
20
+ * (through the type-graphql annotations)
21
+ * and are spawned in the client tests in Ad4mClient.test.ts.
22
+ * For the latter, they return test fixtures.
23
+ */
24
+ export default class RuntimeResolver {
25
+ runtimeQuit(): Boolean;
26
+ runtimeOpenLink(url: string): Boolean;
27
+ runtimeInfo(): RuntimeInfo;
28
+ addTrustedAgents(agents: string[]): string[];
29
+ deleteTrustedAgents(agents: string[]): string[];
30
+ getTrustedAgents(): string[];
31
+ runtimeKnownLinkLanguageTemplates(): string[];
32
+ runtimeAddKnownLinkLanguageTemplates(addresses: string[]): string[];
33
+ runtimeRemoveKnownLinkLanguageTemplates(addresses: string[]): string[];
34
+ runtimeFriends(): string[];
35
+ runtimeAddFriends(dids: string[]): string[];
36
+ runtimeRemoveFriends(dids: string[]): string[];
37
+ runtimeHcAgentInfos(): String;
38
+ runtimeHcAddAgentInfos(agentInfos: any): boolean;
39
+ runtimeVerifyStringSignedByDid(did: string, didSigningKeyId: string, data: string, signedData: string): boolean;
40
+ runtimeSetStatus(status: Perspective): boolean;
41
+ runtimeFriendStatus(did: string): PerspectiveExpression;
42
+ runtimeFriendSendMessage(did: string, message: PerspectiveInput): boolean;
43
+ runtimeMessageInbox(filter?: string): PerspectiveExpression[];
44
+ runtimeMessageOutbox(filter?: string): SentMessage[];
45
+ runtimeMessageReceived(): PerspectiveExpression;
46
+ exceptionOccurred(): ExceptionInfo;
47
+ }
@@ -0,0 +1,382 @@
1
+ # -----------------------------------------------
2
+ # !!! THIS FILE WAS GENERATED BY TYPE-GRAPHQL !!!
3
+ # !!! DO NOT MODIFY THIS FILE BY YOURSELF !!!
4
+ # -----------------------------------------------
5
+
6
+ type Agent {
7
+ did: String!
8
+ directMessageLanguage: String
9
+ perspective: Perspective
10
+ }
11
+
12
+ type AgentSignature {
13
+ publicKey: String!
14
+ signature: String!
15
+ }
16
+
17
+ type AgentStatus {
18
+ did: String
19
+ didDocument: String
20
+ error: String
21
+ isInitialized: Boolean!
22
+ isUnlocked: Boolean!
23
+ }
24
+
25
+ type Apps {
26
+ auth: AuthInfo!
27
+ requestId: String!
28
+ revoked: Boolean
29
+ token: String!
30
+ }
31
+
32
+ type AuthInfo {
33
+ appDesc: String!
34
+ appIconPath: String
35
+ appName: String!
36
+ appUrl: String!
37
+ capabilities: [Capability!]!
38
+ }
39
+
40
+ input AuthInfoInput {
41
+ appDesc: String!
42
+ appDomain: String!
43
+ appIconPath: String
44
+ appName: String!
45
+ appUrl: String
46
+ capabilities: [CapabilityInput!]
47
+ }
48
+
49
+ type Capability {
50
+ can: [String!]!
51
+ with: Resource!
52
+ }
53
+
54
+ input CapabilityInput {
55
+ can: [String!]!
56
+ with: ResourceInput!
57
+ }
58
+
59
+ # The javascript `Date` as string. Type represents date and time as the ISO Date string.
60
+ scalar DateTime
61
+
62
+ type EntanglementProof {
63
+ deviceKey: String!
64
+ deviceKeySignedByDid: String!
65
+ deviceKeyType: String!
66
+ did: String!
67
+ didSignedByDeviceKey: String
68
+ didSigningKeyId: String!
69
+ }
70
+
71
+ input EntanglementProofInput {
72
+ deviceKey: String!
73
+ deviceKeySignedByDid: String!
74
+ deviceKeyType: String!
75
+ did: String!
76
+ didSignedByDeviceKey: String!
77
+ didSigningKeyId: String!
78
+ }
79
+
80
+ type ExceptionInfo {
81
+ addon: String
82
+ message: String!
83
+ title: String!
84
+ type: Float!
85
+ }
86
+
87
+ type ExpressionProof {
88
+ invalid: Boolean
89
+ key: String
90
+ signature: String
91
+ valid: Boolean
92
+ }
93
+
94
+ input ExpressionProofInput {
95
+ invalid: Boolean
96
+ key: String
97
+ signature: String
98
+ valid: Boolean
99
+ }
100
+
101
+ type ExpressionRendered {
102
+ author: String!
103
+ data: String!
104
+ icon: Icon!
105
+ language: LanguageRef!
106
+ proof: ExpressionProof!
107
+ timestamp: String!
108
+ }
109
+
110
+ type Icon {
111
+ code: String!
112
+ }
113
+
114
+ input InteractionCall {
115
+ name: String!
116
+ parametersStringified: String!
117
+ }
118
+
119
+ type InteractionMeta {
120
+ label: String!
121
+ name: String!
122
+ parameters: [InteractionParameter!]!
123
+ }
124
+
125
+ type InteractionParameter {
126
+ name: String!
127
+ type: String!
128
+ }
129
+
130
+ type LanguageHandle {
131
+ address: String!
132
+ constructorIcon: Icon
133
+ icon: Icon
134
+ name: String!
135
+ settings: String
136
+ settingsIcon: Icon
137
+ }
138
+
139
+ type LanguageMeta {
140
+ address: String!
141
+ author: String!
142
+ description: String
143
+ name: String!
144
+ possibleTemplateParams: [String!]
145
+ sourceCodeLink: String
146
+ templateAppliedParams: String
147
+ templateSourceLanguageAddress: String
148
+ templated: Boolean
149
+ }
150
+
151
+ input LanguageMetaInput {
152
+ description: String = ""
153
+ name: String!
154
+ possibleTemplateParams: [String!]
155
+ sourceCodeLink: String
156
+ }
157
+
158
+ type LanguageRef {
159
+ address: String!
160
+ name: String!
161
+ }
162
+
163
+ type Link {
164
+ predicate: String
165
+ source: String!
166
+ target: String!
167
+ }
168
+
169
+ type LinkExpression {
170
+ author: String!
171
+ data: Link!
172
+ proof: ExpressionProof!
173
+ status: String
174
+ timestamp: String!
175
+ }
176
+
177
+ input LinkExpressionInput {
178
+ author: String!
179
+ data: LinkInput!
180
+ proof: ExpressionProofInput!
181
+ status: String = "shared"
182
+ timestamp: String!
183
+ }
184
+
185
+ type LinkExpressionMutations {
186
+ additions: [LinkExpression!]!
187
+ removals: [LinkExpression!]!
188
+ }
189
+
190
+ type LinkExpressionUpdated {
191
+ newLink: LinkExpression!
192
+ oldLink: LinkExpression!
193
+ }
194
+
195
+ input LinkInput {
196
+ predicate: String
197
+ source: String!
198
+ target: String!
199
+ }
200
+
201
+ input LinkMutations {
202
+ additions: [LinkInput!]!
203
+ removals: [LinkExpressionInput!]!
204
+ }
205
+
206
+ input LinkQuery {
207
+ fromDate: DateTime
208
+ limit: Float
209
+ predicate: String
210
+ source: String
211
+ target: String
212
+ untilDate: DateTime
213
+ }
214
+
215
+ type Mutation {
216
+ addTrustedAgents(agents: [String!]!): [String!]!
217
+ agentAddEntanglementProofs(proofs: [EntanglementProofInput!]!): [EntanglementProof!]!
218
+ agentDeleteEntanglementProofs(proofs: [EntanglementProofInput!]!): [EntanglementProof!]!
219
+ agentEntanglementProofPreFlight(deviceKey: String!, deviceKeyType: String!): EntanglementProof!
220
+ agentGenerate(passphrase: String!): AgentStatus!
221
+ agentGenerateJwt(rand: String!, requestId: String!): String!
222
+ agentImport(did: String!, didDocument: String!, keystore: String!, passphrase: String!): AgentStatus!
223
+ agentLock(passphrase: String!): AgentStatus!
224
+ agentPermitCapability(auth: String!): String!
225
+ agentRemoveApp(requestId: String!): [Apps!]!
226
+ agentRequestCapability(authInfo: AuthInfoInput!): String!
227
+ agentRevokeToken(requestId: String!): [Apps!]!
228
+ agentSignMessage(message: String!): AgentSignature!
229
+ agentUnlock(holochain: Boolean!, passphrase: String!): AgentStatus!
230
+ agentUpdateDirectMessageLanguage(directMessageLanguage: String!): Agent!
231
+ agentUpdatePublicPerspective(perspective: PerspectiveInput!): Agent!
232
+ deleteTrustedAgents(agents: [String!]!): [String!]!
233
+ expressionCreate(content: String!, languageAddress: String!): String!
234
+ expressionInteract(interactionCall: InteractionCall!, url: String!): String
235
+ languageApplyTemplateAndPublish(sourceLanguageHash: String!, templateData: String!): LanguageRef!
236
+ languagePublish(languageMeta: LanguageMetaInput!, languagePath: String!): LanguageMeta!
237
+ languageRemove(address: String!): Boolean!
238
+ languageWriteSettings(languageAddress: String!, settings: String!): Boolean!
239
+ neighbourhoodJoinFromUrl(url: String!): PerspectiveHandle!
240
+ neighbourhoodPublishFromPerspective(linkLanguage: String!, meta: PerspectiveInput!, perspectiveUUID: String!): String!
241
+ neighbourhoodSendBroadcast(payload: PerspectiveInput!, perspectiveUUID: String!): Boolean!
242
+ neighbourhoodSendBroadcastU(payload: PerspectiveUnsignedInput!, perspectiveUUID: String!): Boolean!
243
+ neighbourhoodSendSignal(payload: PerspectiveInput!, perspectiveUUID: String!, remoteAgentDid: String!): Boolean!
244
+ neighbourhoodSendSignalU(payload: PerspectiveUnsignedInput!, perspectiveUUID: String!, remoteAgentDid: String!): Boolean!
245
+ neighbourhoodSetOnlineStatus(perspectiveUUID: String!, status: PerspectiveInput!): Boolean!
246
+ neighbourhoodSetOnlineStatusU(perspectiveUUID: String!, status: PerspectiveUnsignedInput!): Boolean!
247
+ perspectiveAdd(name: String!): PerspectiveHandle!
248
+ perspectiveAddLink(link: LinkInput!, status: String = "shared", uuid: String!): LinkExpression!
249
+ perspectiveAddLinkExpression(link: LinkExpressionInput!, status: String, uuid: String!): LinkExpression!
250
+ perspectiveAddLinks(links: [LinkInput!]!, status: String, uuid: String!): [LinkExpression!]!
251
+ perspectiveLinkMutations(mutations: LinkMutations!, status: String, uuid: String!): LinkExpressionMutations!
252
+ perspectivePublishSnapshot(uuid: String!): String
253
+ perspectiveRemove(uuid: String!): Boolean!
254
+ perspectiveRemoveLink(link: LinkExpressionInput!, uuid: String!): Boolean!
255
+ perspectiveRemoveLinks(links: [LinkExpressionInput!]!, uuid: String!): [LinkExpression!]!
256
+ perspectiveUpdate(name: String!, uuid: String!): PerspectiveHandle
257
+ perspectiveUpdateLink(newLink: LinkInput!, oldLink: LinkExpressionInput!, uuid: String!): LinkExpression!
258
+ runtimeAddFriends(dids: [String!]!): [String!]!
259
+ runtimeAddKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
260
+ runtimeFriendSendMessage(did: String!, message: PerspectiveInput!): Boolean!
261
+ runtimeHcAddAgentInfos(agentInfos: String!): Boolean!
262
+ runtimeOpenLink(url: String!): Boolean!
263
+ runtimeQuit: Boolean!
264
+ runtimeRemoveFriends(dids: [String!]!): [String!]!
265
+ runtimeRemoveKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
266
+ runtimeSetStatus(status: PerspectiveInput!): Boolean!
267
+ }
268
+
269
+ type Neighbourhood {
270
+ linkLanguage: String!
271
+ meta: Perspective!
272
+ }
273
+
274
+ type NeighbourhoodExpression {
275
+ author: String!
276
+ data: Neighbourhood!
277
+ proof: ExpressionProof!
278
+ timestamp: String!
279
+ }
280
+
281
+ type OnlineAgent {
282
+ did: String!
283
+ status: PerspectiveExpression!
284
+ }
285
+
286
+ type Perspective {
287
+ links: [LinkExpression!]!
288
+ }
289
+
290
+ type PerspectiveExpression {
291
+ author: String!
292
+ data: Perspective!
293
+ proof: ExpressionProof!
294
+ timestamp: String!
295
+ }
296
+
297
+ type PerspectiveHandle {
298
+ name: String!
299
+ neighbourhood: NeighbourhoodExpression
300
+ sharedUrl: String
301
+ state: String!
302
+ uuid: String!
303
+ }
304
+
305
+ input PerspectiveInput {
306
+ links: [LinkExpressionInput!]!
307
+ }
308
+
309
+ input PerspectiveUnsignedInput {
310
+ links: [LinkInput!] = []
311
+ }
312
+
313
+ type Query {
314
+ agent: Agent!
315
+ agentByDID(did: String!): Agent
316
+ agentGetApps: [Apps!]!
317
+ agentGetEntanglementProofs: [EntanglementProof!]!
318
+ agentIsLocked: Boolean!
319
+ agentStatus: AgentStatus!
320
+ expression(url: String!): ExpressionRendered
321
+ expressionInteractions(url: String!): [InteractionMeta!]!
322
+ expressionMany(urls: [String!]!): [ExpressionRendered]!
323
+ expressionRaw(url: String!): String
324
+ getTrustedAgents: [String!]!
325
+ language(address: String!): LanguageHandle
326
+ languageMeta(address: String!): LanguageMeta!
327
+ languageSource(address: String!): String!
328
+ languages(filter: String): [LanguageHandle!]!
329
+ neighbourhoodHasTelepresenceAdapter(perspectiveUUID: String!): Boolean!
330
+ neighbourhoodOnlineAgents(perspectiveUUID: String!): [OnlineAgent!]!
331
+ neighbourhoodOtherAgents(perspectiveUUID: String!): [String!]!
332
+ perspective(uuid: String!): PerspectiveHandle
333
+ perspectiveQueryLinks(query: LinkQuery!, uuid: String!): [LinkExpression!]
334
+ perspectiveQueryProlog(query: String!, uuid: String!): String!
335
+ perspectiveSnapshot(uuid: String!): Perspective
336
+ perspectives: [PerspectiveHandle!]!
337
+ runtimeFriendStatus(did: String!): PerspectiveExpression
338
+ runtimeFriends: [String!]!
339
+ runtimeHcAgentInfos: String!
340
+ runtimeInfo: RuntimeInfo!
341
+ runtimeKnownLinkLanguageTemplates: [String!]!
342
+ runtimeMessageInbox(filter: String): [PerspectiveExpression!]!
343
+ runtimeMessageOutbox(filter: String): [SentMessage!]!
344
+ runtimeVerifyStringSignedByDid(data: String!, did: String!, didSigningKeyId: String!, signedData: String!): Boolean!
345
+ }
346
+
347
+ type Resource {
348
+ domain: String!
349
+ pointers: [String!]!
350
+ }
351
+
352
+ input ResourceInput {
353
+ domain: String!
354
+ pointers: [String!]!
355
+ }
356
+
357
+ type RuntimeInfo {
358
+ ad4mExecutorVersion: String!
359
+ isInitialized: Boolean!
360
+ isUnlocked: Boolean!
361
+ }
362
+
363
+ type SentMessage {
364
+ message: PerspectiveExpression!
365
+ recipient: String!
366
+ }
367
+
368
+ type Subscription {
369
+ agentAppsChanged: [Apps!]
370
+ agentStatusChanged: AgentStatus
371
+ agentUpdated: Agent
372
+ exceptionOccurred: ExceptionInfo
373
+ neighbourhoodSignal(perspectiveUUID: String!): PerspectiveExpression
374
+ perspectiveAdded: PerspectiveHandle
375
+ perspectiveLinkAdded(uuid: String!): LinkExpression
376
+ perspectiveLinkRemoved(uuid: String!): LinkExpression
377
+ perspectiveLinkUpdated(uuid: String!): LinkExpressionUpdated
378
+ perspectiveRemoved: String
379
+ perspectiveSyncStateChange(uuid: String!): String!
380
+ perspectiveUpdated: PerspectiveHandle
381
+ runtimeMessageReceived: PerspectiveExpression
382
+ }
@@ -0,0 +1,45 @@
1
+ export declare class PerspectiveAction {
2
+ action: string;
3
+ source: string;
4
+ predicate: string;
5
+ target: string;
6
+ }
7
+ export declare function addLink(source: string, predicate: string, target: string): PerspectiveAction;
8
+ export declare function hasLink(predicate: string): string;
9
+ interface InstanceQueryParams {
10
+ where?: object;
11
+ condition?: string;
12
+ }
13
+ export declare function instanceQuery(options?: InstanceQueryParams): <T>(target: T, key: keyof T, descriptor: PropertyDescriptor) => void;
14
+ interface PropertyOptions {
15
+ through?: string;
16
+ initial?: string;
17
+ required?: boolean;
18
+ writable?: boolean;
19
+ resolveLanguage?: string;
20
+ getter?: string;
21
+ setter?: string;
22
+ local?: boolean;
23
+ }
24
+ export declare function subjectProperty(opts: PropertyOptions): <T>(target: T, key: keyof T) => void;
25
+ interface FlagOptions {
26
+ through: string;
27
+ value: string;
28
+ }
29
+ export declare function subjectFlag(opts: FlagOptions): <T>(target: T, key: keyof T) => void;
30
+ interface WhereOptions {
31
+ isInstance?: any;
32
+ condition?: string;
33
+ }
34
+ interface CollectionOptions {
35
+ through: string;
36
+ where?: WhereOptions;
37
+ local?: boolean;
38
+ }
39
+ export declare function subjectCollection(opts: CollectionOptions): <T>(target: T, key: keyof T) => void;
40
+ export declare function makeRandomPrologAtom(length: number): string;
41
+ interface SDNAClassOptions {
42
+ name: string;
43
+ }
44
+ export declare function SDNAClass(opts: SDNAClassOptions): (target: any) => void;
45
+ export {};
@@ -0,0 +1,7 @@
1
+ import { PerspectiveProxy } from "../perspectives/PerspectiveProxy";
2
+ export declare class Subject {
3
+ #private;
4
+ constructor(perspective: PerspectiveProxy, baseExpression: string, subjectClass: string);
5
+ get baseExpression(): string;
6
+ init(): Promise<void>;
7
+ }
@@ -0,0 +1,31 @@
1
+ import { PerspectiveProxy } from "../perspectives/PerspectiveProxy";
2
+ export type QueryPartialEntity<T> = {
3
+ [P in keyof T]?: T[P] | (() => string);
4
+ };
5
+ export declare class SubjectEntity {
6
+ #private;
7
+ author: string;
8
+ timestamp: string;
9
+ constructor(perspective: PerspectiveProxy, baseExpression?: string, source?: string);
10
+ get baseExpression(): string;
11
+ private getData;
12
+ private setProperty;
13
+ private setCollectionSetter;
14
+ private setCollectionAdder;
15
+ private setCollectionRemover;
16
+ save(): Promise<void>;
17
+ update(): Promise<void>;
18
+ get(): Promise<this>;
19
+ delete(): Promise<void>;
20
+ static all(perspective: PerspectiveProxy): Promise<any[]>;
21
+ static query(perspective: PerspectiveProxy, query?: SubjectEntityQueryParam): Promise<SubjectEntity[]>;
22
+ }
23
+ export type SubjectArray<T> = T[] | {
24
+ action: 'setter' | 'adder' | 'remover';
25
+ value: T[];
26
+ };
27
+ export type SubjectEntityQueryParam = {
28
+ source?: string;
29
+ size?: number;
30
+ page?: number;
31
+ };
@@ -0,0 +1,12 @@
1
+ export declare function capitalize(str: string): string;
2
+ export declare function propertyNameToSetterName(property: string): string;
3
+ export declare function setterNameToPropertyName(setter: string): string;
4
+ export declare function singularToPlural(singular: string): string;
5
+ export declare function pluralToSingular(plural: string): string;
6
+ export declare function collectionToAdderName(collection: string): string;
7
+ export declare function collectionAdderToName(adderName: string): string;
8
+ export declare function collectionToRemoverName(collection: string): string;
9
+ export declare function collectionRemoverToName(removerName: string): string;
10
+ export declare function collectionSetterToName(adderName: string): string;
11
+ export declare function collectionToSetterName(collection: string): string;
12
+ export declare function stringifyObjectLiteral(obj: any): any;
@@ -0,0 +1 @@
1
+ export declare const typeDefsString = "";
@@ -0,0 +1,2 @@
1
+ import { ApolloQueryResult, FetchResult } from "@apollo/client/core";
2
+ export default function unwrapApolloResult(result: ApolloQueryResult<any> | FetchResult<any>): any;
@@ -0,0 +1,2 @@
1
+ export declare function formatList(list: any): any;
2
+ export declare function capSentence(cap: any): string;
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@coasys/ad4m",
3
+ "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",
4
+ "main": "lib/index.cjs",
5
+ "module": "lib/index.js",
6
+ "types": "lib/src/index.d.ts",
7
+ "type": "module",
8
+ "scripts": {
9
+ "build": "patch-package && tsc && pnpm run buildSchema && pnpm run bundle",
10
+ "buildSchema": "node --es-module-specifier-resolution=node lib/src/buildSchema.js",
11
+ "bundle": "rollup -c rollup.config.js",
12
+ "test": "jest --forceExit"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/perspect3vism/ad4m.git"
17
+ },
18
+ "author": {
19
+ "name": "Nicolas Luck",
20
+ "email": "nicolas@lucksus.eu"
21
+ },
22
+ "contributors": [
23
+ {
24
+ "name": "Joshua Parkin",
25
+ "email": "joshuadparkin@gmail.com"
26
+ }
27
+ ],
28
+ "license": "CAL-1.0",
29
+ "bugs": {
30
+ "url": "https://github.com/perspect3vism/ad4m/issues"
31
+ },
32
+ "homepage": "https://ad4m.dev",
33
+ "dependencies": {
34
+ "@apollo/client": "3.7.10",
35
+ "@holochain/client": "0.16.0",
36
+ "@types/jest": "^26.0.14",
37
+ "class-validator": "^0.13.1",
38
+ "express": "4.18.2",
39
+ "graphql": "15.7.2",
40
+ "reflect-metadata": "^0.1.13",
41
+ "type-graphql": "1.1.1"
42
+ },
43
+ "devDependencies": {
44
+ "@rollup/plugin-alias": "^3.1.5",
45
+ "@rollup/plugin-commonjs": "^20.0.0",
46
+ "@rollup/plugin-node-resolve": "^13.0.4",
47
+ "@apollo/server": "^4.9.4",
48
+ "concat-md": "^0.5.0",
49
+ "cross-fetch": "^3.1.4",
50
+ "graphql-ws": "5.12.0",
51
+ "honkit": "^4.0.0",
52
+ "jest": "^26.6.0",
53
+ "patch-package": "^8.0.0",
54
+ "rollup": "^2.56.3",
55
+ "ts-jest": "^26.5.6",
56
+ "typescript": "^4.6.2",
57
+ "ws": "8.13.0"
58
+ },
59
+ "version": "0.8.0"
60
+ }
@@ -0,0 +1,27 @@
1
+ import alias from '@rollup/plugin-alias';
2
+ import nodeResolve from '@rollup/plugin-node-resolve';
3
+ import commonjs from '@rollup/plugin-commonjs';
4
+
5
+ module.exports = {
6
+ input: 'lib/src/index.js',
7
+ output: [
8
+ {
9
+ format: 'cjs',
10
+ file: "lib/index.cjs",
11
+ },
12
+ {
13
+ format: 'esm',
14
+ file: "lib/index.js",
15
+ }
16
+ ],
17
+ plugins: [
18
+ alias({
19
+ entries: [
20
+ { find: 'type-graphql', replacement: './lib/shims/type-graphql.js' },
21
+ { find: 'reflect-metadata', replacement: './lib/shims/reflect-metadata.js' }
22
+ ]
23
+ }),
24
+ nodeResolve(),
25
+ commonjs()
26
+ ]
27
+ };
File without changes