Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: ICP Ninja Migration #293

Merged
merged 6 commits into from
Mar 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
dfx generate
fxgst committed Mar 12, 2025
commit 13fb211e1c7d1020bc6e4d9933fa9ec89c30267f
81 changes: 41 additions & 40 deletions src/declarations/saved/saved.did
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
type Time = int;
type StatResult =
record {
byte_size: nat;
num_projects: nat;
};
type SavedProject =
record {
project: Project;
timestamp: Time;
};
type Project =
record {
canisters: opt vec CanisterInfo;
files: vec NamedFile;
packages: opt vec PackageInfo;
};
type PackageInfo =
record {
dir: opt text;
homepage: opt text;
name: text;
repo: text;
version: text;
};
type NamedFile =
record {
content: text;
name: text;
};
type StatResult = record {
byte_size : nat;
num_projects : nat;
};
type SavedProject = record {
project : Project;
timestamp : Time;
};
type Saved = service {
getProject : (HashId) -> (opt SavedProject) query;
getProjectsPage : (nat, nat) -> (
vec record {
HashId;
SavedProject;
}
) query;
getStats : () -> (StatResult) query;
putProject : (Project) -> (HashId);
};
type Project = record {
canisters : opt vec CanisterInfo;
files : vec NamedFile;
packages : opt vec PackageInfo;
};
type PackageInfo = record {
dir : opt text;
homepage : opt text;
name : text;
repo : text;
version : text;
};
type NamedFile = record {
content : text;
name : text;
};
type HashId = nat;
type CanisterInfo =
record {
candid: text;
id: principal;
name: text;
};
service : {
getProject: (HashId) -> (opt SavedProject) query;
getStats: () -> (StatResult) query;
putProject: (Project) -> (HashId);
}
type CanisterInfo = record {
candid : text;
id : principal;
name : text;
};
service : () -> Saved;
12 changes: 7 additions & 5 deletions src/declarations/saved/saved.did.d.ts
Original file line number Diff line number Diff line change
@@ -24,6 +24,12 @@ export interface Project {
packages: [] | [Array<PackageInfo>];
canisters: [] | [Array<CanisterInfo>];
}
export interface Saved {
getProject: ActorMethod<[HashId], [] | [SavedProject]>;
getProjectsPage: ActorMethod<[bigint, bigint], Array<[HashId, SavedProject]>>;
getStats: ActorMethod<[], StatResult>;
putProject: ActorMethod<[Project], HashId>;
}
export interface SavedProject {
timestamp: Time;
project: Project;
@@ -33,10 +39,6 @@ export interface StatResult {
num_projects: bigint;
}
export type Time = bigint;
export interface _SERVICE {
getProject: ActorMethod<[HashId], [] | [SavedProject]>;
getStats: ActorMethod<[], StatResult>;
putProject: ActorMethod<[Project], HashId>;
}
export interface _SERVICE extends Saved {}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
8 changes: 7 additions & 1 deletion src/declarations/saved/saved.did.js
Original file line number Diff line number Diff line change
@@ -24,11 +24,17 @@ export const idlFactory = ({ IDL }) => {
byte_size: IDL.Nat,
num_projects: IDL.Nat,
});
return IDL.Service({
const Saved = IDL.Service({
getProject: IDL.Func([HashId], [IDL.Opt(SavedProject)], ["query"]),
getProjectsPage: IDL.Func(
[IDL.Nat, IDL.Nat],
[IDL.Vec(IDL.Tuple(HashId, SavedProject))],
["query"],
),
getStats: IDL.Func([], [StatResult], ["query"]),
putProject: IDL.Func([Project], [HashId], []),
});
return Saved;
};
export const init = ({ IDL }) => {
return [];