@plures/praxis 1.0.3 → 1.1.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/FRAMEWORK.md +55 -5
- package/LICENSE +21 -21
- package/README.md +162 -375
- package/core/codegen/docs-generator.ts +5 -2
- package/core/codegen/index.ts +1 -1
- package/core/codegen/ts-generator.ts +15 -15
- package/core/db-adapter/index.ts +2 -2
- package/core/db-adapter/sync-engine.ts +17 -6
- package/core/logic-engine/engine.ts +1 -1
- package/core/logic-engine/index.ts +2 -2
- package/core/logic-engine/protocol.ts +1 -1
- package/core/logic-engine/psf-adapter.ts +8 -4
- package/core/logic-engine/rules.ts +1 -1
- package/core/schema-engine/compiler.ts +53 -11
- package/core/schema-engine/generator.ts +17 -7
- package/core/schema-engine/index.ts +2 -2
- package/core/schema-engine/psf.ts +12 -3
- package/core/schema-engine/types.ts +3 -11
- package/core/schema-engine/validator.ts +112 -22
- package/dist/browser/engine-BjdqxeXG.d.ts +333 -0
- package/dist/browser/index.d.ts +3004 -0
- package/dist/browser/index.js +2892 -0
- package/dist/{src → browser}/integrations/svelte.d.ts +19 -17
- package/dist/browser/integrations/svelte.js +298 -0
- package/dist/node/auth-STARLY7I.js +207 -0
- package/dist/node/build-Y7OT5VBF.js +144 -0
- package/dist/node/canvas-UERZHJYW.js +362 -0
- package/dist/node/chunk-DSDC2JWZ.js +256 -0
- package/dist/node/chunk-FXQZXAWF.js +175 -0
- package/dist/node/chunk-N5Y37EUV.js +202 -0
- package/dist/node/chunk-QGM4M3NI.js +37 -0
- package/dist/node/chunk-RJMWCNHR.js +175 -0
- package/dist/node/chunk-SRM3OPPM.js +404 -0
- package/dist/node/chunk-UATVJBNV.js +175 -0
- package/dist/node/chunk-UY7YEBE2.js +159 -0
- package/dist/node/chunk-XCY2VIFX.js +143 -0
- package/dist/node/chunk-YXH4Y7ZZ.js +349 -0
- package/dist/node/cli/index.cjs +217418 -0
- package/dist/node/cli/index.d.cts +1 -0
- package/dist/node/cli/index.d.ts +1 -0
- package/dist/node/cli/index.js +690 -0
- package/dist/node/cloud/index.cjs +1043 -0
- package/dist/node/cloud/index.d.cts +864 -0
- package/dist/node/cloud/index.d.ts +864 -0
- package/dist/node/cloud/index.js +456 -0
- package/dist/node/cloud-AXOK4PSN.js +212 -0
- package/dist/node/component.cjs +374 -0
- package/dist/node/component.d.cts +125 -0
- package/dist/{src/core/component/generator.d.ts → node/component.d.ts} +11 -8
- package/dist/node/component.js +9 -0
- package/dist/node/components/index.cjs +216 -0
- package/dist/node/components/index.d.cts +43 -0
- package/dist/{src → node}/components/index.d.ts +8 -8
- package/dist/node/components/index.js +7 -0
- package/dist/node/create-TRLSVCNQ.js +584 -0
- package/dist/node/dev-PMJZUYGE.js +65 -0
- package/dist/node/engine-1iqLe6_P.d.ts +214 -0
- package/dist/node/engine-CVJobhHm.d.cts +214 -0
- package/dist/node/index.cjs +3247 -0
- package/dist/node/index.d.cts +2579 -0
- package/dist/node/index.d.ts +2579 -0
- package/dist/node/index.js +2098 -0
- package/dist/node/integrations/svelte.cjs +330 -0
- package/dist/node/integrations/svelte.d.cts +309 -0
- package/dist/node/integrations/svelte.d.ts +309 -0
- package/dist/node/integrations/svelte.js +300 -0
- package/dist/node/orchestrate-737TCL5H.js +127 -0
- package/dist/{src/core/protocol.d.ts → node/protocol-Qek7ebBl.d.cts} +11 -10
- package/dist/node/protocol-Qek7ebBl.d.ts +122 -0
- package/dist/node/schema.cjs +200 -0
- package/dist/{src/core/schema/types.d.ts → node/schema.d.cts} +30 -29
- package/dist/node/schema.d.ts +371 -0
- package/dist/node/schema.js +9 -0
- package/dist/{src/runtime/terminal-adapter.d.ts → node/terminal-adapter-07HGftGQ.d.ts} +86 -11
- package/dist/node/terminal-adapter-XLtCjjb_.d.cts +231 -0
- package/dist/node/verify-YBZ7W24H.js +213239 -0
- package/docs/MONETIZATION.md +21 -16
- package/docs/REACTIVE_REDESIGN.md +132 -0
- package/docs/README.md +47 -36
- package/docs/SVELTE_INTEGRATION_STRATEGY.md +68 -0
- package/docs/TERMINAL_NODE.md +27 -24
- package/docs/core/building-extensions.md +58 -61
- package/docs/core/cli-usage.md +59 -59
- package/docs/core/code-canvas-sync.md +28 -16
- package/docs/core/logic-engine.md +77 -82
- package/docs/core/pluresdb-integration.md +29 -39
- package/docs/core/schema-model.md +66 -52
- package/docs/core/ui-generation.md +57 -49
- package/docs/core/what-is-praxis.md +32 -15
- package/docs/guides/canvas.md +21 -5
- package/docs/guides/getting-started.md +13 -7
- package/docs/guides/history-state-pattern.md +65 -51
- package/docs/guides/orchestration.md +46 -32
- package/docs/guides/parallel-state-pattern.md +56 -72
- package/docs/guides/svelte-integration.md +45 -53
- package/docs/tutorials/README.md +16 -0
- package/docs/tutorials/ecommerce-cart.md +177 -95
- package/docs/tutorials/first-app.md +26 -41
- package/docs/tutorials/form-builder.md +191 -138
- package/docs/tutorials/todo-pluresdb.md +71 -69
- package/package.json +132 -97
- package/src/__tests__/actors.test.ts +68 -68
- package/src/__tests__/billing.test.ts +32 -32
- package/src/__tests__/canvas-components.test.ts +94 -73
- package/src/__tests__/cli-create.test.ts +28 -28
- package/src/__tests__/cloud.test.ts +36 -36
- package/src/__tests__/code-canvas-integration.test.ts +132 -141
- package/src/__tests__/docs-generator.test.ts +3 -9
- package/src/__tests__/dsl.test.ts +58 -64
- package/src/__tests__/edge-cases.test.ts +106 -108
- package/src/__tests__/engine.test.ts +51 -25
- package/src/__tests__/generators.test.ts +42 -44
- package/src/__tests__/introspection.test.ts +104 -114
- package/src/__tests__/pluresdb.test.ts +189 -187
- package/src/__tests__/protocol.test.ts +15 -15
- package/src/__tests__/provisioning.test.ts +61 -61
- package/src/__tests__/schema.test.ts +7 -11
- package/src/__tests__/state-docs-integration.test.ts +162 -145
- package/src/__tests__/svelte-integration.test.ts +16 -19
- package/src/__tests__/tauri-integration.test.ts +149 -147
- package/src/__tests__/terminal-node.test.ts +12 -7
- package/src/__tests__/unum-integration.test.ts +68 -68
- package/src/adapters/cli.ts +21 -15
- package/src/cli/commands/auth.ts +82 -78
- package/src/cli/commands/build.ts +29 -27
- package/src/cli/commands/canvas.ts +338 -127
- package/src/cli/commands/cloud.ts +47 -47
- package/src/cli/commands/create.ts +59 -47
- package/src/cli/commands/dev.ts +12 -12
- package/src/cli/commands/generate.ts +29 -40
- package/src/cli/commands/orchestrate.ts +24 -24
- package/src/cli/commands/verify.ts +7 -8
- package/src/cli/index.ts +14 -10
- package/src/cloud/README.md +28 -15
- package/src/cloud/auth.ts +55 -70
- package/src/cloud/billing.ts +59 -58
- package/src/cloud/client.ts +29 -35
- package/src/cloud/index.ts +19 -40
- package/src/cloud/marketplace.ts +69 -78
- package/src/cloud/provisioning.ts +42 -51
- package/src/cloud/relay/endpoints.ts +30 -34
- package/src/cloud/relay/health/index.ts +1 -1
- package/src/cloud/relay/stats/index.ts +1 -1
- package/src/cloud/relay/sync/index.ts +1 -1
- package/src/cloud/relay/usage/index.ts +1 -1
- package/src/cloud/sponsors.ts +31 -34
- package/src/cloud/types.ts +4 -4
- package/src/components/README.md +1 -0
- package/src/components/TerminalNode.svelte +457 -457
- package/src/components/index.ts +3 -4
- package/src/core/actors.ts +7 -7
- package/src/core/component/generator.ts +10 -28
- package/src/core/engine.ts +51 -24
- package/src/core/introspection.ts +37 -35
- package/src/core/logic/generator.ts +62 -62
- package/src/core/pluresdb/adapter.ts +8 -8
- package/src/core/pluresdb/generator.ts +39 -35
- package/src/core/pluresdb/index.ts +9 -12
- package/src/core/pluresdb/schema-registry.ts +22 -25
- package/src/core/pluresdb/store.ts +57 -57
- package/src/core/protocol.ts +14 -14
- package/src/core/reactive-engine.svelte.ts +65 -0
- package/src/core/reactive-engine.ts +67 -0
- package/src/core/rules.ts +4 -4
- package/src/core/schema/loader.common.ts +150 -0
- package/src/core/schema/loader.ts +19 -149
- package/src/core/schema/normalize.ts +34 -51
- package/src/core/schema/types.ts +47 -11
- package/src/dsl/index.ts +8 -8
- package/src/dsl.ts +11 -17
- package/src/examples/advanced-todo/App.svelte +506 -506
- package/src/examples/advanced-todo/README.md +58 -40
- package/src/examples/advanced-todo/index.ts +3 -3
- package/src/examples/auth-basic/index.ts +30 -30
- package/src/examples/cart/index.ts +50 -50
- package/src/examples/hero-ecommerce/index.ts +130 -157
- package/src/examples/svelte-counter/index.ts +22 -26
- package/src/flows.ts +6 -17
- package/src/index.browser.ts +204 -0
- package/src/index.ts +37 -42
- package/src/integrations/code-canvas.ts +237 -193
- package/src/integrations/pluresdb.ts +55 -35
- package/src/integrations/state-docs.ts +104 -104
- package/src/integrations/svelte.ts +35 -35
- package/src/integrations/tauri.ts +75 -73
- package/src/integrations/unum.ts +68 -61
- package/src/registry.ts +7 -14
- package/src/runtime/terminal-adapter.ts +31 -26
- package/src/step.ts +10 -16
- package/src/types.ts +1 -1
- package/templates/basic-app/README.md +6 -9
- package/templates/fullstack-app/README.md +10 -0
- package/dist/core/codegen/docs-generator.d.ts +0 -123
- package/dist/core/codegen/docs-generator.d.ts.map +0 -1
- package/dist/core/codegen/docs-generator.js +0 -674
- package/dist/core/codegen/docs-generator.js.map +0 -1
- package/dist/core/codegen/index.d.ts +0 -11
- package/dist/core/codegen/index.d.ts.map +0 -1
- package/dist/core/codegen/index.js +0 -13
- package/dist/core/codegen/index.js.map +0 -1
- package/dist/core/codegen/ts-generator.d.ts +0 -8
- package/dist/core/codegen/ts-generator.d.ts.map +0 -1
- package/dist/core/codegen/ts-generator.js +0 -8
- package/dist/core/codegen/ts-generator.js.map +0 -1
- package/dist/core/db-adapter/index.d.ts +0 -18
- package/dist/core/db-adapter/index.d.ts.map +0 -1
- package/dist/core/db-adapter/index.js +0 -23
- package/dist/core/db-adapter/index.js.map +0 -1
- package/dist/core/db-adapter/sync-engine.d.ts +0 -180
- package/dist/core/db-adapter/sync-engine.d.ts.map +0 -1
- package/dist/core/db-adapter/sync-engine.js +0 -342
- package/dist/core/db-adapter/sync-engine.js.map +0 -1
- package/dist/core/logic-engine/engine.d.ts +0 -8
- package/dist/core/logic-engine/engine.d.ts.map +0 -1
- package/dist/core/logic-engine/engine.js +0 -8
- package/dist/core/logic-engine/engine.js.map +0 -1
- package/dist/core/logic-engine/index.d.ts +0 -16
- package/dist/core/logic-engine/index.d.ts.map +0 -1
- package/dist/core/logic-engine/index.js +0 -16
- package/dist/core/logic-engine/index.js.map +0 -1
- package/dist/core/logic-engine/protocol.d.ts +0 -7
- package/dist/core/logic-engine/protocol.d.ts.map +0 -1
- package/dist/core/logic-engine/protocol.js +0 -7
- package/dist/core/logic-engine/protocol.js.map +0 -1
- package/dist/core/logic-engine/psf-adapter.d.ts +0 -88
- package/dist/core/logic-engine/psf-adapter.d.ts.map +0 -1
- package/dist/core/logic-engine/psf-adapter.js +0 -207
- package/dist/core/logic-engine/psf-adapter.js.map +0 -1
- package/dist/core/logic-engine/rules.d.ts +0 -7
- package/dist/core/logic-engine/rules.d.ts.map +0 -1
- package/dist/core/logic-engine/rules.js +0 -7
- package/dist/core/logic-engine/rules.js.map +0 -1
- package/dist/core/schema-engine/compiler.d.ts +0 -198
- package/dist/core/schema-engine/compiler.d.ts.map +0 -1
- package/dist/core/schema-engine/compiler.js +0 -262
- package/dist/core/schema-engine/compiler.js.map +0 -1
- package/dist/core/schema-engine/generator.d.ts +0 -115
- package/dist/core/schema-engine/generator.d.ts.map +0 -1
- package/dist/core/schema-engine/generator.js +0 -506
- package/dist/core/schema-engine/generator.js.map +0 -1
- package/dist/core/schema-engine/index.d.ts +0 -18
- package/dist/core/schema-engine/index.d.ts.map +0 -1
- package/dist/core/schema-engine/index.js +0 -18
- package/dist/core/schema-engine/index.js.map +0 -1
- package/dist/core/schema-engine/psf.d.ts +0 -612
- package/dist/core/schema-engine/psf.d.ts.map +0 -1
- package/dist/core/schema-engine/psf.js +0 -45
- package/dist/core/schema-engine/psf.js.map +0 -1
- package/dist/core/schema-engine/types.d.ts +0 -10
- package/dist/core/schema-engine/types.d.ts.map +0 -1
- package/dist/core/schema-engine/types.js +0 -7
- package/dist/core/schema-engine/types.js.map +0 -1
- package/dist/core/schema-engine/validator.d.ts +0 -140
- package/dist/core/schema-engine/validator.d.ts.map +0 -1
- package/dist/core/schema-engine/validator.js +0 -407
- package/dist/core/schema-engine/validator.js.map +0 -1
- package/dist/src/adapters/cli.d.ts +0 -43
- package/dist/src/adapters/cli.d.ts.map +0 -1
- package/dist/src/adapters/cli.js +0 -126
- package/dist/src/adapters/cli.js.map +0 -1
- package/dist/src/cli/commands/auth.d.ts +0 -26
- package/dist/src/cli/commands/auth.d.ts.map +0 -1
- package/dist/src/cli/commands/auth.js +0 -233
- package/dist/src/cli/commands/auth.js.map +0 -1
- package/dist/src/cli/commands/build.d.ts +0 -23
- package/dist/src/cli/commands/build.d.ts.map +0 -1
- package/dist/src/cli/commands/build.js +0 -162
- package/dist/src/cli/commands/build.js.map +0 -1
- package/dist/src/cli/commands/canvas.d.ts +0 -23
- package/dist/src/cli/commands/canvas.d.ts.map +0 -1
- package/dist/src/cli/commands/canvas.js +0 -215
- package/dist/src/cli/commands/canvas.js.map +0 -1
- package/dist/src/cli/commands/cloud.d.ts +0 -27
- package/dist/src/cli/commands/cloud.d.ts.map +0 -1
- package/dist/src/cli/commands/cloud.js +0 -232
- package/dist/src/cli/commands/cloud.js.map +0 -1
- package/dist/src/cli/commands/create.d.ts +0 -21
- package/dist/src/cli/commands/create.d.ts.map +0 -1
- package/dist/src/cli/commands/create.js +0 -621
- package/dist/src/cli/commands/create.js.map +0 -1
- package/dist/src/cli/commands/dev.d.ts +0 -21
- package/dist/src/cli/commands/dev.d.ts.map +0 -1
- package/dist/src/cli/commands/dev.js +0 -71
- package/dist/src/cli/commands/dev.js.map +0 -1
- package/dist/src/cli/commands/generate.d.ts +0 -25
- package/dist/src/cli/commands/generate.d.ts.map +0 -1
- package/dist/src/cli/commands/generate.js +0 -168
- package/dist/src/cli/commands/generate.js.map +0 -1
- package/dist/src/cli/commands/orchestrate.d.ts +0 -44
- package/dist/src/cli/commands/orchestrate.d.ts.map +0 -1
- package/dist/src/cli/commands/orchestrate.js +0 -150
- package/dist/src/cli/commands/orchestrate.js.map +0 -1
- package/dist/src/cli/commands/verify.d.ts +0 -10
- package/dist/src/cli/commands/verify.d.ts.map +0 -1
- package/dist/src/cli/commands/verify.js +0 -39
- package/dist/src/cli/commands/verify.js.map +0 -1
- package/dist/src/cli/index.d.ts +0 -8
- package/dist/src/cli/index.d.ts.map +0 -1
- package/dist/src/cli/index.js +0 -226
- package/dist/src/cli/index.js.map +0 -1
- package/dist/src/cloud/auth.d.ts +0 -51
- package/dist/src/cloud/auth.d.ts.map +0 -1
- package/dist/src/cloud/auth.js +0 -194
- package/dist/src/cloud/auth.js.map +0 -1
- package/dist/src/cloud/billing.d.ts +0 -184
- package/dist/src/cloud/billing.d.ts.map +0 -1
- package/dist/src/cloud/billing.js +0 -179
- package/dist/src/cloud/billing.js.map +0 -1
- package/dist/src/cloud/client.d.ts +0 -39
- package/dist/src/cloud/client.d.ts.map +0 -1
- package/dist/src/cloud/client.js +0 -176
- package/dist/src/cloud/client.js.map +0 -1
- package/dist/src/cloud/index.d.ts +0 -44
- package/dist/src/cloud/index.d.ts.map +0 -1
- package/dist/src/cloud/index.js +0 -44
- package/dist/src/cloud/index.js.map +0 -1
- package/dist/src/cloud/marketplace.d.ts +0 -166
- package/dist/src/cloud/marketplace.d.ts.map +0 -1
- package/dist/src/cloud/marketplace.js +0 -159
- package/dist/src/cloud/marketplace.js.map +0 -1
- package/dist/src/cloud/provisioning.d.ts +0 -110
- package/dist/src/cloud/provisioning.d.ts.map +0 -1
- package/dist/src/cloud/provisioning.js +0 -148
- package/dist/src/cloud/provisioning.js.map +0 -1
- package/dist/src/cloud/relay/endpoints.d.ts +0 -62
- package/dist/src/cloud/relay/endpoints.d.ts.map +0 -1
- package/dist/src/cloud/relay/endpoints.js +0 -217
- package/dist/src/cloud/relay/endpoints.js.map +0 -1
- package/dist/src/cloud/relay/health/index.d.ts +0 -5
- package/dist/src/cloud/relay/health/index.d.ts.map +0 -1
- package/dist/src/cloud/relay/health/index.js +0 -9
- package/dist/src/cloud/relay/health/index.js.map +0 -1
- package/dist/src/cloud/relay/stats/index.d.ts +0 -5
- package/dist/src/cloud/relay/stats/index.d.ts.map +0 -1
- package/dist/src/cloud/relay/stats/index.js +0 -9
- package/dist/src/cloud/relay/stats/index.js.map +0 -1
- package/dist/src/cloud/relay/sync/index.d.ts +0 -5
- package/dist/src/cloud/relay/sync/index.d.ts.map +0 -1
- package/dist/src/cloud/relay/sync/index.js +0 -9
- package/dist/src/cloud/relay/sync/index.js.map +0 -1
- package/dist/src/cloud/relay/usage/index.d.ts +0 -5
- package/dist/src/cloud/relay/usage/index.d.ts.map +0 -1
- package/dist/src/cloud/relay/usage/index.js +0 -9
- package/dist/src/cloud/relay/usage/index.js.map +0 -1
- package/dist/src/cloud/sponsors.d.ts +0 -81
- package/dist/src/cloud/sponsors.d.ts.map +0 -1
- package/dist/src/cloud/sponsors.js +0 -130
- package/dist/src/cloud/sponsors.js.map +0 -1
- package/dist/src/cloud/types.d.ts +0 -169
- package/dist/src/cloud/types.d.ts.map +0 -1
- package/dist/src/cloud/types.js +0 -7
- package/dist/src/cloud/types.js.map +0 -1
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/components/index.js +0 -17
- package/dist/src/components/index.js.map +0 -1
- package/dist/src/core/actors.d.ts +0 -95
- package/dist/src/core/actors.d.ts.map +0 -1
- package/dist/src/core/actors.js +0 -158
- package/dist/src/core/actors.js.map +0 -1
- package/dist/src/core/component/generator.d.ts.map +0 -1
- package/dist/src/core/component/generator.js +0 -349
- package/dist/src/core/component/generator.js.map +0 -1
- package/dist/src/core/engine.d.ts +0 -92
- package/dist/src/core/engine.d.ts.map +0 -1
- package/dist/src/core/engine.js +0 -199
- package/dist/src/core/engine.js.map +0 -1
- package/dist/src/core/introspection.d.ts +0 -141
- package/dist/src/core/introspection.d.ts.map +0 -1
- package/dist/src/core/introspection.js +0 -208
- package/dist/src/core/introspection.js.map +0 -1
- package/dist/src/core/logic/generator.d.ts +0 -76
- package/dist/src/core/logic/generator.d.ts.map +0 -1
- package/dist/src/core/logic/generator.js +0 -370
- package/dist/src/core/logic/generator.js.map +0 -1
- package/dist/src/core/pluresdb/adapter.d.ts +0 -72
- package/dist/src/core/pluresdb/adapter.d.ts.map +0 -1
- package/dist/src/core/pluresdb/adapter.js +0 -73
- package/dist/src/core/pluresdb/adapter.js.map +0 -1
- package/dist/src/core/pluresdb/generator.d.ts +0 -58
- package/dist/src/core/pluresdb/generator.d.ts.map +0 -1
- package/dist/src/core/pluresdb/generator.js +0 -191
- package/dist/src/core/pluresdb/generator.js.map +0 -1
- package/dist/src/core/pluresdb/index.d.ts +0 -15
- package/dist/src/core/pluresdb/index.d.ts.map +0 -1
- package/dist/src/core/pluresdb/index.js +0 -11
- package/dist/src/core/pluresdb/index.js.map +0 -1
- package/dist/src/core/pluresdb/schema-registry.d.ts +0 -104
- package/dist/src/core/pluresdb/schema-registry.d.ts.map +0 -1
- package/dist/src/core/pluresdb/schema-registry.js +0 -130
- package/dist/src/core/pluresdb/schema-registry.js.map +0 -1
- package/dist/src/core/pluresdb/store.d.ts +0 -199
- package/dist/src/core/pluresdb/store.d.ts.map +0 -1
- package/dist/src/core/pluresdb/store.js +0 -344
- package/dist/src/core/pluresdb/store.js.map +0 -1
- package/dist/src/core/protocol.d.ts.map +0 -1
- package/dist/src/core/protocol.js +0 -46
- package/dist/src/core/protocol.js.map +0 -1
- package/dist/src/core/rules.d.ts +0 -120
- package/dist/src/core/rules.d.ts.map +0 -1
- package/dist/src/core/rules.js +0 -81
- package/dist/src/core/rules.js.map +0 -1
- package/dist/src/core/schema/loader.d.ts +0 -47
- package/dist/src/core/schema/loader.d.ts.map +0 -1
- package/dist/src/core/schema/loader.js +0 -189
- package/dist/src/core/schema/loader.js.map +0 -1
- package/dist/src/core/schema/normalize.d.ts +0 -72
- package/dist/src/core/schema/normalize.d.ts.map +0 -1
- package/dist/src/core/schema/normalize.js +0 -190
- package/dist/src/core/schema/normalize.js.map +0 -1
- package/dist/src/core/schema/types.d.ts.map +0 -1
- package/dist/src/core/schema/types.js +0 -161
- package/dist/src/core/schema/types.js.map +0 -1
- package/dist/src/dsl/index.d.ts +0 -152
- package/dist/src/dsl/index.d.ts.map +0 -1
- package/dist/src/dsl/index.js +0 -132
- package/dist/src/dsl/index.js.map +0 -1
- package/dist/src/dsl.d.ts +0 -124
- package/dist/src/dsl.d.ts.map +0 -1
- package/dist/src/dsl.js +0 -130
- package/dist/src/dsl.js.map +0 -1
- package/dist/src/examples/advanced-todo/index.d.ts +0 -55
- package/dist/src/examples/advanced-todo/index.d.ts.map +0 -1
- package/dist/src/examples/advanced-todo/index.js +0 -222
- package/dist/src/examples/advanced-todo/index.js.map +0 -1
- package/dist/src/examples/auth-basic/index.d.ts +0 -17
- package/dist/src/examples/auth-basic/index.d.ts.map +0 -1
- package/dist/src/examples/auth-basic/index.js +0 -122
- package/dist/src/examples/auth-basic/index.js.map +0 -1
- package/dist/src/examples/cart/index.d.ts +0 -19
- package/dist/src/examples/cart/index.d.ts.map +0 -1
- package/dist/src/examples/cart/index.js +0 -202
- package/dist/src/examples/cart/index.js.map +0 -1
- package/dist/src/examples/hero-ecommerce/index.d.ts +0 -39
- package/dist/src/examples/hero-ecommerce/index.d.ts.map +0 -1
- package/dist/src/examples/hero-ecommerce/index.js +0 -506
- package/dist/src/examples/hero-ecommerce/index.js.map +0 -1
- package/dist/src/examples/svelte-counter/index.d.ts +0 -31
- package/dist/src/examples/svelte-counter/index.d.ts.map +0 -1
- package/dist/src/examples/svelte-counter/index.js +0 -123
- package/dist/src/examples/svelte-counter/index.js.map +0 -1
- package/dist/src/flows.d.ts +0 -125
- package/dist/src/flows.d.ts.map +0 -1
- package/dist/src/flows.js +0 -160
- package/dist/src/flows.js.map +0 -1
- package/dist/src/index.d.ts +0 -77
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -64
- package/dist/src/index.js.map +0 -1
- package/dist/src/integrations/code-canvas.d.ts +0 -265
- package/dist/src/integrations/code-canvas.d.ts.map +0 -1
- package/dist/src/integrations/code-canvas.js +0 -451
- package/dist/src/integrations/code-canvas.js.map +0 -1
- package/dist/src/integrations/pluresdb.d.ts +0 -117
- package/dist/src/integrations/pluresdb.d.ts.map +0 -1
- package/dist/src/integrations/pluresdb.js +0 -117
- package/dist/src/integrations/pluresdb.js.map +0 -1
- package/dist/src/integrations/state-docs.d.ts +0 -191
- package/dist/src/integrations/state-docs.d.ts.map +0 -1
- package/dist/src/integrations/state-docs.js +0 -515
- package/dist/src/integrations/state-docs.js.map +0 -1
- package/dist/src/integrations/svelte.d.ts.map +0 -1
- package/dist/src/integrations/svelte.js +0 -447
- package/dist/src/integrations/svelte.js.map +0 -1
- package/dist/src/integrations/tauri.d.ts +0 -360
- package/dist/src/integrations/tauri.d.ts.map +0 -1
- package/dist/src/integrations/tauri.js +0 -278
- package/dist/src/integrations/tauri.js.map +0 -1
- package/dist/src/integrations/unum.d.ts +0 -159
- package/dist/src/integrations/unum.d.ts.map +0 -1
- package/dist/src/integrations/unum.js +0 -240
- package/dist/src/integrations/unum.js.map +0 -1
- package/dist/src/registry.d.ts +0 -94
- package/dist/src/registry.d.ts.map +0 -1
- package/dist/src/registry.js +0 -181
- package/dist/src/registry.js.map +0 -1
- package/dist/src/runtime/terminal-adapter.d.ts.map +0 -1
- package/dist/src/runtime/terminal-adapter.js +0 -239
- package/dist/src/runtime/terminal-adapter.js.map +0 -1
- package/dist/src/step.d.ts +0 -34
- package/dist/src/step.d.ts.map +0 -1
- package/dist/src/step.js +0 -111
- package/dist/src/step.js.map +0 -1
- package/dist/src/types.d.ts +0 -63
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -6
- package/dist/src/types.js.map +0 -1
- package/dist/tools/ast-analyzer/src/ast-analyzer.d.ts +0 -8
- package/dist/tools/ast-analyzer/src/ast-analyzer.d.ts.map +0 -1
- package/dist/tools/ast-analyzer/src/ast-analyzer.js +0 -119
- package/dist/tools/ast-analyzer/src/ast-analyzer.js.map +0 -1
- package/dist/tools/cli/commands/index.d.ts +0 -7
- package/dist/tools/cli/commands/index.d.ts.map +0 -1
- package/dist/tools/cli/commands/index.js +0 -7
- package/dist/tools/cli/commands/index.js.map +0 -1
- package/dist/tools/cli/index.d.ts +0 -8
- package/dist/tools/cli/index.d.ts.map +0 -1
- package/dist/tools/cli/index.js +0 -9
- package/dist/tools/cli/index.js.map +0 -1
- package/dist/tools/watcher/index.d.ts +0 -105
- package/dist/tools/watcher/index.d.ts.map +0 -1
- package/dist/tools/watcher/index.js +0 -213
- package/dist/tools/watcher/index.js.map +0 -1
- package/dist/ui/canvas/canvas-projection.d.ts +0 -78
- package/dist/ui/canvas/canvas-projection.d.ts.map +0 -1
- package/dist/ui/canvas/canvas-projection.js +0 -416
- package/dist/ui/canvas/canvas-projection.js.map +0 -1
- package/dist/ui/canvas/canvas-state.d.ts +0 -200
- package/dist/ui/canvas/canvas-state.d.ts.map +0 -1
- package/dist/ui/canvas/canvas-state.js +0 -464
- package/dist/ui/canvas/canvas-state.js.map +0 -1
- package/dist/ui/canvas/components/index.d.ts +0 -95
- package/dist/ui/canvas/components/index.d.ts.map +0 -1
- package/dist/ui/canvas/components/index.js +0 -19
- package/dist/ui/canvas/components/index.js.map +0 -1
- package/dist/ui/canvas/index.d.ts +0 -32
- package/dist/ui/canvas/index.d.ts.map +0 -1
- package/dist/ui/canvas/index.js +0 -32
- package/dist/ui/canvas/index.js.map +0 -1
- package/dist/ui/canvas-inspector/src/server.d.ts +0 -2
- package/dist/ui/canvas-inspector/src/server.d.ts.map +0 -1
- package/dist/ui/canvas-inspector/src/server.js +0 -248
- package/dist/ui/canvas-inspector/src/server.js.map +0 -1
- package/dist/ui/canvas-inspector/src/verify-fsm-implementation.d.ts +0 -5
- package/dist/ui/canvas-inspector/src/verify-fsm-implementation.d.ts.map +0 -1
- package/dist/ui/canvas-inspector/src/verify-fsm-implementation.js +0 -58
- package/dist/ui/canvas-inspector/src/verify-fsm-implementation.js.map +0 -1
- package/dist/ui/svelte-generator/index.d.ts +0 -9
- package/dist/ui/svelte-generator/index.d.ts.map +0 -1
- package/dist/ui/svelte-generator/index.js +0 -11
- package/dist/ui/svelte-generator/index.js.map +0 -1
- package/dist/ui/svelte-generator/psf-generator.d.ts +0 -128
- package/dist/ui/svelte-generator/psf-generator.d.ts.map +0 -1
- package/dist/ui/svelte-generator/psf-generator.js +0 -506
- package/dist/ui/svelte-generator/psf-generator.js.map +0 -1
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub Sponsors and Marketplace Billing
|
|
3
|
-
*
|
|
4
|
-
* Types and utilities for GitHub-based monetization.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Praxis Cloud subscription tiers
|
|
8
|
-
*/
|
|
9
|
-
export var SubscriptionTier;
|
|
10
|
-
(function (SubscriptionTier) {
|
|
11
|
-
/**
|
|
12
|
-
* Free tier - limited usage
|
|
13
|
-
*/
|
|
14
|
-
SubscriptionTier["FREE"] = "free";
|
|
15
|
-
/**
|
|
16
|
-
* Solo tier - individual developers via GitHub Sponsors
|
|
17
|
-
*/
|
|
18
|
-
SubscriptionTier["SOLO"] = "solo";
|
|
19
|
-
/**
|
|
20
|
-
* Team tier - small teams via GitHub Sponsors
|
|
21
|
-
*/
|
|
22
|
-
SubscriptionTier["TEAM"] = "team";
|
|
23
|
-
/**
|
|
24
|
-
* Enterprise tier - self-service enterprise via GitHub Sponsors/Marketplace
|
|
25
|
-
*/
|
|
26
|
-
SubscriptionTier["ENTERPRISE"] = "enterprise";
|
|
27
|
-
})(SubscriptionTier || (SubscriptionTier = {}));
|
|
28
|
-
/**
|
|
29
|
-
* Billing provider type
|
|
30
|
-
*/
|
|
31
|
-
export var BillingProvider;
|
|
32
|
-
(function (BillingProvider) {
|
|
33
|
-
/**
|
|
34
|
-
* GitHub Sponsors
|
|
35
|
-
*/
|
|
36
|
-
BillingProvider["SPONSORS"] = "sponsors";
|
|
37
|
-
/**
|
|
38
|
-
* GitHub Marketplace (SaaS)
|
|
39
|
-
*/
|
|
40
|
-
BillingProvider["MARKETPLACE"] = "marketplace";
|
|
41
|
-
/**
|
|
42
|
-
* Free tier (no billing)
|
|
43
|
-
*/
|
|
44
|
-
BillingProvider["NONE"] = "none";
|
|
45
|
-
})(BillingProvider || (BillingProvider = {}));
|
|
46
|
-
/**
|
|
47
|
-
* Subscription status
|
|
48
|
-
*/
|
|
49
|
-
export var SubscriptionStatus;
|
|
50
|
-
(function (SubscriptionStatus) {
|
|
51
|
-
/**
|
|
52
|
-
* Active subscription
|
|
53
|
-
*/
|
|
54
|
-
SubscriptionStatus["ACTIVE"] = "active";
|
|
55
|
-
/**
|
|
56
|
-
* Subscription cancelled, but still valid until period end
|
|
57
|
-
*/
|
|
58
|
-
SubscriptionStatus["CANCELLED"] = "cancelled";
|
|
59
|
-
/**
|
|
60
|
-
* Subscription expired or payment failed
|
|
61
|
-
*/
|
|
62
|
-
SubscriptionStatus["EXPIRED"] = "expired";
|
|
63
|
-
/**
|
|
64
|
-
* No subscription
|
|
65
|
-
*/
|
|
66
|
-
SubscriptionStatus["NONE"] = "none";
|
|
67
|
-
})(SubscriptionStatus || (SubscriptionStatus = {}));
|
|
68
|
-
/**
|
|
69
|
-
* Default tier limits
|
|
70
|
-
*/
|
|
71
|
-
export const TIER_LIMITS = {
|
|
72
|
-
[SubscriptionTier.FREE]: {
|
|
73
|
-
maxSyncsPerMonth: 1000,
|
|
74
|
-
maxStorageBytes: 10 * 1024 * 1024, // 10 MB
|
|
75
|
-
maxTeamMembers: 1,
|
|
76
|
-
maxApps: 1,
|
|
77
|
-
supportLevel: "community",
|
|
78
|
-
},
|
|
79
|
-
[SubscriptionTier.SOLO]: {
|
|
80
|
-
maxSyncsPerMonth: 50000,
|
|
81
|
-
maxStorageBytes: 1024 * 1024 * 1024, // 1 GB
|
|
82
|
-
maxTeamMembers: 1,
|
|
83
|
-
maxApps: 10,
|
|
84
|
-
supportLevel: "standard",
|
|
85
|
-
},
|
|
86
|
-
[SubscriptionTier.TEAM]: {
|
|
87
|
-
maxSyncsPerMonth: 500000,
|
|
88
|
-
maxStorageBytes: 10 * 1024 * 1024 * 1024, // 10 GB
|
|
89
|
-
maxTeamMembers: 10,
|
|
90
|
-
maxApps: 50,
|
|
91
|
-
supportLevel: "standard",
|
|
92
|
-
},
|
|
93
|
-
[SubscriptionTier.ENTERPRISE]: {
|
|
94
|
-
maxSyncsPerMonth: 5000000,
|
|
95
|
-
maxStorageBytes: 100 * 1024 * 1024 * 1024, // 100 GB
|
|
96
|
-
maxTeamMembers: null, // unlimited
|
|
97
|
-
maxApps: 1000,
|
|
98
|
-
supportLevel: "priority",
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* Check if a user has access to a specific tier
|
|
103
|
-
*/
|
|
104
|
-
export function hasAccessToTier(subscription, requiredTier) {
|
|
105
|
-
if (subscription.status !== SubscriptionStatus.ACTIVE) {
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
const tierOrder = [
|
|
109
|
-
SubscriptionTier.FREE,
|
|
110
|
-
SubscriptionTier.SOLO,
|
|
111
|
-
SubscriptionTier.TEAM,
|
|
112
|
-
SubscriptionTier.ENTERPRISE,
|
|
113
|
-
];
|
|
114
|
-
const currentTierIndex = tierOrder.indexOf(subscription.tier);
|
|
115
|
-
const requiredTierIndex = tierOrder.indexOf(requiredTier);
|
|
116
|
-
return currentTierIndex >= requiredTierIndex;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Check if usage is within tier limits
|
|
120
|
-
*/
|
|
121
|
-
export function checkUsageLimits(subscription, usage) {
|
|
122
|
-
const violations = [];
|
|
123
|
-
if (usage.syncCount > subscription.limits.maxSyncsPerMonth) {
|
|
124
|
-
violations.push(`Sync limit exceeded: ${usage.syncCount}/${subscription.limits.maxSyncsPerMonth}`);
|
|
125
|
-
}
|
|
126
|
-
if (usage.storageBytes > subscription.limits.maxStorageBytes) {
|
|
127
|
-
violations.push(`Storage limit exceeded: ${(usage.storageBytes / 1024 / 1024).toFixed(2)}MB/${(subscription.limits.maxStorageBytes / 1024 / 1024).toFixed(2)}MB`);
|
|
128
|
-
}
|
|
129
|
-
if (subscription.limits.maxTeamMembers !== null &&
|
|
130
|
-
usage.teamMembers > subscription.limits.maxTeamMembers) {
|
|
131
|
-
violations.push(`Team member limit exceeded: ${usage.teamMembers}/${subscription.limits.maxTeamMembers}`);
|
|
132
|
-
}
|
|
133
|
-
if (usage.appCount > subscription.limits.maxApps) {
|
|
134
|
-
violations.push(`App limit exceeded: ${usage.appCount}/${subscription.limits.maxApps}`);
|
|
135
|
-
}
|
|
136
|
-
return {
|
|
137
|
-
withinLimits: violations.length === 0,
|
|
138
|
-
violations,
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Create a free tier subscription
|
|
143
|
-
*/
|
|
144
|
-
export function createFreeSubscription() {
|
|
145
|
-
return {
|
|
146
|
-
tier: SubscriptionTier.FREE,
|
|
147
|
-
status: SubscriptionStatus.ACTIVE,
|
|
148
|
-
provider: BillingProvider.NONE,
|
|
149
|
-
startDate: Date.now(),
|
|
150
|
-
autoRenew: true,
|
|
151
|
-
limits: TIER_LIMITS[SubscriptionTier.FREE],
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Create a subscription from GitHub Sponsors tier
|
|
156
|
-
*/
|
|
157
|
-
export function createSponsorSubscription(tierName, monthlyPriceInCents) {
|
|
158
|
-
let tier = SubscriptionTier.FREE;
|
|
159
|
-
// Map price to tier (example pricing)
|
|
160
|
-
if (monthlyPriceInCents >= 5000) { // $50/month
|
|
161
|
-
tier = SubscriptionTier.ENTERPRISE;
|
|
162
|
-
}
|
|
163
|
-
else if (monthlyPriceInCents >= 2000) { // $20/month
|
|
164
|
-
tier = SubscriptionTier.TEAM;
|
|
165
|
-
}
|
|
166
|
-
else if (monthlyPriceInCents >= 500) { // $5/month
|
|
167
|
-
tier = SubscriptionTier.SOLO;
|
|
168
|
-
}
|
|
169
|
-
return {
|
|
170
|
-
tier,
|
|
171
|
-
status: SubscriptionStatus.ACTIVE,
|
|
172
|
-
provider: BillingProvider.SPONSORS,
|
|
173
|
-
sponsorTierId: tierName,
|
|
174
|
-
startDate: Date.now(),
|
|
175
|
-
autoRenew: true,
|
|
176
|
-
limits: TIER_LIMITS[tier],
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
//# sourceMappingURL=billing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../../src/cloud/billing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,gBAoBX;AApBD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,iCAAa,CAAA;IAEb;;OAEG;IACH,iCAAa,CAAA;IAEb;;OAEG;IACH,iCAAa,CAAA;IAEb;;OAEG;IACH,6CAAyB,CAAA;AAC3B,CAAC,EApBW,gBAAgB,KAAhB,gBAAgB,QAoB3B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,eAeX;AAfD,WAAY,eAAe;IACzB;;OAEG;IACH,wCAAqB,CAAA;IAErB;;OAEG;IACH,8CAA2B,CAAA;IAE3B;;OAEG;IACH,gCAAa,CAAA;AACf,CAAC,EAfW,eAAe,KAAf,eAAe,QAe1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,kBAoBX;AApBD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,uCAAiB,CAAA;IAEjB;;OAEG;IACH,6CAAuB,CAAA;IAEvB;;OAEG;IACH,yCAAmB,CAAA;IAEnB;;OAEG;IACH,mCAAa,CAAA;AACf,CAAC,EApBW,kBAAkB,KAAlB,kBAAkB,QAoB7B;AAgHD;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAyC;IAC/D,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
-
*
|
|
4
|
-
* Client for connecting to Praxis Cloud Relay service (Azure-based).
|
|
5
|
-
*/
|
|
6
|
-
import type { CloudRelayConfig, CloudRelayClient } from "./types.js";
|
|
7
|
-
/**
|
|
8
|
-
* Create a cloud relay client
|
|
9
|
-
*/
|
|
10
|
-
export declare function createCloudRelay(config: CloudRelayConfig): CloudRelayClient;
|
|
11
|
-
/**
|
|
12
|
-
* Connect to Praxis Cloud Relay
|
|
13
|
-
*
|
|
14
|
-
* @param endpoint - Azure Function App endpoint URL
|
|
15
|
-
* @param options - Additional configuration options
|
|
16
|
-
* @returns Cloud relay client instance
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* import { connectRelay } from "@plures/praxis/cloud";
|
|
21
|
-
*
|
|
22
|
-
* const relay = await connectRelay("https://my-app.azurewebsites.net", {
|
|
23
|
-
* appId: "my-app",
|
|
24
|
-
* authToken: "github-token",
|
|
25
|
-
* autoSync: true
|
|
26
|
-
* });
|
|
27
|
-
*
|
|
28
|
-
* // Sync data
|
|
29
|
-
* await relay.sync({
|
|
30
|
-
* type: "delta",
|
|
31
|
-
* appId: "my-app",
|
|
32
|
-
* clock: {},
|
|
33
|
-
* facts: [...],
|
|
34
|
-
* timestamp: Date.now()
|
|
35
|
-
* });
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export declare function connectRelay(endpoint: string, options?: Omit<CloudRelayConfig, "endpoint">): Promise<CloudRelayClient>;
|
|
39
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/cloud/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAKjB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAiK3E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAwB,GACjE,OAAO,CAAC,gBAAgB,CAAC,CAS3B"}
|
package/dist/src/cloud/client.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cloud Relay Client
|
|
3
|
-
*
|
|
4
|
-
* Client for connecting to Praxis Cloud Relay service (Azure-based).
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Create a cloud relay client
|
|
8
|
-
*/
|
|
9
|
-
export function createCloudRelay(config) {
|
|
10
|
-
let status = {
|
|
11
|
-
connected: false,
|
|
12
|
-
endpoint: config.endpoint,
|
|
13
|
-
appId: config.appId,
|
|
14
|
-
};
|
|
15
|
-
let syncTimer = null;
|
|
16
|
-
const vectorClock = {};
|
|
17
|
-
return {
|
|
18
|
-
async connect() {
|
|
19
|
-
// Validate endpoint
|
|
20
|
-
if (!config.endpoint) {
|
|
21
|
-
throw new Error("Cloud relay endpoint is required");
|
|
22
|
-
}
|
|
23
|
-
// Test connection
|
|
24
|
-
try {
|
|
25
|
-
const response = await fetch(`${config.endpoint}/health`, {
|
|
26
|
-
method: "GET",
|
|
27
|
-
headers: {
|
|
28
|
-
"Content-Type": "application/json",
|
|
29
|
-
...(config.authToken && {
|
|
30
|
-
Authorization: `Bearer ${config.authToken}`,
|
|
31
|
-
}),
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
if (!response.ok) {
|
|
35
|
-
throw new Error(`Health check failed: ${response.statusText}`);
|
|
36
|
-
}
|
|
37
|
-
status.connected = true;
|
|
38
|
-
status.lastSync = Date.now();
|
|
39
|
-
// Start auto-sync if enabled
|
|
40
|
-
if (config.autoSync) {
|
|
41
|
-
const interval = config.syncInterval || 5000;
|
|
42
|
-
syncTimer = setInterval(() => {
|
|
43
|
-
// Auto-sync logic would go here
|
|
44
|
-
// For now, just update lastSync
|
|
45
|
-
status.lastSync = Date.now();
|
|
46
|
-
}, interval);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
status.connected = false;
|
|
51
|
-
throw new Error(`Failed to connect to cloud relay: ${error instanceof Error ? error.message : String(error)}`);
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
async disconnect() {
|
|
55
|
-
if (syncTimer) {
|
|
56
|
-
clearInterval(syncTimer);
|
|
57
|
-
syncTimer = null;
|
|
58
|
-
}
|
|
59
|
-
status.connected = false;
|
|
60
|
-
},
|
|
61
|
-
async sync(message) {
|
|
62
|
-
if (!status.connected) {
|
|
63
|
-
throw new Error("Not connected to cloud relay");
|
|
64
|
-
}
|
|
65
|
-
// Update vector clock
|
|
66
|
-
vectorClock[config.appId] = (vectorClock[config.appId] || 0) + 1;
|
|
67
|
-
message.clock = { ...vectorClock };
|
|
68
|
-
try {
|
|
69
|
-
const response = await fetch(`${config.endpoint}/sync`, {
|
|
70
|
-
method: "POST",
|
|
71
|
-
headers: {
|
|
72
|
-
"Content-Type": "application/json",
|
|
73
|
-
...(config.authToken && {
|
|
74
|
-
Authorization: `Bearer ${config.authToken}`,
|
|
75
|
-
}),
|
|
76
|
-
},
|
|
77
|
-
body: JSON.stringify(message),
|
|
78
|
-
});
|
|
79
|
-
if (!response.ok) {
|
|
80
|
-
throw new Error(`Sync failed: ${response.statusText}`);
|
|
81
|
-
}
|
|
82
|
-
status.lastSync = Date.now();
|
|
83
|
-
// Merge received vector clock
|
|
84
|
-
const result = await response.json();
|
|
85
|
-
if (result.clock) {
|
|
86
|
-
Object.entries(result.clock).forEach(([key, value]) => {
|
|
87
|
-
vectorClock[key] = Math.max(vectorClock[key] || 0, value);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
throw new Error(`Failed to sync: ${error instanceof Error ? error.message : String(error)}`);
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
async getUsage() {
|
|
96
|
-
if (!status.connected) {
|
|
97
|
-
throw new Error("Not connected to cloud relay");
|
|
98
|
-
}
|
|
99
|
-
try {
|
|
100
|
-
const response = await fetch(`${config.endpoint}/usage?appId=${config.appId}`, {
|
|
101
|
-
method: "GET",
|
|
102
|
-
headers: {
|
|
103
|
-
"Content-Type": "application/json",
|
|
104
|
-
...(config.authToken && {
|
|
105
|
-
Authorization: `Bearer ${config.authToken}`,
|
|
106
|
-
}),
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
if (!response.ok) {
|
|
110
|
-
throw new Error(`Failed to get usage: ${response.statusText}`);
|
|
111
|
-
}
|
|
112
|
-
return await response.json();
|
|
113
|
-
}
|
|
114
|
-
catch (error) {
|
|
115
|
-
throw new Error(`Failed to get usage metrics: ${error instanceof Error ? error.message : String(error)}`);
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
async getHealth() {
|
|
119
|
-
try {
|
|
120
|
-
const response = await fetch(`${config.endpoint}/health`, {
|
|
121
|
-
method: "GET",
|
|
122
|
-
headers: {
|
|
123
|
-
"Content-Type": "application/json",
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
if (!response.ok) {
|
|
127
|
-
throw new Error(`Health check failed: ${response.statusText}`);
|
|
128
|
-
}
|
|
129
|
-
return await response.json();
|
|
130
|
-
}
|
|
131
|
-
catch (error) {
|
|
132
|
-
throw new Error(`Failed to get health status: ${error instanceof Error ? error.message : String(error)}`);
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
getStatus() {
|
|
136
|
-
return { ...status };
|
|
137
|
-
},
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Connect to Praxis Cloud Relay
|
|
142
|
-
*
|
|
143
|
-
* @param endpoint - Azure Function App endpoint URL
|
|
144
|
-
* @param options - Additional configuration options
|
|
145
|
-
* @returns Cloud relay client instance
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* ```typescript
|
|
149
|
-
* import { connectRelay } from "@plures/praxis/cloud";
|
|
150
|
-
*
|
|
151
|
-
* const relay = await connectRelay("https://my-app.azurewebsites.net", {
|
|
152
|
-
* appId: "my-app",
|
|
153
|
-
* authToken: "github-token",
|
|
154
|
-
* autoSync: true
|
|
155
|
-
* });
|
|
156
|
-
*
|
|
157
|
-
* // Sync data
|
|
158
|
-
* await relay.sync({
|
|
159
|
-
* type: "delta",
|
|
160
|
-
* appId: "my-app",
|
|
161
|
-
* clock: {},
|
|
162
|
-
* facts: [...],
|
|
163
|
-
* timestamp: Date.now()
|
|
164
|
-
* });
|
|
165
|
-
* ```
|
|
166
|
-
*/
|
|
167
|
-
export async function connectRelay(endpoint, options = { appId: "default" }) {
|
|
168
|
-
const config = {
|
|
169
|
-
endpoint,
|
|
170
|
-
...options,
|
|
171
|
-
};
|
|
172
|
-
const client = createCloudRelay(config);
|
|
173
|
-
await client.connect();
|
|
174
|
-
return client;
|
|
175
|
-
}
|
|
176
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/cloud/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAwB;IACvD,IAAI,MAAM,GAAgB;QACxB,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC;IAEF,IAAI,SAAS,GAA0B,IAAI,CAAC;IAC5C,MAAM,WAAW,GAA2B,EAAE,CAAC;IAE/C,OAAO;QACL,KAAK,CAAC,OAAO;YACX,oBAAoB;YACpB,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACrB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;YACtD,CAAC;YAED,kBAA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|
8
|
-
* import { connectRelay } from "@plures/praxis/cloud";
|
|
9
|
-
*
|
|
10
|
-
* const relay = await connectRelay("https://my-app.azurewebsites.net", {
|
|
11
|
-
* appId: "my-app",
|
|
12
|
-
* authToken: "github-token",
|
|
13
|
-
* autoSync: true
|
|
14
|
-
* });
|
|
15
|
-
*
|
|
16
|
-
* // Sync data
|
|
17
|
-
* await relay.sync({
|
|
18
|
-
* type: "delta",
|
|
19
|
-
* appId: "my-app",
|
|
20
|
-
* clock: {},
|
|
21
|
-
* facts: [...],
|
|
22
|
-
* timestamp: Date.now()
|
|
23
|
-
* });
|
|
24
|
-
*
|
|
25
|
-
* // Get usage metrics
|
|
26
|
-
* const usage = await relay.getUsage();
|
|
27
|
-
* console.log(`Syncs: ${usage.syncCount}, Events: ${usage.eventCount}`);
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export { createCloudRelay, connectRelay } from "./client.js";
|
|
31
|
-
export type { CloudRelayConfig, CloudRelayClient, RelayStatus, CRDTSyncMessage, UsageMetrics, HealthCheckResponse, GitHubUser, AuthResult, } from "./types.js";
|
|
32
|
-
export { GitHubOAuth, createGitHubOAuth, authenticateWithDeviceFlow, } from "./auth.js";
|
|
33
|
-
export type { GitHubOAuthConfig } from "./auth.js";
|
|
34
|
-
export { SubscriptionTier, BillingProvider, SubscriptionStatus, TIER_LIMITS, hasAccessToTier, checkUsageLimits, createFreeSubscription, createSponsorSubscription, } from "./billing.js";
|
|
35
|
-
export type { TierLimits, Subscription, BillingEvent, } from "./billing.js";
|
|
36
|
-
export { GitHubSponsorsClient, createSponsorsClient, } from "./sponsors.js";
|
|
37
|
-
export type { SponsorTier, Sponsorship, } from "./sponsors.js";
|
|
38
|
-
export { GitHubMarketplaceClient, createMarketplaceClient, MARKETPLACE_PLANS, } from "./marketplace.js";
|
|
39
|
-
export type { MarketplacePlan, MarketplaceAccount, MarketplaceWebhookEvent, } from "./marketplace.js";
|
|
40
|
-
export { generateStorageNamespace, generateTenantId, createTenant, validateStorageNamespace, getAppStorageContainer, provisionTenant, getOrCreateTenant, } from "./provisioning.js";
|
|
41
|
-
export type { Tenant, ProvisioningResult, } from "./provisioning.js";
|
|
42
|
-
export { healthEndpoint, syncEndpoint, usageEndpoint, statsEndpoint, eventsEndpoint, schemaEndpoint, } from "./relay/endpoints.js";
|
|
43
|
-
export type { AzureContext, AzureHttpRequest, AzureHttpResponse, } from "./relay/endpoints.js";
|
|
44
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cloud/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG7D,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,UAAU,GACX,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGnD,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,UAAU,EACV,YAAY,EACZ,YAAY,GACb,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,WAAW,EACX,WAAW,GACZ,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,EACf,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,MAAM,EACN,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC"}
|
package/dist/src/cloud/index.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Praxis Cloud
|
|
3
|
-
*
|
|
4
|
-
* Cloud relay and synchronization for Praxis applications.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import { connectRelay } from "@plures/praxis/cloud";
|
|
9
|
-
*
|
|
10
|
-
* const relay = await connectRelay("https://my-app.azurewebsites.net", {
|
|
11
|
-
* appId: "my-app",
|
|
12
|
-
* authToken: "github-token",
|
|
13
|
-
* autoSync: true
|
|
14
|
-
* });
|
|
15
|
-
*
|
|
16
|
-
* // Sync data
|
|
17
|
-
* await relay.sync({
|
|
18
|
-
* type: "delta",
|
|
19
|
-
* appId: "my-app",
|
|
20
|
-
* clock: {},
|
|
21
|
-
* facts: [...],
|
|
22
|
-
* timestamp: Date.now()
|
|
23
|
-
* });
|
|
24
|
-
*
|
|
25
|
-
* // Get usage metrics
|
|
26
|
-
* const usage = await relay.getUsage();
|
|
27
|
-
* console.log(`Syncs: ${usage.syncCount}, Events: ${usage.eventCount}`);
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
// Client
|
|
31
|
-
export { createCloudRelay, connectRelay } from "./client.js";
|
|
32
|
-
// Authentication
|
|
33
|
-
export { GitHubOAuth, createGitHubOAuth, authenticateWithDeviceFlow, } from "./auth.js";
|
|
34
|
-
// Billing and Subscriptions
|
|
35
|
-
export { SubscriptionTier, BillingProvider, SubscriptionStatus, TIER_LIMITS, hasAccessToTier, checkUsageLimits, createFreeSubscription, createSponsorSubscription, } from "./billing.js";
|
|
36
|
-
// GitHub Sponsors
|
|
37
|
-
export { GitHubSponsorsClient, createSponsorsClient, } from "./sponsors.js";
|
|
38
|
-
// GitHub Marketplace
|
|
39
|
-
export { GitHubMarketplaceClient, createMarketplaceClient, MARKETPLACE_PLANS, } from "./marketplace.js";
|
|
40
|
-
// Auto-Provisioning
|
|
41
|
-
export { generateStorageNamespace, generateTenantId, createTenant, validateStorageNamespace, getAppStorageContainer, provisionTenant, getOrCreateTenant, } from "./provisioning.js";
|
|
42
|
-
// Relay endpoints (for Azure Functions deployment)
|
|
43
|
-
export { healthEndpoint, syncEndpoint, usageEndpoint, statsEndpoint, eventsEndpoint, schemaEndpoint, } from "./relay/endpoints.js";
|
|
44
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cloud/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,SAAS;AACT,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAc7D,iBAAiB;AACjB,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAGnB,4BAA4B;AAC5B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AAOtB,kBAAkB;AAClB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAMvB,qBAAqB;AACrB,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAO1B,oBAAoB;AACpB,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,EACf,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAM3B,mDAAmD;AACnD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,GACf,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub Marketplace API Client
|
|
3
|
-
*
|
|
4
|
-
* Client for GitHub Marketplace SaaS integration (preparatory).
|
|
5
|
-
*/
|
|
6
|
-
import type { Subscription } from "./billing.js";
|
|
7
|
-
/**
|
|
8
|
-
* GitHub Marketplace plan
|
|
9
|
-
*/
|
|
10
|
-
export interface MarketplacePlan {
|
|
11
|
-
/**
|
|
12
|
-
* Plan ID
|
|
13
|
-
*/
|
|
14
|
-
id: number;
|
|
15
|
-
/**
|
|
16
|
-
* Plan name
|
|
17
|
-
*/
|
|
18
|
-
name: string;
|
|
19
|
-
/**
|
|
20
|
-
* Plan description
|
|
21
|
-
*/
|
|
22
|
-
description: string;
|
|
23
|
-
/**
|
|
24
|
-
* Monthly price in cents
|
|
25
|
-
*/
|
|
26
|
-
monthlyPriceInCents: number;
|
|
27
|
-
/**
|
|
28
|
-
* Yearly price in cents
|
|
29
|
-
*/
|
|
30
|
-
yearlyPriceInCents: number;
|
|
31
|
-
/**
|
|
32
|
-
* Price model
|
|
33
|
-
*/
|
|
34
|
-
priceModel: "FLAT_RATE" | "PER_UNIT";
|
|
35
|
-
/**
|
|
36
|
-
* Whether this plan has a free trial
|
|
37
|
-
*/
|
|
38
|
-
hasFreeTrial: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Unit name (for per-unit pricing)
|
|
41
|
-
*/
|
|
42
|
-
unitName?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Bullets (features list)
|
|
45
|
-
*/
|
|
46
|
-
bullets: string[];
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Marketplace account
|
|
50
|
-
*/
|
|
51
|
-
export interface MarketplaceAccount {
|
|
52
|
-
/**
|
|
53
|
-
* Account ID
|
|
54
|
-
*/
|
|
55
|
-
id: number;
|
|
56
|
-
/**
|
|
57
|
-
* Account login
|
|
58
|
-
*/
|
|
59
|
-
login: string;
|
|
60
|
-
/**
|
|
61
|
-
* Account type
|
|
62
|
-
*/
|
|
63
|
-
type: "User" | "Organization";
|
|
64
|
-
/**
|
|
65
|
-
* Plan
|
|
66
|
-
*/
|
|
67
|
-
plan: MarketplacePlan;
|
|
68
|
-
/**
|
|
69
|
-
* Whether account is on free trial
|
|
70
|
-
*/
|
|
71
|
-
onFreeTrial: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Free trial ends on (if applicable)
|
|
74
|
-
*/
|
|
75
|
-
freeTrialEndsOn?: string;
|
|
76
|
-
/**
|
|
77
|
-
* Next billing date
|
|
78
|
-
*/
|
|
79
|
-
nextBillingDate?: string;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Marketplace webhook event
|
|
83
|
-
*/
|
|
84
|
-
export interface MarketplaceWebhookEvent {
|
|
85
|
-
/**
|
|
86
|
-
* Action type
|
|
87
|
-
*/
|
|
88
|
-
action: "purchased" | "cancelled" | "changed" | "pending_change" | "pending_change_cancelled";
|
|
89
|
-
/**
|
|
90
|
-
* Effective date
|
|
91
|
-
*/
|
|
92
|
-
effectiveDate?: string;
|
|
93
|
-
/**
|
|
94
|
-
* Marketplace purchase
|
|
95
|
-
*/
|
|
96
|
-
marketplacePurchase: {
|
|
97
|
-
account: MarketplaceAccount;
|
|
98
|
-
billingCycle: "monthly" | "yearly";
|
|
99
|
-
unitCount?: number;
|
|
100
|
-
onFreeTrial: boolean;
|
|
101
|
-
freeTrialEndsOn?: string;
|
|
102
|
-
nextBillingDate?: string;
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Previous plan (for changes)
|
|
106
|
-
*/
|
|
107
|
-
previousMarketplacePurchase?: {
|
|
108
|
-
account: MarketplaceAccount;
|
|
109
|
-
billingCycle: "monthly" | "yearly";
|
|
110
|
-
unitCount?: number;
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Praxis Cloud Marketplace plans configuration
|
|
115
|
-
*/
|
|
116
|
-
export declare const MARKETPLACE_PLANS: {
|
|
117
|
-
solo: {
|
|
118
|
-
name: string;
|
|
119
|
-
description: string;
|
|
120
|
-
monthlyPriceInCents: number;
|
|
121
|
-
yearlyPriceInCents: number;
|
|
122
|
-
features: string[];
|
|
123
|
-
};
|
|
124
|
-
team: {
|
|
125
|
-
name: string;
|
|
126
|
-
description: string;
|
|
127
|
-
monthlyPriceInCents: number;
|
|
128
|
-
yearlyPriceInCents: number;
|
|
129
|
-
features: string[];
|
|
130
|
-
};
|
|
131
|
-
enterprise: {
|
|
132
|
-
name: string;
|
|
133
|
-
description: string;
|
|
134
|
-
monthlyPriceInCents: number;
|
|
135
|
-
yearlyPriceInCents: number;
|
|
136
|
-
features: string[];
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
/**
|
|
140
|
-
* GitHub Marketplace API client
|
|
141
|
-
*/
|
|
142
|
-
export declare class GitHubMarketplaceClient {
|
|
143
|
-
private token;
|
|
144
|
-
constructor(token: string);
|
|
145
|
-
/**
|
|
146
|
-
* Get accounts for the authenticated user
|
|
147
|
-
*/
|
|
148
|
-
getAccounts(): Promise<MarketplaceAccount[]>;
|
|
149
|
-
/**
|
|
150
|
-
* Get subscription from marketplace account
|
|
151
|
-
*/
|
|
152
|
-
getSubscription(accountId: number): Promise<Subscription | null>;
|
|
153
|
-
/**
|
|
154
|
-
* Handle marketplace webhook event
|
|
155
|
-
*/
|
|
156
|
-
handleWebhookEvent(event: MarketplaceWebhookEvent): {
|
|
157
|
-
userId: number;
|
|
158
|
-
userLogin: string;
|
|
159
|
-
subscription: Subscription;
|
|
160
|
-
} | null;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Create a GitHub Marketplace client
|
|
164
|
-
*/
|
|
165
|
-
export declare function createMarketplaceClient(token: string): GitHubMarketplaceClient;
|
|
166
|
-
//# sourceMappingURL=marketplace.d.ts.map
|