Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@eslint/eslintrc": "^3.3.0",
"@eslint/js": "^9.22.0",
"@junobuild/config": "^0.1.3",
"@junobuild/functions": "^0.0.12",
"@junobuild/functions": "^0.0.13",
"@types/node": "^22.13.10",
"@types/prompts": "^2.4.9",
"@types/semver": "^7.5.8",
Expand Down
59 changes: 57 additions & 2 deletions templates/eject/javascript/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,67 @@ import {defineAssert, defineHook} from '@junobuild/functions';
// However, if you don’t have to implement all of them, for example to improve readability or reduce unnecessary logic,
// you can selectively delete the features you do not need.

export const onSetDoc = defineHook({
collections: [],
run: async (context) => {}
});

export const onSetManyDocs = defineHook({
collections: [],
run: async (context) => {}
});

export const onDeleteDoc = defineHook({
collections: [],
run: async (context) => {}
});

export const onDeleteManyDocs = defineHook({
collections: [],
run: async (context) => {}
});

export const onDeleteFilteredDocs = defineHook({
collections: [],
run: async (context) => {}
});

export const onUploadAsset = defineHook({
collections: [],
run: async (context) => {}
});

export const onDeleteAsset = defineHook({
collections: [],
run: async (context) => {}
});

export const onDeleteManyAssets = defineHook({
collections: [],
run: async (context) => {}
});

export const onDeleteFilteredAssets = defineHook({
collections: [],
run: async (context) => {}
});

export const assertSetDoc = defineAssert({
collections: [],
assert: (context) => {}
});

export const onSetDoc = defineHook({
export const assertDeleteDoc = defineAssert({
collections: [],
run: async (context) => {}
assert: (context) => {}
});

export const assertUploadAsset = defineAssert({
collections: [],
assert: (context) => {}
});

export const assertDeleteAsset = defineAssert({
collections: [],
assert: (context) => {}
});
77 changes: 74 additions & 3 deletions templates/eject/typescript/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,86 @@
import {type AssertSetDoc, defineAssert, defineHook, type OnSetDoc} from '@junobuild/functions';
import {
type AssertDeleteAsset,
type AssertDeleteDoc,
type AssertSetDoc,
type AssertUploadAsset,
defineAssert,
defineHook,
type OnDeleteAsset,
type OnDeleteDoc,
type OnDeleteFilteredAssets,
type OnDeleteFilteredDocs,
type OnDeleteManyAssets,
type OnDeleteManyDocs,
type OnSetDoc,
type OnSetManyDocs,
OnUploadAsset
} from '@junobuild/functions';

// All the available hooks and assertions for your Datastore and Storage are scaffolded by default in this module.
// However, if you don’t have to implement all of them, for example to improve readability or reduce unnecessary logic,
// you can selectively delete the features you do not need.

export const onSetDoc = defineHook<OnSetDoc>({
collections: [],
run: async (context) => {}
});

export const onSetManyDocs = defineHook<OnSetManyDocs>({
collections: [],
run: async (context) => {}
});

export const onDeleteDoc = defineHook<OnDeleteDoc>({
collections: [],
run: async (context) => {}
});

export const onDeleteManyDocs = defineHook<OnDeleteManyDocs>({
collections: [],
run: async (context) => {}
});

export const onDeleteFilteredDocs = defineHook<OnDeleteFilteredDocs>({
collections: [],
run: async (context) => {}
});

export const onUploadAsset = defineHook<OnUploadAsset>({
collections: [],
run: async (context) => {}
});

export const onDeleteAsset = defineHook<OnDeleteAsset>({
collections: [],
run: async (context) => {}
});

export const onDeleteManyAssets = defineHook<OnDeleteManyAssets>({
collections: [],
run: async (context) => {}
});

export const onDeleteFilteredAssets = defineHook<OnDeleteFilteredAssets>({
collections: [],
run: async (context) => {}
});

export const assertSetDoc = defineAssert<AssertSetDoc>({
collections: [],
assert: (context) => {}
});

export const onSetDoc = defineHook<OnSetDoc>({
export const assertDeleteDoc = defineAssert<AssertDeleteDoc>({
collections: [],
run: async (context) => {}
assert: (context) => {}
});

export const assertUploadAsset = defineAssert<AssertUploadAsset>({
collections: [],
assert: (context) => {}
});

export const assertDeleteAsset = defineAssert<AssertDeleteAsset>({
collections: [],
assert: (context) => {}
});