Skip to content

Commit

Permalink
Merge pull request #1641 from demergent-labs/remove_candid
Browse files Browse the repository at this point in the history
Remove candid
  • Loading branch information
lastmjs authored Feb 12, 2024
2 parents 93f75dc + e9caa62 commit 9fbd0c5
Show file tree
Hide file tree
Showing 17 changed files with 407 additions and 329 deletions.
1 change: 1 addition & 0 deletions examples/apollo_server/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "custom",
"main": "src/index.ts",
"candid": "src/index.did",
"candid_gen": "http",
"build": "npx azle apollo_server",
"wasm": ".azle/apollo_server/apollo_server.wasm",
"gzip": true
Expand Down
1 change: 1 addition & 0 deletions examples/audio_recorder/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "custom",
"main": "src/index.ts",
"candid": "src/index.did",
"candid_gen": "custom",
"build": "npx azle audio_recorder",
"wasm": ".azle/audio_recorder/audio_recorder.wasm",
"gzip": true,
Expand Down
36 changes: 28 additions & 8 deletions examples/audio_recorder/src/index.did
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
type User = record {
id: principal;
createdAt: nat64;
recordingIds: vec principal;
username: text;
};

type Recording = record {
id: principal;
audio: blob;
createdAt: nat64;
name: text;
userId: principal;
};

type AudioRecorderError = variant {
RecordingDoesNotExist: principal;
UserDoesNotExist: principal;
};

service: () -> {
createRecording: (vec nat8, text, principal) -> (variant {Ok:record {id:principal; audio:vec nat8; userId:principal; name:text; createdAt:nat64}; Err:variant {RecordingDoesNotExist:principal; UserDoesNotExist:principal}});
createUser: (text) -> (record {id:principal; username:text; recordingIds:vec principal; createdAt:nat64});
deleteRecording: (principal) -> (variant {Ok:record {id:principal; audio:vec nat8; userId:principal; name:text; createdAt:nat64}; Err:variant {RecordingDoesNotExist:principal; UserDoesNotExist:principal}});
deleteUser: (principal) -> (variant {Ok:record {id:principal; username:text; recordingIds:vec principal; createdAt:nat64}; Err:variant {RecordingDoesNotExist:principal; UserDoesNotExist:principal}});
readRecordingById: (principal) -> (opt record {id:principal; audio:vec nat8; userId:principal; name:text; createdAt:nat64}) query;
readRecordings: () -> (vec record {id:principal; audio:vec nat8; userId:principal; name:text; createdAt:nat64}) query;
readUserById: (principal) -> (opt record {id:principal; username:text; recordingIds:vec principal; createdAt:nat64}) query;
readUsers: () -> (vec record {id:principal; username:text; recordingIds:vec principal; createdAt:nat64}) query;
createUser: (text) -> (User);
readUsers: () -> (vec User) query;
readUserById: (principal) -> (opt User) query;
deleteUser: (principal) -> (variant { Ok: User; Err: AudioRecorderError });
createRecording: (vec nat8, text, principal) -> (variant { Ok: Recording; Err: AudioRecorderError });
readRecordings: () -> (vec Recording) query;
readRecordingById: (principal) -> (opt Recording) query;
deleteRecording: (principal) -> (variant { Ok: Recording; Err: AudioRecorderError });
}
1 change: 1 addition & 0 deletions examples/complex_types/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "custom",
"main": "src/index.ts",
"candid": "src/index.did",
"candid_gen": "custom",
"build": "npx azle complex_types",
"wasm": ".azle/complex_types/complex_types.wasm",
"gzip": true,
Expand Down
75 changes: 0 additions & 75 deletions examples/complex_types/src/complex_types.did

This file was deleted.

