@distilled.cloud/stripe 0.7.12 → 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,13 +1,13 @@
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.stripe.com";
6
6
  export interface Config {
7
7
  readonly apiKey: Redacted.Redacted<string>;
8
8
  readonly apiBaseUrl: string;
9
9
  }
10
- declare const Credentials_base: ServiceMap.ServiceClass<Credentials, "StripeCredentials", Config>;
10
+ declare const Credentials_base: Context.ServiceClass<Credentials, "StripeCredentials", Config>;
11
11
  export declare class Credentials extends Credentials_base {
12
12
  }
13
13
  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,2BAA2B,CAAC;AAE7D,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAEJ,eAAO,MAAM,kBAAkB,8CAa9B,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,2BAA2B,CAAC;AAE7D,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAEJ,eAAO,MAAM,kBAAkB,8CAa9B,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.stripe.com";
7
- export class Credentials extends ServiceMap.Service()("StripeCredentials") {
7
+ export class Credentials extends Context.Service()("StripeCredentials") {
8
8
  }
9
9
  export const CredentialsFromEnv = Layer.effect(Credentials, Effect.gen(function* () {
10
10
  const apiKey = process.env.STRIPE_API_KEY;
@@ -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,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAO7D,MAAM,OAAO,WAAY,SAAQ,UAA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,CAAC;IACL,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC;AAC7E,CAAC,CAAC,CACH,CAAC"}
package/lib/errors.d.ts CHANGED
@@ -8,7 +8,7 @@ export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeou
8
8
  export type { DefaultErrors } from "@distilled.cloud/core/errors";
9
9
  import * as Schema from "effect/Schema";
10
10
  import * as Category from "@distilled.cloud/core/category";
11
- declare const PaymentError_base: Schema.ErrorClass<PaymentError, Schema.TaggedStruct<"PaymentError", {
11
+ declare const PaymentError_base: Schema.Class<PaymentError, Schema.TaggedStruct<"PaymentError", {
12
12
  readonly message: Schema.optional<Schema.String>;
13
13
  readonly code: Schema.optional<Schema.String>;
14
14
  readonly decline_code: Schema.optional<Schema.String>;
@@ -26,7 +26,7 @@ declare const PaymentError_base: Schema.ErrorClass<PaymentError, Schema.TaggedSt
26
26
  */
27
27
  export declare class PaymentError extends PaymentError_base {
28
28
  }
29
- declare const CardError_base: Schema.ErrorClass<CardError, Schema.TaggedStruct<"CardError", {
29
+ declare const CardError_base: Schema.Class<CardError, Schema.TaggedStruct<"CardError", {
30
30
  readonly message: Schema.optional<Schema.String>;
31
31
  readonly code: Schema.optional<Schema.String>;
32
32
  readonly decline_code: Schema.optional<Schema.String>;
@@ -48,7 +48,7 @@ declare const CardError_base: Schema.ErrorClass<CardError, Schema.TaggedStruct<"
48
48
  */
49
49
  export declare class CardError extends CardError_base {
50
50
  }
51
- declare const IdempotencyError_base: Schema.ErrorClass<IdempotencyError, Schema.TaggedStruct<"IdempotencyError", {
51
+ declare const IdempotencyError_base: Schema.Class<IdempotencyError, Schema.TaggedStruct<"IdempotencyError", {
52
52
  readonly message: Schema.optional<Schema.String>;
53
53
  readonly code: Schema.optional<Schema.String>;
54
54
  readonly doc_url: Schema.optional<Schema.String>;
@@ -64,7 +64,7 @@ declare const IdempotencyError_base: Schema.ErrorClass<IdempotencyError, Schema.
64
64
  */
65
65
  export declare class IdempotencyError extends IdempotencyError_base {
66
66
  }
67
- declare const InvalidRequestError_base: Schema.ErrorClass<InvalidRequestError, Schema.TaggedStruct<"InvalidRequestError", {
67
+ declare const InvalidRequestError_base: Schema.Class<InvalidRequestError, Schema.TaggedStruct<"InvalidRequestError", {
68
68
  readonly message: Schema.optional<Schema.String>;
69
69
  readonly code: Schema.optional<Schema.String>;
70
70
  readonly param: Schema.optional<Schema.String>;
@@ -80,7 +80,7 @@ declare const InvalidRequestError_base: Schema.ErrorClass<InvalidRequestError, S
80
80
  */
81
81
  export declare class InvalidRequestError extends InvalidRequestError_base {
82
82
  }
83
- declare const ExternalDependencyFailed_base: Schema.ErrorClass<ExternalDependencyFailed, Schema.TaggedStruct<"ExternalDependencyFailed", {
83
+ declare const ExternalDependencyFailed_base: Schema.Class<ExternalDependencyFailed, Schema.TaggedStruct<"ExternalDependencyFailed", {
84
84
  readonly message: Schema.optional<Schema.String>;
85
85
  readonly code: Schema.optional<Schema.String>;
86
86
  readonly doc_url: Schema.optional<Schema.String>;
@@ -104,7 +104,7 @@ export declare const STRIPE_HTTP_STATUS_MAP: {
104
104
  readonly 402: typeof PaymentError;
105
105
  readonly 424: typeof ExternalDependencyFailed;
106
106
  };
107
- declare const UnknownStripeError_base: Schema.ErrorClass<UnknownStripeError, Schema.TaggedStruct<"UnknownStripeError", {
107
+ declare const UnknownStripeError_base: Schema.Class<UnknownStripeError, Schema.TaggedStruct<"UnknownStripeError", {
108
108
  readonly type: Schema.optional<Schema.String>;
109
109
  readonly code: Schema.optional<Schema.String>;
110
110
  readonly message: Schema.optional<Schema.String>;
@@ -117,7 +117,7 @@ declare const UnknownStripeError_base: Schema.ErrorClass<UnknownStripeError, Sch
117
117
  });
118
118
  export declare class UnknownStripeError extends UnknownStripeError_base {
119
119
  }
120
- declare const StripeParseError_base: Schema.ErrorClass<StripeParseError, Schema.TaggedStruct<"StripeParseError", {
120
+ declare const StripeParseError_base: Schema.Class<StripeParseError, Schema.TaggedStruct<"StripeParseError", {
121
121
  readonly body: Schema.Unknown;
122
122
  readonly cause: Schema.Unknown;
123
123
  }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
package/lib/retry.d.ts CHANGED
@@ -2,10 +2,10 @@
2
2
  * Stripe retry configuration.
3
3
  */
4
4
  import * as Effect from "effect/Effect";
5
- import * as ServiceMap from "effect/ServiceMap";
5
+ import * as Context from "effect/Context";
6
6
  export { type Options, type Factory, type Policy, makeDefault, jittered, capped, throttlingOptions, transientOptions, } from "@distilled.cloud/core/retry";
7
7
  import type { Policy } from "@distilled.cloud/core/retry";
8
- declare const Retry_base: ServiceMap.ServiceClass<Retry, "StripeRetry", Policy>;
8
+ declare const Retry_base: Context.ServiceClass<Retry, "StripeRetry", Policy>;
9
9
  /**
10
10
  * Context tag for configuring retry behavior of Stripe API calls.
11
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;GAEG;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,UAAkD;CAAG;AAEhF;;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;;GAEG;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,UAA+C;CAAG;AAE7E;;GAEG;AACH,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,IAAI,mFAEhB,CAAC"}
package/lib/retry.js CHANGED
@@ -3,12 +3,12 @@
3
3
  */
4
4
  import * as Effect from "effect/Effect";
5
5
  import * as Layer from "effect/Layer";
6
- import * as ServiceMap from "effect/ServiceMap";
6
+ import * as Context from "effect/Context";
7
7
  export { makeDefault, jittered, capped, throttlingOptions, transientOptions, } from "@distilled.cloud/core/retry";
8
8
  /**
9
9
  * Context tag for configuring retry behavior of Stripe API calls.
10
10
  */
11
- export class Retry extends ServiceMap.Service()("StripeRetry") {
11
+ export class Retry extends Context.Service()("StripeRetry") {
12
12
  }
13
13
  /**
14
14
  * Provides a custom retry policy to all Stripe API calls.
package/lib/retry.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;GAEG;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,CAAC,aAAa,CAAC;CAAG;AAEhF;;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;;GAEG;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,CAAC,aAAa,CAAC;CAAG;AAE7E;;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/stripe",
3
- "version": "0.7.12",
3
+ "version": "0.9.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/alchemy-run/distilled",
@@ -66,15 +66,15 @@
66
66
  "fmt": "oxfmt --write src",
67
67
  "lint": "oxlint --fix src",
68
68
  "check": "tsgo && oxlint src && oxfmt --check src",
69
- "test": "bunx vitest run test",
69
+ "test": "bunx vitest run test --exclude specs",
70
70
  "publish:npm": "bun run build && bun publish --access public",
71
71
  "generate": "bun run scripts/generate.ts && oxlint --fix src && oxfmt --write src && oxfmt --write src",
72
72
  "specs:fetch": "git submodule update --force --init --recursive --depth=1 specs/stripe-openapi && git -C specs/stripe-openapi checkout -- .",
73
73
  "specs:update": "git -C specs/stripe-openapi fetch && git -C specs/stripe-openapi checkout master && git -C specs/stripe-openapi pull"
74
74
  },
75
75
  "dependencies": {
76
- "@distilled.cloud/core": "0.7.12",
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.stripe.com";
@@ -11,7 +11,7 @@ export interface Config {
11
11
  readonly apiBaseUrl: string;
12
12
  }
13
13
 
14
- export class Credentials extends ServiceMap.Service<Credentials, Config>()(
14
+ export class Credentials extends Context.Service<Credentials, Config>()(
15
15
  "StripeCredentials",
16
16
  ) {}
17
17
 
package/src/retry.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as Effect from "effect/Effect";
5
5
  import * as Layer from "effect/Layer";
6
- import * as ServiceMap from "effect/ServiceMap";
6
+ import * as Context from "effect/Context";
7
7
  export {
8
8
  type Options,
9
9
  type Factory,
@@ -19,7 +19,7 @@ import type { Policy } from "@distilled.cloud/core/retry";
19
19
  /**
20
20
  * Context tag for configuring retry behavior of Stripe API calls.
21
21
  */
22
- export class Retry extends ServiceMap.Service<Retry, Policy>()("StripeRetry") {}
22
+ export class Retry extends Context.Service<Retry, Policy>()("StripeRetry") {}
23
23
 
24
24
  /**
25
25
  * Provides a custom retry policy to all Stripe API calls.