@stacksjs/actions 0.75.87 → 0.75.89

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.
@@ -31,6 +31,7 @@ export declare interface CraftIosConfig {
31
31
  devServerURL?: string
32
32
  urlSchemes?: string[]
33
33
  trustedOrigins?: string[]
34
+ appBoundDomains?: string[]
34
35
  associatedDomains?: string[]
35
36
  appGroups?: string[]
36
37
  appIconPath?: string
@@ -1,4 +1,4 @@
1
- import{existsSync,readFileSync,writeFileSync}from"node:fs";import{isAbsolute,join,resolve}from"node:path";import{spotlightActivityTypes}from"@stacksjs/mobile";const CAPABILITY_KEYS={speechRecognition:"enableSpeechRecognition",haptics:"enableHaptics",share:"enableShare",camera:"enableCamera",biometric:"enableBiometric",pushNotifications:"enablePushNotifications",secureStorage:"enableSecureStorage",geolocation:"enableGeolocation",backgroundLocation:"enableBackgroundLocation",clipboard:"enableClipboard",contacts:"enableContacts",calendar:"enableCalendar",localNotifications:"enableLocalNotifications",inAppPurchase:"enableInAppPurchase",keepAwake:"enableKeepAwake",orientationLock:"enableOrientationLock",deepLinks:"enableDeepLinks",qrScanner:"enableQRScanner",localNetwork:"enableLocalNetwork",filePicker:"enableFilePicker",fileDownload:"enableFileDownload",socialAuth:"enableSocialAuth",audioRecording:"enableAudioRecording",videoRecording:"enableVideoRecording",motionSensors:"enableMotionSensors",localDatabase:"enableLocalDatabase",bluetooth:"enableBluetooth",nfc:"enableNFC",healthKit:"enableHealthKit",liveActivities:"enableLiveActivities",watchApp:"enableWatchApp",backgroundTasks:"enableBackgroundTasks",screenCapture:"enableScreenCapture",pdfViewer:"enablePDFViewer",augmentedReality:"enableAR",machineLearning:"enableMLKit"};export function normalizeMobileUrl(value){const input=value?.trim();if(!input)return;return new URL(/^https?:\/\//i.test(input)?input:`https://${input}`).toString().replace(/\/$/,"")}export function resolveMobilePath(root,value){if(!value)return;return isAbsolute(value)?value:resolve(root,value)}export function toCraftIosConfig(config){const devServerURL=normalizeMobileUrl(config.url),trustedOrigins=new Set(config.trustedOrigins??[]);if(devServerURL)trustedOrigins.add(new URL(devServerURL).origin);const craft={appName:config.appName,bundleId:config.bundleId,version:config.version,buildNumber:config.buildNumber,darkMode:config.darkMode,appearance:config.appearance,backgroundColor:config.backgroundColor,backgroundColorDark:config.backgroundColorDark,swipeNavigation:config.swipeNavigation,iosVersion:config.deploymentTarget,watchosVersion:config.watchDeploymentTarget,teamId:config.teamId,devServerURL,urlSchemes:config.urlSchemes,trustedOrigins:[...trustedOrigins],associatedDomains:config.associatedDomains,appGroups:config.appGroups,appIconPath:config.appIcon,privacy:config.privacy,orientations:config.orientations,deviceFamilies:config.deviceFamilies};for(const[key,nativeKey]of Object.entries(CAPABILITY_KEYS)){const enabled=config.capabilities?.[key];if(enabled!==void 0)craft[nativeKey]=enabled}if(config.capabilities?.backgroundLocation)craft.enableGeolocation=!0;for(const key of Object.keys(craft))if(craft[key]===void 0)delete craft[key];return craft}export function validateIosMobileConfig(config){if(!config.appName?.trim())throw Error("config/mobile.ts must define ios.appName");if(!/^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/.test(config.bundleId))throw Error(`Invalid iOS bundle identifier: ${config.bundleId}`);if(config.url&&config.webAssets)throw Error("Choose either ios.url or ios.webAssets in config/mobile.ts, not both");if(!config.url&&!config.webAssets)throw Error("config/mobile.ts must define ios.url or ios.webAssets");if(config.fallbackWebAssets&&!config.url)throw Error("ios.fallbackWebAssets requires ios.url");if(config.deviceFamilies&&(config.deviceFamilies.length===0||config.deviceFamilies.some((family)=>family!=="iphone"&&family!=="ipad")))throw Error("ios.deviceFamilies must contain iphone and/or ipad");if(config.url){const url=new URL(normalizeMobileUrl(config.url)),isLocal=["localhost","127.0.0.1","::1"].includes(url.hostname);if(url.protocol!=="https:"&&!isLocal)throw Error("ios.url must use HTTPS outside local development")}for(const domain of config.associatedDomains??[])if(!/^(applinks|webcredentials|activitycontinuation):[^/\s]+$/.test(domain))throw Error(`Invalid iOS associated domain: ${domain}`);if(config.capabilities?.watchApp){const target=Number.parseFloat(config.watchDeploymentTarget??"9.0");if(!Number.isFinite(target)||target<9)throw Error("ios.watchDeploymentTarget must be watchOS 9.0 or newer")}}const ACTIVITY_TYPES_BLOCK=/[ \t]*<key>NSUserActivityTypes<\/key>\s*<array>[\s\S]*?<\/array>\n?/;export function withActivityTypes(plist,types){const entries=types.map((type)=>` <string>${escapeXml(type)}</string>`).join(`
1
+ import{existsSync,readFileSync,writeFileSync}from"node:fs";import{isAbsolute,join,resolve}from"node:path";import{spotlightActivityTypes}from"@stacksjs/mobile";const CAPABILITY_KEYS={speechRecognition:"enableSpeechRecognition",haptics:"enableHaptics",share:"enableShare",camera:"enableCamera",biometric:"enableBiometric",pushNotifications:"enablePushNotifications",secureStorage:"enableSecureStorage",geolocation:"enableGeolocation",backgroundLocation:"enableBackgroundLocation",clipboard:"enableClipboard",contacts:"enableContacts",calendar:"enableCalendar",localNotifications:"enableLocalNotifications",inAppPurchase:"enableInAppPurchase",keepAwake:"enableKeepAwake",orientationLock:"enableOrientationLock",deepLinks:"enableDeepLinks",qrScanner:"enableQRScanner",localNetwork:"enableLocalNetwork",filePicker:"enableFilePicker",fileDownload:"enableFileDownload",socialAuth:"enableSocialAuth",audioRecording:"enableAudioRecording",videoRecording:"enableVideoRecording",motionSensors:"enableMotionSensors",localDatabase:"enableLocalDatabase",bluetooth:"enableBluetooth",nfc:"enableNFC",healthKit:"enableHealthKit",liveActivities:"enableLiveActivities",watchApp:"enableWatchApp",backgroundTasks:"enableBackgroundTasks",screenCapture:"enableScreenCapture",pdfViewer:"enablePDFViewer",augmentedReality:"enableAR",machineLearning:"enableMLKit"};export function normalizeMobileUrl(value){const input=value?.trim();if(!input)return;return new URL(/^https?:\/\//i.test(input)?input:`https://${input}`).toString().replace(/\/$/,"")}export function resolveMobilePath(root,value){if(!value)return;return isAbsolute(value)?value:resolve(root,value)}export function toCraftIosConfig(config){const devServerURL=normalizeMobileUrl(config.url),trustedOrigins=new Set(config.trustedOrigins??[]);if(devServerURL)trustedOrigins.add(new URL(devServerURL).origin);const craft={appName:config.appName,bundleId:config.bundleId,version:config.version,buildNumber:config.buildNumber,darkMode:config.darkMode,appearance:config.appearance,backgroundColor:config.backgroundColor,backgroundColorDark:config.backgroundColorDark,swipeNavigation:config.swipeNavigation,iosVersion:config.deploymentTarget,watchosVersion:config.watchDeploymentTarget,teamId:config.teamId,devServerURL,urlSchemes:config.urlSchemes,trustedOrigins:[...trustedOrigins],appBoundDomains:config.appBoundDomains,associatedDomains:config.associatedDomains,appGroups:config.appGroups,appIconPath:config.appIcon,privacy:config.privacy,orientations:config.orientations,deviceFamilies:config.deviceFamilies};for(const[key,nativeKey]of Object.entries(CAPABILITY_KEYS)){const enabled=config.capabilities?.[key];if(enabled!==void 0)craft[nativeKey]=enabled}if(config.capabilities?.backgroundLocation)craft.enableGeolocation=!0;for(const key of Object.keys(craft))if(craft[key]===void 0)delete craft[key];return craft}export function validateIosMobileConfig(config){if(!config.appName?.trim())throw Error("config/mobile.ts must define ios.appName");if(!/^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/.test(config.bundleId))throw Error(`Invalid iOS bundle identifier: ${config.bundleId}`);if(config.url&&config.webAssets)throw Error("Choose either ios.url or ios.webAssets in config/mobile.ts, not both");if(!config.url&&!config.webAssets)throw Error("config/mobile.ts must define ios.url or ios.webAssets");if(config.fallbackWebAssets&&!config.url)throw Error("ios.fallbackWebAssets requires ios.url");if(config.deviceFamilies&&(config.deviceFamilies.length===0||config.deviceFamilies.some((family)=>family!=="iphone"&&family!=="ipad")))throw Error("ios.deviceFamilies must contain iphone and/or ipad");if(config.url){const url=new URL(normalizeMobileUrl(config.url)),isLocal=["localhost","127.0.0.1","::1"].includes(url.hostname);if(url.protocol!=="https:"&&!isLocal)throw Error("ios.url must use HTTPS outside local development")}for(const domain of config.associatedDomains??[])if(!/^(applinks|webcredentials|activitycontinuation):[^/\s]+$/.test(domain))throw Error(`Invalid iOS associated domain: ${domain}`);if(config.capabilities?.watchApp){const target=Number.parseFloat(config.watchDeploymentTarget??"9.0");if(!Number.isFinite(target)||target<9)throw Error("ios.watchDeploymentTarget must be watchOS 9.0 or newer")}}const ACTIVITY_TYPES_BLOCK=/[ \t]*<key>NSUserActivityTypes<\/key>\s*<array>[\s\S]*?<\/array>\n?/;export function withActivityTypes(plist,types){const entries=types.map((type)=>` <string>${escapeXml(type)}</string>`).join(`
2
2
  `),block=types.length===0?"":` <key>NSUserActivityTypes</key>
3
3
  <array>
4
4
  ${entries}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.87",
5
+ "version": "0.75.89",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -66,57 +66,57 @@
66
66
  "prepublishOnly": "bun run build"
67
67
  },
68
68
  "dependencies": {
69
- "@stacksjs/action-runner": "0.75.87",
70
- "@stacksjs/ai": "0.75.87",
71
- "@stacksjs/analytics": "0.75.87",
72
- "@stacksjs/api": "0.75.87",
73
- "@stacksjs/auth": "0.75.87",
74
- "@stacksjs/build": "0.75.87",
69
+ "@stacksjs/action-runner": "0.75.89",
70
+ "@stacksjs/ai": "0.75.89",
71
+ "@stacksjs/analytics": "0.75.89",
72
+ "@stacksjs/api": "0.75.89",
73
+ "@stacksjs/auth": "0.75.89",
74
+ "@stacksjs/build": "0.75.89",
75
75
  "@stacksjs/bumpx": "^0.2.18",
76
76
  "@stacksjs/bunpress": "^0.2.15",
77
- "@stacksjs/cli": "0.75.87",
78
- "@stacksjs/cloud": "0.75.87",
79
- "@stacksjs/cms": "0.75.87",
80
- "@stacksjs/components": "^0.2.384",
81
- "@stacksjs/config": "0.75.87",
82
- "@stacksjs/database": "0.75.87",
83
- "@stacksjs/desktop-build": "0.75.87",
84
- "@stacksjs/dns": "0.75.87",
85
- "@stacksjs/enums": "0.75.87",
86
- "@stacksjs/env": "0.75.87",
87
- "@stacksjs/error-handling": "0.75.87",
77
+ "@stacksjs/cli": "0.75.89",
78
+ "@stacksjs/cloud": "0.75.89",
79
+ "@stacksjs/cms": "0.75.89",
80
+ "@stacksjs/components": "^0.2.395",
81
+ "@stacksjs/config": "0.75.89",
82
+ "@stacksjs/database": "0.75.89",
83
+ "@stacksjs/desktop-build": "0.75.89",
84
+ "@stacksjs/dns": "0.75.89",
85
+ "@stacksjs/enums": "0.75.89",
86
+ "@stacksjs/env": "0.75.89",
87
+ "@stacksjs/error-handling": "0.75.89",
88
88
  "@stacksjs/gitit": "^0.2.5",
89
- "@stacksjs/i18n": "0.75.87",
90
- "@stacksjs/image": "0.75.87",
91
- "@stacksjs/logging": "0.75.87",
89
+ "@stacksjs/i18n": "0.75.89",
90
+ "@stacksjs/image": "0.75.89",
91
+ "@stacksjs/logging": "0.75.89",
92
92
  "@stacksjs/logsmith": "^0.2.11",
93
- "@stacksjs/mobile": "0.75.87",
94
- "@stacksjs/orm": "0.75.87",
95
- "@stacksjs/path": "0.75.87",
96
- "@stacksjs/payments": "0.75.87",
97
- "@stacksjs/queue": "0.75.87",
98
- "@stacksjs/registry": "0.75.87",
99
- "@stacksjs/router": "0.75.87",
93
+ "@stacksjs/mobile": "0.75.89",
94
+ "@stacksjs/orm": "0.75.89",
95
+ "@stacksjs/path": "0.75.89",
96
+ "@stacksjs/payments": "0.75.89",
97
+ "@stacksjs/queue": "0.75.89",
98
+ "@stacksjs/registry": "0.75.89",
99
+ "@stacksjs/router": "0.75.89",
100
100
  "@stacksjs/rpx": "^0.11.54",
101
- "@stacksjs/scheduler": "0.75.87",
102
- "@stacksjs/search-engine": "0.75.87",
103
- "@stacksjs/security": "0.75.87",
104
- "@stacksjs/server": "0.75.87",
105
- "@stacksjs/sites": "0.75.87",
106
- "@stacksjs/storage": "0.75.87",
107
- "@stacksjs/strings": "0.75.87",
108
- "@stacksjs/stx": "^0.2.384",
101
+ "@stacksjs/scheduler": "0.75.89",
102
+ "@stacksjs/search-engine": "0.75.89",
103
+ "@stacksjs/security": "0.75.89",
104
+ "@stacksjs/server": "0.75.89",
105
+ "@stacksjs/sites": "0.75.89",
106
+ "@stacksjs/storage": "0.75.89",
107
+ "@stacksjs/strings": "0.75.89",
108
+ "@stacksjs/stx": "^0.2.395",
109
109
  "@stacksjs/tlsx": "^0.13.19",
110
- "@stacksjs/ts-cloud": "^0.16.44",
110
+ "@stacksjs/ts-cloud": "^0.16.47",
111
111
  "@stacksjs/ts-md": "^0.1.1",
112
- "@stacksjs/tunnel": "0.75.87",
113
- "@stacksjs/types": "0.75.87",
114
- "@stacksjs/utils": "0.75.87",
115
- "@stacksjs/whois": "0.75.87",
116
- "bun-plugin-stx": "^0.2.384"
112
+ "@stacksjs/tunnel": "0.75.89",
113
+ "@stacksjs/types": "0.75.89",
114
+ "@stacksjs/utils": "0.75.89",
115
+ "@stacksjs/whois": "0.75.89",
116
+ "bun-plugin-stx": "^0.2.395"
117
117
  },
118
118
  "peerDependencies": {
119
- "craft-native": ">=0.0.118",
119
+ "craft-native": ">=0.0.119",
120
120
  "pickier": "^0.1.68"
121
121
  },
122
122
  "peerDependenciesMeta": {
@@ -128,7 +128,7 @@
128
128
  }
129
129
  },
130
130
  "devDependencies": {
131
- "@stacksjs/validation": "0.75.87",
131
+ "@stacksjs/validation": "0.75.89",
132
132
  "better-dx": "^0.2.24"
133
133
  }
134
134
  }