Skip to content

Commit

Permalink
Merge pull request #4 from golemcloud/config_improvements
Browse files Browse the repository at this point in the history
Use @golemcloud org + Config improvements
  • Loading branch information
nicoburniske authored Jun 14, 2024
2 parents e7e1357 + b7ed07c commit f3dde33
Show file tree
Hide file tree
Showing 12 changed files with 579 additions and 557 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# golem-ts
`golem-ts` is a TypeScript library that provides high-level wrappers for Golem's runtime API, including the [transaction API](https://learn.golem.cloud/docs/transaction-api). It simplifies the process of writing Golem programs by offering a set of utilities and abstractions.
# golem
`golem` is a TypeScript library that provides high-level wrappers for Golem's runtime API, including the [transaction API](https://learn.golem.cloud/docs/transaction-api). It simplifies the process of writing Golem programs by offering a set of utilities and abstractions.

## Installation

To install `golem-ts`, use the following command:
To install `golem`, use the following command:

```bash
npm install golem-ts
npm install @golemcloud/golem-ts
```

## Features
Expand Down
52 changes: 26 additions & 26 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noUselessElse": "off"
},
"suspicious": {
"noExplicitAny": "off",
"noShadowRestrictedNames": "off"
}
}
},
"formatter": {
"enabled": true,
"lineWidth": 100,
"indentStyle": "space",
"indentWidth": 3
},
"files": {
"include": ["src/**/*"]
}
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noUselessElse": "off"
},
"suspicious": {
"noExplicitAny": "off",
"noShadowRestrictedNames": "off"
}
}
},
"formatter": {
"enabled": true,
"lineWidth": 100,
"indentStyle": "space",
"indentWidth": 4
},
"files": {
"include": ["src/**/*"]
}
}
24 changes: 20 additions & 4 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "golem-ts",
"version": "0.1.4",
"name": "@golemcloud/golem-ts",
"version": "0.1.0",
"description": "A library that help writing Golem programs by providing higher level wrappers for Golem's runtime APIs, including functions for defining and performing operations transactionally.",
"repository": {
"url": "git+https://github.com/golemcloud/golem-ts.git",
Expand All @@ -25,6 +25,7 @@
"devDependencies": {
"@biomejs/biome": "1.8.0",
"@bytecodealliance/jco": "1.2.4",
"@types/node": "^20.14.2",
"typescript": "^4.9.5"
}
}
140 changes: 70 additions & 70 deletions src/bindgen/bindgen.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ export function getIdempotenceMode(): boolean;
export function setIdempotenceMode(idempotent: boolean): void;
export function generateIdempotencyKey(): Uuid;
export function updateWorker(
workerId: WorkerId,
targetVersion: ComponentVersion,
mode: UpdateMode,
workerId: WorkerId,
targetVersion: ComponentVersion,
mode: UpdateMode,
): void;

export class GetWorkers {
constructor(componentId: ComponentId, filter: WorkerAnyFilter | undefined, precise: boolean);
getNext(): WorkerMetadata[] | undefined;
constructor(componentId: ComponentId, filter: WorkerAnyFilter | undefined, precise: boolean);
getNext(): WorkerMetadata[] | undefined;
}

