@andco/protocol 0.0.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.
Files changed (126) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +44 -0
  3. package/dist/authorization-preparation.d.ts +754 -0
  4. package/dist/authorization-preparation.d.ts.map +1 -0
  5. package/dist/authorization-preparation.js +187 -0
  6. package/dist/authorization.d.ts +99 -0
  7. package/dist/authorization.d.ts.map +1 -0
  8. package/dist/authorization.js +227 -0
  9. package/dist/automatic-charge.d.ts +314 -0
  10. package/dist/automatic-charge.d.ts.map +1 -0
  11. package/dist/automatic-charge.js +126 -0
  12. package/dist/bank-account-authorization.d.ts +6 -0
  13. package/dist/bank-account-authorization.d.ts.map +1 -0
  14. package/dist/bank-account-authorization.js +13 -0
  15. package/dist/callback-state.d.ts +10 -0
  16. package/dist/callback-state.d.ts.map +1 -0
  17. package/dist/callback-state.js +28 -0
  18. package/dist/consent.d.ts +48 -0
  19. package/dist/consent.d.ts.map +1 -0
  20. package/dist/consent.js +110 -0
  21. package/dist/constants.d.ts +17 -0
  22. package/dist/constants.d.ts.map +1 -0
  23. package/dist/constants.js +20 -0
  24. package/dist/errors.d.ts +70 -0
  25. package/dist/errors.d.ts.map +1 -0
  26. package/dist/errors.js +80 -0
  27. package/dist/index.d.ts +33 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +32 -0
  30. package/dist/intent-input.d.ts +637 -0
  31. package/dist/intent-input.d.ts.map +1 -0
  32. package/dist/intent-input.js +101 -0
  33. package/dist/messages/authorization-response.d.ts +12 -0
  34. package/dist/messages/authorization-response.d.ts.map +1 -0
  35. package/dist/messages/authorization-response.js +9 -0
  36. package/dist/messages/base.d.ts +31 -0
  37. package/dist/messages/base.d.ts.map +1 -0
  38. package/dist/messages/base.js +30 -0
  39. package/dist/messages/click.d.ts +11 -0
  40. package/dist/messages/click.d.ts.map +1 -0
  41. package/dist/messages/click.js +8 -0
  42. package/dist/messages/error.d.ts +13 -0
  43. package/dist/messages/error.d.ts.map +1 -0
  44. package/dist/messages/error.js +9 -0
  45. package/dist/messages/index.d.ts +75 -0
  46. package/dist/messages/index.d.ts.map +1 -0
  47. package/dist/messages/index.js +27 -0
  48. package/dist/messages/init.d.ts +9 -0
  49. package/dist/messages/init.d.ts.map +1 -0
  50. package/dist/messages/init.js +6 -0
  51. package/dist/messages/popup.d.ts +108 -0
  52. package/dist/messages/popup.d.ts.map +1 -0
  53. package/dist/messages/popup.js +62 -0
  54. package/dist/messages/ready.d.ts +9 -0
  55. package/dist/messages/ready.d.ts.map +1 -0
  56. package/dist/messages/ready.js +6 -0
  57. package/dist/messages/set-preferences.d.ts +16 -0
  58. package/dist/messages/set-preferences.d.ts.map +1 -0
  59. package/dist/messages/set-preferences.js +20 -0
  60. package/dist/miniapp-icon.d.ts +4 -0
  61. package/dist/miniapp-icon.d.ts.map +1 -0
  62. package/dist/miniapp-icon.js +68 -0
  63. package/dist/miniapp-manifest.d.ts +71 -0
  64. package/dist/miniapp-manifest.d.ts.map +1 -0
  65. package/dist/miniapp-manifest.js +46 -0
  66. package/dist/native-copy.d.ts +7 -0
  67. package/dist/native-copy.d.ts.map +1 -0
  68. package/dist/native-copy.js +436 -0
  69. package/dist/native-intent.d.ts +402 -0
  70. package/dist/native-intent.d.ts.map +1 -0
  71. package/dist/native-intent.js +410 -0
  72. package/dist/native.d.ts +55 -0
  73. package/dist/native.d.ts.map +1 -0
  74. package/dist/native.js +53 -0
  75. package/dist/oauth.d.ts +4 -0
  76. package/dist/oauth.d.ts.map +1 -0
  77. package/dist/oauth.js +3 -0
  78. package/dist/release.d.ts +3 -0
  79. package/dist/release.d.ts.map +1 -0
  80. package/dist/release.js +2 -0
  81. package/dist/scopes.d.ts +35 -0
  82. package/dist/scopes.d.ts.map +1 -0
  83. package/dist/scopes.js +15 -0
  84. package/dist/server.d.ts +9 -0
  85. package/dist/server.d.ts.map +1 -0
  86. package/dist/server.js +14 -0
  87. package/dist/transport/financial-events.d.ts +134 -0
  88. package/dist/transport/financial-events.d.ts.map +1 -0
  89. package/dist/transport/financial-events.js +120 -0
  90. package/dist/transport/generated/oauth-api.d.ts +1685 -0
  91. package/dist/transport/generated/oauth-api.d.ts.map +1 -0
  92. package/dist/transport/generated/oauth-api.js +5 -0
  93. package/dist/transport/index.d.ts +6 -0
  94. package/dist/transport/index.d.ts.map +1 -0
  95. package/dist/transport/index.js +5 -0
  96. package/dist/transport/intents.d.ts +81 -0
  97. package/dist/transport/intents.d.ts.map +1 -0
  98. package/dist/transport/intents.js +286 -0
  99. package/dist/transport/rest.d.ts +76 -0
  100. package/dist/transport/rest.d.ts.map +1 -0
  101. package/dist/transport/rest.js +48 -0
  102. package/dist/transport/runtime.d.ts +8 -0
  103. package/dist/transport/runtime.d.ts.map +1 -0
  104. package/dist/transport/runtime.js +16 -0
  105. package/dist/transport/webhooks.d.ts +27 -0
  106. package/dist/transport/webhooks.d.ts.map +1 -0
  107. package/dist/transport/webhooks.js +68 -0
  108. package/dist/urls.d.ts +71 -0
  109. package/dist/urls.d.ts.map +1 -0
  110. package/dist/urls.js +132 -0
  111. package/dist/userinfo.d.ts +11 -0
  112. package/dist/userinfo.d.ts.map +1 -0
  113. package/dist/userinfo.js +9 -0
  114. package/dist/utils.d.ts +20 -0
  115. package/dist/utils.d.ts.map +1 -0
  116. package/dist/utils.js +45 -0
  117. package/dist/webhook-input.d.ts +22 -0
  118. package/dist/webhook-input.d.ts.map +1 -0
  119. package/dist/webhook-input.js +11 -0
  120. package/dist/webhook-signature.d.ts +54 -0
  121. package/dist/webhook-signature.d.ts.map +1 -0
  122. package/dist/webhook-signature.js +74 -0
  123. package/dist/window-features.d.ts +28 -0
  124. package/dist/window-features.d.ts.map +1 -0
  125. package/dist/window-features.js +55 -0
  126. package/package.json +63 -0
