@dyne/interfacer-client 0.4.0 → 0.5.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.
package/dist/index.d.cts CHANGED
@@ -806,6 +806,23 @@ interface PaginationParams {
806
806
  last?: number;
807
807
  before?: string;
808
808
  }
809
+ type TraceDppNodeType = "EconomicResource" | "EconomicEvent" | "Process" | string;
810
+ /** Recursive node returned by Zenflows' traceDpp resolver. */
811
+ interface TraceDppNode {
812
+ type: TraceDppNodeType;
813
+ node: {
814
+ id?: string;
815
+ name?: string;
816
+ note?: string | null;
817
+ action?: {
818
+ id?: string;
819
+ label?: string;
820
+ } | null;
821
+ metadata?: Record<string, unknown> | null;
822
+ [key: string]: unknown;
823
+ };
824
+ children?: TraceDppNode[];
825
+ }
809
826
  type ResourceFilter = Record<string, unknown>;
810
827
  type ProposalFilter = Record<string, unknown>;
811
828
  declare class ResourceClient {
@@ -876,6 +893,7 @@ declare class ResourceClient {
876
893
  proposerId: string;
877
894
  newMetadata: Record<string, unknown>;
878
895
  }): Promise<void>;
896
+ getTraceDpp(id: string): Promise<TraceDppNode[]>;
879
897
  rejectProposal(intentCite: string, intentAccept: string, intentModify: string): Promise<void>;
880
898
  }
881
899
 