export interface Uuid {
highBits: bigint;
lowBits: bigint;
highBits: bigint;
lowBits: bigint;
}
export interface ComponentId {
uuid: Uuid;
uuid: Uuid;
}
/**
* # Variants
Expand All @@ -60,8 +60,8 @@ export interface ComponentId {
*/
export type StringFilterComparator = "equal" | "not-equal" | "like" | "not-like";
export interface WorkerNameFilter {
comparator: StringFilterComparator;
value: string;
comparator: StringFilterComparator;
value: string;
}
/**
* # Variants
Expand All @@ -79,12 +79,12 @@ export interface WorkerNameFilter {
* ## `"less"`
*/
export type FilterComparator =
| "equal"
| "not-equal"
| "greater-equal"
| "greater"
| "less-equal"
| "less";
| "equal"
| "not-equal"
| "greater-equal"
| "greater"
| "less-equal"
| "less";
/**
* # Variants
*
Expand All @@ -103,101 +103,101 @@ export type FilterComparator =
* ## `"exited"`
*/
export type WorkerStatus =
| "running"
| "idle"
| "suspended"
| "interrupted"
| "retrying"
| "failed"
| "exited";
| "running"
| "idle"
| "suspended"
| "interrupted"
| "retrying"
| "failed"
| "exited";
export interface WorkerStatusFilter {
comparator: FilterComparator;
value: WorkerStatus;
comparator: FilterComparator;
value: WorkerStatus;
}
export interface WorkerVersionFilter {
comparator: FilterComparator;
value: bigint;
comparator: FilterComparator;
value: bigint;
}
export interface WorkerCreatedAtFilter {
comparator: FilterComparator;
value: bigint;
comparator: FilterComparator;
value: bigint;
}
export interface WorkerEnvFilter {
name: string;
comparator: StringFilterComparator;
value: string;
name: string;
comparator: StringFilterComparator;
value: string;
}
export type WorkerPropertyFilter =
| WorkerPropertyFilterName
| WorkerPropertyFilterStatus
| WorkerPropertyFilterVersion
| WorkerPropertyFilterCreatedAt
| WorkerPropertyFilterEnv;
| WorkerPropertyFilterName
| WorkerPropertyFilterStatus
| WorkerPropertyFilterVersion
| WorkerPropertyFilterCreatedAt
| WorkerPropertyFilterEnv;
export interface WorkerPropertyFilterName {
tag: "name";
val: WorkerNameFilter;
tag: "name";
val: WorkerNameFilter;
}
export interface WorkerPropertyFilterStatus {
tag: "status";
val: WorkerStatusFilter;
tag: "status";
val: WorkerStatusFilter;
}
export interface WorkerPropertyFilterVersion {
tag: "version";
val: WorkerVersionFilter;
tag: "version";
val: WorkerVersionFilter;
}
export interface WorkerPropertyFilterCreatedAt {
tag: "created-at";
val: WorkerCreatedAtFilter;
tag: "created-at";
val: WorkerCreatedAtFilter;
}
export interface WorkerPropertyFilterEnv {
tag: "env";
val: WorkerEnvFilter;
tag: "env";
val: WorkerEnvFilter;
}
export interface WorkerAllFilter {
filters: WorkerPropertyFilter[];
filters: WorkerPropertyFilter[];
}
export interface WorkerAnyFilter {
filters: WorkerAllFilter[];
filters: WorkerAllFilter[];
}
export interface WorkerId {
componentId: ComponentId;
workerName: string;
componentId: ComponentId;
workerName: string;
}
export interface WorkerMetadata {
workerId: WorkerId;
args: string[];
env: [string, string][];
status: WorkerStatus;
componentVersion: bigint;
retryCount: bigint;
workerId: WorkerId;
args: string[];
env: [string, string][];
status: WorkerStatus;
componentVersion: bigint;
retryCount: bigint;
}
export type OplogIndex = bigint;
export interface PromiseId {
workerId: WorkerId;
oplogIdx: OplogIndex;
workerId: WorkerId;
oplogIdx: OplogIndex;
}
export interface Uri {
value: string;
value: string;
}
export type Duration = bigint;
export interface RetryPolicy {
maxAttempts: number;
minDelay: Duration;
maxDelay: Duration;
multiplier: number;
maxAttempts: number;
minDelay: Duration;
maxDelay: Duration;
multiplier: number;
}
export type PersistenceLevel =
| PersistenceLevelPersistNothing
| PersistenceLevelPersistRemoteSideEffects
| PersistenceLevelSmart;
| PersistenceLevelPersistNothing
| PersistenceLevelPersistRemoteSideEffects
| PersistenceLevelSmart;
export interface PersistenceLevelPersistNothing {
tag: "persist-nothing";
tag: "persist-nothing";
}
export interface PersistenceLevelPersistRemoteSideEffects {
tag: "persist-remote-side-effects";
tag: "persist-remote-side-effects";
}
export interface PersistenceLevelSmart {
tag: "smart";
tag: "smart";
}
export type ComponentVersion = bigint;
/**
Expand Down
Loading

0 comments on commit f3dde33

Please sign in to comment.