@kubun/standalone 0.6.0 → 0.6.1

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/lib/graphql.d.ts CHANGED
@@ -1,6 +1,8 @@
1
+ import type { KubunDB } from '@kubun/db';
1
2
  import type { Context } from '@kubun/graphql';
2
3
  import { type HLC, type MutationContext } from '@kubun/mutation';
3
4
  export type ExecutionContext = MutationContext & {
5
+ db: KubunDB;
4
6
  did: string;
5
7
  hlc: HLC;
6
8
  };
package/lib/graphql.js CHANGED
@@ -1 +1 @@
1
- import{createReadContext as e}from"@kubun/graphql";import{applyChangeMutation as t,applySetMutation as o,convertPatchInput as n,createMutationOperations as c}from"@kubun/mutation";export function createContext(a){let r=c({issuer:a.did,hlc:a.hlc,processSetMutation:e=>o(a,e),processChangeMutation:e=>t(a,e)});return{...e({db:a.db,viewerDID:a.did}),executeCreateMutation:async(e,t)=>await r.createDocument(e,t),executeSetMutation:async(e,t,o)=>await r.setDocument(e,t,o),executeUpdateMutation:async e=>await r.updateDocument(e.id,n(e.patch)),async executeRemoveMutation(e){await r.removeDocument(e)},async executeSetModelAccessDefaults(){throw Error("Access control mutations are not supported in standalone mode")},async executeRemoveModelAccessDefaults(){throw Error("Access control mutations are not supported in standalone mode")},async executeSetDocumentAccessOverride(){throw Error("Access control mutations are not supported in standalone mode")},async executeRemoveDocumentAccessOverride(){throw Error("Access control mutations are not supported in standalone mode")}}}
1
+ import{createReadContext as t}from"@kubun/graphql";import{applyChangeMutation as e,applySetMutation as o,convertPatchInput as n,createMutationOperations as a}from"@kubun/mutation";export function createContext(r){let c=a({issuer:r.did,hlc:r.hlc,processSetMutation:t=>o(r,t),processChangeMutation:t=>e(r,t)});return{...t({db:r.db,viewerDID:r.did}),executeCreateMutation:async({modelID:t,data:e})=>await c.createDocument({modelID:t,data:e}),executeSetMutation:async({modelID:t,unique:e,data:o})=>await c.setDocument({modelID:t,unique:e,data:o}),executeUpdateMutation:async({input:t})=>await c.updateDocument({docID:t.id,patch:n(t.patch)}),async executeRemoveMutation({id:t}){await c.removeDocument({docID:t})},async executeSetModelAccessDefaults(){throw Error("Access control mutations are not supported in standalone mode")},async executeRemoveModelAccessDefaults(){throw Error("Access control mutations are not supported in standalone mode")},async executeSetDocumentAccessOverride(){throw Error("Access control mutations are not supported in standalone mode")},async executeRemoveDocumentAccessOverride(){throw Error("Access control mutations are not supported in standalone mode")},beginTransaction(){throw Error("Transaction mutations are not supported in standalone mode")},async commitTransaction(){throw Error("Transaction mutations are not supported in standalone mode")},rollbackTransaction(){throw Error("Transaction mutations are not supported in standalone mode")}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubun/standalone",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "license": "see LICENSE.md",
5
5
  "keywords": [],
6
6
  "type": "module",
@@ -15,11 +15,11 @@
15
15
  ],
16
16
  "sideEffects": false,
17
17
  "dependencies": {
18
- "graphql": "^16.12.0",
19
- "@kubun/logger": "^0.6.0",
20
- "@kubun/mutation": "^0.6.0",
18
+ "graphql": "^16.13.1",
19
+ "@kubun/graphql": "^0.6.1",
20
+ "@kubun/logger": "^0.6.1",
21
21
  "@kubun/protocol": "^0.6.0",
22
- "@kubun/graphql": "^0.6.0"
22
+ "@kubun/mutation": "^0.6.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@kubun/db": "^0.6.0",