@dyne/interfacer-client 0.4.1 → 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.cjs +333 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +86 -1
- package/dist/index.d.ts +86 -1
- package/dist/index.js +273 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
|
414
|
+
images { hash name mimeType }
|
|
367
415
|
}
|
|
368
416
|
}
|
|
369
417
|
`;
|
|
@@ -406,7 +454,7 @@ var QUERY_PROJECTS = gql`
|
|
|
406
454
|
primaryAccountable { name id }
|
|
407
455
|
name id note metadata
|
|
408
456
|
onhandQuantity { hasUnit { label } }
|
|
409
|
-
images { hash name mimeType
|
|
457
|
+
images { hash name mimeType }
|
|
410
458
|
}
|
|
411
459
|
}
|
|
412
460
|
reciprocalIntents {
|
|
@@ -450,7 +498,81 @@ var QUERY_PROJECT_FOR_METADATA_UPDATE = gql`
|
|
|
450
498
|
var ASK_RESOURCE_PRIMARY_ACCOUNTABLE = gql`
|
|
451
499
|
query askResourcePrimaryAccountable($id: ID!) {
|
|
452
500
|
economicResource(id: $id) {
|
|
453
|
-
id name primaryAccountable { id name
|
|
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 }
|
|
454
576
|
}
|
|
455
577
|
}
|
|
456
578
|
`;
|
|
@@ -511,7 +633,7 @@ var QUERY_PROPOSAL = gql`
|
|
|
511
633
|
id provider { id name } receiver { id name }
|
|
512
634
|
inputOf { name id } outputOf { id name } hasPointInTime
|
|
513
635
|
resourceInventoriedAs {
|
|
514
|
-
id name repo metadata images { hash name mimeType
|
|
636
|
+
id name repo metadata images { hash name mimeType }
|
|
515
637
|
primaryAccountable { id name } onhandQuantity { hasNumericalValue hasUnit { id } }
|
|
516
638
|
}
|
|
517
639
|
resourceConformsTo { id name }
|
|
@@ -724,6 +846,18 @@ var UPDATE_RESOURCE_CLASSIFIED_AS = gql`
|
|
|
724
846
|
updateEconomicResource(resource: { id: $id classifiedAs: $classifiedAs }) { economicResource { id } }
|
|
725
847
|
}
|
|
726
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
|
+
`;
|
|
727
861
|
var RELOCATE_PROJECT = gql`
|
|
728
862
|
mutation relocateProject(
|
|
729
863
|
$process: ID! $agent: ID! $resource: ID! $quantity: IMeasure! $now: DateTime! $location: ID!
|
|
@@ -761,11 +895,71 @@ var FETCH_USER = gql`
|
|
|
761
895
|
}
|
|
762
896
|
}
|
|
763
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
|
+
`;
|
|
764
953
|
var GET_TAGS = gql`
|
|
765
954
|
query GetTags {
|
|
766
955
|
economicResourceClassifications
|
|
767
956
|
}
|
|
768
957
|
`;
|
|
958
|
+
var SEARCH_TAGS = gql`
|
|
959
|
+
query SearchTags($text: URI!) {
|
|
960
|
+
economicResourceClassifications(filter: { uri: $text })
|
|
961
|
+
}
|
|
962
|
+
`;
|
|
769
963
|
var GET_RESOURCE_DETAILS = gql`
|
|
770
964
|
query GetResourceDetails($id: ID!) {
|
|
771
965
|
proposal(id: $id) {
|
|
@@ -775,12 +969,20 @@ var GET_RESOURCE_DETAILS = gql`
|
|
|
775
969
|
resourceInventoriedAs {
|
|
776
970
|
conformsTo { name id } currentLocation { name } name id note
|
|
777
971
|
classifiedAs metadata primaryAccountable { name id }
|
|
778
|
-
onhandQuantity { hasUnit { label } } images { hash name mimeType
|
|
972
|
+
onhandQuantity { hasUnit { label } } images { hash name mimeType }
|
|
779
973
|
}
|
|
780
974
|
}
|
|
781
975
|
}
|
|
782
976
|
}
|
|
783
977
|
`;
|
|
978
|
+
var QUERY_RESOURCE_TRACE_DPP = gql`
|
|
979
|
+
query GetResourceTraceDpp($id: ID!) {
|
|
980
|
+
economicResource(id: $id) {
|
|
981
|
+
id
|
|
982
|
+
traceDpp
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
`;
|
|
784
986
|
|
|
785
987
|
// src/auth/AuthClient.ts
|
|
786
988
|
var AuthClient = class {
|
|
@@ -1820,6 +2022,12 @@ var ResourceClient = class {
|
|
|
1820
2022
|
});
|
|
1821
2023
|
if (satRes.errors?.length) throw new Error(`satisfyIntents failed: ${satRes.errors[0].message}`);
|
|
1822
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
|
+
}
|
|
1823
2031
|
async rejectProposal(intentCite, intentAccept, intentModify) {
|
|
1824
2032
|
const res = await this.graphql.request(REJECT_PROPOSAL, {
|
|
1825
2033
|
intentCite,
|
|
@@ -2381,30 +2589,90 @@ function createConfig(config) {
|
|
|
2381
2589
|
// src/index.ts
|
|
2382
2590
|
init_sign();
|
|
2383
2591
|
export {
|
|
2592
|
+
ACCEPT_PROPOSAL,
|
|
2593
|
+
ASK_RESOURCE_PRIMARY_ACCOUNTABLE,
|
|
2384
2594
|
AVAILABILITY_OPTIONS,
|
|
2385
2595
|
AuthClient,
|
|
2596
|
+
CITE_PROJECT,
|
|
2597
|
+
CLAIM_DID,
|
|
2386
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,
|
|
2387
2608
|
DppClient,
|
|
2609
|
+
EDIT_IMAGES,
|
|
2610
|
+
EDIT_MAIN,
|
|
2611
|
+
EDIT_SPECS,
|
|
2388
2612
|
ENERGY_THRESHOLDS_KWH,
|
|
2613
|
+
FETCH_AGENTS,
|
|
2614
|
+
FETCH_RESOURCES,
|
|
2615
|
+
FETCH_SELF,
|
|
2616
|
+
FETCH_USER,
|
|
2617
|
+
FORK_PROJECT,
|
|
2389
2618
|
FeedbackClient,
|
|
2390
2619
|
FileClient,
|
|
2620
|
+
GET_PROJECT_LAYOUT,
|
|
2621
|
+
GET_RESOURCE_DETAILS,
|
|
2622
|
+
GET_TAGS,
|
|
2623
|
+
GET_USER_IMAGES,
|
|
2624
|
+
GET_USER_LAYOUT,
|
|
2391
2625
|
GraphQLClient,
|
|
2392
2626
|
ImportClient,
|
|
2393
2627
|
InboxClient,
|
|
2394
2628
|
InterfacerClient,
|
|
2629
|
+
LINK_CONTRIBUTION_PROPOSAL_INTENT,
|
|
2630
|
+
LINK_PROPOSAL_AND_INTENT,
|
|
2395
2631
|
MANUFACTURABLE_TRUE_TAG,
|
|
2632
|
+
PERSON_EXISTS,
|
|
2396
2633
|
POWER_COMPATIBILITY_OPTIONS,
|
|
2397
2634
|
POWER_REQUIREMENT_THRESHOLDS_W,
|
|
2398
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,
|
|
2399
2649
|
RECYCLABILITY_THRESHOLDS_PCT,
|
|
2650
|
+
REGISTER_USER,
|
|
2651
|
+
REJECT_PROPOSAL,
|
|
2652
|
+
RELOCATE_PROJECT,
|
|
2400
2653
|
REPAIRABILITY_AVAILABLE_TAG,
|
|
2401
2654
|
REPLICABILITY_OPTIONS,
|
|
2402
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,
|
|
2403
2664
|
SERVICE_TYPE_OPTIONS,
|
|
2665
|
+
SIGN_UP,
|
|
2404
2666
|
SYSTEM_TAG_PREFIXES,
|
|
2405
2667
|
SocialClient,
|
|
2406
2668
|
TAG_PREFIX,
|
|
2669
|
+
TRANSFER_PROJECT,
|
|
2407
2670
|
TaggingClient,
|
|
2671
|
+
UPDATE_CONTRIBUTION,
|
|
2672
|
+
UPDATE_METADATA,
|
|
2673
|
+
UPDATE_RESOURCE_CLASSIFIED_AS,
|
|
2674
|
+
UPDATE_USER,
|
|
2675
|
+
VERIFY_EMAIL,
|
|
2408
2676
|
WalletClient,
|
|
2409
2677
|
clearInstanceVariablesCache,
|
|
2410
2678
|
createConfig,
|