@@ -1171,6 +1189,73 @@ declare const CO2_THRESHOLDS_KG: readonly [0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 5, 7.
1171
1189
  declare const REPAIRABILITY_AVAILABLE_TAG = "repairability-available";
1172
1190
  declare const MANUFACTURABLE_TRUE_TAG = "manufacturable-true";
1173
1191
 
1192
+ /**
1193
+ * Zenflows GraphQL operations — all queries and mutations.
1194
+ *
1195
+ * Ported from interfacer-gui lib/QueryAndMutation.ts.
1196
+ * These are raw GQL documents used by the GraphQLClient.
1197
+ */
1198
+ declare const QUERY_VARIABLES: string;
1199
+ declare const QUERY_PROJECT_TYPES: string;
1200
+ declare const QUERY_UNIT_AND_CURRENCY: string;
1201
+ declare const REGISTER_USER: string;
1202
+ declare const SIGN_UP: string;
1203
+ declare const FETCH_SELF: string;
1204
+ declare const SEND_EMAIL_VERIFICATION: string;
1205
+ declare const CLAIM_DID: string;
1206
+ declare const PERSON_EXISTS: string;
1207
+ declare const VERIFY_EMAIL: string;
1208
+ declare const QUERY_RESOURCE: string;
1209
+ declare const FETCH_RESOURCES: string;
1210
+ declare const QUERY_PROJECTS: string;
1211
+ declare const QUERY_MACHINES: string;
1212
+ declare const QUERY_CITED_RESOURCES: string;
1213
+ declare const QUERY_PROJECT_FOR_METADATA_UPDATE: string;
1214
+ declare const ASK_RESOURCE_PRIMARY_ACCOUNTABLE: string;
1215
+ declare const GET_PROJECT_LAYOUT: string;
1216
+ declare const SEARCH_PROJECT: string;
1217
+ declare const SEARCH_PROJECTS: string;
1218
+ declare const SELECT_RESOURCES: string;
1219
+ declare const EDIT_IMAGES: string;
1220
+ declare const EDIT_MAIN: string;
1221
+ declare const EDIT_SPECS: string;
1222
+ declare const CREATE_PROPOSAL: string;
1223
+ declare const CREATE_INTENT: string;
1224
+ declare const LINK_PROPOSAL_AND_INTENT: string;
1225
+ declare const PROPOSE_CONTRIBUTION: string;
1226
+ declare const LINK_CONTRIBUTION_PROPOSAL_INTENT: string;
1227
+ declare const QUERY_PROPOSAL: string;
1228
+ declare const QUERY_RESOURCE_PROPOSALS: string;
1229
+ declare const ACCEPT_PROPOSAL: string;
1230
+ declare const SATISFY_INTENTS: string;
1231
+ declare const REJECT_PROPOSAL: string;
1232
+ declare const CREATE_PROJECT: string;
1233
+ declare const CREATE_MACHINE_RESOURCE: string;
1234
+ declare const CREATE_DPP_RESOURCE: string;
1235
+ declare const CREATE_LOCATION: string;
1236
+ declare const CREATE_PROCESS: string;
1237
+ declare const CITE_PROJECT: string;
1238
+ declare const CONSUME_RESOURCE: string;
1239
+ declare const CONTRIBUTE_TO_PROJECT: string;
1240
+ declare const FORK_PROJECT: string;
1241
+ declare const TRANSFER_PROJECT: string;
1242
+ declare const UPDATE_METADATA: string;
1243
+ declare const UPDATE_RESOURCE_CLASSIFIED_AS: string;
1244
+ declare const UPDATE_CONTRIBUTION: string;
1245
+ declare const RELOCATE_PROJECT: string;
1246
+ declare const QUERY_AGENTS: string;
1247
+ declare const FETCH_AGENTS: string;
1248
+ declare const FETCH_USER: string;
1249
+ declare const GET_USER_LAYOUT: string;
1250
+ declare const UPDATE_USER: string;
1251
+ declare const GET_USER_IMAGES: string;
1252
+ declare const SEARCH_PERSON: string;
1253
+ declare const SEARCH_PEOPLE: string;
1254
+ declare const GET_TAGS: string;
1255
+ declare const SEARCH_TAGS: string;
1256
+ declare const GET_RESOURCE_DETAILS: string;
1257
+ declare const QUERY_RESOURCE_TRACE_DPP: string;
1258
+
1174
1259
  /**
1175
1260
  * Instance variables resolver.
1176
1261
  *
@@ -1240,4 +1325,4 @@ declare function signDidRequest(body: string, store: KeyStorage): Promise<{
1240
1325
  */
1241
1326
  declare function signFileUpload(checksumHex: string, store: KeyStorage): Promise<string>;
1242
1327
 
1243
- export { AVAILABILITY_OPTIONS, AuthClient, CO2_THRESHOLDS_KG, type Comment, type Contributor, type CreateProjectParams, type DerivedEndpoints, type DppAttachment, DppClient, type DppDocument, type DppStatus, ENERGY_THRESHOLDS_KWH, FeedbackClient, FileClient, type GetCommentsParams, type GetReviewsParams, type GqlFile, GraphQLClient, type ImageRef, ImportClient, InboxClient, type InstanceVariables, InterfacerClient, type InterfacerConfig, type KeyStorage, type Keyring, type License, type Location, MANUFACTURABLE_TRUE_TAG, type MachineRef, type MaterialRef, type ModelFile, POWER_COMPATIBILITY_OPTIONS, POWER_REQUIREMENT_THRESHOLDS_W, PRODUCT_CATEGORY_OPTIONS, type ProductFilters, type Project, type ProjectFilter, type ProjectModelMetadata, ProjectType, type Proposal, RECYCLABILITY_THRESHOLDS_PCT, REPAIRABILITY_AVAILABLE_TAG, REPLICABILITY_OPTIONS, ResourceClient, type Review, type ReviewSummary, SERVICE_TYPE_OPTIONS, SYSTEM_TAG_PREFIXES, type ServiceFilters, SocialClient, TAG_PREFIX, TaggingClient, type UserChallenges, WalletClient, type ZenflowsFile, clearInstanceVariablesCache, createConfig, createMemoryStorage, deriveEndpointsFromProxy, derivedProductFilterTags, extractUserTagValues, formatImageSrc, getInstanceVariables, getResourceImage, isSystemTag, isUserTag, mergeTags, monotonicRangeTags, normalizeUserTagsForSave, prefixedTag, prepFileForZenflows, prepFilesForZenflows, rangeFilterTags, removeTagsWithPrefixes, signDidRequest, signFileUpload, signGraphQLRequest, slugifyTagValue, stripUserTagPrefix, userTag };
1328
+ export { ACCEPT_PROPOSAL, ASK_RESOURCE_PRIMARY_ACCOUNTABLE, AVAILABILITY_OPTIONS, AuthClient, CITE_PROJECT, CLAIM_DID, CO2_THRESHOLDS_KG, CONSUME_RESOURCE, CONTRIBUTE_TO_PROJECT, CREATE_DPP_RESOURCE, CREATE_INTENT, CREATE_LOCATION, CREATE_MACHINE_RESOURCE, CREATE_PROCESS, CREATE_PROJECT, CREATE_PROPOSAL, type Comment, type Contributor, type CreateProjectParams, type DerivedEndpoints, type DppAttachment, DppClient, type DppDocument, type DppStatus, EDIT_IMAGES, EDIT_MAIN, EDIT_SPECS, ENERGY_THRESHOLDS_KWH, FETCH_AGENTS, FETCH_RESOURCES, FETCH_SELF, FETCH_USER, FORK_PROJECT, FeedbackClient, FileClient, GET_PROJECT_LAYOUT, GET_RESOURCE_DETAILS, GET_TAGS, GET_USER_IMAGES, GET_USER_LAYOUT, type GetCommentsParams, type GetReviewsParams, type GqlFile, GraphQLClient, type ImageRef, ImportClient, InboxClient, type InstanceVariables, InterfacerClient, type InterfacerConfig, type KeyStorage, type Keyring, LINK_CONTRIBUTION_PROPOSAL_INTENT, LINK_PROPOSAL_AND_INTENT, type License, type Location, MANUFACTURABLE_TRUE_TAG, type MachineRef, type MaterialRef, type ModelFile, PERSON_EXISTS, POWER_COMPATIBILITY_OPTIONS, POWER_REQUIREMENT_THRESHOLDS_W, PRODUCT_CATEGORY_OPTIONS, PROPOSE_CONTRIBUTION, type ProductFilters, type Project, type ProjectFilter, type ProjectModelMetadata, ProjectType, type Proposal, QUERY_AGENTS, QUERY_CITED_RESOURCES, QUERY_MACHINES, QUERY_PROJECTS, QUERY_PROJECT_FOR_METADATA_UPDATE, QUERY_PROJECT_TYPES, QUERY_PROPOSAL, QUERY_RESOURCE, QUERY_RESOURCE_PROPOSALS, QUERY_RESOURCE_TRACE_DPP, QUERY_UNIT_AND_CURRENCY, QUERY_VARIABLES, RECYCLABILITY_THRESHOLDS_PCT, REGISTER_USER, REJECT_PROPOSAL, RELOCATE_PROJECT, REPAIRABILITY_AVAILABLE_TAG, REPLICABILITY_OPTIONS, ResourceClient, type Review, type ReviewSummary, SATISFY_INTENTS, SEARCH_PEOPLE, SEARCH_PERSON, SEARCH_PROJECT, SEARCH_PROJECTS, SEARCH_TAGS, SELECT_RESOURCES, SEND_EMAIL_VERIFICATION, SERVICE_TYPE_OPTIONS, SIGN_UP, SYSTEM_TAG_PREFIXES, type ServiceFilters, SocialClient, TAG_PREFIX, TRANSFER_PROJECT, TaggingClient, type TraceDppNode, type TraceDppNodeType, UPDATE_CONTRIBUTION, UPDATE_METADATA, UPDATE_RESOURCE_CLASSIFIED_AS, UPDATE_USER, type UserChallenges, VERIFY_EMAIL, WalletClient, type ZenflowsFile, clearInstanceVariablesCache, createConfig, createMemoryStorage, deriveEndpointsFromProxy, derivedProductFilterTags, extractUserTagValues, formatImageSrc, getInstanceVariables, getResourceImage, isSystemTag, isUserTag, mergeTags, monotonicRangeTags, normalizeUserTagsForSave, prefixedTag, prepFileForZenflows, prepFilesForZenflows, rangeFilterTags, removeTagsWithPrefixes, signDidRequest, signFileUpload, signGraphQLRequest, slugifyTagValue, stripUserTagPrefix, userTag };
package/dist/index.d.ts CHANGED
@@ -806,6 +806,23 @@ interface PaginationParams {
806
806
  last?: number;
807
807
  before?: string;
808
808
  }
809
+ type TraceDppNodeType = "EconomicResource" | "EconomicEvent" | "Process" | string;
810
+ /** Recursive node returned by Zenflows' traceDpp resolver. */
811
+ interface TraceDppNode {
812
+ type: TraceDppNodeType;
813
+ node: {
814
+ id?: string;
815
+ name?: string;
816
+ note?: string | null;
817
+ action?: {
818
+ id?: string;
819
+ label?: string;
820
+ } | null;
821
+ metadata?: Record<string, unknown> | null;
822
+ [key: string]: unknown;
823
+ };
824
+ children?: TraceDppNode[];
825
+ }
809
826
  type ResourceFilter = Record<string, unknown>;
810
827
  type ProposalFilter = Record<string, unknown>;
811
828
  declare class ResourceClient {
@@ -876,6 +893,7 @@ declare class ResourceClient {
876
893
  proposerId: string;
877
894
  newMetadata: Record<string, unknown>;
878
895
  }): Promise<void>;
896
+ getTraceDpp(id: string): Promise<TraceDppNode[]>;
879
897
  rejectProposal(intentCite: string, intentAccept: string, intentModify: string): Promise<void>;
880
898
  }