100 changes: 44 additions & 56 deletions examples/complex_types/src/index.did
Original file line number Diff line number Diff line change
@@ -1,58 +1,46 @@
type rec_441 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_441; posts:vec rec_440}; posts:vec rec_440; reactions:vec record {id:text; post:rec_440; author:rec_441; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_443 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_443; posts:vec rec_440}; posts:vec rec_440; reactions:vec record {id:text; post:rec_440; author:rec_443; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_442 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_442; posts:vec rec_440}; posts:vec rec_440; reactions:vec record {id:text; post:rec_440; author:rec_442; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_440 = record {id:text; text:text; author:rec_441; thread:record {id:text; title:text; author:rec_443; posts:vec rec_440}; reactions:vec record {id:text; post:rec_440; author:rec_442; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_485 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_485; posts:vec rec_484}; posts:vec rec_484; reactions:vec record {id:text; post:rec_484; author:rec_485; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_487 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_487; posts:vec rec_484}; posts:vec rec_484; reactions:vec record {id:text; post:rec_484; author:rec_487; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_486 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_486; posts:vec rec_484}; posts:vec rec_484; reactions:vec record {id:text; post:rec_484; author:rec_486; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_484 = record {id:text; text:text; author:rec_485; thread:record {id:text; title:text; author:rec_487; posts:vec rec_484}; reactions:vec record {id:text; post:rec_484; author:rec_486; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_483 = record {id:text; text:text; author:rec_480; thread:record {id:text; title:text; author:rec_480; posts:vec rec_483}; reactions:vec record {id:text; post:rec_483; author:rec_480; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_481 = record {id:text; text:text; author:rec_480; thread:record {id:text; title:text; author:rec_480; posts:vec rec_481}; reactions:vec record {id:text; post:rec_481; author:rec_480; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_482 = record {id:text; text:text; author:rec_480; thread:record {id:text; title:text; author:rec_480; posts:vec rec_482}; reactions:vec record {id:text; post:rec_482; author:rec_480; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_480 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_480; posts:vec rec_483}; posts:vec rec_481; reactions:vec record {id:text; post:rec_482; author:rec_480; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_547 = record {id:text; text:text; author:rec_544; thread:record {id:text; title:text; author:rec_544; posts:vec rec_547}; reactions:vec record {id:text; post:rec_547; author:rec_544; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_545 = record {id:text; text:text; author:rec_544; thread:record {id:text; title:text; author:rec_544; posts:vec rec_545}; reactions:vec record {id:text; post:rec_545; author:rec_544; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_546 = record {id:text; text:text; author:rec_544; thread:record {id:text; title:text; author:rec_544; posts:vec rec_546}; reactions:vec record {id:text; post:rec_546; author:rec_544; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_544 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_544; posts:vec rec_547}; posts:vec rec_545; reactions:vec record {id:text; post:rec_546; author:rec_544; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_549 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_549; posts:vec rec_548}; posts:vec rec_548; reactions:vec record {id:text; post:rec_548; author:rec_549; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_551 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_551; posts:vec rec_548}; posts:vec rec_548; reactions:vec record {id:text; post:rec_548; author:rec_551; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_550 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_550; posts:vec rec_548}; posts:vec rec_548; reactions:vec record {id:text; post:rec_548; author:rec_550; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_548 = record {id:text; text:text; author:rec_549; thread:record {id:text; title:text; author:rec_551; posts:vec rec_548}; reactions:vec record {id:text; post:rec_548; author:rec_550; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_603 = record {id:text; text:text; author:rec_600; thread:record {id:text; title:text; author:rec_600; posts:vec rec_603}; reactions:vec record {id:text; post:rec_603; author:rec_600; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_601 = record {id:text; text:text; author:rec_600; thread:record {id:text; title:text; author:rec_600; posts:vec rec_601}; reactions:vec record {id:text; post:rec_601; author:rec_600; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_602 = record {id:text; text:text; author:rec_600; thread:record {id:text; title:text; author:rec_600; posts:vec rec_602}; reactions:vec record {id:text; post:rec_602; author:rec_600; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_600 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_600; posts:vec rec_603}; posts:vec rec_601; reactions:vec record {id:text; post:rec_602; author:rec_600; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_457 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_457; posts:vec rec_456}; posts:vec rec_456; reactions:vec record {id:text; post:rec_456; author:rec_457; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_459 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_459; posts:vec rec_456}; posts:vec rec_456; reactions:vec record {id:text; post:rec_456; author:rec_459; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_458 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_458; posts:vec rec_456}; posts:vec rec_456; reactions:vec record {id:text; post:rec_456; author:rec_458; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_456 = record {id:text; text:text; author:rec_457; thread:record {id:text; title:text; author:rec_459; posts:vec rec_456}; reactions:vec record {id:text; post:rec_456; author:rec_458; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_517 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_517; posts:vec rec_516}; posts:vec rec_516; reactions:vec record {id:text; post:rec_516; author:rec_517; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_519 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_519; posts:vec rec_516}; posts:vec rec_516; reactions:vec record {id:text; post:rec_516; author:rec_519; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_518 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_518; posts:vec rec_516}; posts:vec rec_516; reactions:vec record {id:text; post:rec_516; author:rec_518; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_516 = record {id:text; text:text; author:rec_517; thread:record {id:text; title:text; author:rec_519; posts:vec rec_516}; reactions:vec record {id:text; post:rec_516; author:rec_518; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_515 = record {id:text; text:text; author:rec_512; thread:record {id:text; title:text; author:rec_512; posts:vec rec_515}; reactions:vec record {id:text; post:rec_515; author:rec_512; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_513 = record {id:text; text:text; author:rec_512; thread:record {id:text; title:text; author:rec_512; posts:vec rec_513}; reactions:vec record {id:text; post:rec_513; author:rec_512; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_514 = record {id:text; text:text; author:rec_512; thread:record {id:text; title:text; author:rec_512; posts:vec rec_514}; reactions:vec record {id:text; post:rec_514; author:rec_512; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_512 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_512; posts:vec rec_515}; posts:vec rec_513; reactions:vec record {id:text; post:rec_514; author:rec_512; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_579 = record {id:text; text:text; author:rec_576; thread:record {id:text; title:text; author:rec_576; posts:vec rec_579}; reactions:vec record {id:text; post:rec_579; author:rec_576; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_577 = record {id:text; text:text; author:rec_576; thread:record {id:text; title:text; author:rec_576; posts:vec rec_577}; reactions:vec record {id:text; post:rec_577; author:rec_576; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_578 = record {id:text; text:text; author:rec_576; thread:record {id:text; title:text; author:rec_576; posts:vec rec_578}; reactions:vec record {id:text; post:rec_578; author:rec_576; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_576 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_576; posts:vec rec_579}; posts:vec rec_577; reactions:vec record {id:text; post:rec_578; author:rec_576; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_581 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_581; posts:vec rec_580}; posts:vec rec_580; reactions:vec record {id:text; post:rec_580; author:rec_581; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_583 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_583; posts:vec rec_580}; posts:vec rec_580; reactions:vec record {id:text; post:rec_580; author:rec_583; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_582 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_582; posts:vec rec_580}; posts:vec rec_580; reactions:vec record {id:text; post:rec_580; author:rec_582; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_580 = record {id:text; text:text; author:rec_581; thread:record {id:text; title:text; author:rec_583; posts:vec rec_580}; reactions:vec record {id:text; post:rec_580; author:rec_582; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_619 = record {id:text; text:text; author:rec_616; thread:record {id:text; title:text; author:rec_616; posts:vec rec_619}; reactions:vec record {id:text; post:rec_619; author:rec_616; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_617 = record {id:text; text:text; author:rec_616; thread:record {id:text; title:text; author:rec_616; posts:vec rec_617}; reactions:vec record {id:text; post:rec_617; author:rec_616; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_618 = record {id:text; text:text; author:rec_616; thread:record {id:text; title:text; author:rec_616; posts:vec rec_618}; reactions:vec record {id:text; post:rec_618; author:rec_616; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type rec_616 = record {id:text; username:text; threads:vec record {id:text; title:text; author:rec_616; posts:vec rec_619}; posts:vec rec_617; reactions:vec record {id:text; post:rec_618; author:rec_616; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}};
type Post = record {
id: text;
author: User;
reactions: vec Reaction;
text: text;
thread: Thread;
};

type Reaction = record {
id: text;
author: User;
post: Post;
reactionType: ReactionType;
};

type ReactionType = variant {
Fire;
ThumbsUp;
ThumbsDown;
};

type Thread = record {
id: text;
author: User;
posts: vec Post;
title: text;
};

type User = record {
id: text;
posts: vec Post;
reactions: vec Reaction;
threads: vec Thread;
username: text;
};

service: () -> {
createPost: (text, text, text, nat32) -> (rec_440);
createReaction: (text, text, variant {Fire; ThumbsDown; ThumbsUp}, nat32) -> (record {id:text; post:rec_484; author:rec_480; reactionType:variant {Fire; ThumbsDown; ThumbsUp}});
createThread: (text, text, nat32) -> (record {id:text; title:text; author:rec_544; posts:vec rec_548});
createUser: (text, nat32) -> (rec_600);
getAllPosts: (nat32) -> (vec rec_456) query;
getAllReactions: (nat32) -> (vec record {id:text; post:rec_516; author:rec_512; reactionType:variant {Fire; ThumbsDown; ThumbsUp}}) query;
getAllThreads: (nat32) -> (vec record {id:text; title:text; author:rec_576; posts:vec rec_580}) query;
getAllUsers: (nat32) -> (vec rec_616) query;
createPost: (text, text, text, nat32) -> (Post);
getAllPosts: (nat32) -> (vec Post) query;
createReaction: (text, text, ReactionType, nat32) -> (Reaction);
getAllReactions: (nat32) -> (vec Reaction) query;
createThread: (text, text, nat32) -> (Thread);
getAllThreads: (nat32) -> (vec Thread) query;
createUser: (text, nat32) -> (User);
getAllUsers: (nat32) -> (vec User) query;
}
1 change: 1 addition & 0 deletions examples/ethers/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "custom",
"main": "src/index.ts",
"candid": "src/index.did",
"candid_gen": "http",
"build": "npx azle ethers",
"wasm": ".azle/ethers/ethers.wasm",
"gzip": true
Expand Down
1 change: 1 addition & 0 deletions examples/express/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "custom",
"main": "src/backend/index.ts",
"candid": "src/backend/index.did",
"candid_gen": "http",
"build": "npx azle express",
"wasm": ".azle/express/express.wasm",
"gzip": true,
Expand Down
1 change: 1 addition & 0 deletions examples/fs/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "custom",
"main": "src/index.ts",
"candid": "src/index.did",
"candid_gen": "http",
"build": "npx azle fs",
"wasm": ".azle/fs/fs.wasm",
"gzip": true
Expand Down
1 change: 1 addition & 0 deletions examples/hello_world/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "custom",
"main": "src/backend/index.ts",
"candid": "src/backend/index.did",
"candid_gen": "http",
"build": "npx azle backend",
"wasm": ".azle/backend/backend.wasm",
"gzip": true,
Expand Down
1 change: 1 addition & 0 deletions examples/ic_evm_rpc/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "custom",
"main": "src/server.ts",
"candid": "src/server.did",
"candid_gen": "http",
"build": "npx azle server",
"wasm": ".azle/server/server.wasm",
"gzip": true,
Expand Down
Loading

0 comments on commit 9fbd0c5

Please sign in to comment.