@4mica/sdk-deno 1.3.1 → 2.0.0-alpha.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.
package/dist/index.cjs CHANGED
@@ -32,7 +32,7 @@ function buildConfig(options = {}) {
32
32
  return (options.configure ? options.configure(builder) : builder).build();
33
33
  }
34
34
  async function createClient(options = {}) {
35
- return sdk.Client.new(buildConfig(options));
35
+ return sdk.Client.connect(buildConfig(options));
36
36
  }
37
37
  async function createPaywall(config, options) {
38
38
  const client = await createClient(options);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["ConfigBuilder","Client","coreCreatePaywall"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,OAAA,GAA8C;AACrD,EAAA,OAAO,OAAO,IAAA,KAAS,WAAA,GAAc,KAAK,GAAA,CAAI,QAAA,KAAa,EAAC;AAC9D;AAGO,SAAS,WAAA,CAAY,OAAA,GAA+B,EAAC,EAAW;AACrE,EAAA,MAAM,OAAA,GAAU,IAAIA,iBAAA,EAAc,CAAE,QAAQ,OAAA,CAAQ,GAAA,IAAO,SAAS,CAAA;AACpE,EAAA,OAAA,CAAQ,QAAQ,SAAA,GAAY,OAAA,CAAQ,UAAU,OAAO,CAAA,GAAI,SAAS,KAAA,EAAM;AAC1E;AAGA,eAAsB,YAAA,CACpB,OAAA,GAA+B,EAAC,EACf;AACjB,EAAA,OAAOC,UAAA,CAAO,GAAA,CAAI,WAAA,CAAY,OAAO,CAAC,CAAA;AACxC;AAGA,eAAsB,aAAA,CACpB,QACA,OAAA,EACkB;AAClB,EAAA,MAAM,MAAA,GAAS,MAAM,YAAA,CAAa,OAAO,CAAA;AACzC,EAAA,OAAOC,oBAAA,CAAkB,QAAQ,MAAM,CAAA;AACzC;AAGO,SAAS,gBAAA,CACd,UACA,MAAA,EACS;AACT,EAAA,OAAOA,oBAAA,CAAkB,UAAU,MAAM,CAAA;AAC3C","file":"index.cjs","sourcesContent":["import type { Config } from \"@4mica/sdk\";\nimport { Client, ConfigBuilder } from \"@4mica/sdk\";\nimport type {\n Paywall,\n PaywallConfig,\n PaywallVerifier,\n} from \"@4mica/sdk/server\";\nimport { createPaywall as coreCreatePaywall } from \"@4mica/sdk/server\";\n\n// Minimal ambient declaration so we can read `Deno.env` without a hard dep on\n// Deno's type definitions. Present at runtime under Deno; guarded otherwise.\ndeclare const Deno: { env: { toObject(): Record<string, string> } } | undefined;\n\n/** Options for the Deno env-driven factories. */\nexport interface CreateClientOptions {\n /** Environment source. Defaults to `Deno.env.toObject()`. */\n env?: Record<string, string | undefined>;\n /** Hook to tweak the builder after env is applied (e.g. `.network(\"base\")`). */\n configure?: (builder: ConfigBuilder) => ConfigBuilder;\n}\n\nfunction denoEnv(): Record<string, string | undefined> {\n return typeof Deno !== \"undefined\" ? Deno.env.toObject() : {};\n}\n\n/** Build a validated {@link Config} from `Deno.env` (+ optional overrides). */\nexport function buildConfig(options: CreateClientOptions = {}): Config {\n const builder = new ConfigBuilder().fromEnv(options.env ?? denoEnv());\n return (options.configure ? options.configure(builder) : builder).build();\n}\n\n/** Create a fully-initialised {@link Client} from `Deno.env`. */\nexport async function createClient(\n options: CreateClientOptions = {},\n): Promise<Client> {\n return Client.new(buildConfig(options));\n}\n\n/** Convenience factory: build a client from `Deno.env` and wrap it as a paywall. */\nexport async function createPaywall(\n config: PaywallConfig,\n options?: CreateClientOptions,\n): Promise<Paywall> {\n const client = await createClient(options);\n return coreCreatePaywall(client, config);\n}\n\n/** Wrap an already-built verifier (`client`, `client.rpc`, …) as a paywall. */\nexport function createPaywallFor(\n verifier: PaywallVerifier,\n config: PaywallConfig,\n): Paywall {\n return coreCreatePaywall(verifier, config);\n}\n\nexport * from \"@4mica/sdk\";\nexport * as server from \"@4mica/sdk/server\";\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["ConfigBuilder","Client","coreCreatePaywall"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,OAAA,GAA8C;AACrD,EAAA,OAAO,OAAO,IAAA,KAAS,WAAA,GAAc,KAAK,GAAA,CAAI,QAAA,KAAa,EAAC;AAC9D;AAGO,SAAS,WAAA,CAAY,OAAA,GAA+B,EAAC,EAAW;AACrE,EAAA,MAAM,OAAA,GAAU,IAAIA,iBAAA,EAAc,CAAE,QAAQ,OAAA,CAAQ,GAAA,IAAO,SAAS,CAAA;AACpE,EAAA,OAAA,CAAQ,QAAQ,SAAA,GAAY,OAAA,CAAQ,UAAU,OAAO,CAAA,GAAI,SAAS,KAAA,EAAM;AAC1E;AAGA,eAAsB,YAAA,CACpB,OAAA,GAA+B,EAAC,EACf;AACjB,EAAA,OAAOC,UAAA,CAAO,OAAA,CAAQ,WAAA,CAAY,OAAO,CAAC,CAAA;AAC5C;AAGA,eAAsB,aAAA,CACpB,QACA,OAAA,EACkB;AAClB,EAAA,MAAM,MAAA,GAAS,MAAM,YAAA,CAAa,OAAO,CAAA;AACzC,EAAA,OAAOC,oBAAA,CAAkB,QAAQ,MAAM,CAAA;AACzC;AAGO,SAAS,gBAAA,CACd,UACA,MAAA,EACS;AACT,EAAA,OAAOA,oBAAA,CAAkB,UAAU,MAAM,CAAA;AAC3C","file":"index.cjs","sourcesContent":["import type { Config } from \"@4mica/sdk\";\nimport { Client, ConfigBuilder } from \"@4mica/sdk\";\nimport type {\n Paywall,\n PaywallConfig,\n PaywallVerifier,\n} from \"@4mica/sdk/server\";\nimport { createPaywall as coreCreatePaywall } from \"@4mica/sdk/server\";\n\n// Minimal ambient declaration so we can read `Deno.env` without a hard dep on\n// Deno's type definitions. Present at runtime under Deno; guarded otherwise.\ndeclare const Deno: { env: { toObject(): Record<string, string> } } | undefined;\n\n/** Options for the Deno env-driven factories. */\nexport interface CreateClientOptions {\n /** Environment source. Defaults to `Deno.env.toObject()`. */\n env?: Record<string, string | undefined>;\n /** Hook to tweak the builder after env is applied (e.g. `.network(\"base\")`). */\n configure?: (builder: ConfigBuilder) => ConfigBuilder;\n}\n\nfunction denoEnv(): Record<string, string | undefined> {\n return typeof Deno !== \"undefined\" ? Deno.env.toObject() : {};\n}\n\n/** Build a validated {@link Config} from `Deno.env` (+ optional overrides). */\nexport function buildConfig(options: CreateClientOptions = {}): Config {\n const builder = new ConfigBuilder().fromEnv(options.env ?? denoEnv());\n return (options.configure ? options.configure(builder) : builder).build();\n}\n\n/** Create a fully-initialised {@link Client} from `Deno.env`. */\nexport async function createClient(\n options: CreateClientOptions = {},\n): Promise<Client> {\n return Client.connect(buildConfig(options));\n}\n\n/** Convenience factory: build a client from `Deno.env` and wrap it as a paywall. */\nexport async function createPaywall(\n config: PaywallConfig,\n options?: CreateClientOptions,\n): Promise<Paywall> {\n const client = await createClient(options);\n return coreCreatePaywall(client, config);\n}\n\n/** Wrap an already-built verifier (`client`, `client.rpc`, …) as a paywall. */\nexport function createPaywallFor(\n verifier: PaywallVerifier,\n config: PaywallConfig,\n): Paywall {\n return coreCreatePaywall(verifier, config);\n}\n\nexport * from \"@4mica/sdk\";\nexport * as server from \"@4mica/sdk/server\";\n"]}
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ function buildConfig(options = {}) {
13
13
  return (options.configure ? options.configure(builder) : builder).build();
14
14
  }
15
15
  async function createClient(options = {}) {
16
- return Client.new(buildConfig(options));
16
+ return Client.connect(buildConfig(options));
17
17
  }
18
18
  async function createPaywall(config, options) {
19
19
  const client = await createClient(options);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["coreCreatePaywall"],"mappings":";;;;;;;AAqBA,SAAS,OAAA,GAA8C;AACrD,EAAA,OAAO,OAAO,IAAA,KAAS,WAAA,GAAc,KAAK,GAAA,CAAI,QAAA,KAAa,EAAC;AAC9D;AAGO,SAAS,WAAA,CAAY,OAAA,GAA+B,EAAC,EAAW;AACrE,EAAA,MAAM,OAAA,GAAU,IAAI,aAAA,EAAc,CAAE,QAAQ,OAAA,CAAQ,GAAA,IAAO,SAAS,CAAA;AACpE,EAAA,OAAA,CAAQ,QAAQ,SAAA,GAAY,OAAA,CAAQ,UAAU,OAAO,CAAA,GAAI,SAAS,KAAA,EAAM;AAC1E;AAGA,eAAsB,YAAA,CACpB,OAAA,GAA+B,EAAC,EACf;AACjB,EAAA,OAAO,MAAA,CAAO,GAAA,CAAI,WAAA,CAAY,OAAO,CAAC,CAAA;AACxC;AAGA,eAAsB,aAAA,CACpB,QACA,OAAA,EACkB;AAClB,EAAA,MAAM,MAAA,GAAS,MAAM,YAAA,CAAa,OAAO,CAAA;AACzC,EAAA,OAAOA,eAAA,CAAkB,QAAQ,MAAM,CAAA;AACzC;AAGO,SAAS,gBAAA,CACd,UACA,MAAA,EACS;AACT,EAAA,OAAOA,eAAA,CAAkB,UAAU,MAAM,CAAA;AAC3C","file":"index.js","sourcesContent":["import type { Config } from \"@4mica/sdk\";\nimport { Client, ConfigBuilder } from \"@4mica/sdk\";\nimport type {\n Paywall,\n PaywallConfig,\n PaywallVerifier,\n} from \"@4mica/sdk/server\";\nimport { createPaywall as coreCreatePaywall } from \"@4mica/sdk/server\";\n\n// Minimal ambient declaration so we can read `Deno.env` without a hard dep on\n// Deno's type definitions. Present at runtime under Deno; guarded otherwise.\ndeclare const Deno: { env: { toObject(): Record<string, string> } } | undefined;\n\n/** Options for the Deno env-driven factories. */\nexport interface CreateClientOptions {\n /** Environment source. Defaults to `Deno.env.toObject()`. */\n env?: Record<string, string | undefined>;\n /** Hook to tweak the builder after env is applied (e.g. `.network(\"base\")`). */\n configure?: (builder: ConfigBuilder) => ConfigBuilder;\n}\n\nfunction denoEnv(): Record<string, string | undefined> {\n return typeof Deno !== \"undefined\" ? Deno.env.toObject() : {};\n}\n\n/** Build a validated {@link Config} from `Deno.env` (+ optional overrides). */\nexport function buildConfig(options: CreateClientOptions = {}): Config {\n const builder = new ConfigBuilder().fromEnv(options.env ?? denoEnv());\n return (options.configure ? options.configure(builder) : builder).build();\n}\n\n/** Create a fully-initialised {@link Client} from `Deno.env`. */\nexport async function createClient(\n options: CreateClientOptions = {},\n): Promise<Client> {\n return Client.new(buildConfig(options));\n}\n\n/** Convenience factory: build a client from `Deno.env` and wrap it as a paywall. */\nexport async function createPaywall(\n config: PaywallConfig,\n options?: CreateClientOptions,\n): Promise<Paywall> {\n const client = await createClient(options);\n return coreCreatePaywall(client, config);\n}\n\n/** Wrap an already-built verifier (`client`, `client.rpc`, …) as a paywall. */\nexport function createPaywallFor(\n verifier: PaywallVerifier,\n config: PaywallConfig,\n): Paywall {\n return coreCreatePaywall(verifier, config);\n}\n\nexport * from \"@4mica/sdk\";\nexport * as server from \"@4mica/sdk/server\";\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["coreCreatePaywall"],"mappings":";;;;;;;AAqBA,SAAS,OAAA,GAA8C;AACrD,EAAA,OAAO,OAAO,IAAA,KAAS,WAAA,GAAc,KAAK,GAAA,CAAI,QAAA,KAAa,EAAC;AAC9D;AAGO,SAAS,WAAA,CAAY,OAAA,GAA+B,EAAC,EAAW;AACrE,EAAA,MAAM,OAAA,GAAU,IAAI,aAAA,EAAc,CAAE,QAAQ,OAAA,CAAQ,GAAA,IAAO,SAAS,CAAA;AACpE,EAAA,OAAA,CAAQ,QAAQ,SAAA,GAAY,OAAA,CAAQ,UAAU,OAAO,CAAA,GAAI,SAAS,KAAA,EAAM;AAC1E;AAGA,eAAsB,YAAA,CACpB,OAAA,GAA+B,EAAC,EACf;AACjB,EAAA,OAAO,MAAA,CAAO,OAAA,CAAQ,WAAA,CAAY,OAAO,CAAC,CAAA;AAC5C;AAGA,eAAsB,aAAA,CACpB,QACA,OAAA,EACkB;AAClB,EAAA,MAAM,MAAA,GAAS,MAAM,YAAA,CAAa,OAAO,CAAA;AACzC,EAAA,OAAOA,eAAA,CAAkB,QAAQ,MAAM,CAAA;AACzC;AAGO,SAAS,gBAAA,CACd,UACA,MAAA,EACS;AACT,EAAA,OAAOA,eAAA,CAAkB,UAAU,MAAM,CAAA;AAC3C","file":"index.js","sourcesContent":["import type { Config } from \"@4mica/sdk\";\nimport { Client, ConfigBuilder } from \"@4mica/sdk\";\nimport type {\n Paywall,\n PaywallConfig,\n PaywallVerifier,\n} from \"@4mica/sdk/server\";\nimport { createPaywall as coreCreatePaywall } from \"@4mica/sdk/server\";\n\n// Minimal ambient declaration so we can read `Deno.env` without a hard dep on\n// Deno's type definitions. Present at runtime under Deno; guarded otherwise.\ndeclare const Deno: { env: { toObject(): Record<string, string> } } | undefined;\n\n/** Options for the Deno env-driven factories. */\nexport interface CreateClientOptions {\n /** Environment source. Defaults to `Deno.env.toObject()`. */\n env?: Record<string, string | undefined>;\n /** Hook to tweak the builder after env is applied (e.g. `.network(\"base\")`). */\n configure?: (builder: ConfigBuilder) => ConfigBuilder;\n}\n\nfunction denoEnv(): Record<string, string | undefined> {\n return typeof Deno !== \"undefined\" ? Deno.env.toObject() : {};\n}\n\n/** Build a validated {@link Config} from `Deno.env` (+ optional overrides). */\nexport function buildConfig(options: CreateClientOptions = {}): Config {\n const builder = new ConfigBuilder().fromEnv(options.env ?? denoEnv());\n return (options.configure ? options.configure(builder) : builder).build();\n}\n\n/** Create a fully-initialised {@link Client} from `Deno.env`. */\nexport async function createClient(\n options: CreateClientOptions = {},\n): Promise<Client> {\n return Client.connect(buildConfig(options));\n}\n\n/** Convenience factory: build a client from `Deno.env` and wrap it as a paywall. */\nexport async function createPaywall(\n config: PaywallConfig,\n options?: CreateClientOptions,\n): Promise<Paywall> {\n const client = await createClient(options);\n return coreCreatePaywall(client, config);\n}\n\n/** Wrap an already-built verifier (`client`, `client.rpc`, …) as a paywall. */\nexport function createPaywallFor(\n verifier: PaywallVerifier,\n config: PaywallConfig,\n): Paywall {\n return coreCreatePaywall(verifier, config);\n}\n\nexport * from \"@4mica/sdk\";\nexport * as server from \"@4mica/sdk/server\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4mica/sdk-deno",
3
- "version": "1.3.1",
3
+ "version": "2.0.0-alpha.0",
4
4
  "description": "Deno adapter for the 4Mica SDK: Deno.env-driven client and x402 paywall factories",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -43,7 +43,7 @@
43
43
  "payments"
44
44
  ],
45
45
  "dependencies": {
46
- "@4mica/sdk": "1.3.1"
46
+ "@4mica/sdk": "2.0.0-alpha.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@arethetypeswrong/cli": "^0.18.2",