881
899
 
@@ -1171,6 +1189,73 @@ declare const CO2_THRESHOLDS_KG: readonly [0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 5, 7.
1171
1189
  declare const REPAIRABILITY_AVAILABLE_TAG = "repairability-available";
1172
1190
  declare const MANUFACTURABLE_TRUE_TAG = "manufacturable-true";
1173
1191
 
1192
+ /**
1193
+ * Zenflows GraphQL operations — all queries and mutations.
1194
+ *
1195
+ * Ported from interfacer-gui lib/QueryAndMutation.ts.
1196
+ * These are raw GQL documents used by the GraphQLClient.
1197
+ */
1198
+ declare const QUERY_VARIABLES: string;
1199
+ declare const QUERY_PROJECT_TYPES: string;
1200
+ declare const QUERY_UNIT_AND_CURRENCY: string;
1201
+ declare const REGISTER_USER: string;
1202
+ declare const SIGN_UP: string;
1203
+ declare const FETCH_SELF: string;
1204
+ declare const SEND_EMAIL_VERIFICATION: string;
1205
+ declare const CLAIM_DID: string;
1206
+ declare const PERSON_EXISTS: string;
1207
+ declare const VERIFY_EMAIL: string;
1208
+ declare const QUERY_RESOURCE: string;
1209
+ declare const FETCH_RESOURCES: string;
1210
+ declare const QUERY_PROJECTS: string;
1211
+ declare const QUERY_MACHINES: string;
1212
+ declare const QUERY_CITED_RESOURCES: string;
1213
+ declare const QUERY_PROJECT_FOR_METADATA_UPDATE: string;
1214
+ declare const ASK_RESOURCE_PRIMARY_ACCOUNTABLE: string;
1215
+ declare const GET_PROJECT_LAYOUT: string;
1216
+ declare const SEARCH_PROJECT: string;
1217
+ declare const SEARCH_PROJECTS: string;
1218
+ declare const SELECT_RESOURCES: string;
1219
+ declare const EDIT_IMAGES: string;
1220
+ declare const EDIT_MAIN: string;
1221
+ declare const EDIT_SPECS: string;
1222
+ declare const CREATE_PROPOSAL: string;
1223
+ declare const CREATE_INTENT: string;
1224
+ declare const LINK_PROPOSAL_AND_INTENT: string;
1225
+ declare const PROPOSE_CONTRIBUTION: string;
1226
+ declare const LINK_CONTRIBUTION_PROPOSAL_INTENT: string;
1227
+ declare const QUERY_PROPOSAL: string;
1228
+ declare const QUERY_RESOURCE_PROPOSALS: string;
1229
+ declare const ACCEPT_PROPOSAL: string;
1230
+ declare const SATISFY_INTENTS: string;
1231
+ declare const REJECT_PROPOSAL: string;
1232
+ declare const CREATE_PROJECT: string;
1233
+ declare const CREATE_MACHINE_RESOURCE: string;
1234
+ declare const CREATE_DPP_RESOURCE: string;
1235
+ declare const CREATE_LOCATION: string;
1236
+ declare const CREATE_PROCESS: string;
1237
+ declare const CITE_PROJECT: string;
1238
+ declare const CONSUME_RESOURCE: string;
1239
+ declare const CONTRIBUTE_TO_PROJECT: string;
1240
+ declare const FORK_PROJECT: string;
1241
+ declare const TRANSFER_PROJECT: string;
1242
+ declare const UPDATE_METADATA: string;
1243
+ declare const UPDATE_RESOURCE_CLASSIFIED_AS: string;
1244
+ declare const UPDATE_CONTRIBUTION: string;
1245
+ declare const RELOCATE_PROJECT: string;
1246
+ declare const QUERY_AGENTS: string;
1247
+ declare const FETCH_AGENTS: string;
1248
+ declare const FETCH_USER: string;
1249
+ declare const GET_USER_LAYOUT: string;
1250
+ declare const UPDATE_USER: string;
1251
+ declare const GET_USER_IMAGES: string;
1252
+ declare const SEARCH_PERSON: string;
1253
+ declare const SEARCH_PEOPLE: string;
1254
+ declare const GET_TAGS: string;
1255
+ declare const SEARCH_TAGS: string;
1256
+ declare const GET_RESOURCE_DETAILS: string;
1257
+ declare const QUERY_RESOURCE_TRACE_DPP: string;
1258
+
1174
1259
  /**
1175
1260
  * Instance variables resolver.
1176
1261
  *
@@ -1240,4 +1325,4 @@ declare function signDidRequest(body: string, store: KeyStorage): Promise<{
1240
1325
  */
1241
1326
  declare function signFileUpload(checksumHex: string, store: KeyStorage): Promise<string>;
1242
1327
 
1243
- export { AVAILABILITY_OPTIONS, AuthClient, CO2_THRESHOLDS_KG, type Comment, type Contributor, type CreateProjectParams, type DerivedEndpoints, type DppAttachment, DppClient, type DppDocument, type DppStatus, ENERGY_THRESHOLDS_KWH, FeedbackClient, FileClient, type GetCommentsParams, type GetReviewsParams, type GqlFile, GraphQLClient, type ImageRef, ImportClient, InboxClient, type InstanceVariables, InterfacerClient, type InterfacerConfig, type KeyStorage, type Keyring, type License, type Location, MANUFACTURABLE_TRUE_TAG, type MachineRef, type MaterialRef, type ModelFile, POWER_COMPATIBILITY_OPTIONS, POWER_REQUIREMENT_THRESHOLDS_W, PRODUCT_CATEGORY_OPTIONS, type ProductFilters, type Project, type ProjectFilter, type ProjectModelMetadata, ProjectType, type Proposal, RECYCLABILITY_THRESHOLDS_PCT, REPAIRABILITY_AVAILABLE_TAG, REPLICABILITY_OPTIONS, ResourceClient, type Review, type ReviewSummary, SERVICE_TYPE_OPTIONS, SYSTEM_TAG_PREFIXES, type ServiceFilters, SocialClient, TAG_PREFIX, TaggingClient, type UserChallenges, WalletClient, type ZenflowsFile, clearInstanceVariablesCache, createConfig, createMemoryStorage, deriveEndpointsFromProxy, derivedProductFilterTags, extractUserTagValues, formatImageSrc, getInstanceVariables, getResourceImage, isSystemTag, isUserTag, mergeTags, monotonicRangeTags, normalizeUserTagsForSave, prefixedTag, prepFileForZenflows, prepFilesForZenflows, rangeFilterTags, removeTagsWithPrefixes, signDidRequest, signFileUpload, signGraphQLRequest, slugifyTagValue, stripUserTagPrefix, userTag };
1328
+ export { ACCEPT_PROPOSAL, ASK_RESOURCE_PRIMARY_ACCOUNTABLE, AVAILABILITY_OPTIONS, AuthClient, CITE_PROJECT, CLAIM_DID, CO2_THRESHOLDS_KG, CONSUME_RESOURCE, CONTRIBUTE_TO_PROJECT, CREATE_DPP_RESOURCE, CREATE_INTENT, CREATE_LOCATION, CREATE_MACHINE_RESOURCE, CREATE_PROCESS, CREATE_PROJECT, CREATE_PROPOSAL, type Comment, type Contributor, type CreateProjectParams, type DerivedEndpoints, type DppAttachment, DppClient, type DppDocument, type DppStatus, EDIT_IMAGES, EDIT_MAIN, EDIT_SPECS, ENERGY_THRESHOLDS_KWH, FETCH_AGENTS, FETCH_RESOURCES, FETCH_SELF, FETCH_USER, FORK_PROJECT, FeedbackClient, FileClient, GET_PROJECT_LAYOUT, GET_RESOURCE_DETAILS, GET_TAGS, GET_USER_IMAGES, GET_USER_LAYOUT, type GetCommentsParams, type GetReviewsParams, type GqlFile, GraphQLClient, type ImageRef, ImportClient, InboxClient, type InstanceVariables, InterfacerClient, type InterfacerConfig, type KeyStorage, type Keyring, LINK_CONTRIBUTION_PROPOSAL_INTENT, LINK_PROPOSAL_AND_INTENT, type License, type Location, MANUFACTURABLE_TRUE_TAG, type MachineRef, type MaterialRef, type ModelFile, PERSON_EXISTS, POWER_COMPATIBILITY_OPTIONS, POWER_REQUIREMENT_THRESHOLDS_W, PRODUCT_CATEGORY_OPTIONS, PROPOSE_CONTRIBUTION, type ProductFilters, type Project, type ProjectFilter, type ProjectModelMetadata, ProjectType, type Proposal, QUERY_AGENTS, QUERY_CITED_RESOURCES, QUERY_MACHINES, QUERY_PROJECTS, QUERY_PROJECT_FOR_METADATA_UPDATE, QUERY_PROJECT_TYPES, QUERY_PROPOSAL, QUERY_RESOURCE, QUERY_RESOURCE_PROPOSALS, QUERY_RESOURCE_TRACE_DPP, QUERY_UNIT_AND_CURRENCY, QUERY_VARIABLES, RECYCLABILITY_THRESHOLDS_PCT, REGISTER_USER, REJECT_PROPOSAL, RELOCATE_PROJECT, REPAIRABILITY_AVAILABLE_TAG, REPLICABILITY_OPTIONS, ResourceClient, type Review, type ReviewSummary, SATISFY_INTENTS, SEARCH_PEOPLE, SEARCH_PERSON, SEARCH_PROJECT, SEARCH_PROJECTS, SEARCH_TAGS, SELECT_RESOURCES, SEND_EMAIL_VERIFICATION, SERVICE_TYPE_OPTIONS, SIGN_UP, SYSTEM_TAG_PREFIXES, type ServiceFilters, SocialClient, TAG_PREFIX, TRANSFER_PROJECT, TaggingClient, type TraceDppNode, type TraceDppNodeType, UPDATE_CONTRIBUTION, UPDATE_METADATA, UPDATE_RESOURCE_CLASSIFIED_AS, UPDATE_USER, type UserChallenges, VERIFY_EMAIL, WalletClient, type ZenflowsFile, clearInstanceVariablesCache, createConfig, createMemoryStorage, deriveEndpointsFromProxy, derivedProductFilterTags, extractUserTagValues, formatImageSrc, getInstanceVariables, getResourceImage, isSystemTag, isUserTag, mergeTags, monotonicRangeTags, normalizeUserTagsForSave, prefixedTag, prepFileForZenflows, prepFilesForZenflows, rangeFilterTags, removeTagsWithPrefixes, signDidRequest, signFileUpload, signGraphQLRequest, slugifyTagValue, stripUserTagPrefix, userTag };
package/dist/index.js CHANGED
@@ -316,6 +316,44 @@ function gql(strings, ...values) {
316
316
  }
317
317
 
318
318
  // src/graphql/operations.ts
319
+ var QUERY_VARIABLES = gql`
320
+ query GetVariables {
321
+ instanceVariables {
322
+ specs {
323
+ specCurrency { id name }
324
+ specProjectDesign { id name }
325
+ specProjectProduct { id name }
326
+ specProjectService { id name }
327
+ specDpp { id name }
328
+ specMachine { id name }
329
+ specMaterial { id name }
330
+ }
331
+ units { unitOne { id } }
332
+ }
333
+ }
334
+ `;
335
+ var QUERY_PROJECT_TYPES = gql`
336
+ query GetProjectTypes {
337
+ instanceVariables {
338
+ specs {
339
+ specProjectDesign { id name }
340
+ specProjectProduct { id name }
341
+ specProjectService { id name }
342
+ specDpp { id name }
343
+ specMachine { id name }
344
+ specMaterial { id name }
345
+ }
346
+ }
347
+ }
348
+ `;
349
+ var QUERY_UNIT_AND_CURRENCY = gql`
350
+ query GetUnitAndCurrency {
351
+ instanceVariables {
352
+ units { unitOne { id } }
353
+ specs { specCurrency { id } }
354
+ }
355
+ }
356
+ `;
319
357
  var REGISTER_USER = gql`
320
358
  mutation RegisterUser($firstRegistration: Boolean!, $userData: JSONObject!) {
321
359
  keypairoomServer(firstRegistration: $firstRegistration, userData: $userData)
@@ -354,6 +392,16 @@ var CLAIM_DID = gql`
354
392
  claimPerson(id: $id)
355
393
  }
