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

fix: Bump client-js and update usage #419

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class {{pascal_case collection_name}} extends LitElement {
signaledHashes: Array<{{referenceable.hash_type}}> = [];

_fetch{{pascal_case (plural referenceable.name)}} = new Task(this, ([{{#if (eq collection_type.type "ByAuthor")}}author{{/if}}]: any) => this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case collection_name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export class Create{{pascal_case entry_type.name}} extends LitElement {

try {
const record: Record = await this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'create_{{snake_case entry_type.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export class {{pascal_case (plural ../entry_type.name)}}For{{pascal_case linked_
hashes: Array<ActionHash> = [];

_fetch{{pascal_case (plural ../entry_type.name)}} = new Task(this, ([{{camel_case linked_from.singular_arg}}]: Array<{{linked_from.hash_type}}>) => this.client.callZome({
cap_secret: null,
role_name: '{{../dna_role_name}}',
zome_name: '{{../coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural ../entry_type.name)}}_for_{{snake_case linked_from.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export class Edit{{pascal_case entry_type.name}} extends LitElement {

try {
const updateRecord: Record = await this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'update_{{snake_case entry_type.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class {{pascal_case entry_type.name}}Detail extends LitElement {
{{camel_case entry_type.name}}Hash!: {{#if entry_type.reference_entry_hash}}EntryHash{{else}}ActionHash{{/if}};

_fetchRecord = new Task(this, ([{{camel_case entry_type.name}}Hash]: Array<{{#if entry_type.reference_entry_hash}}EntryHash{{else}}ActionHash{{/if}}>) => this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: '{{#if crud.update}}get_latest_{{snake_case entry_type.name}}{{else}}get_{{snake_case entry_type.name}}{{/if}}',
Expand All @@ -53,7 +52,6 @@ export class {{pascal_case entry_type.name}}Detail extends LitElement {
async delete{{pascal_case entry_type.name}}() {
try {
await this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'delete_{{snake_case entry_type.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class {{pascal_case (plural from_referenceable.name)}}For{{pascal_case to
{{camel_case to_referenceable.singular_arg}}!: {{to_referenceable.hash_type}};

_fetch{{pascal_case (plural from_referenceable.name)}} = new Task(this, ([{{camel_case to_referenceable.singular_arg}}]: Array<{{to_referenceable.hash_type}}>) => this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural from_referenceable.name)}}_for_{{snake_case to_referenceable.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export class {{pascal_case (plural to_referenceable.name)}}For{{pascal_case from
signaledHashes: Array<{{to_referenceable.hash_type}}> = [];

_fetch{{pascal_case (plural to_referenceable.name)}} = new Task(this, ([{{camel_case from_referenceable.singular_arg}}]: Array<{{from_referenceable.hash_type}}>) => this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural to_referenceable.name)}}_for_{{snake_case from_referenceable.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const {{pascal_case collection_name}}: FC{{#if (eq collection_type.type "ByAutho
setLoading(true)
try {
const links: Link[] = await client?.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{snake_case coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case collection_name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ const Create{{pascal_case entry_type.name}}: FC<Create{{pascal_case entry_type.n
const [is{{pascal_case entry_type.name}}Valid, setIs{{pascal_case entry_type.name}}Valid] = useState(false);

const create{{pascal_case entry_type.name}} = async () => {
const {{camel_case entry_type.name}}Entry: {{pascal_case entry_type.name}} = {
const {{camel_case entry_type.name}}Entry: {{pascal_case entry_type.name}} = {
{{#each entry_type.fields}}
{{snake_case field_name}}: {{camel_case field_name}}{{#if (eq cardinality "single")}}!{{/if}},
{{/each}}
};
try {
const record = await client?.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'create_{{snake_case entry_type.name}}',
Expand Down Expand Up @@ -84,4 +83,4 @@ interface Create{{pascal_case entry_type.name}}Props {
{{/each}}
}

export default Create{{pascal_case entry_type.name}};
export default Create{{pascal_case entry_type.name}};
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const {{pascal_case (plural ../entry_type.name)}}For{{pascal_case linked_from.na
setLoading(true)
try {
const links: Link[] = await client?.callZome({
cap_secret: null,
role_name: '{{../dna_role_name}}',
zome_name: '{{../coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural ../entry_type.name)}}_for_{{snake_case linked_from.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const Edit{{pascal_case entry_type.name}}: FC<Edit{{pascal_case entry_type.name}
};
try {
const updateRecord = await client?.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'update_{{snake_case entry_type.name}}',
Expand Down Expand Up @@ -135,4 +134,4 @@ interface Edit{{pascal_case entry_type.name}}Props {
on{{pascal_case entry_type.name}}UpdateError?: (error: HolochainError) => void,
}

export default Edit{{pascal_case entry_type.name}};
export default Edit{{pascal_case entry_type.name}};
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const {{pascal_case entry_type.name}}Detail: FC<{{pascal_case entry_type.name}}D
setRecord(undefined);
try {
const result = await client?.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: '{{#if crud.update}}get_latest_{{snake_case entry_type.name}}{{else}}get_{{snake_case entry_type.name}}{{/if}}',
Expand All @@ -50,7 +49,6 @@ const {{pascal_case entry_type.name}}Detail: FC<{{pascal_case entry_type.name}}D
setLoading(true)
try {
await client?.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'delete_{{snake_case entry_type.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const {{pascal_case (plural from_referenceable.name)}}For{{pascal_case to_refere
setLoading(true)
try {
const links: Link[] = await client?.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{snake_case coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural from_referenceable.name)}}_for_{{snake_case to_referenceable.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const {{pascal_case (plural to_referenceable.name)}}For{{pascal_case from_refere
setLoading(true)
try {
const links: Link[] = await client?.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural to_referenceable.name)}}_for_{{snake_case from_referenceable.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ async function fetch{{pascal_case (plural referenceable.name)}}() {
loading = true;
try {
const links: Array<Link> = await client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{snake_case coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case collection_name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ async function create{{pascal_case entry_type.name}}() {

try {
const record: Record = await client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'create_{{snake_case entry_type.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ async function fetch{{pascal_case (plural ../entry_type.name)}}() {
loading = true;
try {
const links: Array<Link> = await client.callZome({
cap_secret: null,
role_name: '{{../dna_role_name}}',
zome_name: '{{../coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural ../entry_type.name)}}_for_{{snake_case linked_from.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ async function update{{pascal_case entry_type.name}}() {

try {
const updateRecord: Record = await client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'update_{{snake_case entry_type.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ async function fetch{{pascal_case entry_type.name}}() {
loading = true;
try {
record = await client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: '{{#if crud.update}}get_latest_{{snake_case entry_type.name}}{{else}}get_{{snake_case entry_type.name}}{{/if}}',
Expand All @@ -62,7 +61,6 @@ async function fetch{{pascal_case entry_type.name}}() {
async function delete{{pascal_case entry_type.name}}() {
try {
await client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'delete_{{snake_case entry_type.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ onMount(async () => {
try {
loading = true;
const links: Array<Link> = await client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{snake_case coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural from_referenceable.name)}}_for_{{snake_case to_referenceable.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ onMount(async () => {
try {
loading = true;
const links: Array<Link> = await client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural to_referenceable.name)}}_for_{{snake_case from_referenceable.name}}',
Expand Down
4 changes: 1 addition & 3 deletions templates/ui-frameworks/vanilla/example/ui/index.html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
const hellos = ["hello world","hola mundo","bonjur monde","guten Tag Welt","salve mondo","你好世界","مرحبا بالعالم","こんにちは 世界","olá mundo","Привет, мир","Selam Dünya","Witaj świecie"];
const message = hellos[getRandomInt(hellos.length)];
const result = await client.callZome({
cap_secret: null,
role_name: 'hello_world',
zome_name: 'hello_world',
fn_name: 'hello_world',
Expand All @@ -66,7 +65,6 @@

async function getHellos() {
const result = await client.callZome({
cap_secret: null,
role_name: 'hello_world',
zome_name: 'hello_world',
fn_name: 'get_hellos',
Expand Down Expand Up @@ -98,4 +96,4 @@

</script>
</body>
</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export default defineComponent({
try {
this.loading = true;
const links: Array<Link> = await this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{snake_case coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case collection_name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export default defineComponent({

try {
const record: Record = await this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'create_{{snake_case entry_type.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export default defineComponent({
this.loading = true;
try {
const links: Array<Link> = await this.client.callZome({
cap_secret: null,
role_name: '{{../dna_role_name}}',
zome_name: '{{../coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural ../entry_type.name)}}_for_{{snake_case linked_from.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export default defineComponent({

try {
const updateRecord: Record = await this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'update_{{snake_case entry_type.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export default defineComponent({
try {
this.loading = true;
this.record = await this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: '{{#if crud.update}}get_latest_{{snake_case entry_type.name}}{{else}}get_{{snake_case entry_type.name}}{{/if}}',
Expand All @@ -121,7 +120,6 @@ export default defineComponent({
try {
this.loading = true
await this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'delete_{{snake_case entry_type.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default defineComponent({
try {
this.loading = true;
const links: Array<Link> = await this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural from_referenceable.name)}}_for_{{snake_case to_referenceable.name}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default defineComponent({
try {
this.loading = true;
const links: Array<Link> = await this.client.callZome({
cap_secret: null,
role_name: '{{dna_role_name}}',
zome_name: '{{coordinator_zome_manifest.name}}',
fn_name: 'get_{{snake_case (plural to_referenceable.name)}}_for_{{snake_case from_referenceable.name}}',
Expand Down