@arcblock/payment-service 1.29.1
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/drivers.d.ts +144 -0
- package/dist/drivers.js +850 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +76355 -0
- package/package.json +88 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @arcblock/payment-service — Phase 7 (W2-0, decision D4).
|
|
3
|
+
*
|
|
4
|
+
* This module is deliberately SIDE-EFFECT-FREE at import time: it only
|
|
5
|
+
* defines types and a factory function. The heavy core graph (express app,
|
|
6
|
+
* sequelize, queues, crons) is loaded lazily inside the factory call, so a
|
|
7
|
+
* host (arc, standalone worker) can `import '@arcblock/payment-service'` without
|
|
8
|
+
* touching the filesystem, opening sockets or starting timers.
|
|
9
|
+
*
|
|
10
|
+
* Transition note (D4): the implementation currently re-exports the core
|
|
11
|
+
* living in blocklets/core/api/src; the package boundary is the contract.
|
|
12
|
+
* Runtime-relevant code moves here physically as Phases 8-12 formalize the
|
|
13
|
+
* slots (db/locks -> P8, queue/cron -> P9, identity/tenancy -> P10,
|
|
14
|
+
* secrets -> P11, config -> P12).
|
|
15
|
+
*/
|
|
16
|
+
import type { LocksDriver, QueueHostHooks, CronDriver, IdentityDriver, SecretsDriver } from './drivers';
|
|
17
|
+
export * from './drivers';
|
|
18
|
+
export type TenancySlot = {
|
|
19
|
+
mode: 'single';
|
|
20
|
+
instanceDid: string;
|
|
21
|
+
} | {
|
|
22
|
+
mode: 'multi';
|
|
23
|
+
};
|
|
24
|
+
export interface PaymentCoreSlots {
|
|
25
|
+
config: Record<string, any>;
|
|
26
|
+
db: {
|
|
27
|
+
sequelize: any;
|
|
28
|
+
};
|
|
29
|
+
queue?: QueueHostHooks;
|
|
30
|
+
cron?: CronDriver;
|
|
31
|
+
locks?: LocksDriver;
|
|
32
|
+
identity?: IdentityDriver;
|
|
33
|
+
secrets?: SecretsDriver;
|
|
34
|
+
tenancy?: TenancySlot;
|
|
35
|
+
}
|
|
36
|
+
export interface PaymentCoreLifecycle {
|
|
37
|
+
start: () => Promise<void>;
|
|
38
|
+
stop: () => Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
export interface PaymentCoreService {
|
|
41
|
+
/** (req, res) handler — mount under the host's prefix (lazy: node app shell) */
|
|
42
|
+
handler: any;
|
|
43
|
+
/** embeddable HTTP surface — `resourceRoutes` for hosts owning their own shell */
|
|
44
|
+
http: {
|
|
45
|
+
resourceRoutes: any;
|
|
46
|
+
};
|
|
47
|
+
rpc: {
|
|
48
|
+
entitlements: {
|
|
49
|
+
check: (input: {
|
|
50
|
+
customerDid: string;
|
|
51
|
+
featureKey: string;
|
|
52
|
+
livemode?: boolean;
|
|
53
|
+
}) => Promise<any>;
|
|
54
|
+
};
|
|
55
|
+
meterEvents: {
|
|
56
|
+
report: (input: Record<string, any>) => Promise<any>;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
lifecycle: PaymentCoreLifecycle;
|
|
60
|
+
}
|
|
61
|
+
export declare function createEmbeddedPaymentService(slots: PaymentCoreSlots): PaymentCoreService;
|