@plures/praxis 1.0.2 → 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 -96
- 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 +49 -0
- package/src/cli/index.ts +21 -2
- 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/index.d.ts +0 -8
- package/dist/src/cli/index.d.ts.map +0 -1
- package/dist/src/cli/index.js +0 -211
- 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/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/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
|
@@ -0,0 +1,864 @@
|
|
|
1
|
+
import { b as PraxisFact, a as PraxisEvent } from '../protocol-Qek7ebBl.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Cloud Relay Types
|
|
5
|
+
*
|
|
6
|
+
* Type definitions for Praxis Cloud Relay service.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Cloud relay configuration
|
|
11
|
+
*/
|
|
12
|
+
interface CloudRelayConfig {
|
|
13
|
+
/**
|
|
14
|
+
* Azure Function App endpoint URL
|
|
15
|
+
*/
|
|
16
|
+
endpoint: string;
|
|
17
|
+
/**
|
|
18
|
+
* GitHub OAuth token for authentication
|
|
19
|
+
*/
|
|
20
|
+
authToken?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Application identifier
|
|
23
|
+
*/
|
|
24
|
+
appId: string;
|
|
25
|
+
/**
|
|
26
|
+
* Enable automatic sync
|
|
27
|
+
*/
|
|
28
|
+
autoSync?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Sync interval in milliseconds (default: 5000)
|
|
31
|
+
*/
|
|
32
|
+
syncInterval?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Enable encryption for blob storage
|
|
35
|
+
*/
|
|
36
|
+
encryption?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Relay connection status
|
|
40
|
+
*/
|
|
41
|
+
interface RelayStatus {
|
|
42
|
+
connected: boolean;
|
|
43
|
+
lastSync?: number;
|
|
44
|
+
endpoint: string;
|
|
45
|
+
appId: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* CRDT sync message
|
|
49
|
+
*/
|
|
50
|
+
interface CRDTSyncMessage {
|
|
51
|
+
/**
|
|
52
|
+
* Message type
|
|
53
|
+
*/
|
|
54
|
+
type: 'sync' | 'delta' | 'snapshot';
|
|
55
|
+
/**
|
|
56
|
+
* Application identifier
|
|
57
|
+
*/
|
|
58
|
+
appId: string;
|
|
59
|
+
/**
|
|
60
|
+
* Vector clock for causality tracking
|
|
61
|
+
*/
|
|
62
|
+
clock: Record<string, number>;
|
|
63
|
+
/**
|
|
64
|
+
* Facts to sync
|
|
65
|
+
*/
|
|
66
|
+
facts?: PraxisFact[];
|
|
67
|
+
/**
|
|
68
|
+
* Events to forward
|
|
69
|
+
*/
|
|
70
|
+
events?: PraxisEvent[];
|
|
71
|
+
/**
|
|
72
|
+
* Timestamp
|
|
73
|
+
*/
|
|
74
|
+
timestamp: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Usage metrics
|
|
78
|
+
*/
|
|
79
|
+
interface UsageMetrics {
|
|
80
|
+
/**
|
|
81
|
+
* Application identifier
|
|
82
|
+
*/
|
|
83
|
+
appId: string;
|
|
84
|
+
/**
|
|
85
|
+
* Number of sync operations
|
|
86
|
+
*/
|
|
87
|
+
syncCount: number;
|
|
88
|
+
/**
|
|
89
|
+
* Number of events forwarded
|
|
90
|
+
*/
|
|
91
|
+
eventCount: number;
|
|
92
|
+
/**
|
|
93
|
+
* Number of facts synced
|
|
94
|
+
*/
|
|
95
|
+
factCount: number;
|
|
96
|
+
/**
|
|
97
|
+
* Storage used in bytes
|
|
98
|
+
*/
|
|
99
|
+
storageBytes: number;
|
|
100
|
+
/**
|
|
101
|
+
* Period start timestamp
|
|
102
|
+
*/
|
|
103
|
+
periodStart: number;
|
|
104
|
+
/**
|
|
105
|
+
* Period end timestamp
|
|
106
|
+
*/
|
|
107
|
+
periodEnd: number;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Health check response
|
|
111
|
+
*/
|
|
112
|
+
interface HealthCheckResponse {
|
|
113
|
+
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
114
|
+
timestamp: number;
|
|
115
|
+
version: string;
|
|
116
|
+
services: {
|
|
117
|
+
relay: boolean;
|
|
118
|
+
eventGrid: boolean;
|
|
119
|
+
storage: boolean;
|
|
120
|
+
auth: boolean;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Cloud relay client interface
|
|
125
|
+
*/
|
|
126
|
+
interface CloudRelayClient {
|
|
127
|
+
/**
|
|
128
|
+
* Connect to the relay
|
|
129
|
+
*/
|
|
130
|
+
connect(): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Disconnect from the relay
|
|
133
|
+
*/
|
|
134
|
+
disconnect(): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* Sync facts and events
|
|
137
|
+
*/
|
|
138
|
+
sync(message: CRDTSyncMessage): Promise<void>;
|
|
139
|
+
/**
|
|
140
|
+
* Get usage metrics
|
|
141
|
+
*/
|
|
142
|
+
getUsage(): Promise<UsageMetrics>;
|
|
143
|
+
/**
|
|
144
|
+
* Get health status
|
|
145
|
+
*/
|
|
146
|
+
getHealth(): Promise<HealthCheckResponse>;
|
|
147
|
+
/**
|
|
148
|
+
* Get connection status
|
|
149
|
+
*/
|
|
150
|
+
getStatus(): RelayStatus;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* GitHub OAuth user info
|
|
154
|
+
*/
|
|
155
|
+
interface GitHubUser {
|
|
156
|
+
id: number;
|
|
157
|
+
login: string;
|
|
158
|
+
email?: string;
|
|
159
|
+
name?: string;
|
|
160
|
+
avatarUrl?: string;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Authentication result
|
|
164
|
+
*/
|
|
165
|
+
interface AuthResult {
|
|
166
|
+
success: boolean;
|
|
167
|
+
token?: string;
|
|
168
|
+
user?: GitHubUser;
|
|
169
|
+
expiresAt?: number;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Cloud Relay Client
|
|
174
|
+
*
|
|
175
|
+
* Client for connecting to Praxis Cloud Relay service (Azure-based).
|
|
176
|
+
*/
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Create a cloud relay client
|
|
180
|
+
*/
|
|
181
|
+
declare function createCloudRelay(config: CloudRelayConfig): CloudRelayClient;
|
|
182
|
+
/**
|
|
183
|
+
* Connect to Praxis Cloud Relay
|
|
184
|
+
*
|
|
185
|
+
* @param endpoint - Azure Function App endpoint URL
|
|
186
|
+
* @param options - Additional configuration options
|
|
187
|
+
* @returns Cloud relay client instance
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```typescript
|
|
191
|
+
* import { connectRelay } from "@plures/praxis/cloud";
|
|
192
|
+
*
|
|
193
|
+
* const relay = await connectRelay("https://my-app.azurewebsites.net", {
|
|
194
|
+
* appId: "my-app",
|
|
195
|
+
* authToken: "github-token",
|
|
196
|
+
* autoSync: true
|
|
197
|
+
* });
|
|
198
|
+
*
|
|
199
|
+
* // Sync data
|
|
200
|
+
* await relay.sync({
|
|
201
|
+
* type: "delta",
|
|
202
|
+
* appId: "my-app",
|
|
203
|
+
* clock: {},
|
|
204
|
+
* facts: [...],
|
|
205
|
+
* timestamp: Date.now()
|
|
206
|
+
* });
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
declare function connectRelay(endpoint: string, options?: Omit<CloudRelayConfig, 'endpoint'>): Promise<CloudRelayClient>;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* GitHub OAuth Authentication
|
|
213
|
+
*
|
|
214
|
+
* GitHub OAuth integration for Praxis Cloud Relay identity.
|
|
215
|
+
*/
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* GitHub OAuth configuration
|
|
219
|
+
*/
|
|
220
|
+
interface GitHubOAuthConfig {
|
|
221
|
+
clientId: string;
|
|
222
|
+
clientSecret?: string;
|
|
223
|
+
redirectUri?: string;
|
|
224
|
+
scope?: string;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* GitHub OAuth client
|
|
228
|
+
*/
|
|
229
|
+
declare class GitHubOAuth {
|
|
230
|
+
private config;
|
|
231
|
+
constructor(config: GitHubOAuthConfig);
|
|
232
|
+
/**
|
|
233
|
+
* Get the OAuth authorization URL
|
|
234
|
+
*/
|
|
235
|
+
getAuthorizationUrl(state?: string): string;
|
|
236
|
+
/**
|
|
237
|
+
* Exchange authorization code for access token
|
|
238
|
+
*/
|
|
239
|
+
exchangeCode(code: string): Promise<AuthResult>;
|
|
240
|
+
/**
|
|
241
|
+
* Get user information from GitHub
|
|
242
|
+
*/
|
|
243
|
+
getUserInfo(token: string): Promise<GitHubUser>;
|
|
244
|
+
/**
|
|
245
|
+
* Verify a token is valid
|
|
246
|
+
*/
|
|
247
|
+
verifyToken(token: string): Promise<boolean>;
|
|
248
|
+
/**
|
|
249
|
+
* Generate a random state parameter for CSRF protection
|
|
250
|
+
*/
|
|
251
|
+
private generateState;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Create a GitHub OAuth client
|
|
255
|
+
*/
|
|
256
|
+
declare function createGitHubOAuth(config: GitHubOAuthConfig): GitHubOAuth;
|
|
257
|
+
/**
|
|
258
|
+
* Authenticate with GitHub OAuth device flow (for CLI)
|
|
259
|
+
*/
|
|
260
|
+
declare function authenticateWithDeviceFlow(clientId: string): Promise<AuthResult>;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* GitHub Sponsors and Marketplace Billing
|
|
264
|
+
*
|
|
265
|
+
* Types and utilities for GitHub-based monetization.
|
|
266
|
+
*/
|
|
267
|
+
/**
|
|
268
|
+
* Praxis Cloud subscription tiers
|
|
269
|
+
*/
|
|
270
|
+
declare enum SubscriptionTier {
|
|
271
|
+
/**
|
|
272
|
+
* Free tier - limited usage
|
|
273
|
+
*/
|
|
274
|
+
FREE = "free",
|
|
275
|
+
/**
|
|
276
|
+
* Solo tier - individual developers via GitHub Sponsors
|
|
277
|
+
*/
|
|
278
|
+
SOLO = "solo",
|
|
279
|
+
/**
|
|
280
|
+
* Team tier - small teams via GitHub Sponsors
|
|
281
|
+
*/
|
|
282
|
+
TEAM = "team",
|
|
283
|
+
/**
|
|
284
|
+
* Enterprise tier - self-service enterprise via GitHub Sponsors/Marketplace
|
|
285
|
+
*/
|
|
286
|
+
ENTERPRISE = "enterprise"
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Billing provider type
|
|
290
|
+
*/
|
|
291
|
+
declare enum BillingProvider {
|
|
292
|
+
/**
|
|
293
|
+
* GitHub Sponsors
|
|
294
|
+
*/
|
|
295
|
+
SPONSORS = "sponsors",
|
|
296
|
+
/**
|
|
297
|
+
* GitHub Marketplace (SaaS)
|
|
298
|
+
*/
|
|
299
|
+
MARKETPLACE = "marketplace",
|
|
300
|
+
/**
|
|
301
|
+
* Free tier (no billing)
|
|
302
|
+
*/
|
|
303
|
+
NONE = "none"
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Subscription status
|
|
307
|
+
*/
|
|
308
|
+
declare enum SubscriptionStatus {
|
|
309
|
+
/**
|
|
310
|
+
* Active subscription
|
|
311
|
+
*/
|
|
312
|
+
ACTIVE = "active",
|
|
313
|
+
/**
|
|
314
|
+
* Subscription cancelled, but still valid until period end
|
|
315
|
+
*/
|
|
316
|
+
CANCELLED = "cancelled",
|
|
317
|
+
/**
|
|
318
|
+
* Subscription expired or payment failed
|
|
319
|
+
*/
|
|
320
|
+
EXPIRED = "expired",
|
|
321
|
+
/**
|
|
322
|
+
* No subscription
|
|
323
|
+
*/
|
|
324
|
+
NONE = "none"
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Tier limits for different subscription levels
|
|
328
|
+
*/
|
|
329
|
+
interface TierLimits {
|
|
330
|
+
/**
|
|
331
|
+
* Maximum sync operations per month
|
|
332
|
+
*/
|
|
333
|
+
maxSyncsPerMonth: number;
|
|
334
|
+
/**
|
|
335
|
+
* Maximum storage in bytes
|
|
336
|
+
*/
|
|
337
|
+
maxStorageBytes: number;
|
|
338
|
+
/**
|
|
339
|
+
* Maximum number of team members (null = unlimited)
|
|
340
|
+
*/
|
|
341
|
+
maxTeamMembers: number | null;
|
|
342
|
+
/**
|
|
343
|
+
* Maximum number of apps/projects
|
|
344
|
+
*/
|
|
345
|
+
maxApps: number;
|
|
346
|
+
/**
|
|
347
|
+
* Support level
|
|
348
|
+
*/
|
|
349
|
+
supportLevel: 'community' | 'standard' | 'priority';
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Subscription information
|
|
353
|
+
*/
|
|
354
|
+
interface Subscription {
|
|
355
|
+
/**
|
|
356
|
+
* Subscription tier
|
|
357
|
+
*/
|
|
358
|
+
tier: SubscriptionTier;
|
|
359
|
+
/**
|
|
360
|
+
* Subscription status
|
|
361
|
+
*/
|
|
362
|
+
status: SubscriptionStatus;
|
|
363
|
+
/**
|
|
364
|
+
* Billing provider
|
|
365
|
+
*/
|
|
366
|
+
provider: BillingProvider;
|
|
367
|
+
/**
|
|
368
|
+
* GitHub sponsor tier ID (if applicable)
|
|
369
|
+
*/
|
|
370
|
+
sponsorTierId?: string;
|
|
371
|
+
/**
|
|
372
|
+
* GitHub Marketplace plan ID (if applicable)
|
|
373
|
+
*/
|
|
374
|
+
marketplacePlanId?: number;
|
|
375
|
+
/**
|
|
376
|
+
* Subscription start date
|
|
377
|
+
*/
|
|
378
|
+
startDate: number;
|
|
379
|
+
/**
|
|
380
|
+
* Current period end date
|
|
381
|
+
*/
|
|
382
|
+
periodEnd?: number;
|
|
383
|
+
/**
|
|
384
|
+
* Whether subscription auto-renews
|
|
385
|
+
*/
|
|
386
|
+
autoRenew: boolean;
|
|
387
|
+
/**
|
|
388
|
+
* Usage limits for this tier
|
|
389
|
+
*/
|
|
390
|
+
limits: TierLimits;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Billing event type
|
|
394
|
+
*/
|
|
395
|
+
interface BillingEvent {
|
|
396
|
+
/**
|
|
397
|
+
* Event type
|
|
398
|
+
*/
|
|
399
|
+
type: 'subscription_created' | 'subscription_cancelled' | 'subscription_renewed' | 'tier_changed';
|
|
400
|
+
/**
|
|
401
|
+
* Timestamp
|
|
402
|
+
*/
|
|
403
|
+
timestamp: number;
|
|
404
|
+
/**
|
|
405
|
+
* User/organization ID
|
|
406
|
+
*/
|
|
407
|
+
userId: number;
|
|
408
|
+
/**
|
|
409
|
+
* Old subscription (for changes)
|
|
410
|
+
*/
|
|
411
|
+
oldSubscription?: Subscription;
|
|
412
|
+
/**
|
|
413
|
+
* New subscription
|
|
414
|
+
*/
|
|
415
|
+
newSubscription: Subscription;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Default tier limits
|
|
419
|
+
*/
|
|
420
|
+
declare const TIER_LIMITS: Record<SubscriptionTier, TierLimits>;
|
|
421
|
+
/**
|
|
422
|
+
* Check if a user has access to a specific tier
|
|
423
|
+
*/
|
|
424
|
+
declare function hasAccessToTier(subscription: Subscription, requiredTier: SubscriptionTier): boolean;
|
|
425
|
+
/**
|
|
426
|
+
* Check if usage is within tier limits
|
|
427
|
+
*/
|
|
428
|
+
declare function checkUsageLimits(subscription: Subscription, usage: {
|
|
429
|
+
syncCount: number;
|
|
430
|
+
storageBytes: number;
|
|
431
|
+
teamMembers: number;
|
|
432
|
+
appCount: number;
|
|
433
|
+
}): {
|
|
434
|
+
withinLimits: boolean;
|
|
435
|
+
violations: string[];
|
|
436
|
+
};
|
|
437
|
+
/**
|
|
438
|
+
* Create a free tier subscription
|
|
439
|
+
*/
|
|
440
|
+
declare function createFreeSubscription(): Subscription;
|
|
441
|
+
/**
|
|
442
|
+
* Create a subscription from GitHub Sponsors tier
|
|
443
|
+
*/
|
|
444
|
+
declare function createSponsorSubscription(tierName: string, monthlyPriceInCents: number): Subscription;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* GitHub Sponsors API Client
|
|
448
|
+
*
|
|
449
|
+
* Client for checking GitHub Sponsors subscription status.
|
|
450
|
+
*/
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* GitHub Sponsors tier information
|
|
454
|
+
*/
|
|
455
|
+
interface SponsorTier {
|
|
456
|
+
/**
|
|
457
|
+
* Tier ID
|
|
458
|
+
*/
|
|
459
|
+
id: string;
|
|
460
|
+
/**
|
|
461
|
+
* Tier name
|
|
462
|
+
*/
|
|
463
|
+
name: string;
|
|
464
|
+
/**
|
|
465
|
+
* Monthly price in cents
|
|
466
|
+
*/
|
|
467
|
+
monthlyPriceInCents: number;
|
|
468
|
+
/**
|
|
469
|
+
* Tier description
|
|
470
|
+
*/
|
|
471
|
+
description?: string;
|
|
472
|
+
/**
|
|
473
|
+
* Whether this is a one-time sponsorship
|
|
474
|
+
*/
|
|
475
|
+
isOneTime: boolean;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Sponsorship information
|
|
479
|
+
*/
|
|
480
|
+
interface Sponsorship {
|
|
481
|
+
/**
|
|
482
|
+
* Sponsor login
|
|
483
|
+
*/
|
|
484
|
+
sponsorLogin: string;
|
|
485
|
+
/**
|
|
486
|
+
* Sponsor ID
|
|
487
|
+
*/
|
|
488
|
+
sponsorId: number;
|
|
489
|
+
/**
|
|
490
|
+
* Tier information
|
|
491
|
+
*/
|
|
492
|
+
tier: SponsorTier;
|
|
493
|
+
/**
|
|
494
|
+
* Creation date
|
|
495
|
+
*/
|
|
496
|
+
createdAt: string;
|
|
497
|
+
/**
|
|
498
|
+
* Whether sponsorship is active
|
|
499
|
+
*/
|
|
500
|
+
isActive: boolean;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* GitHub Sponsors API client
|
|
504
|
+
*/
|
|
505
|
+
declare class GitHubSponsorsClient {
|
|
506
|
+
private token;
|
|
507
|
+
private accountLogin;
|
|
508
|
+
constructor(token: string, accountLogin: string);
|
|
509
|
+
/**
|
|
510
|
+
* Get current user's sponsorship of the Praxis account
|
|
511
|
+
*/
|
|
512
|
+
getSponsorship(userLogin: string): Promise<Sponsorship | null>;
|
|
513
|
+
/**
|
|
514
|
+
* Get subscription from sponsorship
|
|
515
|
+
*/
|
|
516
|
+
getSubscription(userLogin: string): Promise<Subscription>;
|
|
517
|
+
/**
|
|
518
|
+
* Check if user is a sponsor
|
|
519
|
+
*/
|
|
520
|
+
isSponsor(userLogin: string): Promise<boolean>;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Create a GitHub Sponsors client
|
|
524
|
+
*/
|
|
525
|
+
declare function createSponsorsClient(token: string, accountLogin?: string): GitHubSponsorsClient;
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* GitHub Marketplace API Client
|
|
529
|
+
*
|
|
530
|
+
* Client for GitHub Marketplace SaaS integration (preparatory).
|
|
531
|
+
*/
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* GitHub Marketplace plan
|
|
535
|
+
*/
|
|
536
|
+
interface MarketplacePlan {
|
|
537
|
+
/**
|
|
538
|
+
* Plan ID
|
|
539
|
+
*/
|
|
540
|
+
id: number;
|
|
541
|
+
/**
|
|
542
|
+
* Plan name
|
|
543
|
+
*/
|
|
544
|
+
name: string;
|
|
545
|
+
/**
|
|
546
|
+
* Plan description
|
|
547
|
+
*/
|
|
548
|
+
description: string;
|
|
549
|
+
/**
|
|
550
|
+
* Monthly price in cents
|
|
551
|
+
*/
|
|
552
|
+
monthlyPriceInCents: number;
|
|
553
|
+
/**
|
|
554
|
+
* Yearly price in cents
|
|
555
|
+
*/
|
|
556
|
+
yearlyPriceInCents: number;
|
|
557
|
+
/**
|
|
558
|
+
* Price model
|
|
559
|
+
*/
|
|
560
|
+
priceModel: 'FLAT_RATE' | 'PER_UNIT';
|
|
561
|
+
/**
|
|
562
|
+
* Whether this plan has a free trial
|
|
563
|
+
*/
|
|
564
|
+
hasFreeTrial: boolean;
|
|
565
|
+
/**
|
|
566
|
+
* Unit name (for per-unit pricing)
|
|
567
|
+
*/
|
|
568
|
+
unitName?: string;
|
|
569
|
+
/**
|
|
570
|
+
* Bullets (features list)
|
|
571
|
+
*/
|
|
572
|
+
bullets: string[];
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Marketplace account
|
|
576
|
+
*/
|
|
577
|
+
interface MarketplaceAccount {
|
|
578
|
+
/**
|
|
579
|
+
* Account ID
|
|
580
|
+
*/
|
|
581
|
+
id: number;
|
|
582
|
+
/**
|
|
583
|
+
* Account login
|
|
584
|
+
*/
|
|
585
|
+
login: string;
|
|
586
|
+
/**
|
|
587
|
+
* Account type
|
|
588
|
+
*/
|
|
589
|
+
type: 'User' | 'Organization';
|
|
590
|
+
/**
|
|
591
|
+
* Plan
|
|
592
|
+
*/
|
|
593
|
+
plan: MarketplacePlan;
|
|
594
|
+
/**
|
|
595
|
+
* Whether account is on free trial
|
|
596
|
+
*/
|
|
597
|
+
onFreeTrial: boolean;
|
|
598
|
+
/**
|
|
599
|
+
* Free trial ends on (if applicable)
|
|
600
|
+
*/
|
|
601
|
+
freeTrialEndsOn?: string;
|
|
602
|
+
/**
|
|
603
|
+
* Next billing date
|
|
604
|
+
*/
|
|
605
|
+
nextBillingDate?: string;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Marketplace webhook event
|
|
609
|
+
*/
|
|
610
|
+
interface MarketplaceWebhookEvent {
|
|
611
|
+
/**
|
|
612
|
+
* Action type
|
|
613
|
+
*/
|
|
614
|
+
action: 'purchased' | 'cancelled' | 'changed' | 'pending_change' | 'pending_change_cancelled';
|
|
615
|
+
/**
|
|
616
|
+
* Effective date
|
|
617
|
+
*/
|
|
618
|
+
effectiveDate?: string;
|
|
619
|
+
/**
|
|
620
|
+
* Marketplace purchase
|
|
621
|
+
*/
|
|
622
|
+
marketplacePurchase: {
|
|
623
|
+
account: MarketplaceAccount;
|
|
624
|
+
billingCycle: 'monthly' | 'yearly';
|
|
625
|
+
unitCount?: number;
|
|
626
|
+
onFreeTrial: boolean;
|
|
627
|
+
freeTrialEndsOn?: string;
|
|
628
|
+
nextBillingDate?: string;
|
|
629
|
+
};
|
|
630
|
+
/**
|
|
631
|
+
* Previous plan (for changes)
|
|
632
|
+
*/
|
|
633
|
+
previousMarketplacePurchase?: {
|
|
634
|
+
account: MarketplaceAccount;
|
|
635
|
+
billingCycle: 'monthly' | 'yearly';
|
|
636
|
+
unitCount?: number;
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Praxis Cloud Marketplace plans configuration
|
|
641
|
+
*/
|
|
642
|
+
declare const MARKETPLACE_PLANS: {
|
|
643
|
+
solo: {
|
|
644
|
+
name: string;
|
|
645
|
+
description: string;
|
|
646
|
+
monthlyPriceInCents: number;
|
|
647
|
+
yearlyPriceInCents: number;
|
|
648
|
+
features: string[];
|
|
649
|
+
};
|
|
650
|
+
team: {
|
|
651
|
+
name: string;
|
|
652
|
+
description: string;
|
|
653
|
+
monthlyPriceInCents: number;
|
|
654
|
+
yearlyPriceInCents: number;
|
|
655
|
+
features: string[];
|
|
656
|
+
};
|
|
657
|
+
enterprise: {
|
|
658
|
+
name: string;
|
|
659
|
+
description: string;
|
|
660
|
+
monthlyPriceInCents: number;
|
|
661
|
+
yearlyPriceInCents: number;
|
|
662
|
+
features: string[];
|
|
663
|
+
};
|
|
664
|
+
};
|
|
665
|
+
/**
|
|
666
|
+
* GitHub Marketplace API client
|
|
667
|
+
*/
|
|
668
|
+
declare class GitHubMarketplaceClient {
|
|
669
|
+
private token;
|
|
670
|
+
constructor(token: string);
|
|
671
|
+
/**
|
|
672
|
+
* Get accounts for the authenticated user
|
|
673
|
+
*/
|
|
674
|
+
getAccounts(): Promise<MarketplaceAccount[]>;
|
|
675
|
+
/**
|
|
676
|
+
* Get subscription from marketplace account
|
|
677
|
+
*/
|
|
678
|
+
getSubscription(accountId: number): Promise<Subscription | null>;
|
|
679
|
+
/**
|
|
680
|
+
* Handle marketplace webhook event
|
|
681
|
+
*/
|
|
682
|
+
handleWebhookEvent(event: MarketplaceWebhookEvent): {
|
|
683
|
+
userId: number;
|
|
684
|
+
userLogin: string;
|
|
685
|
+
subscription: Subscription;
|
|
686
|
+
} | null;
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* Create a GitHub Marketplace client
|
|
690
|
+
*/
|
|
691
|
+
declare function createMarketplaceClient(token: string): GitHubMarketplaceClient;
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Auto-Provisioning
|
|
695
|
+
*
|
|
696
|
+
* Automatic tenant/storage provisioning based on GitHub identity.
|
|
697
|
+
*/
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Tenant information
|
|
701
|
+
*/
|
|
702
|
+
interface Tenant {
|
|
703
|
+
/**
|
|
704
|
+
* Tenant ID (derived from GitHub user/org)
|
|
705
|
+
*/
|
|
706
|
+
id: string;
|
|
707
|
+
/**
|
|
708
|
+
* GitHub user ID
|
|
709
|
+
*/
|
|
710
|
+
githubUserId: number;
|
|
711
|
+
/**
|
|
712
|
+
* GitHub login (username or org name)
|
|
713
|
+
*/
|
|
714
|
+
githubLogin: string;
|
|
715
|
+
/**
|
|
716
|
+
* Tenant type
|
|
717
|
+
*/
|
|
718
|
+
type: 'user' | 'organization';
|
|
719
|
+
/**
|
|
720
|
+
* Subscription
|
|
721
|
+
*/
|
|
722
|
+
subscription: Subscription;
|
|
723
|
+
/**
|
|
724
|
+
* Storage namespace
|
|
725
|
+
*/
|
|
726
|
+
storageNamespace: string;
|
|
727
|
+
/**
|
|
728
|
+
* Creation timestamp
|
|
729
|
+
*/
|
|
730
|
+
createdAt: number;
|
|
731
|
+
/**
|
|
732
|
+
* Last accessed timestamp
|
|
733
|
+
*/
|
|
734
|
+
lastAccessedAt: number;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Generate a storage namespace from GitHub login
|
|
738
|
+
*
|
|
739
|
+
* Namespace format: gh-{login}-{hash}
|
|
740
|
+
* This ensures uniqueness and follows Azure Blob Storage naming rules.
|
|
741
|
+
*/
|
|
742
|
+
declare function generateStorageNamespace(githubLogin: string, userId: number): string;
|
|
743
|
+
/**
|
|
744
|
+
* Generate tenant ID from GitHub user
|
|
745
|
+
*/
|
|
746
|
+
declare function generateTenantId(githubUser: GitHubUser): string;
|
|
747
|
+
/**
|
|
748
|
+
* Create a tenant from GitHub user
|
|
749
|
+
*/
|
|
750
|
+
declare function createTenant(githubUser: GitHubUser, subscription: Subscription): Tenant;
|
|
751
|
+
/**
|
|
752
|
+
* Validate storage namespace
|
|
753
|
+
*
|
|
754
|
+
* Ensures namespace follows Azure Blob Storage naming rules:
|
|
755
|
+
* - 3-63 characters
|
|
756
|
+
* - lowercase letters, numbers, and hyphens only
|
|
757
|
+
* - must start with letter or number
|
|
758
|
+
* - no consecutive hyphens
|
|
759
|
+
*/
|
|
760
|
+
declare function validateStorageNamespace(namespace: string): {
|
|
761
|
+
valid: boolean;
|
|
762
|
+
error?: string;
|
|
763
|
+
};
|
|
764
|
+
/**
|
|
765
|
+
* Get storage container name for an app
|
|
766
|
+
*/
|
|
767
|
+
declare function getAppStorageContainer(tenantNamespace: string, appId: string): string;
|
|
768
|
+
/**
|
|
769
|
+
* Provisioning result
|
|
770
|
+
*/
|
|
771
|
+
interface ProvisioningResult {
|
|
772
|
+
/**
|
|
773
|
+
* Whether provisioning was successful
|
|
774
|
+
*/
|
|
775
|
+
success: boolean;
|
|
776
|
+
/**
|
|
777
|
+
* Tenant (if successful)
|
|
778
|
+
*/
|
|
779
|
+
tenant?: Tenant;
|
|
780
|
+
/**
|
|
781
|
+
* Error message (if failed)
|
|
782
|
+
*/
|
|
783
|
+
error?: string;
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* Provision a new tenant
|
|
787
|
+
*
|
|
788
|
+
* This would typically:
|
|
789
|
+
* 1. Create storage containers
|
|
790
|
+
* 2. Set up access policies
|
|
791
|
+
* 3. Initialize tenant metadata
|
|
792
|
+
* 4. Register with billing system
|
|
793
|
+
*/
|
|
794
|
+
declare function provisionTenant(githubUser: GitHubUser, subscription: Subscription): Promise<ProvisioningResult>;
|
|
795
|
+
/**
|
|
796
|
+
* Get or create tenant
|
|
797
|
+
*
|
|
798
|
+
* Checks if tenant exists, creates if not.
|
|
799
|
+
*/
|
|
800
|
+
declare function getOrCreateTenant(githubUser: GitHubUser, subscription: Subscription, tenantLookup: (id: string) => Promise<Tenant | null>): Promise<Tenant>;
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* Azure Functions Relay Endpoints
|
|
804
|
+
*
|
|
805
|
+
* HTTP-triggered Azure Functions for Praxis Cloud Relay.
|
|
806
|
+
*/
|
|
807
|
+
/**
|
|
808
|
+
* Azure Function context (simplified interface)
|
|
809
|
+
*/
|
|
810
|
+
interface AzureContext {
|
|
811
|
+
log: (message: string) => void;
|
|
812
|
+
done: (err?: Error, result?: unknown) => void;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Azure HTTP request
|
|
816
|
+
*/
|
|
817
|
+
interface AzureHttpRequest {
|
|
818
|
+
method: string;
|
|
819
|
+
url: string;
|
|
820
|
+
headers: Record<string, string>;
|
|
821
|
+
query: Record<string, string>;
|
|
822
|
+
body?: unknown;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Azure HTTP response
|
|
826
|
+
*/
|
|
827
|
+
interface AzureHttpResponse {
|
|
828
|
+
status: number;
|
|
829
|
+
headers?: Record<string, string>;
|
|
830
|
+
body?: unknown;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Health check endpoint
|
|
834
|
+
* GET /health
|
|
835
|
+
*/
|
|
836
|
+
declare function healthEndpoint(context: AzureContext, _req: AzureHttpRequest): Promise<AzureHttpResponse>;
|
|
837
|
+
/**
|
|
838
|
+
* CRDT sync endpoint
|
|
839
|
+
* POST /sync
|
|
840
|
+
*/
|
|
841
|
+
declare function syncEndpoint(context: AzureContext, req: AzureHttpRequest): Promise<AzureHttpResponse>;
|
|
842
|
+
/**
|
|
843
|
+
* Usage metrics endpoint
|
|
844
|
+
* GET /usage?appId=<appId>
|
|
845
|
+
*/
|
|
846
|
+
declare function usageEndpoint(context: AzureContext, req: AzureHttpRequest): Promise<AzureHttpResponse>;
|
|
847
|
+
/**
|
|
848
|
+
* Stats endpoint for aggregated metrics
|
|
849
|
+
* GET /stats?appId=<appId>
|
|
850
|
+
*/
|
|
851
|
+
declare function statsEndpoint(context: AzureContext, req: AzureHttpRequest): Promise<AzureHttpResponse>;
|
|
852
|
+
/**
|
|
853
|
+
* Event forwarding endpoint
|
|
854
|
+
* POST /events
|
|
855
|
+
*/
|
|
856
|
+
declare function eventsEndpoint(context: AzureContext, req: AzureHttpRequest): Promise<AzureHttpResponse>;
|
|
857
|
+
/**
|
|
858
|
+
* Schema registry endpoint
|
|
859
|
+
* GET /schema?appId=<appId>
|
|
860
|
+
* POST /schema (to register a schema)
|
|
861
|
+
*/
|
|
862
|
+
declare function schemaEndpoint(context: AzureContext, req: AzureHttpRequest): Promise<AzureHttpResponse>;
|
|
863
|
+
|
|
864
|
+
export { type AuthResult, type AzureContext, type AzureHttpRequest, type AzureHttpResponse, type BillingEvent, BillingProvider, type CRDTSyncMessage, type CloudRelayClient, type CloudRelayConfig, GitHubMarketplaceClient, GitHubOAuth, type GitHubOAuthConfig, GitHubSponsorsClient, type GitHubUser, type HealthCheckResponse, MARKETPLACE_PLANS, type MarketplaceAccount, type MarketplacePlan, type MarketplaceWebhookEvent, type ProvisioningResult, type RelayStatus, type SponsorTier, type Sponsorship, type Subscription, SubscriptionStatus, SubscriptionTier, TIER_LIMITS, type Tenant, type TierLimits, type UsageMetrics, authenticateWithDeviceFlow, checkUsageLimits, connectRelay, createCloudRelay, createFreeSubscription, createGitHubOAuth, createMarketplaceClient, createSponsorSubscription, createSponsorsClient, createTenant, eventsEndpoint, generateStorageNamespace, generateTenantId, getAppStorageContainer, getOrCreateTenant, hasAccessToTier, healthEndpoint, provisionTenant, schemaEndpoint, statsEndpoint, syncEndpoint, usageEndpoint, validateStorageNamespace };
|