356
394
  `;
395
+ var PERSON_EXISTS = gql`
396
+ query PersonExists($email: String, $user: String) {
397
+ personExists(email: $email, user: $user)
398
+ }
399
+ `;
400
+ var VERIFY_EMAIL = gql`
401
+ mutation VerifyEmail($token: String!) {
402
+ personVerifyEmailVerification(token: $token)
403
+ }
404
+ `;
357
405
  var QUERY_RESOURCE = gql`
358
406
  query getResourceTable($id: ID!) {
359
407
  economicResource(id: $id) {
@@ -363,7 +411,7 @@ var QUERY_RESOURCE = gql`
363
411
  accountingQuantity { hasUnit { label symbol } hasNumericalValue }
364
412
  primaryAccountable { id name }
365
413
  currentLocation { id name mappableAddress lat long }
366
- images { hash name mimeType bin }
414
+ images { hash name mimeType }
367
415
  }
368
416
  }
369
417
  `;
@@ -379,12 +427,10 @@ var FETCH_RESOURCES = gql`
379
427
  node {
380
428
  conformsTo { id name }
381
429
  currentLocation { id name mappableAddress lat long }
382
- id name classifiedAs note metadata okhv repo license version licensor
430
+ id name classifiedAs note metadata
383
431
  images { hash name mimeType }
384
- primaryAccountable { id name note images { bin mimeType } primaryLocation { name } }
385
- custodian { id name note }
386
- accountingQuantity { hasUnit { id label symbol } hasNumericalValue }
387
- onhandQuantity { hasUnit { id label symbol } hasNumericalValue }
432
+ license
433
+ primaryAccountable { id name images { mimeType } }
388
434
  }
389
435
  }
390
436
  }
@@ -408,7 +454,7 @@ var QUERY_PROJECTS = gql`
408
454
  primaryAccountable { name id }
409
455
  name id note metadata
410
456
  onhandQuantity { hasUnit { label } }
411
- images { hash name mimeType bin }
457
+ images { hash name mimeType }
412
458
  }
413
459
  }
