@zonastery/bursar 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/auto-recharge-port.d.ts +3 -2
- package/dist/billing/auto-recharge-port.d.ts.map +1 -1
- package/dist/billing/auto-recharge-port.js.map +1 -1
- package/dist/billing/auto-recharge-service.js +3 -3
- package/dist/billing/auto-recharge-service.js.map +1 -1
- package/dist/billing/billing-service.d.ts +3 -2
- package/dist/billing/billing-service.d.ts.map +1 -1
- package/dist/billing/billing-service.js +2 -10
- package/dist/billing/billing-service.js.map +1 -1
- package/dist/billing/billing-store.d.ts +6 -6
- package/dist/billing/billing-store.d.ts.map +1 -1
- package/dist/billing/billing-store.js.map +1 -1
- package/dist/billing/contracts.d.ts +8 -7
- package/dist/billing/contracts.d.ts.map +1 -1
- package/dist/billing/contracts.js.map +1 -1
- package/dist/billing/event-handlers.d.ts +5 -9
- package/dist/billing/event-handlers.d.ts.map +1 -1
- package/dist/billing/event-handlers.js +191 -285
- package/dist/billing/event-handlers.js.map +1 -1
- package/dist/billing/event-processor.d.ts +1 -1
- package/dist/billing/event-processor.d.ts.map +1 -1
- package/dist/billing/event-processor.js +32 -23
- package/dist/billing/event-processor.js.map +1 -1
- package/dist/billing/financial-event-handlers.d.ts +3 -9
- package/dist/billing/financial-event-handlers.d.ts.map +1 -1
- package/dist/billing/financial-event-handlers.js +10 -12
- package/dist/billing/financial-event-handlers.js.map +1 -1
- package/dist/billing/index.d.ts +1 -1
- package/dist/billing/index.d.ts.map +1 -1
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/management.d.ts +3 -2
- package/dist/billing/management.d.ts.map +1 -1
- package/dist/billing/management.js.map +1 -1
- package/dist/billing/postgres/repositories/auto-recharge.d.ts +2 -1
- package/dist/billing/postgres/repositories/auto-recharge.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/auto-recharge.js +58 -40
- package/dist/billing/postgres/repositories/auto-recharge.js.map +1 -1
- package/dist/billing/postgres/repositories/dispute.d.ts +2 -1
- package/dist/billing/postgres/repositories/dispute.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/dispute.js.map +1 -1
- package/dist/billing/postgres/repositories/event.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/event.js.map +1 -1
- package/dist/billing/postgres/repositories/invoice.d.ts +2 -1
- package/dist/billing/postgres/repositories/invoice.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/invoice.js +8 -12
- package/dist/billing/postgres/repositories/invoice.js.map +1 -1
- package/dist/billing/postgres/repositories/offer.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/offer.js +5 -0
- package/dist/billing/postgres/repositories/offer.js.map +1 -1
- package/dist/billing/postgres/repositories/payment.d.ts +1 -1
- package/dist/billing/postgres/repositories/payment.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/payment.js +1 -1
- package/dist/billing/postgres/repositories/payment.js.map +1 -1
- package/dist/billing/postgres/repositories/subscription-change.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/subscription-change.js +1 -9
- package/dist/billing/postgres/repositories/subscription-change.js.map +1 -1
- package/dist/billing/postgres/repositories/subscription.d.ts +6 -6
- package/dist/billing/postgres/repositories/subscription.d.ts.map +1 -1
- package/dist/billing/postgres/repositories/subscription.js +29 -30
- package/dist/billing/postgres/repositories/subscription.js.map +1 -1
- package/dist/billing/postgres/store.d.ts +6 -5
- package/dist/billing/postgres/store.d.ts.map +1 -1
- package/dist/billing/postgres/store.js +15 -13
- package/dist/billing/postgres/store.js.map +1 -1
- package/dist/billing/types/auto-recharge.d.ts +2 -1
- package/dist/billing/types/auto-recharge.d.ts.map +1 -1
- package/dist/billing/types/auto-recharge.js.map +1 -1
- package/dist/billing/types/documents.d.ts +2 -1
- package/dist/billing/types/documents.d.ts.map +1 -1
- package/dist/billing/types/documents.js.map +1 -1
- package/dist/billing/types/events.d.ts +3 -2
- package/dist/billing/types/events.d.ts.map +1 -1
- package/dist/billing/types/events.js +73 -39
- package/dist/billing/types/events.js.map +1 -1
- package/dist/billing/types/subscriptions.d.ts +4 -1
- package/dist/billing/types/subscriptions.d.ts.map +1 -1
- package/dist/billing/types/subscriptions.js.map +1 -1
- package/dist/breakdown.d.ts +3 -2
- package/dist/breakdown.d.ts.map +1 -1
- package/dist/breakdown.js.map +1 -1
- package/dist/bursar.d.ts.map +1 -1
- package/dist/bursar.js +4 -3
- package/dist/bursar.js.map +1 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +45 -42
- package/dist/catalog.js.map +1 -1
- package/dist/commerce/provider-registry.d.ts.map +1 -1
- package/dist/commerce/provider-registry.js +11 -6
- package/dist/commerce/provider-registry.js.map +1 -1
- package/dist/commerce/service.d.ts.map +1 -1
- package/dist/commerce/service.js +16 -22
- package/dist/commerce/service.js.map +1 -1
- package/dist/commerce/types.d.ts.map +1 -1
- package/dist/commerce/types.js.map +1 -1
- package/dist/config/parse-access.d.ts +5 -2
- package/dist/config/parse-access.d.ts.map +1 -1
- package/dist/config/parse-access.js +60 -41
- package/dist/config/parse-access.js.map +1 -1
- package/dist/config/parse-commerce.d.ts +2 -1
- package/dist/config/parse-commerce.d.ts.map +1 -1
- package/dist/config/parse-commerce.js +49 -29
- package/dist/config/parse-commerce.js.map +1 -1
- package/dist/config/parse-credits.d.ts +2 -1
- package/dist/config/parse-credits.d.ts.map +1 -1
- package/dist/config/parse-credits.js +39 -23
- package/dist/config/parse-credits.js.map +1 -1
- package/dist/config/parse-plans.d.ts +7 -2
- package/dist/config/parse-plans.d.ts.map +1 -1
- package/dist/config/parse-plans.js +49 -22
- package/dist/config/parse-plans.js.map +1 -1
- package/dist/config/parse-pricing.d.ts +2 -1
- package/dist/config/parse-pricing.d.ts.map +1 -1
- package/dist/config/parse-pricing.js +41 -31
- package/dist/config/parse-pricing.js.map +1 -1
- package/dist/config/parse-utils.d.ts +15 -11
- package/dist/config/parse-utils.d.ts.map +1 -1
- package/dist/config/parse-utils.js +90 -27
- package/dist/config/parse-utils.js.map +1 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/config.d.ts +6 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +65 -35
- package/dist/config.js.map +1 -1
- package/dist/credits/amount.d.ts +1 -1
- package/dist/credits/amount.d.ts.map +1 -1
- package/dist/credits/amount.js +5 -4
- package/dist/credits/amount.js.map +1 -1
- package/dist/credits/catalog-runtime.d.ts.map +1 -1
- package/dist/credits/catalog-runtime.js +2 -3
- package/dist/credits/catalog-runtime.js.map +1 -1
- package/dist/credits/events.d.ts +12 -1
- package/dist/credits/events.d.ts.map +1 -1
- package/dist/credits/events.js +35 -21
- package/dist/credits/events.js.map +1 -1
- package/dist/credits/lease-workflow.d.ts +2 -1
- package/dist/credits/lease-workflow.d.ts.map +1 -1
- package/dist/credits/lease-workflow.js +3 -2
- package/dist/credits/lease-workflow.js.map +1 -1
- package/dist/credits/low-balance-monitor.d.ts +2 -1
- package/dist/credits/low-balance-monitor.d.ts.map +1 -1
- package/dist/credits/low-balance-monitor.js.map +1 -1
- package/dist/credits/postgres/repositories/analytics.d.ts +2 -2
- package/dist/credits/postgres/repositories/analytics.d.ts.map +1 -1
- package/dist/credits/postgres/repositories/analytics.js +14 -6
- package/dist/credits/postgres/repositories/analytics.js.map +1 -1
- package/dist/credits/postgres/repositories/balance.d.ts.map +1 -1
- package/dist/credits/postgres/repositories/balance.js +6 -6
- package/dist/credits/postgres/repositories/balance.js.map +1 -1
- package/dist/credits/postgres/repositories/catalog.d.ts +4 -3
- package/dist/credits/postgres/repositories/catalog.d.ts.map +1 -1
- package/dist/credits/postgres/repositories/catalog.js +4 -3
- package/dist/credits/postgres/repositories/catalog.js.map +1 -1
- package/dist/credits/postgres/repositories/deduction.d.ts.map +1 -1
- package/dist/credits/postgres/repositories/deduction.js +2 -2
- package/dist/credits/postgres/repositories/deduction.js.map +1 -1
- package/dist/credits/postgres/repositories/plan.d.ts +1 -1
- package/dist/credits/postgres/store.d.ts +3 -2
- package/dist/credits/postgres/store.d.ts.map +1 -1
- package/dist/credits/postgres/store.js +17 -10
- package/dist/credits/postgres/store.js.map +1 -1
- package/dist/credits/postgres/value-mappers.d.ts +4 -3
- package/dist/credits/postgres/value-mappers.d.ts.map +1 -1
- package/dist/credits/postgres/value-mappers.js +10 -11
- package/dist/credits/postgres/value-mappers.js.map +1 -1
- package/dist/credits/service.d.ts.map +1 -1
- package/dist/credits/service.js +10 -5
- package/dist/credits/service.js.map +1 -1
- package/dist/credits/store.d.ts +5 -4
- package/dist/credits/store.d.ts.map +1 -1
- package/dist/credits/store.js.map +1 -1
- package/dist/credits/types/account.d.ts +5 -4
- package/dist/credits/types/account.d.ts.map +1 -1
- package/dist/credits/types/account.js.map +1 -1
- package/dist/credits/types/catalog.d.ts +2 -1
- package/dist/credits/types/catalog.d.ts.map +1 -1
- package/dist/credits/types/catalog.js.map +1 -1
- package/dist/credits/types/grants.d.ts.map +1 -1
- package/dist/credits/types/grants.js.map +1 -1
- package/dist/credits/types/ledger.d.ts +3 -2
- package/dist/credits/types/ledger.d.ts.map +1 -1
- package/dist/credits/types/ledger.js.map +1 -1
- package/dist/engine.d.ts +2 -2
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +39 -10
- package/dist/engine.js.map +1 -1
- package/dist/errors.d.ts +7 -4
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +18 -11
- package/dist/errors.js.map +1 -1
- package/dist/expr/ast.d.ts.map +1 -1
- package/dist/expr/ast.js.map +1 -1
- package/dist/expr/parser.d.ts.map +1 -1
- package/dist/expr/parser.js.map +1 -1
- package/dist/expr/tokenizer.d.ts.map +1 -1
- package/dist/expr/tokenizer.js +34 -12
- package/dist/expr/tokenizer.js.map +1 -1
- package/dist/expr.d.ts.map +1 -1
- package/dist/expr.js +12 -6
- package/dist/expr.js.map +1 -1
- package/dist/generated/pricing-config.types.d.ts.map +1 -1
- package/dist/generated/pricing-config.types.js.map +1 -1
- package/dist/integrations/better-auth.d.ts +4 -1
- package/dist/integrations/better-auth.d.ts.map +1 -1
- package/dist/integrations/better-auth.js +7 -4
- package/dist/integrations/better-auth.js.map +1 -1
- package/dist/load-config-file.d.ts +2 -1
- package/dist/load-config-file.d.ts.map +1 -1
- package/dist/load-config-file.js +19 -13
- package/dist/load-config-file.js.map +1 -1
- package/dist/metrics.d.ts +2 -1
- package/dist/metrics.d.ts.map +1 -1
- package/dist/metrics.js.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js.map +1 -1
- package/dist/providers/_shared.d.ts +8 -5
- package/dist/providers/_shared.d.ts.map +1 -1
- package/dist/providers/_shared.js +15 -11
- package/dist/providers/_shared.js.map +1 -1
- package/dist/providers/dodo/better-auth-core.d.ts +32 -0
- package/dist/providers/dodo/better-auth-core.d.ts.map +1 -0
- package/dist/providers/dodo/better-auth-core.js +14 -0
- package/dist/providers/dodo/better-auth-core.js.map +1 -0
- package/dist/providers/dodo/better-auth.d.ts +5 -7
- package/dist/providers/dodo/better-auth.d.ts.map +1 -1
- package/dist/providers/dodo/better-auth.js +16 -13
- package/dist/providers/dodo/better-auth.js.map +1 -1
- package/dist/providers/dodo/client-contract.d.ts +11 -10
- package/dist/providers/dodo/client-contract.d.ts.map +1 -1
- package/dist/providers/dodo/client-contract.js.map +1 -1
- package/dist/providers/dodo/event-mapper.d.ts +7 -4
- package/dist/providers/dodo/event-mapper.d.ts.map +1 -1
- package/dist/providers/dodo/event-mapper.js +121 -113
- package/dist/providers/dodo/event-mapper.js.map +1 -1
- package/dist/providers/dodo/nextjs-core.d.ts +22 -0
- package/dist/providers/dodo/nextjs-core.d.ts.map +1 -0
- package/dist/providers/dodo/nextjs-core.js +14 -0
- package/dist/providers/dodo/nextjs-core.js.map +1 -0
- package/dist/providers/dodo/nextjs.d.ts +5 -7
- package/dist/providers/dodo/nextjs.d.ts.map +1 -1
- package/dist/providers/dodo/nextjs.js +11 -10
- package/dist/providers/dodo/nextjs.js.map +1 -1
- package/dist/providers/dodo/provider.d.ts +3 -3
- package/dist/providers/dodo/provider.d.ts.map +1 -1
- package/dist/providers/dodo/provider.js +42 -35
- package/dist/providers/dodo/provider.js.map +1 -1
- package/dist/providers/dodo/react-native-core.d.ts +56 -0
- package/dist/providers/dodo/react-native-core.d.ts.map +1 -0
- package/dist/providers/dodo/react-native-core.js +56 -0
- package/dist/providers/dodo/react-native-core.js.map +1 -0
- package/dist/providers/dodo/react-native.d.ts +6 -50
- package/dist/providers/dodo/react-native.d.ts.map +1 -1
- package/dist/providers/dodo/react-native.js +5 -49
- package/dist/providers/dodo/react-native.js.map +1 -1
- package/dist/providers/dodo/webhook-bridge.d.ts +4 -2
- package/dist/providers/dodo/webhook-bridge.d.ts.map +1 -1
- package/dist/providers/dodo/webhook-bridge.js.map +1 -1
- package/dist/providers/environment.d.ts +1 -1
- package/dist/providers/environment.d.ts.map +1 -1
- package/dist/providers/environment.js +4 -2
- package/dist/providers/environment.js.map +1 -1
- package/dist/providers/mock/provider.d.ts.map +1 -1
- package/dist/providers/mock/provider.js +5 -10
- package/dist/providers/mock/provider.js.map +1 -1
- package/dist/providers/stripe/event-mapper.d.ts.map +1 -1
- package/dist/providers/stripe/event-mapper.js +33 -9
- package/dist/providers/stripe/event-mapper.js.map +1 -1
- package/dist/providers/stripe/provider.d.ts.map +1 -1
- package/dist/providers/stripe/provider.js +100 -60
- package/dist/providers/stripe/provider.js.map +1 -1
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/types.js.map +1 -1
- package/dist/retry.d.ts.map +1 -1
- package/dist/retry.js +16 -9
- package/dist/retry.js.map +1 -1
- package/dist/shared/diagnostics.d.ts +5 -5
- package/dist/shared/diagnostics.d.ts.map +1 -1
- package/dist/shared/diagnostics.js +32 -22
- package/dist/shared/diagnostics.js.map +1 -1
- package/dist/shared/idempotency.d.ts +4 -3
- package/dist/shared/idempotency.d.ts.map +1 -1
- package/dist/shared/idempotency.js +21 -10
- package/dist/shared/idempotency.js.map +1 -1
- package/dist/shared/json.d.ts +28 -0
- package/dist/shared/json.d.ts.map +1 -0
- package/dist/shared/json.js +41 -0
- package/dist/shared/json.js.map +1 -0
- package/dist/shared/logger.d.ts +10 -4
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/logger.js.map +1 -1
- package/dist/shared/postgres-client.d.ts +8 -6
- package/dist/shared/postgres-client.d.ts.map +1 -1
- package/dist/shared/postgres-client.js +69 -47
- package/dist/shared/postgres-client.js.map +1 -1
- package/dist/shared/postgres-errors.d.ts +1 -1
- package/dist/shared/postgres-errors.d.ts.map +1 -1
- package/dist/shared/postgres-errors.js +32 -31
- package/dist/shared/postgres-errors.js.map +1 -1
- package/dist/shared/postgres-types.d.ts +3 -2
- package/dist/shared/postgres-types.d.ts.map +1 -1
- package/dist/shared/postgres-types.js.map +1 -1
- package/dist/shared/postgres-validation.d.ts +7 -6
- package/dist/shared/postgres-validation.d.ts.map +1 -1
- package/dist/shared/postgres-validation.js +17 -10
- package/dist/shared/postgres-validation.js.map +1 -1
- package/dist/storage/adapters/clickhouse.d.ts +11 -4
- package/dist/storage/adapters/clickhouse.d.ts.map +1 -1
- package/dist/storage/adapters/clickhouse.js +8 -6
- package/dist/storage/adapters/clickhouse.js.map +1 -1
- package/dist/storage/adapters/s3.d.ts +28 -5
- package/dist/storage/adapters/s3.d.ts.map +1 -1
- package/dist/storage/adapters/s3.js +48 -33
- package/dist/storage/adapters/s3.js.map +1 -1
- package/dist/storage/diagnostics.d.ts +1 -1
- package/dist/storage/diagnostics.js +13 -12
- package/dist/storage/diagnostics.js.map +1 -1
- package/dist/storage/maintenance.d.ts.map +1 -1
- package/dist/storage/maintenance.js +31 -25
- package/dist/storage/maintenance.js.map +1 -1
- package/dist/storage/outbox-worker.d.ts +1 -1
- package/dist/storage/outbox-worker.js +18 -18
- package/dist/storage/outbox-worker.js.map +1 -1
- package/dist/storage/ports.d.ts +10 -7
- package/dist/storage/ports.d.ts.map +1 -1
- package/dist/storage/ports.js.map +1 -1
- package/dist/storage/postgres-repository.d.ts +3 -1
- package/dist/storage/postgres-repository.d.ts.map +1 -1
- package/dist/storage/postgres-repository.js +10 -4
- package/dist/storage/postgres-repository.js.map +1 -1
- package/dist/storage/runtime.d.ts +1 -1
- package/dist/storage/runtime.d.ts.map +1 -1
- package/dist/storage/runtime.js +165 -182
- package/dist/storage/runtime.js.map +1 -1
- package/dist/telemetry/index.d.ts +10 -6
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +26 -23
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/opentelemetry.js +3 -3
- package/dist/telemetry/opentelemetry.js.map +1 -1
- package/package.json +14 -14
package/dist/expr/parser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/expr/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAY/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,QAAQ,EAA8B,MAAM,gBAAgB,CAAC;AAEtE,MAAM,OAAO,gBAAgB;IAGE;IAFrB,QAAQ,GAAG,CAAC,CAAC;IAErB,YAA6B,MAAe;QAAf,WAAM,GAAN,MAAM,CAAS;IAAG,CAAC;IAEhD,MAAM,CAAC,UAAU,CAAC,MAAc;QAC9B,OAAO,IAAI,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC7C,CAAC;IAEO,QAAQ;QACd,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,GA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OpNode,\n CallNode,\n CompareNode,\n IdentNode,\n Node,\n NumNode,\n TernaryNode,\n UnaryNode,\n} from \"./ast.js\";\nimport { ALLOWED_FUNCTIONS } from \"./language.js\";\nimport { tokenize, type Token, type TokenType } from \"./tokenizer.js\";\n\nexport class ExpressionParser {\n private position = 0;\n\n constructor(private readonly tokens: Token[]) {}\n\n static fromSource(source: string): ExpressionParser {\n return new ExpressionParser(tokenize(source));\n }\n\n peek(): Token | undefined {\n return this.tokens[this.position];\n }\n\n isAtEnd(): boolean {\n return this.position >= this.tokens.length;\n }\n\n private previous(): Token {\n const token = this.tokens[this.position - 1];\n if (!token) throw new ExpressionError(\"invalid parser state: no previous token\");\n return token;\n }\n\n private check(...types: TokenType[]): boolean {\n const token = this.peek();\n return token !== undefined && types.includes(token.type);\n }\n\n private match(...types: TokenType[]): boolean {\n for (const type of types) {\n if (this.check(type)) {\n this.position++;\n return true;\n }\n }\n return false;\n }\n\n private consume(type: TokenType, message: string): Token {\n const token = this.peek();\n if (token?.type === type) {\n this.position++;\n return token;\n }\n throw new ExpressionError(message);\n }\n\n parse(): Node {\n const expression = this.booleanExpression();\n if (!this.match(\"if\")) return expression;\n\n const condition = this.booleanExpression();\n this.consume(\"else\", \"expected 'else' in ternary expression\");\n return {\n type: \"ternary\",\n cond: condition,\n then: expression,\n else: this.booleanExpression(),\n } as TernaryNode;\n }\n\n private comparison(): Node {\n const left = this.addition();\n let node: Node;\n if (this.check(\"not\")) {\n this.match(\"not\");\n if (!this.match(\"in\")) {\n throw new ExpressionError(\"expected 'in' after 'not'\");\n }\n node = { type: \"comparison\", op: \"not in\", left, right: this.addition() } as CompareNode;\n } else if (this.match(\"==\", \"!=\", \"<\", \"<=\", \">\", \">=\", \"in\")) {\n node = {\n type: \"comparison\",\n op: this.previous().value,\n left,\n right: this.addition(),\n } as CompareNode;\n } else {\n return left;\n }\n // Reject chained comparisons (a < b < c): a left-associative fold would\n // evaluate them as ((a<b)<c) whereas Python uses and-chaining semantics, so\n // forbidding them keeps the two engines identical (parity).\n if (this.check(\"==\", \"!=\", \"<\", \"<=\", \">\", \">=\", \"in\", \"not\")) {\n throw new ExpressionError(\"chained comparisons are not supported\");\n }\n return node;\n }\n\n private addition(): Node {\n let left = this.multiplication();\n while (this.match(\"+\", \"-\")) {\n left = {\n type: \"binary\",\n op: this.previous().value,\n left,\n right: this.multiplication(),\n } as BinOpNode;\n }\n return left;\n }\n\n private multiplication(): Node {\n let left = this.unary();\n while (this.match(\"*\", \"/\", \"//\", \"%\")) {\n left = {\n type: \"binary\",\n op: this.previous().value,\n left,\n right: this.unary(),\n } as BinOpNode;\n }\n if (this.check(\"**\")) {\n throw new ExpressionError(\n \"exponentiation operator '**' is not allowed in pricing expressions\",\n );\n }\n return left;\n }\n\n private notExpression(): Node {\n if (!this.match(\"not\")) return this.comparison();\n return {\n type: \"unary\",\n op: \"not\",\n operand: this.notExpression(),\n } as UnaryNode;\n }\n\n private andExpression(): Node {\n let left = this.notExpression();\n while (this.match(\"and\")) {\n left = {\n type: \"boolean\",\n op: \"and\",\n left,\n right: this.notExpression(),\n } as BoolOpNode;\n }\n return left;\n }\n\n private booleanExpression(): Node {\n let left = this.andExpression();\n while (this.match(\"or\")) {\n left = {\n type: \"boolean\",\n op: \"or\",\n left,\n right: this.andExpression(),\n } as BoolOpNode;\n }\n return left;\n }\n\n private unary(): Node {\n if (!this.match(\"+\", \"-\")) return this.primary();\n return {\n type: \"unary\",\n op: this.previous().value,\n operand: this.unary(),\n } as UnaryNode;\n }\n\n private primary(): Node {\n if (this.check(\"**\")) {\n throw new ExpressionError(\n \"exponentiation operator '**' is not allowed in pricing expressions\",\n );\n }\n if (this.match(\"number\")) {\n return { type: \"number\", value: this.previous().value } as NumNode;\n }\n if (this.match(\"identifier\")) {\n const name = this.previous().value;\n if (!this.match(\"(\")) return { type: \"identifier\", name } as IdentNode;\n if (!ALLOWED_FUNCTIONS.has(name)) {\n throw new ExpressionError(`disallowed function: ${name}`);\n }\n return { type: \"call\", name, args: this.callArguments() } as CallNode;\n }\n if (this.match(\"if\") && this.match(\"(\")) {\n return { type: \"call\", name: \"if\", args: this.callArguments() } as CallNode;\n }\n if (this.match(\"(\")) {\n const expression = this.parse();\n this.consume(\")\", \"expected ')'\");\n return expression;\n }\n throw new ExpressionError(`unexpected token: '${this.peek()?.value ?? \"EOF\"}'`);\n }\n\n private callArguments(): Node[] {\n const args: Node[] = [];\n if (!this.check(\")\")) {\n do {\n args.push(this.booleanExpression());\n } while (this.match(\",\"));\n }\n this.consume(\")\", \"expected ')'\");\n return args;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/expr/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,QAAQ,EAA8B,MAAM,gBAAgB,CAAC;AAEtE,MAAM,OAAO,gBAAgB;IAGE;IAFrB,QAAQ,GAAG,CAAC,CAAC;IAErB,YAA6B,MAAe;QAAf,WAAM,GAAN,MAAM,CAAS;IAAG,CAAC;IAEhD,MAAM,CAAC,UAAU,CAAC,MAAc;QAC9B,OAAO,IAAI,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC7C,CAAC;IAEO,QAAQ;QACd,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,eAAe,CAAC,yCAAyC,CAAC,CAAC;QACjF,OAAO,KAAK,CAAC;IACf,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C,CAAC;YAC5D,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;QAC5D,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;QAClE,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACpB,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YAClC,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,MAAM,IAAI,eAAe,CAAC,sBAAsB,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,IAAI,KAAK,GAAG,CAAC,CAAC;IAClF,CAAC;IAEO,aAAa;QACnB,MAAM,IAAI,GAAW,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACrB,GAAG,CAAC;gBACF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;YACtC,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QAC5B,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["import { ExpressionError } from \"../errors.js\";\nimport type { Node } from \"./ast.js\";\nimport { ALLOWED_FUNCTIONS } from \"./language.js\";\nimport { tokenize, type Token, type TokenType } from \"./tokenizer.js\";\n\nexport class ExpressionParser {\n private position = 0;\n\n constructor(private readonly tokens: Token[]) {}\n\n static fromSource(source: string): ExpressionParser {\n return new ExpressionParser(tokenize(source));\n }\n\n peek(): Token | undefined {\n return this.tokens[this.position];\n }\n\n isAtEnd(): boolean {\n return this.position >= this.tokens.length;\n }\n\n private previous(): Token {\n const token = this.tokens[this.position - 1];\n if (!token) throw new ExpressionError(\"invalid parser state: no previous token\");\n return token;\n }\n\n private check(...types: TokenType[]): boolean {\n const token = this.peek();\n return token !== undefined && types.includes(token.type);\n }\n\n private match(...types: TokenType[]): boolean {\n for (const type of types) {\n if (this.check(type)) {\n this.position++;\n return true;\n }\n }\n return false;\n }\n\n private consume(type: TokenType, message: string): Token {\n const token = this.peek();\n if (token?.type === type) {\n this.position++;\n return token;\n }\n throw new ExpressionError(message);\n }\n\n parse(): Node {\n const expression = this.booleanExpression();\n if (!this.match(\"if\")) return expression;\n\n const condition = this.booleanExpression();\n this.consume(\"else\", \"expected 'else' in ternary expression\");\n return {\n type: \"ternary\",\n cond: condition,\n then: expression,\n else: this.booleanExpression(),\n };\n }\n\n private comparison(): Node {\n const left = this.addition();\n let node: Node;\n if (this.check(\"not\")) {\n this.match(\"not\");\n if (!this.match(\"in\")) {\n throw new ExpressionError(\"expected 'in' after 'not'\");\n }\n node = { type: \"comparison\", op: \"not in\", left, right: this.addition() };\n } else if (this.match(\"==\", \"!=\", \"<\", \"<=\", \">\", \">=\", \"in\")) {\n node = {\n type: \"comparison\",\n op: this.previous().value,\n left,\n right: this.addition(),\n };\n } else {\n return left;\n }\n // Reject chained comparisons (a < b < c): a left-associative fold would\n // evaluate them as ((a<b)<c) whereas Python uses and-chaining semantics, so\n // forbidding them keeps the two engines identical (parity).\n if (this.check(\"==\", \"!=\", \"<\", \"<=\", \">\", \">=\", \"in\", \"not\")) {\n throw new ExpressionError(\"chained comparisons are not supported\");\n }\n return node;\n }\n\n private addition(): Node {\n let left = this.multiplication();\n while (this.match(\"+\", \"-\")) {\n left = {\n type: \"binary\",\n op: this.previous().value,\n left,\n right: this.multiplication(),\n };\n }\n return left;\n }\n\n private multiplication(): Node {\n let left = this.unary();\n while (this.match(\"*\", \"/\", \"//\", \"%\")) {\n left = {\n type: \"binary\",\n op: this.previous().value,\n left,\n right: this.unary(),\n };\n }\n if (this.check(\"**\")) {\n throw new ExpressionError(\n \"exponentiation operator '**' is not allowed in pricing expressions\",\n );\n }\n return left;\n }\n\n private notExpression(): Node {\n if (!this.match(\"not\")) return this.comparison();\n return {\n type: \"unary\",\n op: \"not\",\n operand: this.notExpression(),\n };\n }\n\n private andExpression(): Node {\n let left = this.notExpression();\n while (this.match(\"and\")) {\n left = {\n type: \"boolean\",\n op: \"and\",\n left,\n right: this.notExpression(),\n };\n }\n return left;\n }\n\n private booleanExpression(): Node {\n let left = this.andExpression();\n while (this.match(\"or\")) {\n left = {\n type: \"boolean\",\n op: \"or\",\n left,\n right: this.andExpression(),\n };\n }\n return left;\n }\n\n private unary(): Node {\n if (!this.match(\"+\", \"-\")) return this.primary();\n return {\n type: \"unary\",\n op: this.previous().value,\n operand: this.unary(),\n };\n }\n\n private primary(): Node {\n if (this.check(\"**\")) {\n throw new ExpressionError(\n \"exponentiation operator '**' is not allowed in pricing expressions\",\n );\n }\n if (this.match(\"number\")) {\n return { type: \"number\", value: this.previous().value };\n }\n if (this.match(\"identifier\")) {\n const name = this.previous().value;\n if (!this.match(\"(\")) return { type: \"identifier\", name };\n if (!ALLOWED_FUNCTIONS.has(name)) {\n throw new ExpressionError(`disallowed function: ${name}`);\n }\n return { type: \"call\", name, args: this.callArguments() };\n }\n if (this.match(\"if\") && this.match(\"(\")) {\n return { type: \"call\", name: \"if\", args: this.callArguments() };\n }\n if (this.match(\"(\")) {\n const expression = this.parse();\n this.consume(\")\", \"expected ')'\");\n return expression;\n }\n throw new ExpressionError(`unexpected token: '${this.peek()?.value ?? \"EOF\"}'`);\n }\n\n private callArguments(): Node[] {\n const args: Node[] = [];\n if (!this.check(\")\")) {\n do {\n args.push(this.booleanExpression());\n } while (this.match(\",\"));\n }\n this.consume(\")\", \"expected ')'\");\n return args;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenizer.d.ts","sourceRoot":"","sources":["../../src/expr/tokenizer.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,YAAY,GACZ,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,GAAG,GACH,IAAI,GACJ,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,GAAG,GACH,IAAI,GACJ,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,MAAM,CAAC;AAEX,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"tokenizer.d.ts","sourceRoot":"","sources":["../../src/expr/tokenizer.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,YAAY,GACZ,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,GAAG,GACH,IAAI,GACJ,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,GAAG,GACH,IAAI,GACJ,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,MAAM,CAAC;AAEX,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AA6ED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CA8ChD"}
|
package/dist/expr/tokenizer.js
CHANGED
|
@@ -1,7 +1,32 @@
|
|
|
1
1
|
import { ExpressionError } from "../errors.js";
|
|
2
|
-
const TWO_CHARACTER_OPERATORS = new
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const TWO_CHARACTER_OPERATORS = new Map([
|
|
3
|
+
["**", "**"],
|
|
4
|
+
["//", "//"],
|
|
5
|
+
["==", "=="],
|
|
6
|
+
["!=", "!="],
|
|
7
|
+
["<=", "<="],
|
|
8
|
+
[">=", ">="],
|
|
9
|
+
]);
|
|
10
|
+
const ONE_CHARACTER_TOKENS = new Map([
|
|
11
|
+
["(", "("],
|
|
12
|
+
[")", ")"],
|
|
13
|
+
[",", ","],
|
|
14
|
+
["+", "+"],
|
|
15
|
+
["-", "-"],
|
|
16
|
+
["*", "*"],
|
|
17
|
+
["/", "/"],
|
|
18
|
+
["%", "%"],
|
|
19
|
+
["<", "<"],
|
|
20
|
+
[">", ">"],
|
|
21
|
+
]);
|
|
22
|
+
const KEYWORDS = new Map([
|
|
23
|
+
["and", "and"],
|
|
24
|
+
["or", "or"],
|
|
25
|
+
["if", "if"],
|
|
26
|
+
["else", "else"],
|
|
27
|
+
["in", "in"],
|
|
28
|
+
["not", "not"],
|
|
29
|
+
]);
|
|
5
30
|
function readNumber(source, start) {
|
|
6
31
|
let index = start;
|
|
7
32
|
let value = "";
|
|
@@ -51,13 +76,14 @@ export function tokenize(source) {
|
|
|
51
76
|
continue;
|
|
52
77
|
}
|
|
53
78
|
const pair = source.slice(index, index + 2);
|
|
54
|
-
|
|
55
|
-
|
|
79
|
+
const pairType = TWO_CHARACTER_OPERATORS.get(pair);
|
|
80
|
+
if (pairType) {
|
|
81
|
+
tokens.push({ type: pairType, value: pair });
|
|
56
82
|
index += 2;
|
|
57
83
|
continue;
|
|
58
84
|
}
|
|
59
|
-
const tokenType = character;
|
|
60
|
-
if (
|
|
85
|
+
const tokenType = ONE_CHARACTER_TOKENS.get(character);
|
|
86
|
+
if (tokenType) {
|
|
61
87
|
tokens.push({ type: tokenType, value: character });
|
|
62
88
|
index++;
|
|
63
89
|
continue;
|
|
@@ -72,11 +98,7 @@ export function tokenize(source) {
|
|
|
72
98
|
const word = readWord(source, index);
|
|
73
99
|
const isBoolean = word.value === "true" || word.value === "false";
|
|
74
100
|
tokens.push({
|
|
75
|
-
type: isBoolean
|
|
76
|
-
? "number"
|
|
77
|
-
: KEYWORDS.has(word.value)
|
|
78
|
-
? word.value
|
|
79
|
-
: "identifier",
|
|
101
|
+
type: isBoolean ? "number" : (KEYWORDS.get(word.value) ?? "identifier"),
|
|
80
102
|
value: word.value === "true" ? "1" : word.value === "false" ? "0" : word.value,
|
|
81
103
|
});
|
|
82
104
|
index = word.next;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenizer.js","sourceRoot":"","sources":["../../src/expr/tokenizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"tokenizer.js","sourceRoot":"","sources":["../../src/expr/tokenizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAsC/C,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAoB;IACzD,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,IAAI,EAAE,IAAI,CAAC;IACZ,CAAC,IAAI,EAAE,IAAI,CAAC;CACb,CAAC,CAAC;AACH,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAoB;IACtD,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG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ChC,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YACrC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,KAAK,MAAM,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC;YAClE,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC;gBACvE,KAAK,EAAE,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK;aAC/E,CAAC,CAAC;YACH,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC;YAClB,SAAS;QACX,CAAC;QAED,MAAM,IAAI,eAAe,CAAC,0BAA0B,SAAS,GAAG,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { ExpressionError } from \"../errors.js\";\n\nexport type TokenType =\n | \"number\"\n | \"identifier\"\n | \"+\"\n | \"-\"\n | \"*\"\n | \"/\"\n | \"//\"\n | \"%\"\n | \"**\"\n | \"(\"\n | \")\"\n | \",\"\n | \"==\"\n | \"!=\"\n | \"<\"\n | \"<=\"\n | \">\"\n | \">=\"\n | \"in\"\n | \"not\"\n | \"and\"\n | \"or\"\n | \"if\"\n | \"else\";\n\nexport interface Token {\n type: TokenType;\n value: string;\n}\n\ninterface ScanResult {\n value: string;\n next: number;\n}\n\nconst TWO_CHARACTER_OPERATORS = new Map<string, TokenType>([\n [\"**\", \"**\"],\n [\"//\", \"//\"],\n [\"==\", \"==\"],\n [\"!=\", \"!=\"],\n [\"<=\", \"<=\"],\n [\">=\", \">=\"],\n]);\nconst ONE_CHARACTER_TOKENS = new Map<string, TokenType>([\n [\"(\", \"(\"],\n [\")\", \")\"],\n [\",\", \",\"],\n [\"+\", \"+\"],\n [\"-\", \"-\"],\n [\"*\", \"*\"],\n [\"/\", \"/\"],\n [\"%\", \"%\"],\n [\"<\", \"<\"],\n [\">\", \">\"],\n]);\nconst KEYWORDS = new Map<string, TokenType>([\n [\"and\", \"and\"],\n [\"or\", \"or\"],\n [\"if\", \"if\"],\n [\"else\", \"else\"],\n [\"in\", \"in\"],\n [\"not\", \"not\"],\n]);\n\nfunction readNumber(source: string, start: number): ScanResult {\n let index = start;\n let value = \"\";\n let dotSeen = false;\n while (index < source.length && /[0-9.]/.test(source.charAt(index))) {\n const character = source.charAt(index);\n if (character === \".\") {\n if (dotSeen) throw new ExpressionError(`invalid number literal: '${value}.'`);\n dotSeen = true;\n }\n value += character;\n index++;\n }\n if (value === \".\" || !/^[0-9]*\\.?[0-9]*$/.test(value) || !/[0-9]/.test(value)) {\n throw new ExpressionError(`invalid number literal: '${value}'`);\n }\n\n if (index < source.length && /[eE]/.test(source.charAt(index))) {\n value += source.charAt(index++);\n if (index < source.length && /[+-]/.test(source.charAt(index))) {\n value += source.charAt(index++);\n }\n if (index >= source.length || !/[0-9]/.test(source.charAt(index))) {\n throw new ExpressionError(`invalid number literal: '${value}'`);\n }\n while (index < source.length && /[0-9]/.test(source.charAt(index))) {\n value += source.charAt(index++);\n }\n }\n return { value, next: index };\n}\n\nfunction readWord(source: string, start: number): ScanResult {\n let index = start;\n let value = \"\";\n while (index < source.length && /[a-zA-Z0-9_]/.test(source.charAt(index))) {\n value += source.charAt(index++);\n }\n return { value, next: index };\n}\n\nexport function tokenize(source: string): Token[] {\n const tokens: Token[] = [];\n let index = 0;\n while (index < source.length) {\n const character = source.charAt(index);\n if (/\\s/.test(character)) {\n index++;\n continue;\n }\n\n const pair = source.slice(index, index + 2);\n const pairType = TWO_CHARACTER_OPERATORS.get(pair);\n if (pairType) {\n tokens.push({ type: pairType, value: pair });\n index += 2;\n continue;\n }\n\n const tokenType = ONE_CHARACTER_TOKENS.get(character);\n if (tokenType) {\n tokens.push({ type: tokenType, value: character });\n index++;\n continue;\n }\n\n if (/[0-9.]/.test(character)) {\n const number = readNumber(source, index);\n tokens.push({ type: \"number\", value: number.value });\n index = number.next;\n continue;\n }\n\n if (/[a-zA-Z_]/.test(character)) {\n const word = readWord(source, index);\n const isBoolean = word.value === \"true\" || word.value === \"false\";\n tokens.push({\n type: isBoolean ? \"number\" : (KEYWORDS.get(word.value) ?? \"identifier\"),\n value: word.value === \"true\" ? \"1\" : word.value === \"false\" ? \"0\" : word.value,\n });\n index = word.next;\n continue;\n }\n\n throw new ExpressionError(`unexpected character: '${character}'`);\n }\n return tokens;\n}\n"]}
|
package/dist/expr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expr.d.ts","sourceRoot":"","sources":["../src/expr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"expr.d.ts","sourceRoot":"","sources":["../src/expr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AASrC,mBAAmB,eAAe,CAAC;AAInC,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAErD;AAaD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAmB7F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAC1C,OAAO,CA2BT"}
|
package/dist/expr.js
CHANGED
|
@@ -4,6 +4,7 @@ import { children } from "./expr/ast.js";
|
|
|
4
4
|
import { evaluateNode } from "./expr/evaluator.js";
|
|
5
5
|
import { ALLOWED_FUNCTIONS, collectVariables, validateCalls } from "./expr/language.js";
|
|
6
6
|
import { ExpressionParser } from "./expr/parser.js";
|
|
7
|
+
import { z } from "zod";
|
|
7
8
|
const MONEY_DECIMAL_PLACES = 6;
|
|
8
9
|
/** Quantize a Decimal credit amount to 6dp using ROUND_HALF_UP. */
|
|
9
10
|
export function quantizeMoney(value) {
|
|
@@ -38,17 +39,21 @@ export function validateExpression(expression, knownVariables) {
|
|
|
38
39
|
catch (error) {
|
|
39
40
|
if (error instanceof ExpressionError)
|
|
40
41
|
throw error;
|
|
41
|
-
|
|
42
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
43
|
+
throw new ExpressionError(`invalid expression: ${message}`, { cause: error });
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* Safely evaluate a validated expression using exact Decimal arithmetic.
|
|
46
48
|
*/
|
|
47
49
|
export function evaluateExpression(expression, variables) {
|
|
48
|
-
|
|
50
|
+
const parsedVariables = z
|
|
51
|
+
.record(z.string(), z.union([z.number().finite(), z.instanceof(Decimal)]))
|
|
52
|
+
.safeParse(variables);
|
|
53
|
+
if (!parsedVariables.success) {
|
|
49
54
|
throw new ExpressionError("variables must be a dict");
|
|
50
55
|
}
|
|
51
|
-
if (Object.keys(
|
|
56
|
+
if (Object.keys(parsedVariables.data).length === 0) {
|
|
52
57
|
throw new ExpressionError("cannot evaluate: variables dict is empty");
|
|
53
58
|
}
|
|
54
59
|
let node;
|
|
@@ -58,11 +63,12 @@ export function evaluateExpression(expression, variables) {
|
|
|
58
63
|
catch (error) {
|
|
59
64
|
if (error instanceof ExpressionError)
|
|
60
65
|
throw error;
|
|
61
|
-
|
|
66
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
67
|
+
throw new ExpressionError(`syntax error: ${message}`, { cause: error });
|
|
62
68
|
}
|
|
63
69
|
validateCalls(node);
|
|
64
|
-
validateVariables(node,
|
|
65
|
-
const result = evaluateNode(node,
|
|
70
|
+
validateVariables(node, parsedVariables.data);
|
|
71
|
+
const result = evaluateNode(node, parsedVariables.data);
|
|
66
72
|
if (!result.isFinite()) {
|
|
67
73
|
throw new ExpressionError(`expression evaluated to a non-finite value: ${result.toString()}`);
|
|
68
74
|
}
|
package/dist/expr.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expr.js","sourceRoot":"","sources":["../src/expr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAa,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"expr.js","sourceRoot":"","sources":["../src/expr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAa,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B,mEAAmE;AACnE,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,KAAK,CAAC,eAAe,CAAC,oBAAoB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;AAC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pB,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAE9C,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IACxD,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;QACvB,MAAM,IAAI,eAAe,CAAC,+CAA+C,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAU,EAAE,SAA2C;IAChF,IACE,IAAI,CAAC,IAAI,KAAK,YAAY;QAC1B,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;QACjC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,EAC3D,CAAC;QACD,MAAM,IAAI,eAAe,CAAC,wBAAwB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IAClE,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,IAAI,CAAC;QAAE,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAC1E,CAAC","sourcesContent":["import { Decimal } from \"decimal.js\";\n\nimport { ExpressionError } from \"./errors.js\";\nimport { children, type Node } from \"./expr/ast.js\";\nimport { evaluateNode } from \"./expr/evaluator.js\";\nimport { ALLOWED_FUNCTIONS, collectVariables, validateCalls } from \"./expr/language.js\";\nimport { ExpressionParser } from \"./expr/parser.js\";\nimport { z } from \"zod\";\n\nexport type * from \"./expr/ast.js\";\n\nconst MONEY_DECIMAL_PLACES = 6;\n\n/** Quantize a Decimal credit amount to 6dp using ROUND_HALF_UP. */\nexport function quantizeMoney(value: Decimal): Decimal {\n return value.toDecimalPlaces(MONEY_DECIMAL_PLACES, Decimal.ROUND_HALF_UP);\n}\n\nfunction parseExpression(source: string, trailingTokenMessage: string): Node {\n const parser = ExpressionParser.fromSource(source);\n const node = parser.parse();\n if (!parser.isAtEnd()) {\n throw new ExpressionError(\n trailingTokenMessage.replace(\"{token}\", parser.peek()?.value ?? \"EOF\"),\n );\n }\n return node;\n}\n\n/**\n * Validate that an expression is safe, syntactically valid, and refers only\n * to the supplied set of known metric variables.\n */\nexport function validateExpression(expression: string, knownVariables: Iterable<string>): void {\n try {\n const node = parseExpression(expression, \"unexpected token after expression: '{token}'\");\n validateCalls(node);\n const variables = collectVariables(node);\n if (variables.size === 0) {\n throw new ExpressionError(\n \"expression references no variables -- must use at least one metric\",\n );\n }\n const known = knownVariables instanceof Set ? knownVariables : new Set(knownVariables);\n for (const name of variables) {\n if (!known.has(name)) throw new ExpressionError(`unknown variable: '${name}'`);\n }\n } catch (error) {\n if (error instanceof ExpressionError) throw error;\n const message = error instanceof Error ? error.message : String(error);\n throw new ExpressionError(`invalid expression: ${message}`, { cause: error });\n }\n}\n\n/**\n * Safely evaluate a validated expression using exact Decimal arithmetic.\n */\nexport function evaluateExpression(\n expression: string,\n variables: Record<string, number | Decimal>,\n): Decimal {\n const parsedVariables = z\n .record(z.string(), z.union([z.number().finite(), z.instanceof(Decimal)]))\n .safeParse(variables);\n if (!parsedVariables.success) {\n throw new ExpressionError(\"variables must be a dict\");\n }\n if (Object.keys(parsedVariables.data).length === 0) {\n throw new ExpressionError(\"cannot evaluate: variables dict is empty\");\n }\n\n let node: Node;\n try {\n node = parseExpression(expression, \"unexpected token: '{token}'\");\n } catch (error) {\n if (error instanceof ExpressionError) throw error;\n const message = error instanceof Error ? error.message : String(error);\n throw new ExpressionError(`syntax error: ${message}`, { cause: error });\n }\n validateCalls(node);\n validateVariables(node, parsedVariables.data);\n\n const result = evaluateNode(node, parsedVariables.data);\n if (!result.isFinite()) {\n throw new ExpressionError(`expression evaluated to a non-finite value: ${result.toString()}`);\n }\n return result;\n}\n\nfunction validateVariables(node: Node, variables: Record<string, number | Decimal>): void {\n if (\n node.type === \"identifier\" &&\n !ALLOWED_FUNCTIONS.has(node.name) &&\n !Object.prototype.hasOwnProperty.call(variables, node.name)\n ) {\n throw new ExpressionError(`undefined variable: '${node.name}'`);\n }\n for (const child of children(node)) validateVariables(child, variables);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-config.types.d.ts","sourceRoot":"","sources":["../../src/generated/pricing-config.types.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC;AACxB,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,IAAI,CAAC;AACxC,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAC1B,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AACnD,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC;AAC/B,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;AACpC,MAAM,MAAM,EAAE,GAAG,IAAI,CAAC;AACtB,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAC9C,MAAM,MAAM,GAAG,GAAG,IAAI,CAAC;AACvB;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO;IAClC,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE;CAC1C,CAAC;AACF,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC;AAC3B;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO;IAClC,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE;CAC1C,CAAC;AACF,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM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":[],"mappings":"AAAA,oBAAoB;AACpB;;;;GAIG","sourcesContent":["/* eslint-disable */\n/**\n * This file was automatically generated by json-schema-to-typescript.\n * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,\n * and run json-schema-to-typescript to regenerate this file.\n */\n\nexport type Version = 1;\nexport type DefaultPlan = string | null;\nexport type Unit = string;\nexport type Type = \"string\" | \"number\" | \"boolean\";\nexport type Required = boolean;\nexport type Extends = string | null;\nexport type Op = \"eq\";\nexport type Value = string | number | boolean;\nexport type Op1 = \"in\";\n/**\n * @minItems 1\n */\nexport type Values = [\n string | number | string | boolean,\n ...(string | number | string | boolean)[],\n];\nexport type Op2 = \"not_in\";\n/**\n * @minItems 1\n */\nexport type Values1 = [\n string | number | string | boolean,\n ...(string | number | string | boolean)[],\n];\nexport type Op3 = \"prefix\";\nexport type Value1 = string;\nexport type Op4 = \"range\";\nexport type Gt = string | null;\nexport type Gte = string | null;\nexport type Lt = string | null;\nexport type Lte = string | null;\nexport type Charge =\n | FlatCharge\n | PerUnitCharge\n | PackageCharge\n | GraduatedCharge\n | VolumeCharge\n | ExpressionCharge\n | SumCharge;\nexport type Type1 = \"flat\";\nexport type Amount = string;\nexport type Type2 = \"per_unit\";\nexport type Measure = string;\n/**\n * Credits charged for each unit_size units of the selected measure.\n */\nexport type Rate = string;\n/**\n * Number of measure units represented by one rate unit; use 1000000 for per-million-token rates.\n */\nexport type UnitSize = string;\nexport type Type3 = \"package\";\nexport type Measure1 = string;\nexport type Units = string;\nexport type Amount1 = string;\nexport type Rounding = \"ceil\" | \"floor\" | \"nearest\";\nexport type Type4 = \"graduated\";\nexport type Measure2 = string;\n/**\n * @minItems 1\n */\nexport type Tiers = [GraduatedTier, ...GraduatedTier[]];\nexport type UpTo = string | null;\nexport type Rate1 = string;\nexport type Type5 = \"volume\";\nexport type Measure3 = string;\n/**\n * @minItems 1\n */\nexport type Tiers1 = [GraduatedTier, ...GraduatedTier[]];\nexport type Type6 = \"expression\";\nexport type Formula = string;\nexport type Type7 = \"sum\";\n/**\n * @minItems 1\n */\nexport type Components = [\n (\n | FlatCharge\n | PerUnitCharge\n | PackageCharge\n | GraduatedCharge\n | VolumeCharge\n | ExpressionCharge\n | SumCharge\n ),\n ...(\n | FlatCharge\n | PerUnitCharge\n | PackageCharge\n | GraduatedCharge\n | VolumeCharge\n | ExpressionCharge\n | SumCharge\n )[],\n];\nexport type Rules = PriceRule[];\nexport type Unmatched = RejectUnmatched | ChargeUnmatched;\nexport type Action = \"reject\";\nexport type Action1 = \"charge\";\nexport type Charge1 =\n | FlatCharge\n | PerUnitCharge\n | PackageCharge\n | GraduatedCharge\n | VolumeCharge\n | ExpressionCharge\n | SumCharge;\nexport type Priority = number;\nexport type Expiry =\n NeverExpiry | AfterGrantExpiry | EndOfWindowExpiry | FixedExpiry | SubscriptionEndExpiry;\nexport type Type8 = \"never\";\nexport type Type9 = \"after_grant\";\nexport type Unit1 = \"day\" | \"week\" | \"month\" | \"year\";\nexport type Count = number;\nexport type Timezone = string;\nexport type Type10 = \"end_of_window\";\nexport type Window = CalendarWindow | PlanAssignmentWindow;\nexport type Type11 = \"calendar\";\nexport type Unit2 = \"day\" | \"week\" | \"month\" | \"year\";\nexport type Count1 = number;\nexport type Timezone1 = string;\nexport type Type12 = \"plan_assignment\";\nexport type Timezone2 = string;\nexport type Type13 = \"fixed_at\";\nexport type At = string;\nexport type Type14 = \"subscription_end\";\nexport type DefaultBucket = string | null;\nexport type Type15 = \"prepaid\";\nexport type Type16 = \"credit_line\";\nexport type Limit = string;\nexport type Trigger = \"account_created\" | \"referral_completed\" | \"promo_code_redeemed\" | \"manual\";\n/**\n * @minItems 1\n */\nexport type Awards = [GrantAward, ...GrantAward[]];\nexport type Recipient = \"subject\" | \"referrer\";\nexport type Amount2 = string;\nexport type Bucket = string;\nexport type Expiry1 =\n (NeverExpiry | AfterGrantExpiry | EndOfWindowExpiry | FixedExpiry | SubscriptionEndExpiry) | null;\nexport type StartsAt = string | null;\nexport type EndsAt = string | null;\nexport type Regions = string[];\nexport type Plans = string[];\nexport type Regions1 = string[];\nexport type MaxAwardsPerSubject = number;\nexport type IdempotencyScope = \"subject\" | \"event\";\nexport type Currency = string;\nexport type UnitsPerMajor = string;\nexport type Type17 = \"boolean\";\nexport type Default = boolean;\nexport type Type18 = \"enum\";\n/**\n * @minItems 1\n */\nexport type Values2 = [string, ...string[]];\nexport type Default1 = string;\nexport type Type19 = \"integer\";\nexport type Default2 = number;\nexport type Minimum = number | null;\nexport type Maximum = number | null;\nexport type Type20 = \"string\";\nexport type Default3 = string;\nexport type Pattern = string | null;\nexport type MaxInFlight = number | null;\nexport type MaxInFlight1 = number;\nexport type DisplayName = string;\n/**\n * Public catalog ordering. Lower ranks appear first; ties are ordered by plan key.\n */\nexport type Rank = number;\nexport type Description = string | null;\nexport type RateCard1 = string | null;\nexport type AllowedOperations = string[];\nexport type Amount3 = string;\n/**\n * Spend priority shared with credit buckets. Lower values are used first.\n */\nexport type Priority1 = number;\nexport type Window1 = CalendarWindow | RollingWindow | PlanAssignmentWindow;\nexport type Type21 = \"rolling\";\nexport type Unit3 = \"second\" | \"minute\" | \"hour\" | \"day\" | \"week\";\nexport type Count2 = number;\nexport type Operation = string;\nexport type Measure4 = string;\nexport type Limit1 = string;\nexport type Window2 = CalendarWindow | RollingWindow | PlanAssignmentWindow;\nexport type Enforcement = \"block\" | \"allow\";\nexport type EmitAtPercent = number[];\nexport type CreditPolicy = string | null;\nexport type AdmissionPolicy1 = string | null;\n/**\n * Default adoption timing for existing assignments when a newer catalog revision changes this plan. A catalog activation may override it for one release.\n */\nexport type DefaultRollout = \"immediate\" | \"next_renewal\" | \"new_assignments_only\";\nexport type Type22 = \"stripe\";\nexport type Type23 = \"dodo\";\nexport type Type24 = \"custom\";\nexport type Adapter = string;\nexport type DisplayName1 = string;\nexport type Description1 = string | null;\nexport type SortOrder = number;\nexport type AmountMinor = number;\nexport type Currency1 = string;\nexport type TaxBehavior = \"inclusive\" | \"exclusive\" | \"unspecified\";\nexport type Type25 = \"stripe_price\";\nexport type PriceId = string;\nexport type Type26 = \"dodo_product\";\nexport type ProductId = string;\nexport type Type27 = \"custom_object\";\nexport type ObjectKind = \"subscription\" | \"one_time\";\nexport type ExternalId = string;\nexport type Type28 = \"subscription\";\nexport type Plan = string;\nexport type Amount4 = string;\nexport type Bucket1 = string;\nexport type Renewal = \"replace_previous\" | \"accumulate\";\nexport type Expiry2 =\n NeverExpiry | AfterGrantExpiry | EndOfWindowExpiry | FixedExpiry | SubscriptionEndExpiry;\nexport type DisplayName2 = string;\nexport type Description2 = string | null;\nexport type SortOrder1 = number;\nexport type Type29 = \"topup\";\nexport type CreditsPerUnit = string;\nexport type Minimum1 = number;\nexport type Maximum1 = number;\nexport type Default4 = number;\nexport type Bucket2 = string;\nexport type Expiry3 =\n (NeverExpiry | AfterGrantExpiry | EndOfWindowExpiry | FixedExpiry | SubscriptionEndExpiry) | null;\nexport type LotBehavior = \"separate_lots\" | \"merge_and_refresh\";\nexport type Effective = \"immediate\" | \"renewal\";\nexport type Proration = \"prorated\" | \"none\";\nexport type PaymentFailure = \"prevent_change\" | \"apply_change\";\n/**\n * @minItems 1\n */\nexport type EligibleTopups = [string, ...string[]];\nexport type Minimum2 = string;\nexport type Maximum2 = string;\nexport type Default5 = string;\n/**\n * Balance that rearms auto-recharge; it must exceed balance_below.maximum.\n */\nexport type RearmAbove = string;\nexport type Minimum3 = number;\nexport type Maximum3 = number;\nexport type Default6 = number;\nexport type MaxPurchases = number;\nexport type Window3 = CalendarWindow | RollingWindow;\nexport type MaxChargeMinor = number;\nexport type MaxConsecutiveFailures = number;\nexport type FailureAction = \"pause\";\n\nexport interface BursarConfig {\n version: Version;\n catalog?: CatalogConfig;\n /**\n * Usage operations, their measures and dimensions, and reusable rate cards.\n */\n pricing?: PricingConfig | null;\n credits: CreditsConfig;\n entitlements?: EntitlementsConfig;\n admission?: AdmissionConfig;\n plans?: Plans1;\n commerce?: CommerceConfig;\n}\n/**\n * Catalog-wide publication settings such as the default signup plan.\n */\nexport interface CatalogConfig {\n default_plan?: DefaultPlan;\n}\nexport interface PricingConfig {\n operations: Operations;\n rate_cards: RateCards;\n}\nexport interface Operations {\n [k: string]: OperationDefinition;\n}\nexport interface OperationDefinition {\n measures: Measures;\n dimensions?: Dimensions;\n}\nexport interface Measures {\n [k: string]: MeasureDefinition;\n}\nexport interface MeasureDefinition {\n unit: Unit;\n}\nexport interface Dimensions {\n [k: string]: DimensionDefinition;\n}\nexport interface DimensionDefinition {\n type: Type;\n required?: Required;\n}\nexport interface RateCards {\n [k: string]: RateCard;\n}\nexport interface RateCard {\n extends?: Extends;\n operations?: Operations1;\n}\nexport interface Operations1 {\n [k: string]: OperationPricing;\n}\nexport interface OperationPricing {\n rules?: Rules;\n unmatched: Unmatched;\n}\nexport interface PriceRule {\n when: When;\n charge: Charge;\n}\nexport interface When {\n [k: string]: EqualMatcher | InMatcher | NotInMatcher | PrefixMatcher | RangeMatcher;\n}\nexport interface EqualMatcher {\n op: Op;\n value: Value;\n}\nexport interface InMatcher {\n op: Op1;\n values: Values;\n}\nexport interface NotInMatcher {\n op: Op2;\n values: Values1;\n}\nexport interface PrefixMatcher {\n op: Op3;\n value: Value1;\n}\nexport interface RangeMatcher {\n op: Op4;\n gt?: Gt;\n gte?: Gte;\n lt?: Lt;\n lte?: Lte;\n}\nexport interface FlatCharge {\n type: Type1;\n amount: Amount;\n}\nexport interface PerUnitCharge {\n type: Type2;\n measure: Measure;\n rate: Rate;\n unit_size?: UnitSize;\n}\nexport interface PackageCharge {\n type: Type3;\n measure: Measure1;\n units: Units;\n amount: Amount1;\n rounding?: Rounding;\n}\nexport interface GraduatedCharge {\n type: Type4;\n measure: Measure2;\n tiers: Tiers;\n}\nexport interface GraduatedTier {\n up_to?: UpTo;\n rate: Rate1;\n}\nexport interface VolumeCharge {\n type: Type5;\n measure: Measure3;\n tiers: Tiers1;\n}\nexport interface ExpressionCharge {\n type: Type6;\n formula: Formula;\n}\nexport interface SumCharge {\n type: Type7;\n components: Components;\n}\nexport interface RejectUnmatched {\n action: Action;\n}\nexport interface ChargeUnmatched {\n action: Action1;\n charge: Charge1;\n}\n/**\n * Credit buckets, spending policies, grants, and optional display conversion.\n */\nexport interface CreditsConfig {\n buckets?: Buckets;\n default_bucket?: DefaultBucket;\n policies?: Policies;\n grant_programs?: GrantPrograms;\n display?: CreditDisplay | null;\n}\nexport interface Buckets {\n [k: string]: BucketDefinition;\n}\nexport interface BucketDefinition {\n priority: Priority;\n expiry?: Expiry;\n}\nexport interface NeverExpiry {\n type: Type8;\n}\nexport interface AfterGrantExpiry {\n type: Type9;\n interval: BillingInterval;\n timezone?: Timezone;\n}\nexport interface BillingInterval {\n unit: Unit1;\n count?: Count;\n}\nexport interface EndOfWindowExpiry {\n type: Type10;\n window: Window;\n}\nexport interface CalendarWindow {\n type: Type11;\n unit: Unit2;\n count?: Count1;\n timezone?: Timezone1;\n}\nexport interface PlanAssignmentWindow {\n type: Type12;\n interval: BillingInterval;\n timezone?: Timezone2;\n}\nexport interface FixedExpiry {\n type: Type13;\n at: At;\n}\nexport interface SubscriptionEndExpiry {\n type: Type14;\n}\nexport interface Policies {\n [k: string]: PrepaidCreditPolicy | CreditLinePolicy;\n}\nexport interface PrepaidCreditPolicy {\n type: Type15;\n}\nexport interface CreditLinePolicy {\n type: Type16;\n limit: Limit;\n}\nexport interface GrantPrograms {\n [k: string]: GrantProgram;\n}\nexport interface GrantProgram {\n trigger: Trigger;\n awards: Awards;\n availability?: Availability | null;\n eligibility?: GrantEligibility;\n max_awards_per_subject?: MaxAwardsPerSubject;\n idempotency_scope?: IdempotencyScope;\n}\nexport interface GrantAward {\n recipient?: Recipient;\n amount: Amount2;\n bucket: Bucket;\n expiry?: Expiry1;\n}\nexport interface Availability {\n starts_at?: StartsAt;\n ends_at?: EndsAt;\n regions?: Regions;\n}\nexport interface GrantEligibility {\n plans?: Plans;\n regions?: Regions1;\n}\nexport interface CreditDisplay {\n currency: Currency;\n units_per_major: UnitsPerMajor;\n}\n/**\n * Typed feature definitions referenced by plan feature values.\n */\nexport interface EntitlementsConfig {\n features?: Features;\n}\nexport interface Features {\n [k: string]: BooleanFeature | EnumFeature | IntegerFeature | StringFeature;\n}\nexport interface BooleanFeature {\n type: Type17;\n default: Default;\n}\nexport interface EnumFeature {\n type: Type18;\n values: Values2;\n default: Default1;\n}\nexport interface IntegerFeature {\n type: Type19;\n default: Default2;\n minimum?: Minimum;\n maximum?: Maximum;\n}\nexport interface StringFeature {\n type: Type20;\n default: Default3;\n pattern?: Pattern;\n}\n/**\n * Reusable global and per-operation concurrency policies.\n */\nexport interface AdmissionConfig {\n policies?: Policies1;\n}\nexport interface Policies1 {\n [k: string]: AdmissionPolicy;\n}\nexport interface AdmissionPolicy {\n max_in_flight?: MaxInFlight;\n operations?: Operations2;\n}\nexport interface Operations2 {\n [k: string]: OperationAdmission;\n}\nexport interface OperationAdmission {\n max_in_flight: MaxInFlight1;\n}\n/**\n * Product plans keyed by stable snake_case identifiers.\n */\nexport interface Plans1 {\n [k: string]: PlanDefinition;\n}\nexport interface PlanDefinition {\n display_name: DisplayName;\n rank?: Rank;\n description?: Description;\n rate_card?: RateCard1;\n allowed_operations?: AllowedOperations;\n features?: Features1;\n credit_allowance?: CreditAllowance | null;\n quotas?: Quotas;\n credit_policy?: CreditPolicy;\n admission_policy?: AdmissionPolicy1;\n /**\n * Catalog evolution defaults. When omitted, subscription-backed plans use next_renewal and other plans use immediate; canonical output materializes the default.\n */\n evolution?: PlanEvolution | null;\n}\nexport interface Features1 {\n [k: string]: boolean | number | string;\n}\nexport interface CreditAllowance {\n amount: Amount3;\n priority: Priority1;\n window: Window1;\n}\nexport interface RollingWindow {\n type: Type21;\n duration: Duration;\n}\nexport interface Duration {\n unit: Unit3;\n count: Count2;\n}\nexport interface Quotas {\n [k: string]: QuotaDefinition;\n}\nexport interface QuotaDefinition {\n operation: Operation;\n measure: Measure4;\n limit: Limit1;\n window: Window2;\n enforcement: Enforcement;\n emit_at_percent?: EmitAtPercent;\n}\nexport interface PlanEvolution {\n default_rollout: DefaultRollout;\n}\n/**\n * Payment providers, subscription and top-up offers, and purchase guardrails.\n */\nexport interface CommerceConfig {\n providers?: Providers;\n offers?: Offers;\n subscription_changes?: SubscriptionChanges | null;\n auto_recharge?: AutoRechargeGuardrails | null;\n}\nexport interface Providers {\n [k: string]: StripeProvider | DodoProvider | CustomProvider;\n}\nexport interface StripeProvider {\n type: Type22;\n}\nexport interface DodoProvider {\n type: Type23;\n}\nexport interface CustomProvider {\n type: Type24;\n adapter: Adapter;\n}\nexport interface Offers {\n [k: string]: SubscriptionOffer | TopupOffer;\n}\nexport interface SubscriptionOffer {\n display_name: DisplayName1;\n description?: Description1;\n sort_order?: SortOrder;\n availability?: Availability | null;\n price: OfferPrice;\n providers: Providers1;\n type: Type28;\n plan: Plan;\n billing_interval: BillingInterval;\n trial?: BillingInterval | null;\n cycle_grant?: CycleGrant | null;\n}\nexport interface OfferPrice {\n amount_minor: AmountMinor;\n currency: Currency1;\n tax_behavior?: TaxBehavior;\n}\nexport interface Providers1 {\n [k: string]: StripePriceReference | DodoProductReference | CustomObjectReference;\n}\nexport interface StripePriceReference {\n type: Type25;\n price_id: PriceId;\n}\nexport interface DodoProductReference {\n type: Type26;\n product_id: ProductId;\n}\nexport interface CustomObjectReference {\n type: Type27;\n object_kind: ObjectKind;\n external_id: ExternalId;\n}\nexport interface CycleGrant {\n amount: Amount4;\n bucket: Bucket1;\n renewal: Renewal;\n expiry?: Expiry2;\n}\nexport interface TopupOffer {\n display_name: DisplayName2;\n description?: Description2;\n sort_order?: SortOrder1;\n availability?: Availability | null;\n price: OfferPrice;\n providers: Providers2;\n type: Type29;\n credits_per_unit: CreditsPerUnit;\n quantity?: QuantityBounds;\n bucket: Bucket2;\n expiry?: Expiry3;\n lot_behavior?: LotBehavior;\n}\nexport interface Providers2 {\n [k: string]: StripePriceReference | DodoProductReference | CustomObjectReference;\n}\nexport interface QuantityBounds {\n minimum?: Minimum1;\n maximum?: Maximum1;\n default?: Default4;\n}\nexport interface SubscriptionChanges {\n upgrade?: SubscriptionChangePolicy | null;\n downgrade?: SubscriptionChangePolicy | null;\n lateral?: SubscriptionChangePolicy | null;\n cadence_change?: SubscriptionChangePolicy | null;\n}\nexport interface SubscriptionChangePolicy {\n effective: Effective;\n proration: Proration;\n payment_failure?: PaymentFailure;\n}\nexport interface AutoRechargeGuardrails {\n eligible_topups: EligibleTopups;\n balance_below: DecimalRange;\n rearm_above: RearmAbove;\n quantity: IntegerRange;\n limits: AutoRechargeLimits;\n}\nexport interface DecimalRange {\n minimum: Minimum2;\n maximum: Maximum2;\n default: Default5;\n}\nexport interface IntegerRange {\n minimum: Minimum3;\n maximum: Maximum3;\n default: Default6;\n}\nexport interface AutoRechargeLimits {\n max_purchases: MaxPurchases;\n window: Window3;\n max_charge_minor: MaxChargeMinor;\n cooldown: Duration;\n max_consecutive_failures?: MaxConsecutiveFailures;\n failure_action?: FailureAction;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pricing-config.types.js","sourceRoot":"","sources":["../../src/generated/pricing-config.types.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;GAIG","sourcesContent":["/* eslint-disable */\n/**\n * This file was automatically generated by json-schema-to-typescript.\n * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,\n * and run json-schema-to-typescript to regenerate this file.\n */\n\nexport type Version = 1;\nexport type DefaultPlan = string | null;\nexport type Unit = string;\nexport type Type = \"string\" | \"number\" | \"boolean\";\nexport type Required = boolean;\nexport type Extends = string | null;\nexport type Op = \"eq\";\nexport type Value = string | number | boolean;\nexport type Op1 = \"in\";\n/**\n * @minItems 1\n */\nexport type Values = [\n string | number | string | boolean,\n ...(string | number | string | boolean)[],\n];\nexport type Op2 = \"not_in\";\n/**\n * @minItems 1\n */\nexport type Values1 = [\n string | number | string | boolean,\n ...(string | number | string | boolean)[],\n];\nexport type Op3 = \"prefix\";\nexport type Value1 = string;\nexport type Op4 = \"range\";\nexport type Gt = string | null;\nexport type Gte = string | null;\nexport type Lt = string | null;\nexport type Lte = string | null;\nexport type Charge =\n | FlatCharge\n | PerUnitCharge\n | PackageCharge\n | GraduatedCharge\n | VolumeCharge\n | ExpressionCharge\n | SumCharge;\nexport type Type1 = \"flat\";\nexport type Amount = string;\nexport type Type2 = \"per_unit\";\nexport type Measure = string;\n/**\n * Credits charged for each unit_size units of the selected measure.\n */\nexport type Rate = string;\n/**\n * Number of measure units represented by one rate unit; use 1000000 for per-million-token rates.\n */\nexport type UnitSize = string;\nexport type Type3 = \"package\";\nexport type Measure1 = string;\nexport type Units = string;\nexport type Amount1 = string;\nexport type Rounding = \"ceil\" | \"floor\" | \"nearest\";\nexport type Type4 = \"graduated\";\nexport type Measure2 = string;\n/**\n * @minItems 1\n */\nexport type Tiers = [GraduatedTier, ...GraduatedTier[]];\nexport type UpTo = string | null;\nexport type Rate1 = string;\nexport type Type5 = \"volume\";\nexport type Measure3 = string;\n/**\n * @minItems 1\n */\nexport type Tiers1 = [GraduatedTier, ...GraduatedTier[]];\nexport type Type6 = \"expression\";\nexport type Formula = string;\nexport type Type7 = \"sum\";\n/**\n * @minItems 1\n */\nexport type Components = [\n (\n | FlatCharge\n | PerUnitCharge\n | PackageCharge\n | GraduatedCharge\n | VolumeCharge\n | ExpressionCharge\n | SumCharge\n ),\n ...(\n | FlatCharge\n | PerUnitCharge\n | PackageCharge\n | GraduatedCharge\n | VolumeCharge\n | ExpressionCharge\n | SumCharge\n )[],\n];\nexport type Rules = PriceRule[];\nexport type Unmatched = RejectUnmatched | ChargeUnmatched;\nexport type Action = \"reject\";\nexport type Action1 = \"charge\";\nexport type Charge1 =\n | FlatCharge\n | PerUnitCharge\n | PackageCharge\n | GraduatedCharge\n | VolumeCharge\n | ExpressionCharge\n | SumCharge;\nexport type Priority = number;\nexport type Expiry =\n | NeverExpiry\n | AfterGrantExpiry\n | EndOfWindowExpiry\n | FixedExpiry\n | SubscriptionEndExpiry;\nexport type Type8 = \"never\";\nexport type Type9 = \"after_grant\";\nexport type Unit1 = \"day\" | \"week\" | \"month\" | \"year\";\nexport type Count = number;\nexport type Timezone = string;\nexport type Type10 = \"end_of_window\";\nexport type Window = CalendarWindow | PlanAssignmentWindow;\nexport type Type11 = \"calendar\";\nexport type Unit2 = \"day\" | \"week\" | \"month\" | \"year\";\nexport type Count1 = number;\nexport type Timezone1 = string;\nexport type Type12 = \"plan_assignment\";\nexport type Timezone2 = string;\nexport type Type13 = \"fixed_at\";\nexport type At = string;\nexport type Type14 = \"subscription_end\";\nexport type DefaultBucket = string | null;\nexport type Type15 = \"prepaid\";\nexport type Type16 = \"credit_line\";\nexport type Limit = string;\nexport type Trigger = \"account_created\" | \"referral_completed\" | \"promo_code_redeemed\" | \"manual\";\n/**\n * @minItems 1\n */\nexport type Awards = [GrantAward, ...GrantAward[]];\nexport type Recipient = \"subject\" | \"referrer\";\nexport type Amount2 = string;\nexport type Bucket = string;\nexport type Expiry1 =\n | (NeverExpiry | AfterGrantExpiry | EndOfWindowExpiry | FixedExpiry | SubscriptionEndExpiry)\n | null;\nexport type StartsAt = string | null;\nexport type EndsAt = string | null;\nexport type Regions = string[];\nexport type Plans = string[];\nexport type Regions1 = string[];\nexport type MaxAwardsPerSubject = number;\nexport type IdempotencyScope = \"subject\" | \"event\";\nexport type Currency = string;\nexport type UnitsPerMajor = string;\nexport type Type17 = \"boolean\";\nexport type Default = boolean;\nexport type Type18 = \"enum\";\n/**\n * @minItems 1\n */\nexport type Values2 = [string, ...string[]];\nexport type Default1 = string;\nexport type Type19 = \"integer\";\nexport type Default2 = number;\nexport type Minimum = number | null;\nexport type Maximum = number | null;\nexport type Type20 = \"string\";\nexport type Default3 = string;\nexport type Pattern = string | null;\nexport type MaxInFlight = number | null;\nexport type MaxInFlight1 = number;\nexport type DisplayName = string;\n/**\n * Public catalog ordering. Lower ranks appear first; ties are ordered by plan key.\n */\nexport type Rank = number;\nexport type Description = string | null;\nexport type RateCard1 = string | null;\nexport type AllowedOperations = string[];\nexport type Amount3 = string;\n/**\n * Spend priority shared with credit buckets. Lower values are used first.\n */\nexport type Priority1 = number;\nexport type Window1 = CalendarWindow | RollingWindow | PlanAssignmentWindow;\nexport type Type21 = \"rolling\";\nexport type Unit3 = \"second\" | \"minute\" | \"hour\" | \"day\" | \"week\";\nexport type Count2 = number;\nexport type Operation = string;\nexport type Measure4 = string;\nexport type Limit1 = string;\nexport type Window2 = CalendarWindow | RollingWindow | PlanAssignmentWindow;\nexport type Enforcement = \"block\" | \"allow\";\nexport type EmitAtPercent = number[];\nexport type CreditPolicy = string | null;\nexport type AdmissionPolicy1 = string | null;\n/**\n * Default adoption timing for existing assignments when a newer catalog revision changes this plan. A catalog activation may override it for one release.\n */\nexport type DefaultRollout = \"immediate\" | \"next_renewal\" | \"new_assignments_only\";\nexport type Type22 = \"stripe\";\nexport type Type23 = \"dodo\";\nexport type Type24 = \"custom\";\nexport type Adapter = string;\nexport type DisplayName1 = string;\nexport type Description1 = string | null;\nexport type SortOrder = number;\nexport type AmountMinor = number;\nexport type Currency1 = string;\nexport type TaxBehavior = \"inclusive\" | \"exclusive\" | \"unspecified\";\nexport type Type25 = \"stripe_price\";\nexport type PriceId = string;\nexport type Type26 = \"dodo_product\";\nexport type ProductId = string;\nexport type Type27 = \"custom_object\";\nexport type ObjectKind = \"subscription\" | \"one_time\";\nexport type ExternalId = string;\nexport type Type28 = \"subscription\";\nexport type Plan = string;\nexport type Amount4 = string;\nexport type Bucket1 = string;\nexport type Renewal = \"replace_previous\" | \"accumulate\";\nexport type Expiry2 =\n | NeverExpiry\n | AfterGrantExpiry\n | EndOfWindowExpiry\n | FixedExpiry\n | SubscriptionEndExpiry;\nexport type DisplayName2 = string;\nexport type Description2 = string | null;\nexport type SortOrder1 = number;\nexport type Type29 = \"topup\";\nexport type CreditsPerUnit = string;\nexport type Minimum1 = number;\nexport type Maximum1 = number;\nexport type Default4 = number;\nexport type Bucket2 = string;\nexport type Expiry3 =\n | (NeverExpiry | AfterGrantExpiry | EndOfWindowExpiry | FixedExpiry | SubscriptionEndExpiry)\n | null;\nexport type LotBehavior = \"separate_lots\" | \"merge_and_refresh\";\nexport type Effective = \"immediate\" | \"renewal\";\nexport type Proration = \"prorated\" | \"none\";\nexport type PaymentFailure = \"prevent_change\" | \"apply_change\";\n/**\n * @minItems 1\n */\nexport type EligibleTopups = [string, ...string[]];\nexport type Minimum2 = string;\nexport type Maximum2 = string;\nexport type Default5 = string;\n/**\n * Balance that rearms auto-recharge; it must exceed balance_below.maximum.\n */\nexport type RearmAbove = string;\nexport type Minimum3 = number;\nexport type Maximum3 = number;\nexport type Default6 = number;\nexport type MaxPurchases = number;\nexport type Window3 = CalendarWindow | RollingWindow;\nexport type MaxChargeMinor = number;\nexport type MaxConsecutiveFailures = number;\nexport type FailureAction = \"pause\";\n\nexport interface BursarConfig {\n version: Version;\n catalog?: CatalogConfig;\n /**\n * Usage operations, their measures and dimensions, and reusable rate cards.\n */\n pricing?: PricingConfig | null;\n credits: CreditsConfig;\n entitlements?: EntitlementsConfig;\n admission?: AdmissionConfig;\n plans?: Plans1;\n commerce?: CommerceConfig;\n}\n/**\n * Catalog-wide publication settings such as the default signup plan.\n */\nexport interface CatalogConfig {\n default_plan?: DefaultPlan;\n}\nexport interface PricingConfig {\n operations: Operations;\n rate_cards: RateCards;\n}\nexport interface Operations {\n [k: string]: OperationDefinition;\n}\nexport interface OperationDefinition {\n measures: Measures;\n dimensions?: Dimensions;\n}\nexport interface Measures {\n [k: string]: MeasureDefinition;\n}\nexport interface MeasureDefinition {\n unit: Unit;\n}\nexport interface Dimensions {\n [k: string]: DimensionDefinition;\n}\nexport interface DimensionDefinition {\n type: Type;\n required?: Required;\n}\nexport interface RateCards {\n [k: string]: RateCard;\n}\nexport interface RateCard {\n extends?: Extends;\n operations?: Operations1;\n}\nexport interface Operations1 {\n [k: string]: OperationPricing;\n}\nexport interface OperationPricing {\n rules?: Rules;\n unmatched: Unmatched;\n}\nexport interface PriceRule {\n when: When;\n charge: Charge;\n}\nexport interface When {\n [k: string]: EqualMatcher | InMatcher | NotInMatcher | PrefixMatcher | RangeMatcher;\n}\nexport interface EqualMatcher {\n op: Op;\n value: Value;\n}\nexport interface InMatcher {\n op: Op1;\n values: Values;\n}\nexport interface NotInMatcher {\n op: Op2;\n values: Values1;\n}\nexport interface PrefixMatcher {\n op: Op3;\n value: Value1;\n}\nexport interface RangeMatcher {\n op: Op4;\n gt?: Gt;\n gte?: Gte;\n lt?: Lt;\n lte?: Lte;\n}\nexport interface FlatCharge {\n type: Type1;\n amount: Amount;\n}\nexport interface PerUnitCharge {\n type: Type2;\n measure: Measure;\n rate: Rate;\n unit_size?: UnitSize;\n}\nexport interface PackageCharge {\n type: Type3;\n measure: Measure1;\n units: Units;\n amount: Amount1;\n rounding?: Rounding;\n}\nexport interface GraduatedCharge {\n type: Type4;\n measure: Measure2;\n tiers: Tiers;\n}\nexport interface GraduatedTier {\n up_to?: UpTo;\n rate: Rate1;\n}\nexport interface VolumeCharge {\n type: Type5;\n measure: Measure3;\n tiers: Tiers1;\n}\nexport interface ExpressionCharge {\n type: Type6;\n formula: Formula;\n}\nexport interface SumCharge {\n type: Type7;\n components: Components;\n}\nexport interface RejectUnmatched {\n action: Action;\n}\nexport interface ChargeUnmatched {\n action: Action1;\n charge: Charge1;\n}\n/**\n * Credit buckets, spending policies, grants, and optional display conversion.\n */\nexport interface CreditsConfig {\n buckets?: Buckets;\n default_bucket?: DefaultBucket;\n policies?: Policies;\n grant_programs?: GrantPrograms;\n display?: CreditDisplay | null;\n}\nexport interface Buckets {\n [k: string]: BucketDefinition;\n}\nexport interface BucketDefinition {\n priority: Priority;\n expiry?: Expiry;\n}\nexport interface NeverExpiry {\n type: Type8;\n}\nexport interface AfterGrantExpiry {\n type: Type9;\n interval: BillingInterval;\n timezone?: Timezone;\n}\nexport interface BillingInterval {\n unit: Unit1;\n count?: Count;\n}\nexport interface EndOfWindowExpiry {\n type: Type10;\n window: Window;\n}\nexport interface CalendarWindow {\n type: Type11;\n unit: Unit2;\n count?: Count1;\n timezone?: Timezone1;\n}\nexport interface PlanAssignmentWindow {\n type: Type12;\n interval: BillingInterval;\n timezone?: Timezone2;\n}\nexport interface FixedExpiry {\n type: Type13;\n at: At;\n}\nexport interface SubscriptionEndExpiry {\n type: Type14;\n}\nexport interface Policies {\n [k: string]: PrepaidCreditPolicy | CreditLinePolicy;\n}\nexport interface PrepaidCreditPolicy {\n type: Type15;\n}\nexport interface CreditLinePolicy {\n type: Type16;\n limit: Limit;\n}\nexport interface GrantPrograms {\n [k: string]: GrantProgram;\n}\nexport interface GrantProgram {\n trigger: Trigger;\n awards: Awards;\n availability?: Availability | null;\n eligibility?: GrantEligibility;\n max_awards_per_subject?: MaxAwardsPerSubject;\n idempotency_scope?: IdempotencyScope;\n}\nexport interface GrantAward {\n recipient?: Recipient;\n amount: Amount2;\n bucket: Bucket;\n expiry?: Expiry1;\n}\nexport interface Availability {\n starts_at?: StartsAt;\n ends_at?: EndsAt;\n regions?: Regions;\n}\nexport interface GrantEligibility {\n plans?: Plans;\n regions?: Regions1;\n}\nexport interface CreditDisplay {\n currency: Currency;\n units_per_major: UnitsPerMajor;\n}\n/**\n * Typed feature definitions referenced by plan feature values.\n */\nexport interface EntitlementsConfig {\n features?: Features;\n}\nexport interface Features {\n [k: string]: BooleanFeature | EnumFeature | IntegerFeature | StringFeature;\n}\nexport interface BooleanFeature {\n type: Type17;\n default: Default;\n}\nexport interface EnumFeature {\n type: Type18;\n values: Values2;\n default: Default1;\n}\nexport interface IntegerFeature {\n type: Type19;\n default: Default2;\n minimum?: Minimum;\n maximum?: Maximum;\n}\nexport interface StringFeature {\n type: Type20;\n default: Default3;\n pattern?: Pattern;\n}\n/**\n * Reusable global and per-operation concurrency policies.\n */\nexport interface AdmissionConfig {\n policies?: Policies1;\n}\nexport interface Policies1 {\n [k: string]: AdmissionPolicy;\n}\nexport interface AdmissionPolicy {\n max_in_flight?: MaxInFlight;\n operations?: Operations2;\n}\nexport interface Operations2 {\n [k: string]: OperationAdmission;\n}\nexport interface OperationAdmission {\n max_in_flight: MaxInFlight1;\n}\n/**\n * Product plans keyed by stable snake_case identifiers.\n */\nexport interface Plans1 {\n [k: string]: PlanDefinition;\n}\nexport interface PlanDefinition {\n display_name: DisplayName;\n rank?: Rank;\n description?: Description;\n rate_card?: RateCard1;\n allowed_operations?: AllowedOperations;\n features?: Features1;\n credit_allowance?: CreditAllowance | null;\n quotas?: Quotas;\n credit_policy?: CreditPolicy;\n admission_policy?: AdmissionPolicy1;\n /**\n * Catalog evolution defaults. When omitted, subscription-backed plans use next_renewal and other plans use immediate; canonical output materializes the default.\n */\n evolution?: PlanEvolution | null;\n}\nexport interface Features1 {\n [k: string]: boolean | number | string;\n}\nexport interface CreditAllowance {\n amount: Amount3;\n priority: Priority1;\n window: Window1;\n}\nexport interface RollingWindow {\n type: Type21;\n duration: Duration;\n}\nexport interface Duration {\n unit: Unit3;\n count: Count2;\n}\nexport interface Quotas {\n [k: string]: QuotaDefinition;\n}\nexport interface QuotaDefinition {\n operation: Operation;\n measure: Measure4;\n limit: Limit1;\n window: Window2;\n enforcement: Enforcement;\n emit_at_percent?: EmitAtPercent;\n}\nexport interface PlanEvolution {\n default_rollout: DefaultRollout;\n}\n/**\n * Payment providers, subscription and top-up offers, and purchase guardrails.\n */\nexport interface CommerceConfig {\n providers?: Providers;\n offers?: Offers;\n subscription_changes?: SubscriptionChanges | null;\n auto_recharge?: AutoRechargeGuardrails | null;\n}\nexport interface Providers {\n [k: string]: StripeProvider | DodoProvider | CustomProvider;\n}\nexport interface StripeProvider {\n type: Type22;\n}\nexport interface DodoProvider {\n type: Type23;\n}\nexport interface CustomProvider {\n type: Type24;\n adapter: Adapter;\n}\nexport interface Offers {\n [k: string]: SubscriptionOffer | TopupOffer;\n}\nexport interface SubscriptionOffer {\n display_name: DisplayName1;\n description?: Description1;\n sort_order?: SortOrder;\n availability?: Availability | null;\n price: OfferPrice;\n providers: Providers1;\n type: Type28;\n plan: Plan;\n billing_interval: BillingInterval;\n trial?: BillingInterval | null;\n cycle_grant?: CycleGrant | null;\n}\nexport interface OfferPrice {\n amount_minor: AmountMinor;\n currency: Currency1;\n tax_behavior?: TaxBehavior;\n}\nexport interface Providers1 {\n [k: string]: StripePriceReference | DodoProductReference | CustomObjectReference;\n}\nexport interface StripePriceReference {\n type: Type25;\n price_id: PriceId;\n}\nexport interface DodoProductReference {\n type: Type26;\n product_id: ProductId;\n}\nexport interface CustomObjectReference {\n type: Type27;\n object_kind: ObjectKind;\n external_id: ExternalId;\n}\nexport interface CycleGrant {\n amount: Amount4;\n bucket: Bucket1;\n renewal: Renewal;\n expiry?: Expiry2;\n}\nexport interface TopupOffer {\n display_name: DisplayName2;\n description?: Description2;\n sort_order?: SortOrder1;\n availability?: Availability | null;\n price: OfferPrice;\n providers: Providers2;\n type: Type29;\n credits_per_unit: CreditsPerUnit;\n quantity?: QuantityBounds;\n bucket: Bucket2;\n expiry?: Expiry3;\n lot_behavior?: LotBehavior;\n}\nexport interface Providers2 {\n [k: string]: StripePriceReference | DodoProductReference | CustomObjectReference;\n}\nexport interface QuantityBounds {\n minimum?: Minimum1;\n maximum?: Maximum1;\n default?: Default4;\n}\nexport interface SubscriptionChanges {\n upgrade?: SubscriptionChangePolicy | null;\n downgrade?: SubscriptionChangePolicy | null;\n lateral?: SubscriptionChangePolicy | null;\n cadence_change?: SubscriptionChangePolicy | null;\n}\nexport interface SubscriptionChangePolicy {\n effective: Effective;\n proration: Proration;\n payment_failure?: PaymentFailure;\n}\nexport interface AutoRechargeGuardrails {\n eligible_topups: EligibleTopups;\n balance_below: DecimalRange;\n rearm_above: RearmAbove;\n quantity: IntegerRange;\n limits: AutoRechargeLimits;\n}\nexport interface DecimalRange {\n minimum: Minimum2;\n maximum: Maximum2;\n default: Default5;\n}\nexport interface IntegerRange {\n minimum: Minimum3;\n maximum: Maximum3;\n default: Default6;\n}\nexport interface AutoRechargeLimits {\n max_purchases: MaxPurchases;\n window: Window3;\n max_charge_minor: MaxChargeMinor;\n cooldown: Duration;\n max_consecutive_failures?: MaxConsecutiveFailures;\n failure_action?: FailureAction;\n}\n"]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { BetterAuthPlugin, User } from "better-auth";
|
|
2
2
|
import type { AccountCreatedInput, Bursar } from "../bursar.js";
|
|
3
|
-
export
|
|
3
|
+
export interface BetterAuthBursarUser extends User {
|
|
4
|
+
/** Optional customer identifier added by a provider Better Auth plugin. */
|
|
5
|
+
dodoCustomerId?: string | null;
|
|
6
|
+
}
|
|
4
7
|
export interface BetterAuthProviderCustomer {
|
|
5
8
|
provider: string;
|
|
6
9
|
customerId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"better-auth.d.ts","sourceRoot":"","sources":["../../src/integrations/better-auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,
|
|
1
|
+
{"version":3,"file":"better-auth.d.ts","sourceRoot":"","sources":["../../src/integrations/better-auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,WAAW,oBAAqB,SAAQ,IAAI;IAChD,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,KAAK,sBAAsB,GAAG,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,gBAAgB,CAAC,CAAC;AAE1E,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC1E,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,MAAM,CAAC;IACzD,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACtE,kBAAkB,CAAC,EAAE,CACnB,IAAI,EAAE,oBAAoB,KACvB,mBAAmB,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC;IAChF,uBAAuB,CAAC,EAAE,CACxB,IAAI,EAAE,oBAAoB,KAExB,0BAA0B,GAC1B,IAAI,GACJ,SAAS,GACT,OAAO,CAAC,0BAA0B,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,CAiDnF"}
|
|
@@ -29,13 +29,16 @@ export function bursarBetterAuth(options) {
|
|
|
29
29
|
const bursar = await options.getBursar();
|
|
30
30
|
const region = options.getRegion?.(bursarUser);
|
|
31
31
|
const metadata = await options.getAccountMetadata?.(bursarUser);
|
|
32
|
-
|
|
32
|
+
const accountInput = {
|
|
33
33
|
accountId: bursarUser.id,
|
|
34
34
|
eventKey: options.accountEventKey?.(bursarUser) ??
|
|
35
35
|
`better-auth:user.created:${bursarUser.id}`,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
};
|
|
37
|
+
if (region != null)
|
|
38
|
+
accountInput.region = region;
|
|
39
|
+
if (metadata != null)
|
|
40
|
+
accountInput.metadata = metadata;
|
|
41
|
+
await bursar.accounts.onAccountCreated(accountInput);
|
|
39
42
|
await syncProviderCustomer(bursarUser);
|
|
40
43
|
},
|
|
41
44
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"better-auth.js","sourceRoot":"","sources":["../../src/integrations/better-auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"better-auth.js","sourceRoot":"","sources":["../../src/integrations/better-auth.ts"],"names":[],"mappings":"AAgCA;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgC;IAC/D,MAAM,oBAAoB,GAAG,KAAK,EAAE,IAA0B,EAAiB,EAAE;QAC/E,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,uBAAuB,EAAE,CAAC,IAAI,CAAC,CAAC;QAC9D,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACzC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QAC7C,IAAI,CAAC,QAAQ,IAAI,CAAC,UAAU,EAAE,CAAC;YAC7B,MAAM,IAAI,SAAS,CAAC,yDAAyD,CAAC,CAAC;QACjF,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;QACzC,MAAM,MAAM,CAAC,cAAc,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1F,CAAC,CAAC;IAEF,OAAO;QACL,EAAE,EAAE,QAAQ;QACZ,IAAI;YACF,OAAO;gBACL,OAAO,EAAE;oBACP,aAAa,EAAE;wBACb,IAAI,EAAE;4BACJ,MAAM,EAAE;gCACN,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;oCACpB,MAAM,UAAU,GAAyB,IAAI,CAAC;oCAC9C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;oCACzC,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,UAAU,CAAC,CAAC;oCAC/C,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC,UAAU,CAAC,CAAC;oCAChE,MAAM,YAAY,GAAwB;wCACxC,SAAS,EAAE,UAAU,CAAC,EAAE;wCACxB,QAAQ,EACN,OAAO,CAAC,eAAe,EAAE,CAAC,UAAU,CAAC;4CACrC,4BAA4B,UAAU,CAAC,EAAE,EAAE;qCAC9C,CAAC;oCACF,IAAI,MAAM,IAAI,IAAI;wCAAE,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC;oCACjD,IAAI,QAAQ,IAAI,IAAI;wCAAE,YAAY,CAAC,QAAQ,GAAG,QAAQ,CAAC;oCACvD,MAAM,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;oCACrD,MAAM,oBAAoB,CAAC,UAAU,CAAC,CAAC;gCACzC,CAAC;6BACF;4BACD,MAAM,EAAE;gCACN,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;oCACpB,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;gCACnC,CAAC;6BACF;yBACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { BetterAuthPlugin, User } from \"better-auth\";\n\nimport type { AccountCreatedInput, Bursar } from \"../bursar.js\";\n\nexport interface BetterAuthBursarUser extends User {\n /** Optional customer identifier added by a provider Better Auth plugin. */\n dodoCustomerId?: string | null;\n}\n\nexport interface BetterAuthProviderCustomer {\n provider: string;\n customerId: string;\n}\n\ntype BetterAuthBursarFacade = Pick<Bursar, \"accounts\" | \"requireBilling\">;\n\nexport interface BursarBetterAuthOptions {\n getBursar: () => BetterAuthBursarFacade | Promise<BetterAuthBursarFacade>;\n accountEventKey?: (user: BetterAuthBursarUser) => string;\n getRegion?: (user: BetterAuthBursarUser) => string | null | undefined;\n getAccountMetadata?: (\n user: BetterAuthBursarUser,\n ) => AccountCreatedInput[\"metadata\"] | Promise<AccountCreatedInput[\"metadata\"]>;\n resolveProviderCustomer?: (\n user: BetterAuthBursarUser,\n ) =>\n | BetterAuthProviderCustomer\n | null\n | undefined\n | Promise<BetterAuthProviderCustomer | null | undefined>;\n}\n\n/**\n * Better Auth lifecycle plugin for Bursar account provisioning and optional\n * provider-customer synchronization. It composes alongside provider plugins\n * such as `@dodopayments/better-auth` without owning their schema or routes.\n */\nexport function bursarBetterAuth(options: BursarBetterAuthOptions): BetterAuthPlugin {\n const syncProviderCustomer = async (user: BetterAuthBursarUser): Promise<void> => {\n const mapping = await options.resolveProviderCustomer?.(user);\n if (!mapping) return;\n const provider = mapping.provider.trim();\n const customerId = mapping.customerId.trim();\n if (!provider || !customerId) {\n throw new TypeError(\"Better Auth provider customer mapping must not be empty\");\n }\n const bursar = await options.getBursar();\n await bursar.requireBilling().upsertCustomer(provider, customerId, user.id, user.email);\n };\n\n return {\n id: \"bursar\",\n init() {\n return {\n options: {\n databaseHooks: {\n user: {\n create: {\n after: async (user) => {\n const bursarUser: BetterAuthBursarUser = user;\n const bursar = await options.getBursar();\n const region = options.getRegion?.(bursarUser);\n const metadata = await options.getAccountMetadata?.(bursarUser);\n const accountInput: AccountCreatedInput = {\n accountId: bursarUser.id,\n eventKey:\n options.accountEventKey?.(bursarUser) ??\n `better-auth:user.created:${bursarUser.id}`,\n };\n if (region != null) accountInput.region = region;\n if (metadata != null) accountInput.metadata = metadata;\n await bursar.accounts.onAccountCreated(accountInput);\n await syncProviderCustomer(bursarUser);\n },\n },\n update: {\n after: async (user) => {\n await syncProviderCustomer(user);\n },\n },\n },\n },\n },\n };\n },\n };\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type JsonObject } from "./shared/json.js";
|
|
1
2
|
/**
|
|
2
3
|
* Read a JSON or YAML Bursar config file from disk.
|
|
3
4
|
*
|
|
@@ -7,5 +8,5 @@
|
|
|
7
8
|
* JSON syntax is validated by the platform parser and mapping keys are also
|
|
8
9
|
* checked by js-yaml so duplicate config fields cannot silently overwrite.
|
|
9
10
|
*/
|
|
10
|
-
export declare function loadConfigFile(filepath: string): Promise<
|
|
11
|
+
export declare function loadConfigFile(filepath: string): Promise<JsonObject>;
|
|
11
12
|
//# sourceMappingURL=load-config-file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-config-file.d.ts","sourceRoot":"","sources":["../src/load-config-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-config-file.d.ts","sourceRoot":"","sources":["../src/load-config-file.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,KAAK,UAAU,EAAkB,MAAM,kBAAkB,CAAC;AAqDjF;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAgC1E"}
|