@@ -0,0 +1,20 @@
1
+ import * as v from "valibot";
2
+ import { AndCoMessageBaseEntries } from "./base.js";
3
+ const AndCoLocaleSchema = /* @__PURE__ */ v.pipe(v.string(), v.maxLength(35), v.check((locale) => {
4
+ try {
5
+ Intl.getCanonicalLocales(locale);
6
+ return true;
7
+ }
8
+ catch {
9
+ return false;
10
+ }
11
+ }));
12
+ /** Colour-scheme preference for hosted AndCo surfaces. */
13
+ export const AndCoThemeModeSchema = /* @__PURE__ */ v.picklist(["dark", "light", "system"]);
14
+ /** Visual preferences that a host can update without recreating the widget. */
15
+ export const AndCoSetPreferencesMessageSchema = /* @__PURE__ */ v.strictObject({
16
+ ...AndCoMessageBaseEntries,
17
+ type: v.literal("set-preferences"),
18
+ themeMode: v.optional(AndCoThemeModeSchema),
19
+ locale: v.optional(AndCoLocaleSchema),
20
+ });
@@ -0,0 +1,4 @@
1
+ import type { AndCoMiniappManifest } from "./miniapp-manifest.js";
2
+ /** Selects a same-origin manifest icon suited to compact native Host chrome. */
3
+ export declare function resolveAndCoMiniappIconUrl(manifest: AndCoMiniappManifest, manifestUrl: string | URL): string;
4
+ //# sourceMappingURL=miniapp-icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"miniapp-icon.d.ts","sourceRoot":"","sources":["../src/miniapp-icon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAwDlE,gFAAgF;AAChF,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,GAAG,GAAG,UAsBnG"}
@@ -0,0 +1,68 @@
1
+ import { SafeURL } from "./urls.js";
2
+ function iconPurposeRank(purpose) {
3
+ const purposes = purpose?.toLowerCase().split(/\s+/).filter(Boolean) ?? [];
4
+ if (purposes.includes("any"))
5
+ return 0;
6
+ if (purposes.includes("maskable"))
7
+ return 1;
8
+ return 2;
9
+ }
10
+ function iconSizeScore(sizes) {
11
+ const sizeTokens = sizes?.toLowerCase().split(/\s+/) ?? [];
12
+ if (sizeTokens.includes("any"))
13
+ return { shapeRank: 0, sizeDistance: 0 };
14
+ const dimensions = sizeTokens.flatMap((size) => {
15
+ const match = /^(\d+)x(\d+)$/.exec(size);
16
+ if (!match)
17
+ return [];
18
+ const width = Number(match[1]);
19
+ const height = Number(match[2]);
20
+ if (!Number.isSafeInteger(width) || !Number.isSafeInteger(height) || width < 1 || height < 1)
21
+ return [];
22
+ return [{ width, height }];
23
+ });
24
+ if (dimensions.some(({ width, height }) => width === height && width >= 40)) {
25
+ return {
26
+ shapeRank: 0,
27
+ sizeDistance: Math.min(...dimensions
28
+ .filter(({ width, height }) => width === height && width >= 40)
29
+ .map(({ width }) => Math.abs(width - 64))),
30
+ };
31
+ }
32
+ if (dimensions.some(({ width, height }) => width === height)) {
33
+ return {
34
+ shapeRank: 1,
35
+ sizeDistance: Math.min(...dimensions.filter(({ width, height }) => width === height).map(({ width }) => Math.abs(width - 64))),
36
+ };
37
+ }
38
+ if (dimensions.length) {
39
+ return {
40
+ shapeRank: 2,
41
+ sizeDistance: Math.min(...dimensions.map(({ width, height }) => Math.abs(Math.max(width, height) - 64))),
42
+ };
43
+ }
44
+ return { shapeRank: 3, sizeDistance: Number.MAX_SAFE_INTEGER };
45
+ }
46
+ /** Selects a same-origin manifest icon suited to compact native Host chrome. */
47
+ export function resolveAndCoMiniappIconUrl(manifest, manifestUrl) {
48
+ const base = new SafeURL(manifestUrl);
49
+ const candidates = [];
50
+ for (const [index, icon] of manifest.icons.entries()) {
51
+ try {
52
+ const url = new SafeURL(new URL(icon.src, base));
53
+ if (url.origin !== base.origin)
54
+ continue;
55
+ const { shapeRank, sizeDistance } = iconSizeScore(icon.sizes);
56
+ candidates.push({ url: url.href, purposeRank: iconPurposeRank(icon.purpose), shapeRank, sizeDistance, index });
57
+ }
58
+ catch {
59
+ // Icons are presentational only: an invalid URL must not invalidate the Miniapp.
60
+ }
61
+ }
62
+ candidates.sort((left, right) => left.shapeRank - right.shapeRank ||
63
+ left.sizeDistance - right.sizeDistance ||
64
+ left.purposeRank - right.purposeRank ||
65
+ left.url.localeCompare(right.url) ||
66
+ left.index - right.index);
67
+ return candidates[0]?.url;
68
+ }
@@ -0,0 +1,71 @@
1
+ import * as v from "valibot";
2
+ /** Public icon metadata compatible with the Web App Manifest icon member. */
3
+ export declare const AndCoMiniappIconSchema: v.ObjectSchema<{
4
+ readonly src: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2048, undefined>]>;
5
+ readonly sizes: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 128, undefined>]>, undefined>;
6
+ readonly type: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 128, undefined>]>, undefined>;
7
+ readonly purpose: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 128, undefined>]>, undefined>;
8
+ }, undefined>;
9
+ /** Identifies the OAuth client and optional same-origin authorization bootstrap. */
10
+ export declare const AndCoMiniappOAuthSchema: v.ObjectSchema<{
11
+ readonly client_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
12
+ readonly auth_url: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2048, undefined>]>, undefined>;
13
+ }, undefined>;
14
+ /** Describes one server-authoritative OAuth scope policy. */
15
+ export declare const AndCoOAuthScopePolicySchema: v.ObjectSchema<{
16
+ readonly scope: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
17
+ readonly mode: v.PicklistSchema<["optional", "default", "required"], undefined>;
18
+ }, undefined>;
19
+ /** Public, non-secret OAuth registration returned by bank-webapp. */
20
+ export declare const AndCoOAuthClientConfigurationSchema: v.ObjectSchema<{
21
+ readonly client_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
22
+ readonly client_name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
23
+ readonly client_type: v.PicklistSchema<["public", "confidential"], undefined>;
24
+ readonly application_type: v.PicklistSchema<["browser", "web_server", "native"], undefined>;
25
+ readonly redirect_uris: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2048, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>, v.MaxLengthAction<string[], 25, undefined>]>;
26
+ readonly allowed_origins: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2048, undefined>]>, undefined>, v.MaxLengthAction<string[], 25, undefined>]>;
27
+ readonly scopes: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
28
+ readonly scope: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
29
+ readonly mode: v.PicklistSchema<["optional", "default", "required"], undefined>;
30
+ }, undefined>, undefined>, v.MinLengthAction<{
31
+ scope: string;
32
+ mode: "optional" | "default" | "required";
33
+ }[], 1, undefined>, v.MaxLengthAction<{
34
+ scope: string;
35
+ mode: "optional" | "default" | "required";
36
+ }[], 50, undefined>]>;
37
+ }, undefined>;
38
+ /** Web App Manifest-compatible descriptor required at `/miniapp.webmanifest`. */
39
+ export declare const AndCoMiniappManifestSchema: v.ObjectSchema<{
40
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2048, undefined>]>;
41
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>;
42
+ readonly short_name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 256, undefined>]>, undefined>;
43
+ readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 512, undefined>]>, undefined>;
44
+ readonly icons: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
45
+ readonly src: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2048, undefined>]>;
46
+ readonly sizes: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 128, undefined>]>, undefined>;
47
+ readonly type: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 128, undefined>]>, undefined>;
48
+ readonly purpose: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 128, undefined>]>, undefined>;
49
+ }, undefined>, undefined>, v.MaxLengthAction<{
50
+ src: string;
51
+ sizes?: string | undefined;
52
+ type?: string | undefined;
53
+ purpose?: string | undefined;
54
+ }[], 20, undefined>]>, readonly []>;
55
+ readonly start_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2048, undefined>]>;
56
+ readonly scope: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2048, undefined>]>, undefined>;
57
+ readonly display: v.OptionalSchema<v.PicklistSchema<["browser", "minimal-ui", "standalone", "fullscreen"], undefined>, undefined>;
58
+ readonly theme_color: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 64, undefined>]>, undefined>;
59
+ readonly background_color: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 64, undefined>]>, undefined>;
60
+ readonly oauth: v.ObjectSchema<{
61
+ readonly client_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
62
+ readonly auth_url: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2048, undefined>]>, undefined>;
63
+ }, undefined>;
64
+ }, undefined>;
65
+ /** Parsed Miniapp Descriptor consumed by Andco Host Applications. */
66
+ export type AndCoMiniappManifest = v.InferOutput<typeof AndCoMiniappManifestSchema>;
67
+ /** Public OAuth registration loaded from bank-webapp. */
68
+ export type AndCoOAuthClientConfiguration = v.InferOutput<typeof AndCoOAuthClientConfigurationSchema>;
69
+ /** Server-authoritative permission policy used by a Host consent surface. */
70
+ export type AndCoOAuthScopePolicy = v.InferOutput<typeof AndCoOAuthScopePolicySchema>;
71
+ //# sourceMappingURL=miniapp-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"miniapp-manifest.d.ts","sourceRoot":"","sources":["../src/miniapp-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAO7B,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB;;;;;aAKjC,CAAC;AAEH,oFAAoF;AACpF,eAAO,MAAM,uBAAuB;;;aAGlC,CAAC;AAEH,6DAA6D;AAC7D,eAAO,MAAM,2BAA2B;;;aAGtC,CAAC;AAEH,qEAAqE;AACrE,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;aAQ9C,CAAC;AAEH,iFAAiF;AACjF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;aAYrC,CAAC;AAEH,qEAAqE;AACrE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,0BAA0B,CAAC,CAAC;AACpF,yDAAyD;AACzD,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,mCAAmC,CAAC,CAAC;AACtG,6EAA6E;AAC7E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ import * as v from "valibot";
2
+ import { ANDCO_SCOPE_REGEX } from "./scopes.js";
3
+ const NonEmptyTextSchema = /* @__PURE__ */ v.pipe(v.string(), v.minLength(1), v.maxLength(256));
4
+ const ManifestURLSchema = /* @__PURE__ */ v.pipe(v.string(), v.minLength(1), v.maxLength(2048));
5
+ const OAuthScopeModeSchema = /* @__PURE__ */ v.picklist(["optional", "default", "required"]);
6
+ /** Public icon metadata compatible with the Web App Manifest icon member. */
7
+ export const AndCoMiniappIconSchema = /* @__PURE__ */ v.object({
8
+ src: ManifestURLSchema,
9
+ sizes: v.optional(v.pipe(v.string(), v.maxLength(128))),
10
+ type: v.optional(v.pipe(v.string(), v.maxLength(128))),
11
+ purpose: v.optional(v.pipe(v.string(), v.maxLength(128))),
12
+ });
13
+ /** Identifies the OAuth client and optional same-origin authorization bootstrap. */
14
+ export const AndCoMiniappOAuthSchema = /* @__PURE__ */ v.object({
15
+ client_id: v.pipe(v.string(), v.minLength(1), v.maxLength(255)),
16
+ auth_url: v.optional(ManifestURLSchema),
17
+ });
18
+ /** Describes one server-authoritative OAuth scope policy. */
19
+ export const AndCoOAuthScopePolicySchema = /* @__PURE__ */ v.object({
20
+ scope: v.pipe(v.string(), v.regex(ANDCO_SCOPE_REGEX)),
21
+ mode: OAuthScopeModeSchema,
22
+ });
23
+ /** Public, non-secret OAuth registration returned by bank-webapp. */
24
+ export const AndCoOAuthClientConfigurationSchema = /* @__PURE__ */ v.object({
25
+ client_id: v.pipe(v.string(), v.minLength(1), v.maxLength(255)),
26
+ client_name: NonEmptyTextSchema,
27
+ client_type: v.picklist(["public", "confidential"]),
28
+ application_type: v.picklist(["browser", "web_server", "native"]),
29
+ redirect_uris: v.pipe(v.array(ManifestURLSchema), v.minLength(1), v.maxLength(25)),
30
+ allowed_origins: v.pipe(v.array(ManifestURLSchema), v.maxLength(25)),
31
+ scopes: v.pipe(v.array(AndCoOAuthScopePolicySchema), v.minLength(1), v.maxLength(50)),
32
+ });
33
+ /** Web App Manifest-compatible descriptor required at `/miniapp.webmanifest`. */
34
+ export const AndCoMiniappManifestSchema = /* @__PURE__ */ v.object({
35
+ id: ManifestURLSchema,
36
+ name: NonEmptyTextSchema,
37
+ short_name: v.optional(NonEmptyTextSchema),
38
+ description: v.optional(v.pipe(v.string(), v.maxLength(512))),
39
+ icons: v.optional(v.pipe(v.array(AndCoMiniappIconSchema), v.maxLength(20)), []),
40
+ start_url: ManifestURLSchema,
41
+ scope: v.optional(ManifestURLSchema),
42
+ display: v.optional(v.picklist(["browser", "minimal-ui", "standalone", "fullscreen"])),
43
+ theme_color: v.optional(v.pipe(v.string(), v.maxLength(64))),
44
+ background_color: v.optional(v.pipe(v.string(), v.maxLength(64))),
45
+ oauth: AndCoMiniappOAuthSchema,
46
+ });
@@ -0,0 +1,7 @@
1
+ /** Selects the supported language while preserving Platform's Spanish fallback. */
2
+ export declare function ANDCO_NATIVE_LOCALE(language?: string): "es" | "en" | "pt";
3
+ /** Formats CLP on Hermes without BigInt coercion or rounding unsafe integers. */
4
+ export declare function ANDCO_NATIVE_MONEY(value: string, locale?: "en" | "es" | "pt"): string;
5
+ /** Native equivalents of Platform's localized labels; server-owned resource descriptions remain unchanged. */
6
+ export declare function ANDCO_NATIVE_TEXT(text: string, values?: Record<string, string | number>, locale?: "en" | "es" | "pt"): string;
7
+ //# sourceMappingURL=native-copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-copy.d.ts","sourceRoot":"","sources":["../src/native-copy.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,QAAQ,SAAiD,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAGjH;AACD,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAwB,UAQ/E;AAED,8GAA8G;AAC9G,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAM,EAC5C,MAAM,qBAAwB,UAK/B"}