@happyvertical/smrt-mobile-contract 0.51.31 → 0.51.33
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/build-contract.d.ts +3 -0
- package/dist/build-contract.d.ts.map +1 -0
- package/dist/contract-version.d.ts +8 -0
- package/dist/contract-version.d.ts.map +1 -0
- package/dist/emit-framework.d.ts +9 -0
- package/dist/emit-framework.d.ts.map +1 -0
- package/dist/emit-kotlin.d.ts +10 -0
- package/dist/emit-kotlin.d.ts.map +1 -0
- package/dist/emit-swift.d.ts +8 -0
- package/dist/emit-swift.d.ts.map +1 -0
- package/dist/file-set.d.ts +8 -0
- package/dist/file-set.d.ts.map +1 -0
- package/dist/framework-types.d.ts +197 -0
- package/dist/framework-types.d.ts.map +1 -0
- package/dist/identifiers.d.ts +17 -0
- package/dist/identifiers.d.ts.map +1 -0
- package/dist/index.d.ts +9 -314
- package/dist/index.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +4 -4
- package/dist/types.d.ts +72 -79
- package/dist/types.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-contract.d.ts","sourceRoot":"","sources":["../src/build-contract.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,cAAc,EAGd,qBAAqB,EAGtB,MAAM,YAAY,CAAC;AAmEpB,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,qBAAqB,GAC7B,cAAc,CA2DhB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Schema version of the mobile-contract.json envelope. */
|
|
2
|
+
export declare const SMRT_MOBILE_CONTRACT_SCHEMA_VERSION = 1;
|
|
3
|
+
/**
|
|
4
|
+
* Version stamp of the framework contract surface (auth/session/device/pack
|
|
5
|
+
* localization types). Bump when the framework contract shape changes.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SMRT_MOBILE_CONTRACT_VERSION = "2026-07-01.v1";
|
|
8
|
+
//# sourceMappingURL=contract-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-version.d.ts","sourceRoot":"","sources":["../src/contract-version.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,eAAO,MAAM,mCAAmC,IAAI,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Kotlin framework contract files, keyed by file name. */
|
|
2
|
+
export declare function frameworkKotlinFiles(): Map<string, string>;
|
|
3
|
+
/**
|
|
4
|
+
* Swift mirror of the framework contract for SwiftUI apps (reporter
|
|
5
|
+
* precedent). Not checked into smrt-mobile — iOS wiring lands with
|
|
6
|
+
* smrt-ios (Phase 6); apps can emit it via this API meanwhile.
|
|
7
|
+
*/
|
|
8
|
+
export declare function frameworkSwiftFiles(): Map<string, string>;
|
|
9
|
+
//# sourceMappingURL=emit-framework.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit-framework.d.ts","sourceRoot":"","sources":["../src/emit-framework.ts"],"names":[],"mappings":"AAqOA,2DAA2D;AAC3D,wBAAgB,oBAAoB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAQ1D;AA6GD;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAEzD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MobileContract } from './types.js';
|
|
2
|
+
export declare const GENERATED_HEADER: string;
|
|
3
|
+
/**
|
|
4
|
+
* Emits one Kotlin DTO file per allowlisted object, plus a
|
|
5
|
+
* `MobileContractManifest.kt` recording the contract identity, all in the
|
|
6
|
+
* consumer's Kotlin package. Framework support types (DecimalString, …) are
|
|
7
|
+
* imported from `com.happyvertical.smrt.mobile.contract`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateKotlinDtoFiles(contract: MobileContract): Map<string, string>;
|
|
10
|
+
//# sourceMappingURL=emit-kotlin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit-kotlin.d.ts","sourceRoot":"","sources":["../src/emit-kotlin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,gBAAgB,QAIjB,CAAC;AAIb;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,cAAc,GACvB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CASrB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MobileContract } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Emits all allowlisted domain DTOs into a single Swift file. Structs are
|
|
4
|
+
* plain (no Codable) per the reporter seed — apps decode JSON as needed.
|
|
5
|
+
* Kotlin `JsonObject` fields arrive as raw JSON strings on the Swift side.
|
|
6
|
+
*/
|
|
7
|
+
export declare function generateSwiftDtoFile(contract: MobileContract): string;
|
|
8
|
+
//# sourceMappingURL=emit-swift.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit-swift.d.ts","sourceRoot":"","sources":["../src/emit-swift.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,YAAY,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAqBrE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Writes every `relPath → content` entry under `rootDir`. */
|
|
2
|
+
export declare function writeFileSet(rootDir: string, files: Map<string, string>): void;
|
|
3
|
+
/**
|
|
4
|
+
* Compares every entry against disk. Returns the list of missing/stale
|
|
5
|
+
* relative paths (empty = fresh).
|
|
6
|
+
*/
|
|
7
|
+
export declare function verifyFileSet(rootDir: string, files: Map<string, string>): string[];
|
|
8
|
+
//# sourceMappingURL=file-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-set.d.ts","sourceRoot":"","sources":["../src/file-set.ts"],"names":[],"mappings":"AAGA,8DAA8D;AAC9D,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACzB,IAAI,CAMN;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACzB,MAAM,EAAE,CASV"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript wire types for the `/api/mobile` auth + session contract.
|
|
3
|
+
*
|
|
4
|
+
* These are the SAME shapes the framework Kotlin contract ships to mobile
|
|
5
|
+
* clients (`MOBILE_AUTH_CONTRACT_KT` in `emit-framework.ts`, checked into
|
|
6
|
+
* `@happyvertical/smrt-mobile` as `MobileAuthContract.kt`). Server-side
|
|
7
|
+
* implementations -- the reusable SvelteKit handlers in
|
|
8
|
+
* `@happyvertical/smrt-users` (issue #1748) -- import them from here so the
|
|
9
|
+
* wire contract has one owning package on both sides.
|
|
10
|
+
*
|
|
11
|
+
* Two sync guarantees keep the three representations locked together:
|
|
12
|
+
*
|
|
13
|
+
* 1. Each interface has a `MobileWireShape` descriptor below. The `satisfies`
|
|
14
|
+
* check makes the descriptor fail to COMPILE when it disagrees with the
|
|
15
|
+
* interface (missing/extra field, or wrong required/optional/nullable
|
|
16
|
+
* kind).
|
|
17
|
+
* 2. `__tests__/framework-auth-types.test.ts` parses the Kotlin literal and
|
|
18
|
+
* asserts it matches the descriptors field-for-field, so editing either
|
|
19
|
+
* side without the other fails the contract package's tests.
|
|
20
|
+
*
|
|
21
|
+
* Kotlin → TypeScript field mapping:
|
|
22
|
+
* - `val x: T` (no default) → `x: T` (required)
|
|
23
|
+
* - `val x: T = <non-null value>` → `x?: T` (kotlinx.serialization omits
|
|
24
|
+
* default-equal values by default, and decoders fill absent fields from
|
|
25
|
+
* defaults — so the wire may omit them in either direction)
|
|
26
|
+
* - `val x: T? = null` → `x?: T | null`
|
|
27
|
+
*
|
|
28
|
+
* @packageDocumentation
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Classifies one wire field. Mirrors the three Kotlin declaration forms the
|
|
32
|
+
* framework contract uses (see the mapping table in the module docs).
|
|
33
|
+
*/
|
|
34
|
+
export type MobileWireFieldKind = 'required' | 'optional' | 'nullable';
|
|
35
|
+
/**
|
|
36
|
+
* Compile-time-checked shape descriptor for a wire type: one entry per field,
|
|
37
|
+
* whose kind is DERIVED from the TypeScript declaration. Using
|
|
38
|
+
* `Extract<keyof T, string>` keeps the mapped type non-homomorphic, so every
|
|
39
|
+
* key must be listed (optionality is not copied from `T`) while `T[K]` still
|
|
40
|
+
* carries `undefined` for optional properties.
|
|
41
|
+
*/
|
|
42
|
+
export type MobileWireShape<T> = {
|
|
43
|
+
[K in Extract<keyof T, string>]: undefined extends T[K] ? null extends T[K] ? 'nullable' : 'optional' : 'required';
|
|
44
|
+
};
|
|
45
|
+
/** Signed-in user summary returned by auth/complete and the session bootstrap. */
|
|
46
|
+
export interface MobileUserSummary {
|
|
47
|
+
id: string;
|
|
48
|
+
email?: string;
|
|
49
|
+
label?: string;
|
|
50
|
+
}
|
|
51
|
+
/** Tenant summary with subscription surface (reserved for app responses). */
|
|
52
|
+
export interface MobileTenantSummary {
|
|
53
|
+
id: string;
|
|
54
|
+
name?: string;
|
|
55
|
+
slug?: string;
|
|
56
|
+
planName?: string;
|
|
57
|
+
subscriptionStatus?: string;
|
|
58
|
+
}
|
|
59
|
+
/** One selectable tenant, labeled with the role the user holds there. */
|
|
60
|
+
export interface MobileTenantOption {
|
|
61
|
+
id: string;
|
|
62
|
+
name?: string;
|
|
63
|
+
slug?: string;
|
|
64
|
+
roleSlug?: string;
|
|
65
|
+
roleLabel?: string;
|
|
66
|
+
}
|
|
67
|
+
/** One configured auth provider (reserved for app-side provider pickers). */
|
|
68
|
+
export interface MobileAuthProviderSummary {
|
|
69
|
+
id: string;
|
|
70
|
+
label?: string;
|
|
71
|
+
type?: string;
|
|
72
|
+
supportsPkce?: boolean;
|
|
73
|
+
}
|
|
74
|
+
/** Body of `POST /api/mobile/auth/start`. */
|
|
75
|
+
export interface MobileAuthStartRequest {
|
|
76
|
+
providerId?: string | null;
|
|
77
|
+
redirectUri: string;
|
|
78
|
+
scopes?: string[];
|
|
79
|
+
state?: string | null;
|
|
80
|
+
loginHint?: string | null;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Response of `POST /api/mobile/auth/start`. The client persists `state` and
|
|
84
|
+
* `codeVerifier` (as an opaque pending handshake) and echoes them back on
|
|
85
|
+
* `auth/complete`; `state` is also validated against the IdP redirect.
|
|
86
|
+
*/
|
|
87
|
+
export interface MobileAuthStartResponse {
|
|
88
|
+
providerId: string;
|
|
89
|
+
authorizationUrl: string;
|
|
90
|
+
state: string;
|
|
91
|
+
codeVerifier?: string | null;
|
|
92
|
+
nonce?: string | null;
|
|
93
|
+
redirectUri: string;
|
|
94
|
+
}
|
|
95
|
+
/** Body of `POST /api/mobile/auth/complete`. */
|
|
96
|
+
export interface MobileAuthCompleteRequest {
|
|
97
|
+
providerId?: string | null;
|
|
98
|
+
code: string;
|
|
99
|
+
state?: string | null;
|
|
100
|
+
codeVerifier?: string | null;
|
|
101
|
+
redirectUri: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Response of `POST /api/mobile/auth/complete` — the mobile bearer session.
|
|
105
|
+
* `accessToken` goes into `Authorization: Bearer <token>` on every
|
|
106
|
+
* authenticated `/api/mobile` request.
|
|
107
|
+
*/
|
|
108
|
+
export interface MobileAuthSession {
|
|
109
|
+
accessToken: string;
|
|
110
|
+
tokenType?: string;
|
|
111
|
+
expiresAt?: string;
|
|
112
|
+
user: MobileUserSummary;
|
|
113
|
+
activeTenant?: MobileTenantOption | null;
|
|
114
|
+
tenants?: MobileTenantOption[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Response of `GET /api/mobile/session` -- the app-boot payload for a stored
|
|
118
|
+
* bearer. `extras` is the only app-defined extension point and must remain a
|
|
119
|
+
* JSON object (the Kotlin side decodes it as `JsonObject`). App-domain fields
|
|
120
|
+
* placed at the top level are outside the contract and are ignored by the
|
|
121
|
+
* Kotlin decoder.
|
|
122
|
+
*/
|
|
123
|
+
export interface MobileSessionBootstrap {
|
|
124
|
+
user: MobileUserSummary;
|
|
125
|
+
activeTenant?: MobileTenantOption | null;
|
|
126
|
+
tenants?: MobileTenantOption[];
|
|
127
|
+
extras?: Record<string, unknown> | null;
|
|
128
|
+
}
|
|
129
|
+
export declare const MOBILE_USER_SUMMARY_SHAPE: {
|
|
130
|
+
readonly id: "required";
|
|
131
|
+
readonly email: "optional";
|
|
132
|
+
readonly label: "optional";
|
|
133
|
+
};
|
|
134
|
+
export declare const MOBILE_TENANT_SUMMARY_SHAPE: {
|
|
135
|
+
readonly id: "required";
|
|
136
|
+
readonly name: "optional";
|
|
137
|
+
readonly slug: "optional";
|
|
138
|
+
readonly planName: "optional";
|
|
139
|
+
readonly subscriptionStatus: "optional";
|
|
140
|
+
};
|
|
141
|
+
export declare const MOBILE_TENANT_OPTION_SHAPE: {
|
|
142
|
+
readonly id: "required";
|
|
143
|
+
readonly name: "optional";
|
|
144
|
+
readonly slug: "optional";
|
|
145
|
+
readonly roleSlug: "optional";
|
|
146
|
+
readonly roleLabel: "optional";
|
|
147
|
+
};
|
|
148
|
+
export declare const MOBILE_AUTH_PROVIDER_SUMMARY_SHAPE: {
|
|
149
|
+
readonly id: "required";
|
|
150
|
+
readonly label: "optional";
|
|
151
|
+
readonly type: "optional";
|
|
152
|
+
readonly supportsPkce: "optional";
|
|
153
|
+
};
|
|
154
|
+
export declare const MOBILE_AUTH_START_REQUEST_SHAPE: {
|
|
155
|
+
readonly providerId: "nullable";
|
|
156
|
+
readonly redirectUri: "required";
|
|
157
|
+
readonly scopes: "optional";
|
|
158
|
+
readonly state: "nullable";
|
|
159
|
+
readonly loginHint: "nullable";
|
|
160
|
+
};
|
|
161
|
+
export declare const MOBILE_AUTH_START_RESPONSE_SHAPE: {
|
|
162
|
+
readonly providerId: "required";
|
|
163
|
+
readonly authorizationUrl: "required";
|
|
164
|
+
readonly state: "required";
|
|
165
|
+
readonly codeVerifier: "nullable";
|
|
166
|
+
readonly nonce: "nullable";
|
|
167
|
+
readonly redirectUri: "required";
|
|
168
|
+
};
|
|
169
|
+
export declare const MOBILE_AUTH_COMPLETE_REQUEST_SHAPE: {
|
|
170
|
+
readonly providerId: "nullable";
|
|
171
|
+
readonly code: "required";
|
|
172
|
+
readonly state: "nullable";
|
|
173
|
+
readonly codeVerifier: "nullable";
|
|
174
|
+
readonly redirectUri: "required";
|
|
175
|
+
};
|
|
176
|
+
export declare const MOBILE_AUTH_SESSION_SHAPE: {
|
|
177
|
+
readonly accessToken: "required";
|
|
178
|
+
readonly tokenType: "optional";
|
|
179
|
+
readonly expiresAt: "optional";
|
|
180
|
+
readonly user: "required";
|
|
181
|
+
readonly activeTenant: "nullable";
|
|
182
|
+
readonly tenants: "optional";
|
|
183
|
+
};
|
|
184
|
+
export declare const MOBILE_SESSION_BOOTSTRAP_SHAPE: {
|
|
185
|
+
readonly user: "required";
|
|
186
|
+
readonly activeTenant: "nullable";
|
|
187
|
+
readonly tenants: "optional";
|
|
188
|
+
readonly extras: "nullable";
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* All auth-contract shape descriptors, keyed by the Kotlin data class name.
|
|
192
|
+
* The parity test asserts this map covers exactly the data classes declared
|
|
193
|
+
* in `MobileAuthContract.kt` — adding a class to either side without the
|
|
194
|
+
* other fails the suite.
|
|
195
|
+
*/
|
|
196
|
+
export declare const MOBILE_AUTH_WIRE_SHAPES: Record<string, Record<string, MobileWireFieldKind>>;
|
|
197
|
+
//# sourceMappingURL=framework-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework-types.d.ts","sourceRoot":"","sources":["../src/framework-types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identifier + literal escaping for generated Kotlin/Swift source. Manifest
|
|
3
|
+
* field names are valid JS identifiers, but may collide with Kotlin/Swift
|
|
4
|
+
* keywords; string defaults may contain characters that Kotlin string
|
|
5
|
+
* templates or escapes treat specially.
|
|
6
|
+
*/
|
|
7
|
+
/** Backtick-escapes Kotlin hard keywords (and non-plain identifiers). */
|
|
8
|
+
export declare function kotlinIdentifier(name: string): string;
|
|
9
|
+
/** Backtick-escapes Swift keywords (and non-plain identifiers). */
|
|
10
|
+
export declare function swiftIdentifier(name: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Emits a Kotlin double-quoted string literal. Escapes `$` (string-template
|
|
13
|
+
* interpolation), quotes, backslashes, and control characters — JSON escaping
|
|
14
|
+
* is NOT Kotlin-safe (`$` stays raw and `\f` is not a Kotlin escape).
|
|
15
|
+
*/
|
|
16
|
+
export declare function kotlinStringLiteral(value: string): string;
|
|
17
|
+
//# sourceMappingURL=identifiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifiers.d.ts","sourceRoot":"","sources":["../src/identifiers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyFH,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIrD;AAED,mEAAmE;AACnE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIpD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAmCzD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,314 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
export declare function frameworkSwiftFiles(): Map<string, string>;
|
|
12
|
-
|
|
13
|
-
export declare const GENERATED_HEADER: string;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Emits one Kotlin DTO file per allowlisted object, plus a
|
|
17
|
-
* `MobileContractManifest.kt` recording the contract identity, all in the
|
|
18
|
-
* consumer's Kotlin package. Framework support types (DecimalString, …) are
|
|
19
|
-
* imported from `com.happyvertical.smrt.mobile.contract`.
|
|
20
|
-
*/
|
|
21
|
-
export declare function generateKotlinDtoFiles(contract: MobileContract): Map<string, string>;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Emits all allowlisted domain DTOs into a single Swift file. Structs are
|
|
25
|
-
* plain (no Codable) per the reporter seed — apps decode JSON as needed.
|
|
26
|
-
* Kotlin `JsonObject` fields arrive as raw JSON strings on the Swift side.
|
|
27
|
-
*/
|
|
28
|
-
export declare function generateSwiftDtoFile(contract: MobileContract): string;
|
|
29
|
-
|
|
30
|
-
export declare const MOBILE_AUTH_COMPLETE_REQUEST_SHAPE: {
|
|
31
|
-
readonly providerId: "nullable";
|
|
32
|
-
readonly code: "required";
|
|
33
|
-
readonly state: "nullable";
|
|
34
|
-
readonly codeVerifier: "nullable";
|
|
35
|
-
readonly redirectUri: "required";
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export declare const MOBILE_AUTH_PROVIDER_SUMMARY_SHAPE: {
|
|
39
|
-
readonly id: "required";
|
|
40
|
-
readonly label: "optional";
|
|
41
|
-
readonly type: "optional";
|
|
42
|
-
readonly supportsPkce: "optional";
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export declare const MOBILE_AUTH_SESSION_SHAPE: {
|
|
46
|
-
readonly accessToken: "required";
|
|
47
|
-
readonly tokenType: "optional";
|
|
48
|
-
readonly expiresAt: "optional";
|
|
49
|
-
readonly user: "required";
|
|
50
|
-
readonly activeTenant: "nullable";
|
|
51
|
-
readonly tenants: "optional";
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export declare const MOBILE_AUTH_START_REQUEST_SHAPE: {
|
|
55
|
-
readonly providerId: "nullable";
|
|
56
|
-
readonly redirectUri: "required";
|
|
57
|
-
readonly scopes: "optional";
|
|
58
|
-
readonly state: "nullable";
|
|
59
|
-
readonly loginHint: "nullable";
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export declare const MOBILE_AUTH_START_RESPONSE_SHAPE: {
|
|
63
|
-
readonly providerId: "required";
|
|
64
|
-
readonly authorizationUrl: "required";
|
|
65
|
-
readonly state: "required";
|
|
66
|
-
readonly codeVerifier: "nullable";
|
|
67
|
-
readonly nonce: "nullable";
|
|
68
|
-
readonly redirectUri: "required";
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* All auth-contract shape descriptors, keyed by the Kotlin data class name.
|
|
73
|
-
* The parity test asserts this map covers exactly the data classes declared
|
|
74
|
-
* in `MobileAuthContract.kt` — adding a class to either side without the
|
|
75
|
-
* other fails the suite.
|
|
76
|
-
*/
|
|
77
|
-
export declare const MOBILE_AUTH_WIRE_SHAPES: Record<string, Record<string, MobileWireFieldKind>>;
|
|
78
|
-
|
|
79
|
-
export declare const MOBILE_SESSION_BOOTSTRAP_SHAPE: {
|
|
80
|
-
readonly user: "required";
|
|
81
|
-
readonly activeTenant: "nullable";
|
|
82
|
-
readonly tenants: "optional";
|
|
83
|
-
readonly extras: "nullable";
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export declare const MOBILE_TENANT_OPTION_SHAPE: {
|
|
87
|
-
readonly id: "required";
|
|
88
|
-
readonly name: "optional";
|
|
89
|
-
readonly slug: "optional";
|
|
90
|
-
readonly roleSlug: "optional";
|
|
91
|
-
readonly roleLabel: "optional";
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export declare const MOBILE_TENANT_SUMMARY_SHAPE: {
|
|
95
|
-
readonly id: "required";
|
|
96
|
-
readonly name: "optional";
|
|
97
|
-
readonly slug: "optional";
|
|
98
|
-
readonly planName: "optional";
|
|
99
|
-
readonly subscriptionStatus: "optional";
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export declare const MOBILE_USER_SUMMARY_SHAPE: {
|
|
103
|
-
readonly id: "required";
|
|
104
|
-
readonly email: "optional";
|
|
105
|
-
readonly label: "optional";
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
/** Body of `POST /api/mobile/auth/complete`. */
|
|
109
|
-
export declare interface MobileAuthCompleteRequest {
|
|
110
|
-
providerId?: string | null;
|
|
111
|
-
code: string;
|
|
112
|
-
state?: string | null;
|
|
113
|
-
codeVerifier?: string | null;
|
|
114
|
-
redirectUri: string;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/** One configured auth provider (reserved for app-side provider pickers). */
|
|
118
|
-
export declare interface MobileAuthProviderSummary {
|
|
119
|
-
id: string;
|
|
120
|
-
label?: string;
|
|
121
|
-
type?: string;
|
|
122
|
-
supportsPkce?: boolean;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Response of `POST /api/mobile/auth/complete` — the mobile bearer session.
|
|
127
|
-
* `accessToken` goes into `Authorization: Bearer <token>` on every
|
|
128
|
-
* authenticated `/api/mobile` request.
|
|
129
|
-
*/
|
|
130
|
-
export declare interface MobileAuthSession {
|
|
131
|
-
accessToken: string;
|
|
132
|
-
tokenType?: string;
|
|
133
|
-
expiresAt?: string;
|
|
134
|
-
user: MobileUserSummary;
|
|
135
|
-
activeTenant?: MobileTenantOption | null;
|
|
136
|
-
tenants?: MobileTenantOption[];
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/** Body of `POST /api/mobile/auth/start`. */
|
|
140
|
-
export declare interface MobileAuthStartRequest {
|
|
141
|
-
providerId?: string | null;
|
|
142
|
-
redirectUri: string;
|
|
143
|
-
scopes?: string[];
|
|
144
|
-
state?: string | null;
|
|
145
|
-
loginHint?: string | null;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Response of `POST /api/mobile/auth/start`. The client persists `state` and
|
|
150
|
-
* `codeVerifier` (as an opaque pending handshake) and echoes them back on
|
|
151
|
-
* `auth/complete`; `state` is also validated against the IdP redirect.
|
|
152
|
-
*/
|
|
153
|
-
export declare interface MobileAuthStartResponse {
|
|
154
|
-
providerId: string;
|
|
155
|
-
authorizationUrl: string;
|
|
156
|
-
state: string;
|
|
157
|
-
codeVerifier?: string | null;
|
|
158
|
-
nonce?: string | null;
|
|
159
|
-
redirectUri: string;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export declare interface MobileContract {
|
|
163
|
-
schemaVersion: number;
|
|
164
|
-
contractVersion: string;
|
|
165
|
-
sourceLabel: string;
|
|
166
|
-
sourceHash: string;
|
|
167
|
-
objectAllowlist: string[];
|
|
168
|
-
objectCount: number;
|
|
169
|
-
kotlin: {
|
|
170
|
-
packageName: string;
|
|
171
|
-
};
|
|
172
|
-
typeMappings: Record<string, string>;
|
|
173
|
-
objects: MobileContractObject[];
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export declare interface MobileContractField {
|
|
177
|
-
/** Manifest-faithful wire name (also the generated property name). */
|
|
178
|
-
name: string;
|
|
179
|
-
kotlinType: string;
|
|
180
|
-
swiftType: string;
|
|
181
|
-
nullable: boolean;
|
|
182
|
-
/** Kotlin default-value expression, or null for required (id). */
|
|
183
|
-
kotlinDefault: string | null;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export declare interface MobileContractObject {
|
|
187
|
-
name: string;
|
|
188
|
-
qualifiedName: string;
|
|
189
|
-
dtoName: string;
|
|
190
|
-
tableName: string | null;
|
|
191
|
-
hasTenantId: boolean;
|
|
192
|
-
fields: MobileContractField[];
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export declare interface MobileContractOptions {
|
|
196
|
-
manifests: SmrtManifest[];
|
|
197
|
-
/** Object names (or qualified names) exposed to mobile. */
|
|
198
|
-
allowlist: string[];
|
|
199
|
-
/** Kotlin package the domain DTOs are emitted into. */
|
|
200
|
-
kotlinPackage: string;
|
|
201
|
-
/** Provenance label recorded in the contract (e.g. the manifest path). */
|
|
202
|
-
sourceLabel?: string;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Response of `GET /api/mobile/session` -- the app-boot payload for a stored
|
|
207
|
-
* bearer. `extras` is the only app-defined extension point and must remain a
|
|
208
|
-
* JSON object (the Kotlin side decodes it as `JsonObject`). App-domain fields
|
|
209
|
-
* placed at the top level are outside the contract and are ignored by the
|
|
210
|
-
* Kotlin decoder.
|
|
211
|
-
*/
|
|
212
|
-
export declare interface MobileSessionBootstrap {
|
|
213
|
-
user: MobileUserSummary;
|
|
214
|
-
activeTenant?: MobileTenantOption | null;
|
|
215
|
-
tenants?: MobileTenantOption[];
|
|
216
|
-
extras?: Record<string, unknown> | null;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/** One selectable tenant, labeled with the role the user holds there. */
|
|
220
|
-
export declare interface MobileTenantOption {
|
|
221
|
-
id: string;
|
|
222
|
-
name?: string;
|
|
223
|
-
slug?: string;
|
|
224
|
-
roleSlug?: string;
|
|
225
|
-
roleLabel?: string;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/** Tenant summary with subscription surface (reserved for app responses). */
|
|
229
|
-
export declare interface MobileTenantSummary {
|
|
230
|
-
id: string;
|
|
231
|
-
name?: string;
|
|
232
|
-
slug?: string;
|
|
233
|
-
planName?: string;
|
|
234
|
-
subscriptionStatus?: string;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/** Signed-in user summary returned by auth/complete and the session bootstrap. */
|
|
238
|
-
export declare interface MobileUserSummary {
|
|
239
|
-
id: string;
|
|
240
|
-
email?: string;
|
|
241
|
-
label?: string;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Classifies one wire field. Mirrors the three Kotlin declaration forms the
|
|
246
|
-
* framework contract uses (see the mapping table in the module docs).
|
|
247
|
-
*/
|
|
248
|
-
export declare type MobileWireFieldKind = 'required' | 'optional' | 'nullable';
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Compile-time-checked shape descriptor for a wire type: one entry per field,
|
|
252
|
-
* whose kind is DERIVED from the TypeScript declaration. Using
|
|
253
|
-
* `Extract<keyof T, string>` keeps the mapped type non-homomorphic, so every
|
|
254
|
-
* key must be listed (optionality is not copied from `T`) while `T[K]` still
|
|
255
|
-
* carries `undefined` for optional properties.
|
|
256
|
-
*/
|
|
257
|
-
export declare type MobileWireShape<T> = {
|
|
258
|
-
[K in Extract<keyof T, string>]: undefined extends T[K] ? null extends T[K] ? 'nullable' : 'optional' : 'required';
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
/** Schema version of the mobile-contract.json envelope. */
|
|
262
|
-
export declare const SMRT_MOBILE_CONTRACT_SCHEMA_VERSION = 1;
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Version stamp of the framework contract surface (auth/session/device/pack
|
|
266
|
-
* localization types). Bump when the framework contract shape changes.
|
|
267
|
-
*/
|
|
268
|
-
export declare const SMRT_MOBILE_CONTRACT_VERSION = "2026-07-01.v1";
|
|
269
|
-
|
|
270
|
-
/** The subset of a SMRT `manifest.json` the codegen consumes. */
|
|
271
|
-
export declare interface SmrtManifest {
|
|
272
|
-
version?: number | string;
|
|
273
|
-
packageName?: string;
|
|
274
|
-
objects: Record<string, SmrtManifestObject> | SmrtManifestObject[];
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Shapes for the SMRT mobile contract pipeline:
|
|
279
|
-
* manifest.json (+ allowlist) → MobileContract → generated Kotlin/Swift DTOs.
|
|
280
|
-
*/
|
|
281
|
-
/** One field entry in a SMRT manifest's `objects[*].fields` map. */
|
|
282
|
-
export declare interface SmrtManifestField {
|
|
283
|
-
type?: string;
|
|
284
|
-
required?: boolean;
|
|
285
|
-
related?: string;
|
|
286
|
-
/** Current SMRT manifests emit `default`; amaru-era manifests used `defaultValue`. */
|
|
287
|
-
default?: unknown;
|
|
288
|
-
defaultValue?: unknown;
|
|
289
|
-
_meta?: Record<string, unknown>;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/** One object entry in a SMRT manifest (model or collection). */
|
|
293
|
-
export declare interface SmrtManifestObject {
|
|
294
|
-
name: string;
|
|
295
|
-
className?: string;
|
|
296
|
-
qualifiedName?: string;
|
|
297
|
-
collection?: string | null;
|
|
298
|
-
packageName?: string;
|
|
299
|
-
fields?: Record<string, SmrtManifestField>;
|
|
300
|
-
schema?: {
|
|
301
|
-
tableName?: string;
|
|
302
|
-
} | null;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Compares every entry against disk. Returns the list of missing/stale
|
|
307
|
-
* relative paths (empty = fresh).
|
|
308
|
-
*/
|
|
309
|
-
export declare function verifyFileSet(rootDir: string, files: Map<string, string>): string[];
|
|
310
|
-
|
|
311
|
-
/** Writes every `relPath → content` entry under `rootDir`. */
|
|
312
|
-
export declare function writeFileSet(rootDir: string, files: Map<string, string>): void;
|
|
313
|
-
|
|
314
|
-
export { }
|
|
1
|
+
export { buildMobileContract } from './build-contract.js';
|
|
2
|
+
export { SMRT_MOBILE_CONTRACT_SCHEMA_VERSION, SMRT_MOBILE_CONTRACT_VERSION, } from './contract-version.js';
|
|
3
|
+
export { frameworkKotlinFiles, frameworkSwiftFiles } from './emit-framework.js';
|
|
4
|
+
export { GENERATED_HEADER, generateKotlinDtoFiles } from './emit-kotlin.js';
|
|
5
|
+
export { generateSwiftDtoFile } from './emit-swift.js';
|
|
6
|
+
export { verifyFileSet, writeFileSet } from './file-set.js';
|
|
7
|
+
export { MOBILE_AUTH_COMPLETE_REQUEST_SHAPE, MOBILE_AUTH_PROVIDER_SUMMARY_SHAPE, MOBILE_AUTH_SESSION_SHAPE, MOBILE_AUTH_START_REQUEST_SHAPE, MOBILE_AUTH_START_RESPONSE_SHAPE, MOBILE_AUTH_WIRE_SHAPES, MOBILE_SESSION_BOOTSTRAP_SHAPE, MOBILE_TENANT_OPTION_SHAPE, MOBILE_TENANT_SUMMARY_SHAPE, MOBILE_USER_SUMMARY_SHAPE, type MobileAuthCompleteRequest, type MobileAuthProviderSummary, type MobileAuthSession, type MobileAuthStartRequest, type MobileAuthStartResponse, type MobileSessionBootstrap, type MobileTenantOption, type MobileTenantSummary, type MobileUserSummary, type MobileWireFieldKind, type MobileWireShape, } from './framework-types.js';
|
|
8
|
+
export type { MobileContract, MobileContractField, MobileContractObject, MobileContractOptions, SmrtManifest, SmrtManifestField, SmrtManifestObject, } from './types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACL,mCAAmC,EACnC,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EACL,kCAAkC,EAClC,kCAAkC,EAClC,yBAAyB,EACzB,+BAA+B,EAC/B,gCAAgC,EAChC,uBAAuB,EACvB,8BAA8B,EAC9B,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,GACrB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
package/dist/manifest.json
CHANGED
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-mobile-contract",
|
|
6
|
-
"packageVersion": "0.51.
|
|
6
|
+
"packageVersion": "0.51.33",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "7b40fe5eaf4f0f800a10cadc389161318c8400f6a01389e569d5fdc4ec78f882",
|
|
11
|
+
"packageJson": "23c14c367a058e04767ef8189fd4d630756410366cd0acd60cbfab76fdff4a8f",
|
|
12
12
|
"agents": "e3769aff93a1a56f2f6862e175a6e35a7996fc5c77c82bfd5cac629711ea8ebe"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@happyvertical/smrt-core": "workspace:*",
|
|
19
19
|
"@types/node": "24.13.6",
|
|
20
|
-
"typescript": "
|
|
20
|
+
"typescript": "6.0.3",
|
|
21
21
|
"vite": "8.1.4",
|
|
22
22
|
"vitest": "4.1.10"
|
|
23
23
|
},
|
package/dist/types.d.ts
CHANGED
|
@@ -1,79 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
name: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
fields?: Record<string, SmrtManifestField>;
|
|
74
|
-
schema?: {
|
|
75
|
-
tableName?: string;
|
|
76
|
-
} | null;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export { }
|
|
1
|
+
/**
|
|
2
|
+
* Shapes for the SMRT mobile contract pipeline:
|
|
3
|
+
* manifest.json (+ allowlist) → MobileContract → generated Kotlin/Swift DTOs.
|
|
4
|
+
*/
|
|
5
|
+
/** One field entry in a SMRT manifest's `objects[*].fields` map. */
|
|
6
|
+
export interface SmrtManifestField {
|
|
7
|
+
type?: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
related?: string;
|
|
10
|
+
/** Current SMRT manifests emit `default`; amaru-era manifests used `defaultValue`. */
|
|
11
|
+
default?: unknown;
|
|
12
|
+
defaultValue?: unknown;
|
|
13
|
+
_meta?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
/** One object entry in a SMRT manifest (model or collection). */
|
|
16
|
+
export interface SmrtManifestObject {
|
|
17
|
+
name: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
qualifiedName?: string;
|
|
20
|
+
collection?: string | null;
|
|
21
|
+
packageName?: string;
|
|
22
|
+
fields?: Record<string, SmrtManifestField>;
|
|
23
|
+
schema?: {
|
|
24
|
+
tableName?: string;
|
|
25
|
+
} | null;
|
|
26
|
+
}
|
|
27
|
+
/** The subset of a SMRT `manifest.json` the codegen consumes. */
|
|
28
|
+
export interface SmrtManifest {
|
|
29
|
+
version?: number | string;
|
|
30
|
+
packageName?: string;
|
|
31
|
+
objects: Record<string, SmrtManifestObject> | SmrtManifestObject[];
|
|
32
|
+
}
|
|
33
|
+
export interface MobileContractField {
|
|
34
|
+
/** Manifest-faithful wire name (also the generated property name). */
|
|
35
|
+
name: string;
|
|
36
|
+
kotlinType: string;
|
|
37
|
+
swiftType: string;
|
|
38
|
+
nullable: boolean;
|
|
39
|
+
/** Kotlin default-value expression, or null for required (id). */
|
|
40
|
+
kotlinDefault: string | null;
|
|
41
|
+
}
|
|
42
|
+
export interface MobileContractObject {
|
|
43
|
+
name: string;
|
|
44
|
+
qualifiedName: string;
|
|
45
|
+
dtoName: string;
|
|
46
|
+
tableName: string | null;
|
|
47
|
+
hasTenantId: boolean;
|
|
48
|
+
fields: MobileContractField[];
|
|
49
|
+
}
|
|
50
|
+
export interface MobileContractOptions {
|
|
51
|
+
manifests: SmrtManifest[];
|
|
52
|
+
/** Object names (or qualified names) exposed to mobile. */
|
|
53
|
+
allowlist: string[];
|
|
54
|
+
/** Kotlin package the domain DTOs are emitted into. */
|
|
55
|
+
kotlinPackage: string;
|
|
56
|
+
/** Provenance label recorded in the contract (e.g. the manifest path). */
|
|
57
|
+
sourceLabel?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface MobileContract {
|
|
60
|
+
schemaVersion: number;
|
|
61
|
+
contractVersion: string;
|
|
62
|
+
sourceLabel: string;
|
|
63
|
+
sourceHash: string;
|
|
64
|
+
objectAllowlist: string[];
|
|
65
|
+
objectCount: number;
|
|
66
|
+
kotlin: {
|
|
67
|
+
packageName: string;
|
|
68
|
+
};
|
|
69
|
+
typeMappings: Record<string, string>;
|
|
70
|
+
objects: MobileContractObject[];
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,iEAAiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACxC;AAED,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,kBAAkB,EAAE,CAAC;CACpE;AAED,MAAM,WAAW,mBAAmB;IAClC,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,kEAAkE;IAClE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,mBAAmB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,2DAA2D;IAC3D,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,EAAE,oBAAoB,EAAE,CAAC;CACjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-mobile-contract",
|
|
3
|
-
"version": "0.51.
|
|
3
|
+
"version": "0.51.33",
|
|
4
4
|
"description": "SMRT mobile contract codegen: manifest + allowlist → mobile-contract.json → Kotlin/Swift DTOs, plus the generated framework contract for @happyvertical/smrt-mobile",
|
|
5
5
|
"author": "HappyVertical",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@happyvertical/smrt-core": "0.51.
|
|
22
|
+
"@happyvertical/smrt-core": "0.51.33",
|
|
23
23
|
"@types/node": "24.13.6",
|
|
24
|
-
"typescript": "
|
|
24
|
+
"typescript": "6.0.3",
|
|
25
25
|
"vite": "8.1.4",
|
|
26
26
|
"vitest": "4.1.10"
|
|
27
27
|
},
|