@sneat/extension-splitus-contract 0.2.0 → 0.2.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 CHANGED
@@ -1,8 +1,7 @@
1
1
  # @sneat/extension-splitus-contract
2
2
 
3
- The `contract` tier of the **splitus** extension (extension library-architecture
4
- convention). See the repo root `README.md` → Frontend for the tier table.
3
+ Splitus extension contract library.
5
4
 
6
- ## Running unit tests
5
+ ## Provenance
7
6
 
8
- Run `npx nx test extension-splitus-contract` to execute the unit tests.
7
+ Migrated from sneat-co/debtus (npm continuity from @sneat/extension-splitus-contract@0.2.0).
@@ -1 +1 @@
1
- {"version":3,"file":"sneat-extension-splitus-contract.mjs","sources":["../../../../../../libs/extensions/splitus/contract/src/lib/services/splitus-service.ts","../../../../../../libs/extensions/splitus/contract/src/sneat-extension-splitus-contract.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport type {\n ICreateSplitRequest,\n ICreateSplitResponse,\n ISplit,\n ISplitListItem,\n} from '../models/splitus-models';\n\nexport type CurrencyCode = 'EUR' | 'USD';\n\n// ISplitusService is the runtime-light contract the splitus components\n// depend on. Members mirror the concrete SplitusService's public surface\n// exactly; the implementation lives in the -internal lib and is provided via\n// the SPLITUS_SERVICE token below.\n//\n// Splitus persists no balance of its own — the payer/participants/shares\n// given to createSplit are posted to the real backend (POST\n// /api4splitus/create-split), which records the expense and posts Debtus\n// transfers as the only who-owes-what records. getSplit/getSplits read the\n// settled state back verbatim from that same API — there is no client-side\n// settled cache (see ISplitParticipant.status in splitus-models.ts).\nexport interface ISplitusService {\n /** REAL: POST /api4splitus/create-split. Payer is the authenticated user. */\n createSplit(request: ICreateSplitRequest): Observable<ICreateSplitResponse>;\n\n /** REAL: GET /api4splitus/split?spaceID=&id= */\n getSplit(spaceID: string, id: string): Observable<ISplit>;\n\n /** REAL: GET /api4splitus/splits?spaceID= */\n getSplits(spaceID: string): Observable<ISplitListItem[]>;\n}\n\nexport const SPLITUS_SERVICE = new InjectionToken<ISplitusService>('SplitusService');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAiCa,eAAe,GAAG,IAAI,cAAc,CAAkB,gBAAgB;;ACjCnF;;AAEG;;;;"}
1
+ {"version":3,"file":"sneat-extension-splitus-contract.mjs","sources":["../../../../libs/splitus/src/services.ts","../../../../libs/splitus/src/sneat-extension-splitus-contract.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { ICreateSplitRequest, ICreateSplitResponse, ISplit, ISplitListItem } from './dto';\n\nexport interface ISplitusService {\n /** REAL: POST /api4splitus/create-split. Payer is the authenticated user. */\n createSplit(request: ICreateSplitRequest): Observable<ICreateSplitResponse>;\n /** REAL: GET /api4splitus/split?spaceID=&id= */\n getSplit(spaceID: string, id: string): Observable<ISplit>;\n /** REAL: GET /api4splitus/splits?spaceID= */\n getSplits(spaceID: string): Observable<ISplitListItem[]>;\n}\n\nexport const SPLITUS_SERVICE = new InjectionToken<ISplitusService>('SplitusService');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;MAaa,eAAe,GAAG,IAAI,cAAc,CAAkB,gBAAgB;;ACbnF;;AAEG;;"}
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@sneat/extension-splitus-contract",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
4
7
  "peerDependencies": {
5
8
  "@angular/core": "^21.0.0",
6
9
  "rxjs": "^7.0.0"
7
10
  },
8
11
  "sideEffects": false,
9
- "publishConfig": {
10
- "access": "public"
11
- },
12
12
  "module": "fesm2022/sneat-extension-splitus-contract.mjs",
13
13
  "typings": "types/sneat-extension-splitus-contract.d.ts",
14
14
  "exports": {
@@ -3,6 +3,7 @@ import { Observable } from 'rxjs';
3
3
 
4
4
  /** Mirrors models4splitus.SplitMode (backend/splitus/models4splitus). */
5
5
  type SplitMode = 'equally' | 'exact-amount' | 'percentage';
6
+ type CurrencyCode = 'EUR' | 'USD';
6
7
  /**
7
8
  * One participant's custom share for `exact-amount` / `percentage` split
8
9
  * modes. An omitted/empty `contactID` denotes the payer's own share. Ignored
@@ -74,7 +75,6 @@ interface ISplitListItem {
74
75
  readonly membersCount: number;
75
76
  }
76
77
 
77
- type CurrencyCode = 'EUR' | 'USD';
78
78
  interface ISplitusService {
79
79
  /** REAL: POST /api4splitus/create-split. Payer is the authenticated user. */
80
80
  createSplit(request: ICreateSplitRequest): Observable<ICreateSplitResponse>;