Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
j03-dev committed Jan 14, 2025
2 parents 6d2f9ba + dd910d7 commit d0473bd
Show file tree
Hide file tree
Showing 103 changed files with 3,098 additions and 2,580 deletions.
9 changes: 7 additions & 2 deletions .ghjk/lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@
}
]
},
"bciqkxr25pjywutrwjgdbuqvhukulifkffcybdcswmbdp6g57uyxalty": {
"bciqmz5es3gg7277grznhdd22rd7tx646occ5qzm455dezuo24mfod6y": {
"provides": [
{
"ty": "posix.envVar",
Expand Down Expand Up @@ -2018,6 +2018,11 @@
"key": "V8_FORCE_DEBUG",
"val": "true"
},
{
"ty": "posix.envVar",
"key": "RUST_JOBS",
"val": "8"
},
{
"ty": "ghjk.ports.InstallSetRef",
"setId": "ghjkEnvProvInstSet___dev"
Expand Down Expand Up @@ -2066,7 +2071,7 @@
"_ecma": "bciqcqqs4e5l7nqt57e4bku3gjdxs2iruhfdl2ocayrkkcs4otx7ig7a",
"_rust": "bciqof7ogmp2lx2bzmkbrtmdmrmj7seytb6bl2sb4uhnsxkf5v24m75i",
"ci": "bciqbjavwy7rbire3zwlpgo2ifwzgnm6ywxqswnh6qxezwuvc4bqhrca",
"dev": "bciqkxr25pjywutrwjgdbuqvhukulifkffcybdcswmbdp6g57uyxalty",
"dev": "bciqmz5es3gg7277grznhdd22rd7tx646occ5qzm455dezuo24mfod6y",
"oci": "bciqmkulmynzdor24gykcjc2vtu2vmzcgavyyytftuf4sibd7yutzmvy"
}
}
Expand Down
49 changes: 49 additions & 0 deletions deno.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Synchronization variable names start with `SYNC_`.
| SYNC\__S3_SECRET_KEY (\_Required_) | Access key secret for the S3 store credentials; |
| SYNC\__S3_PATH_STYLE (\_Optional_) | `true` or `false`, force path style if `true`. |
| SYNC\__S3_BUCKET (\_Required_) | The bucket to be used for the system (dedicated). |
| SYNC\__FORCE_REMOVE (\_Optional_) | `true` or `false`, Undeploy cached typegraphs at boot |

## Synchronized mode features

Expand Down
2 changes: 1 addition & 1 deletion examples/typegraphs/metagen/rs/fdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl Router {
}

pub fn init(&self, args: InitArgs) -> Result<InitResponse, InitError> {
static MT_VERSION: &str = "0.5.0-rc.8";
static MT_VERSION: &str = "0.5.0-rc.9";
if args.metatype_version != MT_VERSION {
return Err(InitError::VersionMismatch(MT_VERSION.into()));
}
Expand Down
2 changes: 2 additions & 0 deletions ghjk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ env("dev")
// debug v8 to fix MET-633: segementation fault bug with custom deno rt
// doesn't appear in CI so only dev envs get it
.var("V8_FORCE_DEBUG", "true")
// limit to 8 cores to avoid exhausting memory
.var("RUST_JOBS", "8")
.install(
ports.act(),
ports.cargobi({ crateName: "whiz", locked: true }),
Expand Down
42 changes: 42 additions & 0 deletions src/common/src/typegraph/runtimes/deno.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0

use anyhow::{anyhow, Context, Result};
use indexmap::IndexMap;
use serde::{Deserialize, Serialize};
use serde_json::Value;
Expand All @@ -11,6 +12,47 @@ pub struct FunctionMatData {
pub script: String,
}

#[derive(Serialize, Deserialize, Clone, Debug, Hash, PartialEq, Eq)]
#[serde(tag = "type", content = "value")]
#[serde(rename_all = "snake_case")]
pub enum ContextCheckX {
NotNull,
Value(String),
Pattern(String),
}

#[derive(PartialEq, Eq, Hash, Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "snake_case")]
#[serde(tag = "name", content = "param")]
pub enum PredefinedFunctionMatData {
Identity,
True,
False,
Allow,
Deny,
Pass,
InternalPolicy,
ContextCheck { key: String, value: ContextCheckX },
}

#[derive(Serialize)]
struct PredefinedFunctionMatDataRaw {
name: String,
param: Option<Value>,
}

impl PredefinedFunctionMatData {
pub fn from_raw(name: String, param: Option<String>) -> Result<Self> {
let param = param
.map(|p| serde_json::from_str(&p))
.transpose()
.context("invalid predefined function materializer parameter")?;
let value = serde_json::to_value(&PredefinedFunctionMatDataRaw { name, param })?;
serde_json::from_value(value)
.map_err(|e| anyhow!("invalid predefined function materializer: {e:?}"))
}
}

#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct ModuleMatData {
Expand Down
1 change: 1 addition & 0 deletions src/typegate/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export function transformSyncConfig(raw: SyncConfig): SyncConfigX {
redis,
s3,
s3Bucket: raw.s3_bucket,
forceRemove: raw.force_remove
};
}

Expand Down
2 changes: 2 additions & 0 deletions src/typegate/src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,14 @@ export const syncConfigSchema = z.object({
s3_access_key: refineEnvVar("SYNC_S3_ACCESS_KEY"),
s3_secret_key: refineEnvVar("SYNC_S3_SECRET_KEY"),
s3_path_style: zBooleanString.default(false),
force_remove: zBooleanString.default(false),
});
export type SyncConfig = z.infer<typeof syncConfigSchema>;
export type SyncConfigX = {
redis: RedisConnectOptions;
s3: S3ClientConfig;
s3Bucket: string;
forceRemove?: boolean
};

export type TypegateConfig = {
Expand Down
1 change: 0 additions & 1 deletion src/typegate/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ try {
base: defaultTypegateConfigBase,
});
const typegate = await Typegate.init(config);

await SystemTypegraph.loadAll(typegate, !globalConfig.packaged);

const server = Deno.serve(
Expand Down
Loading

0 comments on commit d0473bd

Please sign in to comment.