414
460
  reciprocalIntents {
@@ -452,7 +498,81 @@ var QUERY_PROJECT_FOR_METADATA_UPDATE = gql`
452
498
  var ASK_RESOURCE_PRIMARY_ACCOUNTABLE = gql`
453
499
  query askResourcePrimaryAccountable($id: ID!) {
454
500
  economicResource(id: $id) {
455
- id name primaryAccountable { id name images { bin mimeType } }
501
+ id name primaryAccountable { id name }
502
+ }
503
+ }
504
+ `;
505
+ var GET_PROJECT_LAYOUT = gql`
506
+ query getProjectLayout($id: ID!) {
507
+ economicResource(id: $id) {
508
+ id name note metadata license licensor repo classifiedAs
509
+ accountingQuantity { hasNumericalValue }
510
+ onhandQuantity { hasUnit { id } hasNumericalValue }
511
+ conformsTo { id name }
512
+ primaryAccountable {
513
+ id name
514
+ primaryLocation { name mappableAddress lat long }
515
+ }
516
+ currentLocation { id name mappableAddress lat long }
517
+ images { hash name mimeType date description extension size }
518
+ }
519
+ }
520
+ `;
521
+ var SEARCH_PROJECT = gql`
522
+ query SearchProject($id: ID!) {
523
+ economicResource(id: $id) {
524
+ id name metadata
525
+ images { hash mimeType }
526
+ conformsTo { name id }
527
+ primaryAccountable { name }
528
+ }
529
+ }
530
+ `;
531
+ var SEARCH_PROJECTS = gql`
532
+ query SearchProjects(
533
+ $last: Int $IDs: [ID!] $name: String
534
+ $conformsTo: [ID!] $primaryAccountable: [ID!]
535
+ ) {
536
+ economicResources(
537
+ last: $last
538
+ filter: { id: $IDs, name: $name, conformsTo: $conformsTo, primaryAccountable: $primaryAccountable }
539
+ ) {
540
+ edges {
541
+ node {
542
+ id name metadata
543
+ conformsTo { id name }
544
+ primaryAccountable { id name }
545
+ images { hash name mimeType }
546
+ }
547
+ }
548
+ }
549
+ }
550
+ `;
551
+ var SELECT_RESOURCES = gql`
552
+ query FetchResources($filter: EconomicResourceFilterParams) {
553
+ economicResources(last: 10, filter: $filter) {
554
+ edges { cursor node { id name } }
555
+ }
556
+ }
557
+ `;
558
+ var EDIT_IMAGES = gql`
559
+ mutation EditImages($id: ID!, $images: [IFile!]) {
560
+ updateEconomicResource(resource: { id: $id, images: $images }) {
561
+ economicResource { id }
562
+ }
563
+ }
564
+ `;
565
+ var EDIT_MAIN = gql`
566
+ mutation EditMain($id: ID!, $classifiedAs: [URI!], $note: String, $name: String, $repo: String) {
567
+ updateEconomicResource(
568
+ resource: { id: $id, classifiedAs: $classifiedAs, name: $name, note: $note, repo: $repo }
569
+ ) { economicResource { id } }
570
+ }
571
+ `;
572
+ var EDIT_SPECS = gql`
573
+ mutation EditSpecs($id: ID!, $classifiedAs: [URI!]) {
574
+ updateEconomicResource(resource: { id: $id, classifiedAs: $classifiedAs }) {
575
+ economicResource { id }
456
576
  }
457
577
  }
458
578
  `;
@@ -513,7 +633,7 @@ var QUERY_PROPOSAL = gql`
513
633
  id provider { id name } receiver { id name }
514
634
  inputOf { name id } outputOf { id name } hasPointInTime
515
635
  resourceInventoriedAs {
516
- id name repo metadata images { hash name mimeType bin }
636
+ id name repo metadata images { hash name mimeType }
517
637
  primaryAccountable { id name } onhandQuantity { hasNumericalValue hasUnit { id } }
518
638
  }
519
639
  resourceConformsTo { id name }
@@ -726,6 +846,18 @@ var UPDATE_RESOURCE_CLASSIFIED_AS = gql`
726
846
  updateEconomicResource(resource: { id: $id classifiedAs: $classifiedAs }) { economicResource { id } }
727
847
  }
728
848
  `;
849
+ var UPDATE_CONTRIBUTION = gql`
850
+ mutation updateContribution(
851
+ $process: ID! $agent: ID! $resource: ID! $quantity: IMeasure!
852
+ $now: DateTime! $metadata: JSONObject! $conformsTo: ID! $unitOne: ID!
853
+ ) {
854
+ contribute: createEconomicEvent(event: {
855
+ action: "work" inputOf: $process provider: $agent receiver: $agent
856
+ resourceConformsTo: $conformsTo hasPointInTime: $now
857
+ effortQuantity: { hasNumericalValue: 1 hasUnit: $unitOne }
858
+ }) { economicEvent { id } }
859
+ }
860
+ `;
729
861
  var RELOCATE_PROJECT = gql`
730
862
  mutation relocateProject(
731
863
  $process: ID! $agent: ID! $resource: ID! $quantity: IMeasure! $now: DateTime! $location: ID!
@@ -763,11 +895,71 @@ var FETCH_USER = gql`
763
895
  }
