@uniforge/platform-core 0.1.0-alpha.2

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.
Files changed (71) hide show
  1. package/dist/auth/index.d.cts +184 -0
  2. package/dist/auth/index.d.ts +184 -0
  3. package/dist/auth/index.js +62 -0
  4. package/dist/auth/index.js.map +1 -0
  5. package/dist/auth/index.mjs +33 -0
  6. package/dist/auth/index.mjs.map +1 -0
  7. package/dist/billing/index.d.cts +213 -0
  8. package/dist/billing/index.d.ts +213 -0
  9. package/dist/billing/index.js +43 -0
  10. package/dist/billing/index.js.map +1 -0
  11. package/dist/billing/index.mjs +16 -0
  12. package/dist/billing/index.mjs.map +1 -0
  13. package/dist/graphql/index.d.cts +100 -0
  14. package/dist/graphql/index.d.ts +100 -0
  15. package/dist/graphql/index.js +19 -0
  16. package/dist/graphql/index.js.map +1 -0
  17. package/dist/graphql/index.mjs +1 -0
  18. package/dist/graphql/index.mjs.map +1 -0
  19. package/dist/index.d.cts +19 -0
  20. package/dist/index.d.ts +19 -0
  21. package/dist/index.js +31 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/index.mjs +6 -0
  24. package/dist/index.mjs.map +1 -0
  25. package/dist/multi-store/index.d.cts +242 -0
  26. package/dist/multi-store/index.d.ts +242 -0
  27. package/dist/multi-store/index.js +53 -0
  28. package/dist/multi-store/index.js.map +1 -0
  29. package/dist/multi-store/index.mjs +23 -0
  30. package/dist/multi-store/index.mjs.map +1 -0
  31. package/dist/multi-tenant/index.d.cts +64 -0
  32. package/dist/multi-tenant/index.d.ts +64 -0
  33. package/dist/multi-tenant/index.js +19 -0
  34. package/dist/multi-tenant/index.js.map +1 -0
  35. package/dist/multi-tenant/index.mjs +1 -0
  36. package/dist/multi-tenant/index.mjs.map +1 -0
  37. package/dist/performance/index.d.cts +118 -0
  38. package/dist/performance/index.d.ts +118 -0
  39. package/dist/performance/index.js +19 -0
  40. package/dist/performance/index.js.map +1 -0
  41. package/dist/performance/index.mjs +1 -0
  42. package/dist/performance/index.mjs.map +1 -0
  43. package/dist/platform/index.d.cts +156 -0
  44. package/dist/platform/index.d.ts +156 -0
  45. package/dist/platform/index.js +64 -0
  46. package/dist/platform/index.js.map +1 -0
  47. package/dist/platform/index.mjs +37 -0
  48. package/dist/platform/index.mjs.map +1 -0
  49. package/dist/rbac/index.d.cts +140 -0
  50. package/dist/rbac/index.d.ts +140 -0
  51. package/dist/rbac/index.js +55 -0
  52. package/dist/rbac/index.js.map +1 -0
  53. package/dist/rbac/index.mjs +27 -0
  54. package/dist/rbac/index.mjs.map +1 -0
  55. package/dist/registry-efvajmOd.d.cts +118 -0
  56. package/dist/registry-efvajmOd.d.ts +118 -0
  57. package/dist/security/index.d.cts +148 -0
  58. package/dist/security/index.d.ts +148 -0
  59. package/dist/security/index.js +40 -0
  60. package/dist/security/index.js.map +1 -0
  61. package/dist/security/index.mjs +13 -0
  62. package/dist/security/index.mjs.map +1 -0
  63. package/dist/types-CgnJiK8Z.d.cts +74 -0
  64. package/dist/types-CgnJiK8Z.d.ts +74 -0
  65. package/dist/webhooks/index.d.cts +114 -0
  66. package/dist/webhooks/index.d.ts +114 -0
  67. package/dist/webhooks/index.js +19 -0
  68. package/dist/webhooks/index.js.map +1 -0
  69. package/dist/webhooks/index.mjs +1 -0
  70. package/dist/webhooks/index.mjs.map +1 -0
  71. package/package.json +94 -0
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Performance types and configuration interfaces.
3
+ */
4
+ interface CacheManagerConfig {
5
+ defaultTTL: number;
6
+ maxEntries: number;
7
+ keyPrefix?: string;
8
+ strategies?: CacheTTLStrategy[];
9
+ }
10
+ interface CacheTTLStrategy {
11
+ pattern: string;
12
+ ttl: number;
13
+ }
14
+ interface CacheEntry<T = unknown> {
15
+ key: string;
16
+ value: T;
17
+ createdAt: number;
18
+ expiresAt: number;
19
+ hits: number;
20
+ }
21
+ interface CacheMetrics {
22
+ hits: number;
23
+ misses: number;
24
+ hitRate: number;
25
+ totalEntries: number;
26
+ evictions: number;
27
+ }
28
+ interface QueryCostConfig {
29
+ maxCostPerSecond: number;
30
+ trackingWindowMs: number;
31
+ alertThreshold?: number;
32
+ }
33
+ interface QueryCostEntry {
34
+ query: string;
35
+ actualCost: number;
36
+ requestedCost: number;
37
+ timestamp: number;
38
+ }
39
+ interface QueryCostReport {
40
+ totalCost: number;
41
+ averageCost: number;
42
+ maxCost: number;
43
+ queryCount: number;
44
+ costPerSecond: number;
45
+ topQueries: QueryCostEntry[];
46
+ isOverBudget: boolean;
47
+ }
48
+ interface BatchConfig {
49
+ maxBatchSize: number;
50
+ delayMs: number;
51
+ maxDelayMs?: number;
52
+ }
53
+ interface BatchResult<T = unknown> {
54
+ results: T[];
55
+ batchSize: number;
56
+ executionTimeMs: number;
57
+ }
58
+
59
+ /**
60
+ * Cache manager interface.
61
+ */
62
+
63
+ interface CacheManager {
64
+ readonly config: CacheManagerConfig;
65
+ /** Get a cached value by key */
66
+ get<T = unknown>(key: string): Promise<CacheEntry<T> | undefined>;
67
+ /** Set a cached value with optional TTL override */
68
+ set<T = unknown>(key: string, value: T, ttl?: number): Promise<void>;
69
+ /** Delete a cached entry */
70
+ delete(key: string): Promise<boolean>;
71
+ /** Invalidate entries matching a pattern */
72
+ invalidate(pattern: string): Promise<number>;
73
+ /** Check if a key exists in cache */
74
+ has(key: string): Promise<boolean>;
75
+ /** Warm cache with pre-computed entries */
76
+ warm(entries: Array<{
77
+ key: string;
78
+ value: unknown;
79
+ ttl?: number;
80
+ }>): Promise<void>;
81
+ /** Get cache performance metrics */
82
+ getMetrics(): CacheMetrics;
83
+ /** Reset all metrics counters */
84
+ resetMetrics(): void;
85
+ /** Clear all cached entries */
86
+ clear(): Promise<void>;
87
+ }
88
+
89
+ /**
90
+ * Query cost tracking and batching interfaces.
91
+ */
92
+
93
+ /** Tracks GraphQL query costs to prevent throttling */
94
+ interface QueryCostTracker {
95
+ readonly config: QueryCostConfig;
96
+ /** Record a query's cost */
97
+ track(query: string, actualCost: number, requestedCost: number): void;
98
+ /** Get a report of recent query costs */
99
+ getReport(): QueryCostReport;
100
+ /** Check if current usage is within budget */
101
+ isWithinBudget(): boolean;
102
+ /** Get current cost per second */
103
+ getCostPerSecond(): number;
104
+ /** Reset tracking data */
105
+ reset(): void;
106
+ }
107
+ /** Batches multiple queries into single requests */
108
+ interface QueryBatcher<TQuery = string, TResult = unknown> {
109
+ readonly config: BatchConfig;
110
+ /** Add a query to the current batch */
111
+ add(query: TQuery): Promise<TResult>;
112
+ /** Flush the current batch immediately */
113
+ flush(): Promise<BatchResult<TResult>>;
114
+ /** Get the number of pending queries */
115
+ pending(): number;
116
+ }
117
+
118
+ export type { BatchConfig, BatchResult, CacheEntry, CacheManager, CacheManagerConfig, CacheMetrics, CacheTTLStrategy, QueryBatcher, QueryCostConfig, QueryCostEntry, QueryCostReport, QueryCostTracker };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/performance/index.ts
17
+ var performance_exports = {};
18
+ module.exports = __toCommonJS(performance_exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/performance/index.ts"],"sourcesContent":["/**\n * @uniforge/platform-core/performance\n *\n * Performance interfaces for cache management, query cost tracking,\n * and query batching.\n */\n\nexport type {\n CacheManagerConfig,\n CacheTTLStrategy,\n CacheEntry,\n CacheMetrics,\n QueryCostConfig,\n QueryCostEntry,\n QueryCostReport,\n BatchConfig,\n BatchResult,\n} from './types';\n\nexport type { CacheManager } from './cache-manager';\n\nexport type { QueryCostTracker, QueryBatcher } from './query-cost';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,156 @@
1
+ export { A as AuthCapabilities, B as BillingCapabilities, C as CommerceCapabilities, D as DEFAULT_CAPABILITIES, G as GraphQLCapabilities, b as PlatformCapabilities, e as PlatformConfig, c as PlatformId, d as PlatformInfo, P as PlatformProvider, a as PlatformRegistry, g as PlatformValidationError, f as PlatformValidationResult, W as WebhookCapabilities } from '../registry-efvajmOd.cjs';
2
+
3
+ /**
4
+ * Unified commerce types and service interfaces.
5
+ *
6
+ * Platform-agnostic data models for products, orders, and customers.
7
+ * Each platform adapter maps its native API responses to these types.
8
+ */
9
+ interface PaginatedResult<T> {
10
+ items: T[];
11
+ hasNextPage: boolean;
12
+ hasPreviousPage: boolean;
13
+ cursor?: string;
14
+ totalCount?: number;
15
+ }
16
+ interface ListOptions {
17
+ limit?: number;
18
+ cursor?: string;
19
+ sortKey?: string;
20
+ sortDirection?: 'asc' | 'desc';
21
+ }
22
+ interface Money {
23
+ amount: string;
24
+ currencyCode: string;
25
+ }
26
+ type ProductStatus = 'active' | 'draft' | 'archived';
27
+ interface Product {
28
+ id: string;
29
+ platformId: string;
30
+ title: string;
31
+ description: string;
32
+ handle: string;
33
+ vendor: string;
34
+ productType: string;
35
+ status: ProductStatus;
36
+ tags: string[];
37
+ variants: ProductVariant[];
38
+ images: ProductImage[];
39
+ metadata: Record<string, unknown>;
40
+ createdAt: string;
41
+ updatedAt: string;
42
+ }
43
+ interface ProductVariant {
44
+ id: string;
45
+ platformId: string;
46
+ title: string;
47
+ sku: string;
48
+ price: Money;
49
+ compareAtPrice?: Money;
50
+ inventoryQuantity: number;
51
+ weight?: number;
52
+ weightUnit?: string;
53
+ metadata: Record<string, unknown>;
54
+ }
55
+ interface ProductImage {
56
+ id: string;
57
+ src: string;
58
+ altText: string;
59
+ position: number;
60
+ }
61
+ interface CreateProductInput {
62
+ title: string;
63
+ description?: string;
64
+ vendor?: string;
65
+ productType?: string;
66
+ status?: ProductStatus;
67
+ tags?: string[];
68
+ metadata?: Record<string, unknown>;
69
+ }
70
+ interface UpdateProductInput {
71
+ title?: string;
72
+ description?: string;
73
+ vendor?: string;
74
+ productType?: string;
75
+ status?: ProductStatus;
76
+ tags?: string[];
77
+ metadata?: Record<string, unknown>;
78
+ }
79
+ type OrderStatus = 'open' | 'closed' | 'cancelled';
80
+ type FulfillmentStatus = 'unfulfilled' | 'partial' | 'fulfilled';
81
+ type FinancialStatus = 'pending' | 'paid' | 'partially_paid' | 'refunded' | 'voided';
82
+ interface Order {
83
+ id: string;
84
+ platformId: string;
85
+ orderNumber: string;
86
+ status: OrderStatus;
87
+ fulfillmentStatus: FulfillmentStatus;
88
+ financialStatus: FinancialStatus;
89
+ lineItems: OrderLineItem[];
90
+ totalPrice: Money;
91
+ subtotalPrice: Money;
92
+ totalTax: Money;
93
+ customerEmail: string;
94
+ metadata: Record<string, unknown>;
95
+ createdAt: string;
96
+ updatedAt: string;
97
+ }
98
+ interface OrderLineItem {
99
+ id: string;
100
+ title: string;
101
+ quantity: number;
102
+ price: Money;
103
+ sku: string;
104
+ variantId?: string;
105
+ productId?: string;
106
+ }
107
+ interface Customer {
108
+ id: string;
109
+ platformId: string;
110
+ email: string;
111
+ firstName: string;
112
+ lastName: string;
113
+ phone: string;
114
+ ordersCount: number;
115
+ totalSpent: Money;
116
+ tags: string[];
117
+ metadata: Record<string, unknown>;
118
+ createdAt: string;
119
+ updatedAt: string;
120
+ }
121
+ interface CreateCustomerInput {
122
+ email: string;
123
+ firstName?: string;
124
+ lastName?: string;
125
+ phone?: string;
126
+ tags?: string[];
127
+ metadata?: Record<string, unknown>;
128
+ }
129
+ interface UpdateCustomerInput {
130
+ email?: string;
131
+ firstName?: string;
132
+ lastName?: string;
133
+ phone?: string;
134
+ tags?: string[];
135
+ metadata?: Record<string, unknown>;
136
+ }
137
+ interface ProductService {
138
+ getProduct(id: string): Promise<Product | null>;
139
+ listProducts(options?: ListOptions): Promise<PaginatedResult<Product>>;
140
+ createProduct(input: CreateProductInput): Promise<Product>;
141
+ updateProduct(id: string, input: UpdateProductInput): Promise<Product>;
142
+ deleteProduct(id: string): Promise<void>;
143
+ }
144
+ interface OrderService {
145
+ getOrder(id: string): Promise<Order | null>;
146
+ listOrders(options?: ListOptions): Promise<PaginatedResult<Order>>;
147
+ }
148
+ interface CustomerService {
149
+ getCustomer(id: string): Promise<Customer | null>;
150
+ listCustomers(options?: ListOptions): Promise<PaginatedResult<Customer>>;
151
+ createCustomer(input: CreateCustomerInput): Promise<Customer>;
152
+ updateCustomer(id: string, input: UpdateCustomerInput): Promise<Customer>;
153
+ deleteCustomer(id: string): Promise<void>;
154
+ }
155
+
156
+ export type { CreateCustomerInput, CreateProductInput, Customer, CustomerService, FinancialStatus, FulfillmentStatus, ListOptions, Money, Order, OrderLineItem, OrderService, OrderStatus, PaginatedResult, Product, ProductImage, ProductService, ProductStatus, ProductVariant, UpdateCustomerInput, UpdateProductInput };
@@ -0,0 +1,156 @@
1
+ export { A as AuthCapabilities, B as BillingCapabilities, C as CommerceCapabilities, D as DEFAULT_CAPABILITIES, G as GraphQLCapabilities, b as PlatformCapabilities, e as PlatformConfig, c as PlatformId, d as PlatformInfo, P as PlatformProvider, a as PlatformRegistry, g as PlatformValidationError, f as PlatformValidationResult, W as WebhookCapabilities } from '../registry-efvajmOd.js';
2
+
3
+ /**
4
+ * Unified commerce types and service interfaces.
5
+ *
6
+ * Platform-agnostic data models for products, orders, and customers.
7
+ * Each platform adapter maps its native API responses to these types.
8
+ */
9
+ interface PaginatedResult<T> {
10
+ items: T[];
11
+ hasNextPage: boolean;
12
+ hasPreviousPage: boolean;
13
+ cursor?: string;
14
+ totalCount?: number;
15
+ }
16
+ interface ListOptions {
17
+ limit?: number;
18
+ cursor?: string;
19
+ sortKey?: string;
20
+ sortDirection?: 'asc' | 'desc';
21
+ }
22
+ interface Money {
23
+ amount: string;
24
+ currencyCode: string;
25
+ }
26
+ type ProductStatus = 'active' | 'draft' | 'archived';
27
+ interface Product {
28
+ id: string;
29
+ platformId: string;
30
+ title: string;
31
+ description: string;
32
+ handle: string;
33
+ vendor: string;
34
+ productType: string;
35
+ status: ProductStatus;
36
+ tags: string[];
37
+ variants: ProductVariant[];
38
+ images: ProductImage[];
39
+ metadata: Record<string, unknown>;
40
+ createdAt: string;
41
+ updatedAt: string;
42
+ }
43
+ interface ProductVariant {
44
+ id: string;
45
+ platformId: string;
46
+ title: string;
47
+ sku: string;
48
+ price: Money;
49
+ compareAtPrice?: Money;
50
+ inventoryQuantity: number;
51
+ weight?: number;
52
+ weightUnit?: string;
53
+ metadata: Record<string, unknown>;
54
+ }
55
+ interface ProductImage {
56
+ id: string;
57
+ src: string;
58
+ altText: string;
59
+ position: number;
60
+ }
61
+ interface CreateProductInput {
62
+ title: string;
63
+ description?: string;
64
+ vendor?: string;
65
+ productType?: string;
66
+ status?: ProductStatus;
67
+ tags?: string[];
68
+ metadata?: Record<string, unknown>;
69
+ }
70
+ interface UpdateProductInput {
71
+ title?: string;
72
+ description?: string;
73
+ vendor?: string;
74
+ productType?: string;
75
+ status?: ProductStatus;
76
+ tags?: string[];
77
+ metadata?: Record<string, unknown>;
78
+ }
79
+ type OrderStatus = 'open' | 'closed' | 'cancelled';
80
+ type FulfillmentStatus = 'unfulfilled' | 'partial' | 'fulfilled';
81
+ type FinancialStatus = 'pending' | 'paid' | 'partially_paid' | 'refunded' | 'voided';
82
+ interface Order {
83
+ id: string;
84
+ platformId: string;
85
+ orderNumber: string;
86
+ status: OrderStatus;
87
+ fulfillmentStatus: FulfillmentStatus;
88
+ financialStatus: FinancialStatus;
89
+ lineItems: OrderLineItem[];
90
+ totalPrice: Money;
91
+ subtotalPrice: Money;
92
+ totalTax: Money;
93
+ customerEmail: string;
94
+ metadata: Record<string, unknown>;
95
+ createdAt: string;
96
+ updatedAt: string;
97
+ }
98
+ interface OrderLineItem {
99
+ id: string;
100
+ title: string;
101
+ quantity: number;
102
+ price: Money;
103
+ sku: string;
104
+ variantId?: string;
105
+ productId?: string;
106
+ }
107
+ interface Customer {
108
+ id: string;
109
+ platformId: string;
110
+ email: string;
111
+ firstName: string;
112
+ lastName: string;
113
+ phone: string;
114
+ ordersCount: number;
115
+ totalSpent: Money;
116
+ tags: string[];
117
+ metadata: Record<string, unknown>;
118
+ createdAt: string;
119
+ updatedAt: string;
120
+ }
121
+ interface CreateCustomerInput {
122
+ email: string;
123
+ firstName?: string;
124
+ lastName?: string;
125
+ phone?: string;
126
+ tags?: string[];
127
+ metadata?: Record<string, unknown>;
128
+ }
129
+ interface UpdateCustomerInput {
130
+ email?: string;
131
+ firstName?: string;
132
+ lastName?: string;
133
+ phone?: string;
134
+ tags?: string[];
135
+ metadata?: Record<string, unknown>;
136
+ }
137
+ interface ProductService {
138
+ getProduct(id: string): Promise<Product | null>;
139
+ listProducts(options?: ListOptions): Promise<PaginatedResult<Product>>;
140
+ createProduct(input: CreateProductInput): Promise<Product>;
141
+ updateProduct(id: string, input: UpdateProductInput): Promise<Product>;
142
+ deleteProduct(id: string): Promise<void>;
143
+ }
144
+ interface OrderService {
145
+ getOrder(id: string): Promise<Order | null>;
146
+ listOrders(options?: ListOptions): Promise<PaginatedResult<Order>>;
147
+ }
148
+ interface CustomerService {
149
+ getCustomer(id: string): Promise<Customer | null>;
150
+ listCustomers(options?: ListOptions): Promise<PaginatedResult<Customer>>;
151
+ createCustomer(input: CreateCustomerInput): Promise<Customer>;
152
+ updateCustomer(id: string, input: UpdateCustomerInput): Promise<Customer>;
153
+ deleteCustomer(id: string): Promise<void>;
154
+ }
155
+
156
+ export type { CreateCustomerInput, CreateProductInput, Customer, CustomerService, FinancialStatus, FulfillmentStatus, ListOptions, Money, Order, OrderLineItem, OrderService, OrderStatus, PaginatedResult, Product, ProductImage, ProductService, ProductStatus, ProductVariant, UpdateCustomerInput, UpdateProductInput };
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/platform/index.ts
21
+ var platform_exports = {};
22
+ __export(platform_exports, {
23
+ DEFAULT_CAPABILITIES: () => DEFAULT_CAPABILITIES
24
+ });
25
+ module.exports = __toCommonJS(platform_exports);
26
+
27
+ // src/platform/capabilities.ts
28
+ var DEFAULT_CAPABILITIES = {
29
+ auth: {
30
+ tokenExchange: false,
31
+ oauth: false,
32
+ apiKeys: false,
33
+ sessionManagement: false
34
+ },
35
+ billing: {
36
+ subscriptions: false,
37
+ oneTimeCharges: false,
38
+ usageBased: false,
39
+ trialSupport: false
40
+ },
41
+ webhooks: {
42
+ supported: false,
43
+ verificationMethod: "none",
44
+ supportsRegistration: false
45
+ },
46
+ graphql: {
47
+ supported: false,
48
+ rateLimiting: false,
49
+ caching: false
50
+ },
51
+ rbac: false,
52
+ multiStore: false,
53
+ commerce: {
54
+ products: false,
55
+ orders: false,
56
+ customers: false,
57
+ inventory: false
58
+ }
59
+ };
60
+ // Annotate the CommonJS export names for ESM import in node:
61
+ 0 && (module.exports = {
62
+ DEFAULT_CAPABILITIES
63
+ });
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/platform/index.ts","../../src/platform/capabilities.ts"],"sourcesContent":["/**\n * @uniforge/platform-core/platform\n *\n * Platform abstraction layer — provider interfaces, capability detection,\n * registry, and unified commerce types.\n */\n\n// Core types\nexport type {\n PlatformId,\n PlatformInfo,\n PlatformConfig,\n PlatformValidationResult,\n PlatformValidationError,\n} from './types';\n\n// Capabilities\nexport type {\n AuthCapabilities,\n BillingCapabilities,\n WebhookCapabilities,\n GraphQLCapabilities,\n CommerceCapabilities,\n PlatformCapabilities,\n} from './capabilities';\nexport { DEFAULT_CAPABILITIES } from './capabilities';\n\n// Provider\nexport type { PlatformProvider } from './provider';\n\n// Registry\nexport type { PlatformRegistry } from './registry';\n\n// Commerce types\nexport type {\n PaginatedResult,\n ListOptions,\n ProductStatus,\n Product,\n ProductVariant,\n ProductImage,\n CreateProductInput,\n UpdateProductInput,\n OrderStatus,\n FulfillmentStatus,\n FinancialStatus,\n Order,\n OrderLineItem,\n Customer,\n CreateCustomerInput,\n UpdateCustomerInput,\n ProductService,\n OrderService,\n CustomerService,\n} from './commerce';\nexport { type Money } from './commerce';\n","/**\n * Platform capability detection types.\n *\n * Declares what features each platform adapter supports,\n * enabling graceful feature degradation.\n */\n\nexport interface AuthCapabilities {\n tokenExchange: boolean;\n oauth: boolean;\n apiKeys: boolean;\n sessionManagement: boolean;\n}\n\nexport interface BillingCapabilities {\n subscriptions: boolean;\n oneTimeCharges: boolean;\n usageBased: boolean;\n trialSupport: boolean;\n}\n\nexport interface WebhookCapabilities {\n supported: boolean;\n verificationMethod: 'hmac' | 'signature' | 'none';\n supportsRegistration: boolean;\n}\n\nexport interface GraphQLCapabilities {\n supported: boolean;\n rateLimiting: boolean;\n caching: boolean;\n}\n\nexport interface CommerceCapabilities {\n products: boolean;\n orders: boolean;\n customers: boolean;\n inventory: boolean;\n}\n\n/** Full capability declaration for a platform adapter */\nexport interface PlatformCapabilities {\n auth: AuthCapabilities;\n billing: BillingCapabilities;\n webhooks: WebhookCapabilities;\n graphql: GraphQLCapabilities;\n rbac: boolean;\n multiStore: boolean;\n commerce: CommerceCapabilities;\n}\n\n/** Default capabilities for platforms that don't declare specific support */\nexport const DEFAULT_CAPABILITIES: PlatformCapabilities = {\n auth: {\n tokenExchange: false,\n oauth: false,\n apiKeys: false,\n sessionManagement: false,\n },\n billing: {\n subscriptions: false,\n oneTimeCharges: false,\n usageBased: false,\n trialSupport: false,\n },\n webhooks: {\n supported: false,\n verificationMethod: 'none',\n supportsRegistration: false,\n },\n graphql: {\n supported: false,\n rateLimiting: false,\n caching: false,\n },\n rbac: false,\n multiStore: false,\n commerce: {\n products: false,\n orders: false,\n customers: false,\n inventory: false,\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACoDO,IAAM,uBAA6C;AAAA,EACxD,MAAM;AAAA,IACJ,eAAe;AAAA,IACf,OAAO;AAAA,IACP,SAAS;AAAA,IACT,mBAAmB;AAAA,EACrB;AAAA,EACA,SAAS;AAAA,IACP,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB;AAAA,EACA,UAAU;AAAA,IACR,WAAW;AAAA,IACX,oBAAoB;AAAA,IACpB,sBAAsB;AAAA,EACxB;AAAA,EACA,SAAS;AAAA,IACP,WAAW;AAAA,IACX,cAAc;AAAA,IACd,SAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,UAAU;AAAA,IACR,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF;","names":[]}
@@ -0,0 +1,37 @@
1
+ // src/platform/capabilities.ts
2
+ var DEFAULT_CAPABILITIES = {
3
+ auth: {
4
+ tokenExchange: false,
5
+ oauth: false,
6
+ apiKeys: false,
7
+ sessionManagement: false
8
+ },
9
+ billing: {
10
+ subscriptions: false,
11
+ oneTimeCharges: false,
12
+ usageBased: false,
13
+ trialSupport: false
14
+ },
15
+ webhooks: {
16
+ supported: false,
17
+ verificationMethod: "none",
18
+ supportsRegistration: false
19
+ },
20
+ graphql: {
21
+ supported: false,
22
+ rateLimiting: false,
23
+ caching: false
24
+ },
25
+ rbac: false,
26
+ multiStore: false,
27
+ commerce: {
28
+ products: false,
29
+ orders: false,
30
+ customers: false,
31
+ inventory: false
32
+ }
33
+ };
34
+ export {
35
+ DEFAULT_CAPABILITIES
36
+ };
37
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/platform/capabilities.ts"],"sourcesContent":["/**\n * Platform capability detection types.\n *\n * Declares what features each platform adapter supports,\n * enabling graceful feature degradation.\n */\n\nexport interface AuthCapabilities {\n tokenExchange: boolean;\n oauth: boolean;\n apiKeys: boolean;\n sessionManagement: boolean;\n}\n\nexport interface BillingCapabilities {\n subscriptions: boolean;\n oneTimeCharges: boolean;\n usageBased: boolean;\n trialSupport: boolean;\n}\n\nexport interface WebhookCapabilities {\n supported: boolean;\n verificationMethod: 'hmac' | 'signature' | 'none';\n supportsRegistration: boolean;\n}\n\nexport interface GraphQLCapabilities {\n supported: boolean;\n rateLimiting: boolean;\n caching: boolean;\n}\n\nexport interface CommerceCapabilities {\n products: boolean;\n orders: boolean;\n customers: boolean;\n inventory: boolean;\n}\n\n/** Full capability declaration for a platform adapter */\nexport interface PlatformCapabilities {\n auth: AuthCapabilities;\n billing: BillingCapabilities;\n webhooks: WebhookCapabilities;\n graphql: GraphQLCapabilities;\n rbac: boolean;\n multiStore: boolean;\n commerce: CommerceCapabilities;\n}\n\n/** Default capabilities for platforms that don't declare specific support */\nexport const DEFAULT_CAPABILITIES: PlatformCapabilities = {\n auth: {\n tokenExchange: false,\n oauth: false,\n apiKeys: false,\n sessionManagement: false,\n },\n billing: {\n subscriptions: false,\n oneTimeCharges: false,\n usageBased: false,\n trialSupport: false,\n },\n webhooks: {\n supported: false,\n verificationMethod: 'none',\n supportsRegistration: false,\n },\n graphql: {\n supported: false,\n rateLimiting: false,\n caching: false,\n },\n rbac: false,\n multiStore: false,\n commerce: {\n products: false,\n orders: false,\n customers: false,\n inventory: false,\n },\n};\n"],"mappings":";AAoDO,IAAM,uBAA6C;AAAA,EACxD,MAAM;AAAA,IACJ,eAAe;AAAA,IACf,OAAO;AAAA,IACP,SAAS;AAAA,IACT,mBAAmB;AAAA,EACrB;AAAA,EACA,SAAS;AAAA,IACP,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB;AAAA,EACA,UAAU;AAAA,IACR,WAAW;AAAA,IACX,oBAAoB;AAAA,IACpB,sBAAsB;AAAA,EACxB;AAAA,EACA,SAAS;AAAA,IACP,WAAW;AAAA,IACX,cAAc;AAAA,IACd,SAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,UAAU;AAAA,IACR,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF;","names":[]}