@distilled.cloud/planetscale 0.8.0 → 0.9.0

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.
@@ -1,6 +1,6 @@
1
1
  import * as Layer from "effect/Layer";
2
2
  import * as Redacted from "effect/Redacted";
3
- import * as ServiceMap from "effect/ServiceMap";
3
+ import * as Context from "effect/Context";
4
4
  import { ConfigError } from "@distilled.cloud/core/errors";
5
5
  export declare const DEFAULT_API_BASE_URL = "https://api.planetscale.com/v1";
6
6
  export interface Config {
@@ -9,7 +9,7 @@ export interface Config {
9
9
  readonly organization: string;
10
10
  readonly apiBaseUrl: string;
11
11
  }
12
- declare const Credentials_base: ServiceMap.ServiceClass<Credentials, "PlanetScaleCredentials", Config>;
12
+ declare const Credentials_base: Context.ServiceClass<Credentials, "PlanetScaleCredentials", Config>;
13
13
  export declare class Credentials extends Credentials_base {
14
14
  }
15
15
  export declare const CredentialsFromEnv: Layer.Layer<Credentials, ConfigError, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,oBAAoB,mCAAmC,CAAC;AAErE,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAEJ,eAAO,MAAM,kBAAkB,8CAgC9B,CAAC"}
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,oBAAoB,mCAAmC,CAAC;AAErE,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAEJ,eAAO,MAAM,kBAAkB,8CAgC9B,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import * as Effect from "effect/Effect";
2
2
  import * as Layer from "effect/Layer";
3
3
  import * as Redacted from "effect/Redacted";
4
- import * as ServiceMap from "effect/ServiceMap";
4
+ import * as Context from "effect/Context";
5
5
  import { ConfigError } from "@distilled.cloud/core/errors";
6
6
  export const DEFAULT_API_BASE_URL = "https://api.planetscale.com/v1";
7
- export class Credentials extends ServiceMap.Service()("PlanetScaleCredentials") {
7
+ export class Credentials extends Context.Service()("PlanetScaleCredentials") {
8
8
  }
9
9
  export const CredentialsFromEnv = Layer.effect(Credentials, Effect.gen(function* () {
10
10
  const tokenId = process.env.PLANETSCALE_API_TOKEN_ID;
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC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lib/errors.d.ts CHANGED
@@ -12,7 +12,7 @@ import * as Schema from "effect/Schema";
12
12
  * Maps API error response codes to HTTP error classes.
13
13
  */
14
14
  export { HTTP_STATUS_MAP as ERROR_CODE_MAP } from "@distilled.cloud/core/errors";
15
- declare const UnknownPlanetScaleError_base: Schema.ErrorClass<UnknownPlanetScaleError, Schema.TaggedStruct<"UnknownPlanetScaleError", {
15
+ declare const UnknownPlanetScaleError_base: Schema.Class<UnknownPlanetScaleError, Schema.TaggedStruct<"UnknownPlanetScaleError", {
16
16
  readonly code: Schema.optional<Schema.String>;
17
17
  readonly message: Schema.optional<Schema.String>;
18
18
  readonly body: Schema.Unknown;
@@ -23,7 +23,7 @@ declare const UnknownPlanetScaleError_base: Schema.ErrorClass<UnknownPlanetScale
23
23
  });
24
24
  export declare class UnknownPlanetScaleError extends UnknownPlanetScaleError_base {
25
25
  }
26
- declare const PlanetScaleParseError_base: Schema.ErrorClass<PlanetScaleParseError, Schema.TaggedStruct<"PlanetScaleParseError", {
26
+ declare const PlanetScaleParseError_base: Schema.Class<PlanetScaleParseError, Schema.TaggedStruct<"PlanetScaleParseError", {
27
27
  readonly body: Schema.Unknown;
28
28
  readonly cause: Schema.Unknown;
29
29
  }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
package/lib/retry.d.ts CHANGED
@@ -4,10 +4,10 @@
4
4
  * Re-exports shared retry utilities and provides a PlanetScale-specific Retry service.
5
5
  */
6
6
  import * as Effect from "effect/Effect";
7
- import * as ServiceMap from "effect/ServiceMap";
7
+ import * as Context from "effect/Context";
8
8
  export { type Options, type Factory, type Policy, makeDefault, jittered, capped, throttlingOptions, transientOptions, } from "@distilled.cloud/core/retry";
9
9
  import type { Policy } from "@distilled.cloud/core/retry";
10
- declare const Retry_base: ServiceMap.ServiceClass<Retry, "PlanetScaleRetry", Policy>;
10
+ declare const Retry_base: Context.ServiceClass<Retry, "PlanetScaleRetry", Policy>;
11
11
  /**
12
12
  * Context tag for configuring retry behavior of PlanetScale API calls.
13
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;;AAE1D;;GAEG;AACH,qBAAa,KAAM,SAAQ,UAE1B;CAAG;AAEJ;;GAEG;AACH,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,IAAI,mFAEhB,CAAC"}
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;;AAE1D;;GAEG;AACH,qBAAa,KAAM,SAAQ,UAE1B;CAAG;AAEJ;;GAEG;AACH,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,IAAI,mFAEhB,CAAC"}
package/lib/retry.js CHANGED
@@ -5,12 +5,12 @@
5
5
  */
6
6
  import * as Effect from "effect/Effect";
7
7
  import * as Layer from "effect/Layer";
8
- import * as ServiceMap from "effect/ServiceMap";
8
+ import * as Context from "effect/Context";
9
9
  export { makeDefault, jittered, capped, throttlingOptions, transientOptions, } from "@distilled.cloud/core/retry";
10
10
  /**
11
11
  * Context tag for configuring retry behavior of PlanetScale API calls.
12
12
  */
13
- export class Retry extends ServiceMap.Service()("PlanetScaleRetry") {
13
+ export class Retry extends Context.Service()("PlanetScaleRetry") {
14
14
  }
15
15
  /**
16
16
  * Provides a custom retry policy to all PlanetScale API calls.
package/lib/retry.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAIL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAGrC;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU,CAAC,OAAO,EAAiB,CAC5D,kBAAkB,CACnB;CAAG;AAEJ;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,gBAAwB,EAAE,EAAE,CACjD,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAChC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,CAC7C,CAAC"}
1
+ {"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAIL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAGrC;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,OAAO,CAAC,OAAO,EAAiB,CACzD,kBAAkB,CACnB;CAAG;AAEJ;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,gBAAwB,EAAE,EAAE,CACjD,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAChC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,CAC7C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distilled.cloud/planetscale",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/alchemy-run/distilled",
@@ -73,8 +73,8 @@
73
73
  "specs:update": "git -C specs/distilled-spec-planetscale fetch && git -C specs/distilled-spec-planetscale checkout main && git -C specs/distilled-spec-planetscale pull"
74
74
  },
75
75
  "dependencies": {
76
- "@distilled.cloud/core": "0.8.0",
77
- "effect": "4.0.0-beta.43"
76
+ "@distilled.cloud/core": "0.9.0",
77
+ "effect": "4.0.0-beta.46"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@types/bun": "^1.3.0",
@@ -83,6 +83,6 @@
83
83
  "vitest": "^3.2.3"
84
84
  },
85
85
  "peerDependencies": {
86
- "effect": "4.0.0-beta.43"
86
+ "effect": "4.0.0-beta.46"
87
87
  }
88
88
  }
@@ -1,7 +1,7 @@
1
1
  import * as Effect from "effect/Effect";
2
2
  import * as Layer from "effect/Layer";
3
3
  import * as Redacted from "effect/Redacted";
4
- import * as ServiceMap from "effect/ServiceMap";
4
+ import * as Context from "effect/Context";
5
5
  import { ConfigError } from "@distilled.cloud/core/errors";
6
6
 
7
7
  export const DEFAULT_API_BASE_URL = "https://api.planetscale.com/v1";
@@ -13,7 +13,7 @@ export interface Config {
13
13
  readonly apiBaseUrl: string;
14
14
  }
15
15
 
16
- export class Credentials extends ServiceMap.Service<Credentials, Config>()(
16
+ export class Credentials extends Context.Service<Credentials, Config>()(
17
17
  "PlanetScaleCredentials",
18
18
  ) {}
19
19
 
package/src/retry.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import * as Effect from "effect/Effect";
7
7
  import * as Layer from "effect/Layer";
8
- import * as ServiceMap from "effect/ServiceMap";
8
+ import * as Context from "effect/Context";
9
9
  export {
10
10
  type Options,
11
11
  type Factory,
@@ -21,7 +21,7 @@ import type { Policy } from "@distilled.cloud/core/retry";
21
21
  /**
22
22
  * Context tag for configuring retry behavior of PlanetScale API calls.
23
23
  */
24
- export class Retry extends ServiceMap.Service<Retry, Policy>()(
24
+ export class Retry extends Context.Service<Retry, Policy>()(
25
25
  "PlanetScaleRetry",
26
26
  ) {}
27
27