764
896
  }
765
897
  `;
898
+ var GET_USER_LAYOUT = gql`
899
+ query GetUserLayout($id: ID!) {
900
+ person(id: $id) {
901
+ id name note email user
902
+ images { hash name mimeType bin size extension description }
903
+ ethereumAddress
904
+ primaryLocation { id name mappableAddress lat long }
905
+ }
906
+ }
907
+ `;
908
+ var UPDATE_USER = gql`
909
+ mutation updateUser(
910
+ $id: ID! $name: String $note: String $primaryLocation: ID $user: String $images: [IFile!]
911
+ ) {
912
+ updatePerson(
913
+ person: { id: $id name: $name note: $note primaryLocation: $primaryLocation user: $user images: $images }
914
+ ) {
915
+ agent {
916
+ id name note
917
+ images { name }
918
+ primaryLocation { id lat long name }
919
+ }
920
+ }
921
+ }
922
+ `;
923
+ var GET_USER_IMAGES = gql`
924
+ query GetUserImages($userId: ID!) {
925
+ person(id: $userId) {
926
+ id name
927
+ images { bin mimeType date description extension hash name size }
928
+ }
929
+ }
930
+ `;
931
+ var SEARCH_PERSON = gql`
932
+ query getPerson($id: ID!) {
933
+ person(id: $id) {
934
+ id name user
935
+ images { bin mimeType }
936
+ primaryLocation { id name }
937
+ }
938
+ }
939
+ `;
940
+ var SEARCH_PEOPLE = gql`
941
+ query SearchPeople($filter: PersonFilterParams, $last: Int) {
942
+ people(last: $last, filter: $filter) {
943
+ edges {
944
+ node {
945
+ id name user note
946
+ images { bin mimeType }
947
+ primaryLocation { id name }
948
+ }
949
+ }
950
+ }
951
+ }
952
+ `;
766
953
  var GET_TAGS = gql`
