@tokensapi/dsh-finance 0.1.0-beta.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/README.md +53 -0
- package/cordis.patch.yml +3 -0
- package/lib/client.js +42509 -0
- package/lib/index.js +47348 -0
- package/lib/types/client/FinanceBackupSection.d.ts +8 -0
- package/lib/types/client/FinanceBatchSection.d.ts +9 -0
- package/lib/types/client/FinanceImportSection.d.ts +9 -0
- package/lib/types/client/FinanceLauncher.d.ts +4 -0
- package/lib/types/client/FinanceOverlay.d.ts +82 -0
- package/lib/types/client/FinanceReportSection.d.ts +8 -0
- package/lib/types/client/index.d.ts +9 -0
- package/lib/types/client/locales.d.ts +26 -0
- package/lib/types/client/remote.d.ts +45 -0
- package/lib/types/client/store.d.ts +18 -0
- package/lib/types/client/styles.d.ts +1 -0
- package/lib/types/contract.d.ts +784 -0
- package/lib/types/domain.d.ts +67 -0
- package/lib/types/finance/backup.d.ts +10 -0
- package/lib/types/finance/dates.d.ts +2 -0
- package/lib/types/finance/defaults.d.ts +18 -0
- package/lib/types/finance/importing.d.ts +10 -0
- package/lib/types/finance/money.d.ts +3 -0
- package/lib/types/finance/opening.d.ts +12 -0
- package/lib/types/finance/reports.d.ts +11 -0
- package/lib/types/finance/state.d.ts +999 -0
- package/lib/types/finance/types.d.ts +1 -0
- package/lib/types/index.d.ts +7 -0
- package/lib/types/runtime.d.ts +45 -0
- package/lib/types/typert.d.ts +2 -0
- package/package.json +95 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AccountCategory = 'asset' | 'liability' | 'equity' | 'income' | 'expense';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
export declare const name = "@tokensapi/dsh-finance";
|
|
3
|
+
export declare const inject: string[];
|
|
4
|
+
export declare function apply(ctx: Context): Promise<void>;
|
|
5
|
+
export * from './contract.ts';
|
|
6
|
+
export { createEmptyFinanceState, financeDomainSpec } from './domain.ts';
|
|
7
|
+
export { FinanceRuntime } from './runtime.ts';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Service, type Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
3
|
+
import type { CompanyMutationInput, CompanyWorkspace, CreateAccountInput, CreateCompanyInput, DeleteCompanyInput, FinanceBootstrap, RenameCompanyInput, RevisionedIdInput, SetRetainedEarningsInput, UpdateAccountInput, UpdateOpeningBalanceInput, UpdateOpeningSettingsInput, PreviewImportInput, ImportPreview, CommitImportInput, ImportCommitResult, CompanyBatchList, BatchDetail, UpdateTransactionInput, TransactionMutationInput, UpdateBatchFundingInput, BatchMutationInput, GenerateReportsInput, FinanceReports, BackupEnvelope, BackupPreview, PreviewBackupInput, RestoreBackupInput } from './contract.ts';
|
|
4
|
+
export declare class FinanceRuntime extends TypertRemoteService {
|
|
5
|
+
private state;
|
|
6
|
+
private table;
|
|
7
|
+
private writeTail;
|
|
8
|
+
static inject: string[];
|
|
9
|
+
constructor(ctx: Context);
|
|
10
|
+
[Service.init](): Promise<void>;
|
|
11
|
+
private mutate;
|
|
12
|
+
getBootstrap(): FinanceBootstrap;
|
|
13
|
+
getCompanyWorkspace(input: {
|
|
14
|
+
companyId: string;
|
|
15
|
+
}): CompanyWorkspace;
|
|
16
|
+
createCompany(input: CreateCompanyInput): Promise<CompanyWorkspace>;
|
|
17
|
+
renameCompany(input: RenameCompanyInput): Promise<CompanyWorkspace>;
|
|
18
|
+
deleteCompany(input: DeleteCompanyInput): Promise<FinanceBootstrap>;
|
|
19
|
+
createAccount(input: CreateAccountInput): Promise<CompanyWorkspace>;
|
|
20
|
+
updateAccount(input: UpdateAccountInput): Promise<CompanyWorkspace>;
|
|
21
|
+
deleteAccount(input: RevisionedIdInput): Promise<CompanyWorkspace>;
|
|
22
|
+
updateOpeningBalance(input: UpdateOpeningBalanceInput): Promise<CompanyWorkspace>;
|
|
23
|
+
updateOpeningSettings(input: UpdateOpeningSettingsInput): Promise<CompanyWorkspace>;
|
|
24
|
+
setRetainedEarningsAccount(input: SetRetainedEarningsInput): Promise<CompanyWorkspace>;
|
|
25
|
+
lockOpening(input: CompanyMutationInput): Promise<CompanyWorkspace>;
|
|
26
|
+
unlockOpening(input: CompanyMutationInput): Promise<CompanyWorkspace>;
|
|
27
|
+
previewImport(input: PreviewImportInput): ImportPreview;
|
|
28
|
+
commitImport(input: CommitImportInput): Promise<ImportCommitResult>;
|
|
29
|
+
getCompanyBatches(input: {
|
|
30
|
+
companyId: string;
|
|
31
|
+
}): CompanyBatchList;
|
|
32
|
+
getBatchDetail(input: {
|
|
33
|
+
batchId: string;
|
|
34
|
+
}): BatchDetail;
|
|
35
|
+
updateTransaction(input: UpdateTransactionInput): Promise<BatchDetail>;
|
|
36
|
+
deleteTransaction(input: TransactionMutationInput): Promise<BatchDetail>;
|
|
37
|
+
updateBatchFundingAccount(input: UpdateBatchFundingInput): Promise<BatchDetail>;
|
|
38
|
+
deleteBatch(input: BatchMutationInput): Promise<CompanyBatchList>;
|
|
39
|
+
approveBatch(input: BatchMutationInput): Promise<BatchDetail>;
|
|
40
|
+
unapproveBatch(input: BatchMutationInput): Promise<BatchDetail>;
|
|
41
|
+
generateReports(input: GenerateReportsInput): FinanceReports;
|
|
42
|
+
exportBackup(): BackupEnvelope;
|
|
43
|
+
previewBackup(input: PreviewBackupInput): BackupPreview;
|
|
44
|
+
restoreBackup(input: RestoreBackupInput): Promise<FinanceBootstrap>;
|
|
45
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tokensapi/dsh-finance",
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
|
+
"description": "TokensCowork 本地财务报表插件",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"types": "lib/types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./lib/types/index.d.ts",
|
|
12
|
+
"default": "./lib/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./client": {
|
|
15
|
+
"types": "./lib/types/client/index.d.ts",
|
|
16
|
+
"default": "./lib/client.js"
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"lib/**/*.js",
|
|
22
|
+
"lib/**/*.d.ts",
|
|
23
|
+
"cordis.patch.yml",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"tag": "beta"
|
|
32
|
+
},
|
|
33
|
+
"dsh": {
|
|
34
|
+
"bundle": {
|
|
35
|
+
"patch": "./cordis.patch.yml"
|
|
36
|
+
},
|
|
37
|
+
"client": {
|
|
38
|
+
"platform": "web",
|
|
39
|
+
"inject": [
|
|
40
|
+
"@deepseek-ai/dsh-client-locale",
|
|
41
|
+
"@deepseek-ai/dsh-client-ui-layout",
|
|
42
|
+
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
43
|
+
"@deepseek-ai/dsh-client-ui-primitives",
|
|
44
|
+
"@deepseek-ai/dsh-api-remotes"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "node build.mjs",
|
|
50
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
51
|
+
"test": "vitest run tests",
|
|
52
|
+
"verify:bundle": "node scripts/verify-client-loader.mjs",
|
|
53
|
+
"check": "pnpm run typecheck && pnpm run test && pnpm run build && pnpm run verify:bundle"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@deepseek-ai/cordis": "4.0.1",
|
|
57
|
+
"@deepseek-ai/dsh-api-remotes": "0.1.0-rc.8",
|
|
58
|
+
"@deepseek-ai/dsh-client-locale": "0.1.0-rc.8",
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-layout": "0.1.0-rc.8",
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.8",
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "0.1.0-rc.8",
|
|
62
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.8",
|
|
63
|
+
"@deepseek-ai/dsh-storage-domain": "0.1.0-rc.8",
|
|
64
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.0-rc.8",
|
|
65
|
+
"@deepseek-ai/dsh-typert-registry": "0.1.0-rc.8",
|
|
66
|
+
"react": "18.3.1",
|
|
67
|
+
"react-dom": "18.3.1"
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"zod": "^4.4.3"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@deepseek-ai/cordis": "4.0.1",
|
|
74
|
+
"@deepseek-ai/dsh-api-remotes": "0.1.0-rc.8",
|
|
75
|
+
"@deepseek-ai/dsh-client-locale": "0.1.0-rc.8",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-layout": "0.1.0-rc.8",
|
|
77
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.8",
|
|
78
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "0.1.0-rc.8",
|
|
79
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.8",
|
|
80
|
+
"@deepseek-ai/dsh-storage": "0.1.0-rc.8",
|
|
81
|
+
"@deepseek-ai/dsh-storage-domain": "0.1.0-rc.8",
|
|
82
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.0-rc.8",
|
|
83
|
+
"@deepseek-ai/dsh-typert-registry": "0.1.0-rc.8",
|
|
84
|
+
"@types/node": "^22.20.0",
|
|
85
|
+
"@types/react": "^18.3.0",
|
|
86
|
+
"@types/react-dom": "^18.3.0",
|
|
87
|
+
"esbuild": "^0.28.0",
|
|
88
|
+
"react": "18.3.1",
|
|
89
|
+
"react-dom": "18.3.1",
|
|
90
|
+
"typescript": "^6.0.3",
|
|
91
|
+
"vitest": "^4.1.8",
|
|
92
|
+
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
|
93
|
+
},
|
|
94
|
+
"packageManager": "pnpm@11.7.0"
|
|
95
|
+
}
|