767
954
  query GetTags {
768
955
  economicResourceClassifications
769
956
  }
770
957
  `;
958
+ var SEARCH_TAGS = gql`
959
+ query SearchTags($text: URI!) {
960
+ economicResourceClassifications(filter: { uri: $text })
961
+ }
962
+ `;
771
963
  var GET_RESOURCE_DETAILS = gql`
772
964
  query GetResourceDetails($id: ID!) {
773
965
  proposal(id: $id) {
@@ -777,12 +969,20 @@ var GET_RESOURCE_DETAILS = gql`
777
969
  resourceInventoriedAs {
778
970
  conformsTo { name id } currentLocation { name } name id note
779
971
  classifiedAs metadata primaryAccountable { name id }
780
- onhandQuantity { hasUnit { label } } images { hash name mimeType bin }
972
+ onhandQuantity { hasUnit { label } } images { hash name mimeType }
781
973
  }
782
974
  }
783
975
  }
784
976
  }
785
977
  `;
978
+ var QUERY_RESOURCE_TRACE_DPP = gql`
979
+ query GetResourceTraceDpp($id: ID!) {
980
+ economicResource(id: $id) {
981
+ id
982
+ traceDpp
983
+ }
984
+ }
985
+ `;
786
986
 
787
987
  // src/auth/AuthClient.ts
788
988
  var AuthClient = class {
@@ -1822,6 +2022,12 @@ var ResourceClient = class {
1822
2022
  });
1823
2023
  if (satRes.errors?.length) throw new Error(`satisfyIntents failed: ${satRes.errors[0].message}`);
1824
2024
  }
2025
+ async getTraceDpp(id) {
2026
+ const res = await this.graphql.request(QUERY_RESOURCE_TRACE_DPP, { id });
2027
+ if (res.errors?.length) throw new Error(`getTraceDpp failed: ${res.errors[0].message}`);
2028
+ const traceDpp = res.data?.economicResource?.traceDpp;
2029
+ return Array.isArray(traceDpp) ? traceDpp : [];
2030
+ }
1825
2031
  async rejectProposal(intentCite, intentAccept, intentModify) {
1826
2032
  const res = await this.graphql.request(REJECT_PROPOSAL, {
1827
2033
  intentCite,
@@ -2383,30 +2589,90 @@ function createConfig(config) {
2383
2589
  // src/index.ts
2384
2590
  init_sign();
2385
2591
  export {
2592
+ ACCEPT_PROPOSAL,
2593
+ ASK_RESOURCE_PRIMARY_ACCOUNTABLE,
2386
2594
  AVAILABILITY_OPTIONS,
2387
2595
  AuthClient,
2596
+ CITE_PROJECT,
2597
+ CLAIM_DID,
2388
2598
  CO2_THRESHOLDS_KG,
2599
+ CONSUME_RESOURCE,
2600
+ CONTRIBUTE_TO_PROJECT,
2601
+ CREATE_DPP_RESOURCE,
2602
+ CREATE_INTENT,
2603
+ CREATE_LOCATION,
2604
+ CREATE_MACHINE_RESOURCE,
2605
+ CREATE_PROCESS,
2606
+ CREATE_PROJECT,
2607
+ CREATE_PROPOSAL,
2389
2608
  DppClient,
2609
+ EDIT_IMAGES,
2610
+ EDIT_MAIN,
2611
+ EDIT_SPECS,
2390
2612
  ENERGY_THRESHOLDS_KWH,
2613
+ FETCH_AGENTS,
2614
+ FETCH_RESOURCES,
2615
+ FETCH_SELF,
2616
+ FETCH_USER,
2617
+ FORK_PROJECT,
2391
2618
  FeedbackClient,
2392
2619
  FileClient,
2620
+ GET_PROJECT_LAYOUT,
2621
+ GET_RESOURCE_DETAILS,
2622
+ GET_TAGS,
2623
+ GET_USER_IMAGES,
2624
+ GET_USER_LAYOUT,
2393
2625
  GraphQLClient,
2394
2626
  ImportClient,
2395
2627
  InboxClient,
2396
2628
  InterfacerClient,
2629
+ LINK_CONTRIBUTION_PROPOSAL_INTENT,
2630
+ LINK_PROPOSAL_AND_INTENT,
2397
2631
  MANUFACTURABLE_TRUE_TAG,
2632
+ PERSON_EXISTS,
2398
2633
  POWER_COMPATIBILITY_OPTIONS,
2399
2634
  POWER_REQUIREMENT_THRESHOLDS_W,
2400
2635
  PRODUCT_CATEGORY_OPTIONS,
2636
+ PROPOSE_CONTRIBUTION,
2637
+ QUERY_AGENTS,
2638
+ QUERY_CITED_RESOURCES,
2639
+ QUERY_MACHINES,
2640
+ QUERY_PROJECTS,
2641
+ QUERY_PROJECT_FOR_METADATA_UPDATE,
2642
+ QUERY_PROJECT_TYPES,
2643
+ QUERY_PROPOSAL,
2644
+ QUERY_RESOURCE,
2645
+ QUERY_RESOURCE_PROPOSALS,
2646
+ QUERY_RESOURCE_TRACE_DPP,
2647
+ QUERY_UNIT_AND_CURRENCY,
2648
+ QUERY_VARIABLES,
2401
2649
  RECYCLABILITY_THRESHOLDS_PCT,
2650
+ REGISTER_USER,
2651
+ REJECT_PROPOSAL,
2652
+ RELOCATE_PROJECT,
2402
2653
  REPAIRABILITY_AVAILABLE_TAG,
2403
2654
  REPLICABILITY_OPTIONS,
2404
2655
  ResourceClient,
2656
+ SATISFY_INTENTS,
2657
+ SEARCH_PEOPLE,
2658
+ SEARCH_PERSON,
2659
+ SEARCH_PROJECT,
2660
+ SEARCH_PROJECTS,
2661
+ SEARCH_TAGS,
2662
+ SELECT_RESOURCES,
2663
+ SEND_EMAIL_VERIFICATION,
2405
2664
  SERVICE_TYPE_OPTIONS,
2665
+ SIGN_UP,
2406
2666
  SYSTEM_TAG_PREFIXES,
2407
2667
  SocialClient,
2408
2668
  TAG_PREFIX,
2669
+ TRANSFER_PROJECT,
2409
2670
  TaggingClient,
2671
+ UPDATE_CONTRIBUTION,
2672
+ UPDATE_METADATA,
2673
+ UPDATE_RESOURCE_CLASSIFIED_AS,
2674
+ UPDATE_USER,
2675
+ VERIFY_EMAIL,
2410
2676
  WalletClient,
2411
2677
  clearInstanceVariablesCache,
2412
2678
  createConfig,