zcw-shared 2.4.0 → 2.8.0
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/functions/android/integrateThirdPartyModule.d.ts +5 -0
- package/dist/functions/android/integrateThirdPartyModule.js +70 -0
- package/dist/functions/android/integrateThirdPartyModule.js.map +1 -1
- package/dist/functions/android/integrateUniPushAndroid.d.ts +23 -0
- package/dist/functions/android/integrateUniPushAndroid.js +266 -0
- package/dist/functions/android/integrateUniPushAndroid.js.map +1 -0
- package/dist/functions/api/auth.d.ts +14 -0
- package/dist/functions/api/auth.js +109 -0
- package/dist/functions/api/auth.js.map +1 -0
- package/dist/functions/api/schemas/auth.schema.d.ts +363 -0
- package/dist/functions/api/schemas/auth.schema.js +39 -0
- package/dist/functions/api/schemas/auth.schema.js.map +1 -0
- package/dist/functions/api/schemas/video.schema.d.ts +391 -0
- package/dist/functions/api/schemas/video.schema.js +55 -0
- package/dist/functions/api/schemas/video.schema.js.map +1 -0
- package/dist/functions/api/video.d.ts +62 -0
- package/dist/functions/api/video.js +243 -0
- package/dist/functions/api/video.js.map +1 -0
- package/dist/functions/browser/isElectron.d.ts +5 -0
- package/dist/functions/browser/isElectron.js +4 -0
- package/dist/functions/browser/isElectron.js.map +1 -0
- package/dist/functions/dom/isTextTruncated.d.ts +4 -0
- package/dist/functions/dom/isTextTruncated.js +16 -0
- package/dist/functions/dom/isTextTruncated.js.map +1 -0
- package/dist/functions/dom/localFileInput.d.ts +14 -0
- package/dist/functions/dom/localFileInput.js +27 -0
- package/dist/functions/dom/localFileInput.js.map +1 -0
- package/dist/functions/file/getIconfontNameByExtension.js +53 -56
- package/dist/functions/file/getIconfontNameByExtension.js.map +1 -1
- package/dist/functions/im/parseImMentionSegments.d.ts +15 -0
- package/dist/functions/im/parseImMentionSegments.js +56 -0
- package/dist/functions/im/parseImMentionSegments.js.map +1 -0
- package/dist/functions/ios/integrateThirdPartyModule.d.ts +9 -1
- package/dist/functions/ios/integrateThirdPartyModule.js +112 -2
- package/dist/functions/ios/integrateThirdPartyModule.js.map +1 -1
- package/dist/functions/ios/integrateUniPushIOS.d.ts +18 -0
- package/dist/functions/ios/integrateUniPushIOS.js +200 -0
- package/dist/functions/ios/integrateUniPushIOS.js.map +1 -0
- package/dist/functions/oss/uploadViaSignedPut.d.ts +35 -0
- package/dist/functions/oss/uploadViaSignedPut.js +86 -0
- package/dist/functions/oss/uploadViaSignedPut.js.map +1 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +38 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -1
- package/dist/functions/uniapp/app-plus/buildIOSApp.js +38 -0
- package/dist/functions/uniapp/app-plus/buildIOSApp.js.map +1 -1
- package/dist/vue-hooks/dom/useAppendToBody.d.ts +25 -0
- package/dist/vue-hooks/dom/useAppendToBody.js +31 -0
- package/dist/vue-hooks/dom/useAppendToBody.js.map +1 -0
- package/dist/vue-hooks/dom/useDraggable.d.ts +8 -3
- package/dist/vue-hooks/dom/useDraggable.js +57 -19
- package/dist/vue-hooks/dom/useDraggable.js.map +1 -1
- package/package.json +11 -1
- package/references/dom.d.ts +8 -3
- package/types/im-api.d.ts +26 -2
- package/types/im-chat.d.ts +42 -1
- package/types/im-message-display.d.ts +89 -0
- package/types/uniapp-android-build.d.ts +31 -0
- package/types/uniapp-ios-build.d.ts +26 -0
- package/types/user.d.ts +2 -1
- package/dist/functions/async/sleep.d.ts +0 -5
- package/dist/functions/async/sleep.js +0 -6
- package/dist/functions/async/sleep.js.map +0 -1
- package/dist/functions/async/timeout.d.ts +0 -6
- package/dist/functions/async/timeout.js +0 -12
- package/dist/functions/async/timeout.js.map +0 -1
- package/dist/functions/browser/computePosition.d.ts +0 -6
- package/dist/functions/browser/computePosition.js +0 -49
- package/dist/functions/browser/computePosition.js.map +0 -1
- package/dist/functions/browser/createSharedKeyboardCenter.d.ts +0 -18
- package/dist/functions/browser/createSharedKeyboardCenter.js +0 -58
- package/dist/functions/browser/createSharedKeyboardCenter.js.map +0 -1
- package/dist/functions/browser/createThrottledEventListener.d.ts +0 -11
- package/dist/functions/browser/createThrottledEventListener.js +0 -51
- package/dist/functions/browser/createThrottledEventListener.js.map +0 -1
- package/dist/functions/browser/demonstrateResourceLoading.d.ts +0 -32
- package/dist/functions/browser/demonstrateResourceLoading.js +0 -169
- package/dist/functions/browser/demonstrateResourceLoading.js.map +0 -1
- package/dist/functions/browser/detectOverflow.d.ts +0 -12
- package/dist/functions/browser/detectOverflow.js +0 -17
- package/dist/functions/browser/detectOverflow.js.map +0 -1
- package/dist/functions/browser/getAlignment.d.ts +0 -2
- package/dist/functions/browser/getAlignment.js +0 -5
- package/dist/functions/browser/getAlignment.js.map +0 -1
- package/dist/functions/browser/getBasePlacement.d.ts +0 -2
- package/dist/functions/browser/getBasePlacement.js +0 -4
- package/dist/functions/browser/getBasePlacement.js.map +0 -1
- package/dist/functions/browser/getCrossAxisFlip.d.ts +0 -2
- package/dist/functions/browser/getCrossAxisFlip.js +0 -11
- package/dist/functions/browser/getCrossAxisFlip.js.map +0 -1
- package/dist/functions/browser/getElementRect.d.ts +0 -3
- package/dist/functions/browser/getElementRect.js +0 -14
- package/dist/functions/browser/getElementRect.js.map +0 -1
- package/dist/functions/browser/getFlipPlacements.d.ts +0 -2
- package/dist/functions/browser/getFlipPlacements.js +0 -13
- package/dist/functions/browser/getFlipPlacements.js.map +0 -1
- package/dist/functions/browser/getMainAxisFlip.d.ts +0 -2
- package/dist/functions/browser/getMainAxisFlip.js +0 -17
- package/dist/functions/browser/getMainAxisFlip.js.map +0 -1
- package/dist/functions/browser/getRelativePosition.d.ts +0 -3
- package/dist/functions/browser/getRelativePosition.js +0 -14
- package/dist/functions/browser/getRelativePosition.js.map +0 -1
- package/dist/functions/browser/getViewportRect.d.ts +0 -7
- package/dist/functions/browser/getViewportRect.js +0 -15
- package/dist/functions/browser/getViewportRect.js.map +0 -1
- package/dist/functions/browser/isValidPlacement.d.ts +0 -2
- package/dist/functions/browser/isValidPlacement.js +0 -16
- package/dist/functions/browser/isValidPlacement.js.map +0 -1
- package/dist/functions/browser/pickFile.d.ts +0 -15
- package/dist/functions/browser/pickFile.js +0 -48
- package/dist/functions/browser/pickFile.js.map +0 -1
- package/dist/functions/build/generateExports.d.ts +0 -26
- package/dist/functions/build/generateExports.js +0 -34
- package/dist/functions/build/generateExports.js.map +0 -1
- package/dist/functions/core/diff/diff.d.ts +0 -25
- package/dist/functions/core/diff/diff.js +0 -316
- package/dist/functions/core/diff/diff.js.map +0 -1
- package/dist/functions/core/diff/vueDiff.d.ts +0 -38
- package/dist/functions/core/diff/vueDiff.js +0 -333
- package/dist/functions/core/diff/vueDiff.js.map +0 -1
- package/dist/functions/core/generator/generatorUtils.d.ts +0 -16
- package/dist/functions/core/generator/generatorUtils.js +0 -139
- package/dist/functions/core/generator/generatorUtils.js.map +0 -1
- package/dist/functions/core/type/isType.d.ts +0 -11
- package/dist/functions/core/type/isType.js +0 -30
- package/dist/functions/core/type/isType.js.map +0 -1
- package/dist/functions/data/array-object/chunk.d.ts +0 -1
- package/dist/functions/data/array-object/chunk.js +0 -11
- package/dist/functions/data/array-object/chunk.js.map +0 -1
- package/dist/functions/data/array-object/deepClone.d.ts +0 -12
- package/dist/functions/data/array-object/deepClone.js +0 -131
- package/dist/functions/data/array-object/deepClone.js.map +0 -1
- package/dist/functions/data/array-object/evolve.d.ts +0 -3
- package/dist/functions/data/array-object/evolve.js +0 -15
- package/dist/functions/data/array-object/evolve.js.map +0 -1
- package/dist/functions/data/array-object/flatten.d.ts +0 -7
- package/dist/functions/data/array-object/flatten.js +0 -60
- package/dist/functions/data/array-object/flatten.js.map +0 -1
- package/dist/functions/data/array-object/flattenObject.d.ts +0 -5
- package/dist/functions/data/array-object/flattenObject.js +0 -102
- package/dist/functions/data/array-object/flattenObject.js.map +0 -1
- package/dist/functions/data/array-object/groupBy.d.ts +0 -1
- package/dist/functions/data/array-object/groupBy.js +0 -14
- package/dist/functions/data/array-object/groupBy.js.map +0 -1
- package/dist/functions/data/array-object/omit.d.ts +0 -1
- package/dist/functions/data/array-object/omit.js +0 -8
- package/dist/functions/data/array-object/omit.js.map +0 -1
- package/dist/functions/data/array-object/pick.d.ts +0 -1
- package/dist/functions/data/array-object/pick.js +0 -10
- package/dist/functions/data/array-object/pick.js.map +0 -1
- package/dist/functions/data/array-object/shuffle.d.ts +0 -1
- package/dist/functions/data/array-object/shuffle.js +0 -9
- package/dist/functions/data/array-object/shuffle.js.map +0 -1
- package/dist/functions/data/array-object/sortBy.d.ts +0 -1
- package/dist/functions/data/array-object/sortBy.js +0 -13
- package/dist/functions/data/array-object/sortBy.js.map +0 -1
- package/dist/functions/data/array-object/unique.d.ts +0 -10
- package/dist/functions/data/array-object/unique.js +0 -85
- package/dist/functions/data/array-object/unique.js.map +0 -1
- package/dist/functions/data/date/dateRange.d.ts +0 -1
- package/dist/functions/data/date/dateRange.js +0 -18
- package/dist/functions/data/date/dateRange.js.map +0 -1
- package/dist/functions/data/date/formatDate.d.ts +0 -1
- package/dist/functions/data/date/formatDate.js +0 -21
- package/dist/functions/data/date/formatDate.js.map +0 -1
- package/dist/functions/data/date/timeAgo.d.ts +0 -1
- package/dist/functions/data/date/timeAgo.js +0 -49
- package/dist/functions/data/date/timeAgo.js.map +0 -1
- package/dist/functions/data/number/average.d.ts +0 -1
- package/dist/functions/data/number/average.js +0 -8
- package/dist/functions/data/number/average.js.map +0 -1
- package/dist/functions/data/number/clamp.d.ts +0 -1
- package/dist/functions/data/number/clamp.js +0 -7
- package/dist/functions/data/number/clamp.js.map +0 -1
- package/dist/functions/data/number/formatNumber.d.ts +0 -8
- package/dist/functions/data/number/formatNumber.js +0 -16
- package/dist/functions/data/number/formatNumber.js.map +0 -1
- package/dist/functions/data/number/median.d.ts +0 -1
- package/dist/functions/data/number/median.js +0 -14
- package/dist/functions/data/number/median.js.map +0 -1
- package/dist/functions/data/number/percentile.d.ts +0 -1
- package/dist/functions/data/number/percentile.js +0 -18
- package/dist/functions/data/number/percentile.js.map +0 -1
- package/dist/functions/data/number/random.d.ts +0 -4
- package/dist/functions/data/number/random.js +0 -9
- package/dist/functions/data/number/random.js.map +0 -1
- package/dist/functions/data/number/range.d.ts +0 -1
- package/dist/functions/data/number/range.js +0 -18
- package/dist/functions/data/number/range.js.map +0 -1
- package/dist/functions/data/number/sum.d.ts +0 -1
- package/dist/functions/data/number/sum.js +0 -4
- package/dist/functions/data/number/sum.js.map +0 -1
- package/dist/functions/data/randomRegion.d.ts +0 -24
- package/dist/functions/data/randomRegion.js +0 -74
- package/dist/functions/data/randomRegion.js.map +0 -1
- package/dist/functions/data/string/base64.d.ts +0 -5
- package/dist/functions/data/string/base64.js +0 -6
- package/dist/functions/data/string/base64.js.map +0 -1
- package/dist/functions/data/string/capitalize.d.ts +0 -1
- package/dist/functions/data/string/capitalize.js +0 -6
- package/dist/functions/data/string/capitalize.js.map +0 -1
- package/dist/functions/data/string/caseConverter.d.ts +0 -19
- package/dist/functions/data/string/caseConverter.js +0 -94
- package/dist/functions/data/string/caseConverter.js.map +0 -1
- package/dist/functions/data/string/desensitize.d.ts +0 -13
- package/dist/functions/data/string/desensitize.js +0 -107
- package/dist/functions/data/string/desensitize.js.map +0 -1
- package/dist/functions/data/string/htmlEscape.d.ts +0 -20
- package/dist/functions/data/string/htmlEscape.js +0 -80
- package/dist/functions/data/string/htmlEscape.js.map +0 -1
- package/dist/functions/data/string/levenshtein.d.ts +0 -1
- package/dist/functions/data/string/levenshtein.js +0 -27
- package/dist/functions/data/string/levenshtein.js.map +0 -1
- package/dist/functions/data/string/normalize.d.ts +0 -8
- package/dist/functions/data/string/normalize.js +0 -37
- package/dist/functions/data/string/normalize.js.map +0 -1
- package/dist/functions/data/string/pad.d.ts +0 -13
- package/dist/functions/data/string/pad.js +0 -50
- package/dist/functions/data/string/pad.js.map +0 -1
- package/dist/functions/data/string/palindrome.d.ts +0 -3
- package/dist/functions/data/string/palindrome.js +0 -15
- package/dist/functions/data/string/palindrome.js.map +0 -1
- package/dist/functions/data/string/similarity.d.ts +0 -1
- package/dist/functions/data/string/similarity.js +0 -13
- package/dist/functions/data/string/similarity.js.map +0 -1
- package/dist/functions/data/string/template.d.ts +0 -4
- package/dist/functions/data/string/template.js +0 -21
- package/dist/functions/data/string/template.js.map +0 -1
- package/dist/functions/data/string/testRegex.d.ts +0 -20
- package/dist/functions/data/string/testRegex.js +0 -300
- package/dist/functions/data/string/testRegex.js.map +0 -1
- package/dist/functions/data/string/wordCount.d.ts +0 -5
- package/dist/functions/data/string/wordCount.js +0 -11
- package/dist/functions/data/string/wordCount.js.map +0 -1
- package/dist/functions/data/tree/buildTree.d.ts +0 -7
- package/dist/functions/data/tree/buildTree.js +0 -27
- package/dist/functions/data/tree/buildTree.js.map +0 -1
- package/dist/functions/data/tree/filterTree.d.ts +0 -4
- package/dist/functions/data/tree/filterTree.js +0 -21
- package/dist/functions/data/tree/filterTree.js.map +0 -1
- package/dist/functions/data/tree/findNode.d.ts +0 -4
- package/dist/functions/data/tree/findNode.js +0 -21
- package/dist/functions/data/tree/findNode.js.map +0 -1
- package/dist/functions/data/tree/flattenTree.d.ts +0 -6
- package/dist/functions/data/tree/flattenTree.js +0 -21
- package/dist/functions/data/tree/flattenTree.js.map +0 -1
- package/dist/functions/file/walk.d.ts +0 -18
- package/dist/functions/file/walk.js +0 -58
- package/dist/functions/file/walk.js.map +0 -1
- package/dist/functions/hybrid/detectBridgeEnvironment.d.ts +0 -11
- package/dist/functions/hybrid/detectBridgeEnvironment.js +0 -26
- package/dist/functions/hybrid/detectBridgeEnvironment.js.map +0 -1
- package/dist/functions/integrations/ag-grid/generateLicense.d.ts +0 -7
- package/dist/functions/integrations/ag-grid/generateLicense.js +0 -12
- package/dist/functions/integrations/ag-grid/generateLicense.js.map +0 -1
- package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.d.ts +0 -30
- package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.js +0 -884
- package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.js.map +0 -1
- package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.d.ts +0 -31
- package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.js +0 -900
- package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.js.map +0 -1
- package/dist/functions/integrations/uniapp/build.d.ts +0 -21
- package/dist/functions/integrations/uniapp/build.js +0 -83
- package/dist/functions/integrations/uniapp/build.js.map +0 -1
- package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.d.ts +0 -11
- package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.js +0 -30
- package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.js.map +0 -1
- package/dist/functions/integrations/uniapp/detectProjectType.d.ts +0 -20
- package/dist/functions/integrations/uniapp/detectProjectType.js +0 -68
- package/dist/functions/integrations/uniapp/detectProjectType.js.map +0 -1
- package/dist/functions/integrations/uniapp/parseManifest.d.ts +0 -20
- package/dist/functions/integrations/uniapp/parseManifest.js +0 -51
- package/dist/functions/integrations/uniapp/parseManifest.js.map +0 -1
- package/dist/functions/integrations/uniapp/waitForPages.d.ts +0 -7
- package/dist/functions/integrations/uniapp/waitForPages.js +0 -20
- package/dist/functions/integrations/uniapp/waitForPages.js.map +0 -1
- package/dist/functions/integrations/vue/dynamicMount.d.ts +0 -18
- package/dist/functions/integrations/vue/dynamicMount.js +0 -25
- package/dist/functions/integrations/vue/dynamicMount.js.map +0 -1
- package/dist/functions/integrations/vue/extractColorsFromVueFile.d.ts +0 -3
- package/dist/functions/integrations/vue/extractColorsFromVueFile.js +0 -18
- package/dist/functions/integrations/vue/extractColorsFromVueFile.js.map +0 -1
- package/dist/functions/integrations/vue/extractColorsFromVueSection.d.ts +0 -3
- package/dist/functions/integrations/vue/extractColorsFromVueSection.js +0 -53
- package/dist/functions/integrations/vue/extractColorsFromVueSection.js.map +0 -1
- package/dist/functions/integrations/vue/filterSections.d.ts +0 -2
- package/dist/functions/integrations/vue/filterSections.js +0 -11
- package/dist/functions/integrations/vue/filterSections.js.map +0 -1
- package/dist/functions/integrations/vue/isVNode.d.ts +0 -2
- package/dist/functions/integrations/vue/isVNode.js +0 -6
- package/dist/functions/integrations/vue/isVNode.js.map +0 -1
- package/dist/functions/integrations/vue/isVueComponent.d.ts +0 -2
- package/dist/functions/integrations/vue/isVueComponent.js +0 -6
- package/dist/functions/integrations/vue/isVueComponent.js.map +0 -1
- package/dist/functions/integrations/vue/parseVueFile.d.ts +0 -2
- package/dist/functions/integrations/vue/parseVueFile.js +0 -53
- package/dist/functions/integrations/vue/parseVueFile.js.map +0 -1
- package/dist/functions/integrations/wechat/miniapp/downloadFile.d.ts +0 -6
- package/dist/functions/integrations/wechat/miniapp/downloadFile.js +0 -39
- package/dist/functions/integrations/wechat/miniapp/downloadFile.js.map +0 -1
- package/dist/functions/patterns/MyPromise.d.ts +0 -32
- package/dist/functions/patterns/MyPromise.js +0 -254
- package/dist/functions/patterns/MyPromise.js.map +0 -1
- package/dist/functions/patterns/functionBind.d.ts +0 -4
- package/dist/functions/patterns/functionBind.js +0 -33
- package/dist/functions/patterns/functionBind.js.map +0 -1
- package/dist/functions/patterns/myInstanceof.d.ts +0 -5
- package/dist/functions/patterns/myInstanceof.js +0 -56
- package/dist/functions/patterns/myInstanceof.js.map +0 -1
- package/dist/functions/patterns/myNew.d.ts +0 -3
- package/dist/functions/patterns/myNew.js +0 -19
- package/dist/functions/patterns/myNew.js.map +0 -1
- package/dist/functions/platform/android/buildProject.d.ts +0 -13
- package/dist/functions/platform/android/buildProject.js +0 -122
- package/dist/functions/platform/android/buildProject.js.map +0 -1
- package/dist/functions/platform/android/configureAppIcon.d.ts +0 -17
- package/dist/functions/platform/android/configureAppIcon.js +0 -106
- package/dist/functions/platform/android/configureAppIcon.js.map +0 -1
- package/dist/functions/platform/android/configureLaunchScreen.d.ts +0 -21
- package/dist/functions/platform/android/configureLaunchScreen.js +0 -328
- package/dist/functions/platform/android/configureLaunchScreen.js.map +0 -1
- package/dist/functions/platform/android/detectAndroidModules.d.ts +0 -8
- package/dist/functions/platform/android/detectAndroidModules.js +0 -21
- package/dist/functions/platform/android/detectAndroidModules.js.map +0 -1
- package/dist/functions/platform/android/integrateFacebookLogin.d.ts +0 -12
- package/dist/functions/platform/android/integrateFacebookLogin.js +0 -91
- package/dist/functions/platform/android/integrateFacebookLogin.js.map +0 -1
- package/dist/functions/platform/android/integrateGoogleLogin.d.ts +0 -10
- package/dist/functions/platform/android/integrateGoogleLogin.js +0 -199
- package/dist/functions/platform/android/integrateGoogleLogin.js.map +0 -1
- package/dist/functions/platform/android/integrateMiuiLogin.d.ts +0 -13
- package/dist/functions/platform/android/integrateMiuiLogin.js +0 -115
- package/dist/functions/platform/android/integrateMiuiLogin.js.map +0 -1
- package/dist/functions/platform/android/integrateQQLogin.d.ts +0 -12
- package/dist/functions/platform/android/integrateQQLogin.js +0 -130
- package/dist/functions/platform/android/integrateQQLogin.js.map +0 -1
- package/dist/functions/platform/android/integrateShareTrace.d.ts +0 -10
- package/dist/functions/platform/android/integrateShareTrace.js +0 -181
- package/dist/functions/platform/android/integrateShareTrace.js.map +0 -1
- package/dist/functions/platform/android/integrateSinaLogin.d.ts +0 -13
- package/dist/functions/platform/android/integrateSinaLogin.js +0 -85
- package/dist/functions/platform/android/integrateSinaLogin.js.map +0 -1
- package/dist/functions/platform/android/integrateThirdPartyModule.d.ts +0 -46
- package/dist/functions/platform/android/integrateThirdPartyModule.js +0 -251
- package/dist/functions/platform/android/integrateThirdPartyModule.js.map +0 -1
- package/dist/functions/platform/android/integrateUniAppNativePlugin.d.ts +0 -22
- package/dist/functions/platform/android/integrateUniAppNativePlugin.js +0 -631
- package/dist/functions/platform/android/integrateUniAppNativePlugin.js.map +0 -1
- package/dist/functions/platform/android/integrateUniverifyLogin.d.ts +0 -11
- package/dist/functions/platform/android/integrateUniverifyLogin.js +0 -314
- package/dist/functions/platform/android/integrateUniverifyLogin.js.map +0 -1
- package/dist/functions/platform/android/integrateWechatLogin.d.ts +0 -13
- package/dist/functions/platform/android/integrateWechatLogin.js +0 -154
- package/dist/functions/platform/android/integrateWechatLogin.js.map +0 -1
- package/dist/functions/platform/android/integrateWechatShare.d.ts +0 -13
- package/dist/functions/platform/android/integrateWechatShare.js +0 -154
- package/dist/functions/platform/android/integrateWechatShare.js.map +0 -1
- package/dist/functions/platform/android/modifyGradle.d.ts +0 -28
- package/dist/functions/platform/android/modifyGradle.js +0 -119
- package/dist/functions/platform/android/modifyGradle.js.map +0 -1
- package/dist/functions/platform/android/modifyManifest.d.ts +0 -39
- package/dist/functions/platform/android/modifyManifest.js +0 -225
- package/dist/functions/platform/android/modifyManifest.js.map +0 -1
- package/dist/functions/platform/android/permission.d.ts +0 -54
- package/dist/functions/platform/android/permission.js +0 -85
- package/dist/functions/platform/android/permission.js.map +0 -1
- package/dist/functions/platform/ios/configureAppIcon.d.ts +0 -17
- package/dist/functions/platform/ios/configureAppIcon.js +0 -149
- package/dist/functions/platform/ios/configureAppIcon.js.map +0 -1
- package/dist/functions/platform/ios/configureLaunchScreen.d.ts +0 -17
- package/dist/functions/platform/ios/configureLaunchScreen.js +0 -150
- package/dist/functions/platform/ios/configureLaunchScreen.js.map +0 -1
- package/dist/functions/platform/ios/configurePermissions.d.ts +0 -19
- package/dist/functions/platform/ios/configurePermissions.js +0 -120
- package/dist/functions/platform/ios/configurePermissions.js.map +0 -1
- package/dist/functions/platform/ios/integrateNativePlugin.d.ts +0 -35
- package/dist/functions/platform/ios/integrateNativePlugin.js +0 -994
- package/dist/functions/platform/ios/integrateNativePlugin.js.map +0 -1
- package/dist/functions/platform/ios/integrateQQShare.d.ts +0 -14
- package/dist/functions/platform/ios/integrateQQShare.js +0 -132
- package/dist/functions/platform/ios/integrateQQShare.js.map +0 -1
- package/dist/functions/platform/ios/integrateSinaShare.d.ts +0 -16
- package/dist/functions/platform/ios/integrateSinaShare.js +0 -108
- package/dist/functions/platform/ios/integrateSinaShare.js.map +0 -1
- package/dist/functions/platform/ios/integrateThirdPartyModule.d.ts +0 -62
- package/dist/functions/platform/ios/integrateThirdPartyModule.js +0 -883
- package/dist/functions/platform/ios/integrateThirdPartyModule.js.map +0 -1
- package/dist/functions/platform/ios/integrateWechatOauth.d.ts +0 -14
- package/dist/functions/platform/ios/integrateWechatOauth.js +0 -107
- package/dist/functions/platform/ios/integrateWechatOauth.js.map +0 -1
- package/dist/functions/platform/ios/integrateWechatShare.d.ts +0 -14
- package/dist/functions/platform/ios/integrateWechatShare.js +0 -101
- package/dist/functions/platform/ios/integrateWechatShare.js.map +0 -1
- package/dist/functions/platform/ios/modifyInfoPlistKeyValue.d.ts +0 -2
- package/dist/functions/platform/ios/modifyInfoPlistKeyValue.js +0 -45
- package/dist/functions/platform/ios/modifyInfoPlistKeyValue.js.map +0 -1
- package/dist/functions/platform/ios/safelyModifyProjectPbxproj.d.ts +0 -16
- package/dist/functions/platform/ios/safelyModifyProjectPbxproj.js +0 -136
- package/dist/functions/platform/ios/safelyModifyProjectPbxproj.js.map +0 -1
- package/dist/functions/platform/ios/useAltool.d.ts +0 -39
- package/dist/functions/platform/ios/useAltool.js +0 -350
- package/dist/functions/platform/ios/useAltool.js.map +0 -1
- package/dist/functions/style/buildTokens.d.ts +0 -76
- package/dist/functions/style/buildTokens.js +0 -183
- package/dist/functions/style/buildTokens.js.map +0 -1
- package/dist/functions/style/extractCssVariables.d.ts +0 -16
- package/dist/functions/style/extractCssVariables.js +0 -256
- package/dist/functions/style/extractCssVariables.js.map +0 -1
- package/dist/functions/style/generateVariables.d.ts +0 -7
- package/dist/functions/style/generateVariables.js +0 -135
- package/dist/functions/style/generateVariables.js.map +0 -1
- package/dist/functions/style/mixColors.d.ts +0 -1
- package/dist/functions/style/mixColors.js +0 -38
- package/dist/functions/style/mixColors.js.map +0 -1
- package/dist/functions/style/parseDesignTokens.d.ts +0 -10
- package/dist/functions/style/parseDesignTokens.js +0 -216
- package/dist/functions/style/parseDesignTokens.js.map +0 -1
- package/dist/functions/uniapp/app-plus/buildAndroidPlugin.d.ts +0 -3
- package/dist/functions/uniapp/app-plus/buildAndroidPlugin.js +0 -509
- package/dist/functions/uniapp/app-plus/buildAndroidPlugin.js.map +0 -1
- package/dist/functions/uniapp/app-plus/buildIOSPlugin.d.ts +0 -3
- package/dist/functions/uniapp/app-plus/buildIOSPlugin.js +0 -406
- package/dist/functions/uniapp/app-plus/buildIOSPlugin.js.map +0 -1
- package/dist/functions/validation/parseJwtPayload.d.ts +0 -7
- package/dist/functions/validation/parseJwtPayload.js +0 -33
- package/dist/functions/validation/parseJwtPayload.js.map +0 -1
- package/dist/functions/validation/validate.d.ts +0 -11
- package/dist/functions/validation/validate.js +0 -44
- package/dist/functions/validation/validate.js.map +0 -1
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
import { build } from '../build';
|
|
2
|
-
import { integrateNativePluginIOS } from '../../ios/integrateNativePlugin';
|
|
3
|
-
import { modifyInfoPlistKeyValue } from '../../ios/modifyInfoPlistKeyValue';
|
|
4
|
-
import { safelyModifyProjectPbxproj } from '../../ios/safelyModifyProjectPbxproj';
|
|
5
|
-
export async function buildIOSPlugin(options, deps) {
|
|
6
|
-
const logs = [];
|
|
7
|
-
if (!options.uniappProjectPath) {
|
|
8
|
-
return {
|
|
9
|
-
success: false,
|
|
10
|
-
error: 'uniappProjectPath 是必需的',
|
|
11
|
-
logs
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
if (!options.projectPath) {
|
|
15
|
-
return {
|
|
16
|
-
success: false,
|
|
17
|
-
error: 'projectPath 是必需的',
|
|
18
|
-
logs
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
if (!options.uniAppId) {
|
|
22
|
-
return {
|
|
23
|
-
success: false,
|
|
24
|
-
error: 'uniAppId 是必需的',
|
|
25
|
-
logs
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
if (!options.displayName) {
|
|
29
|
-
return {
|
|
30
|
-
success: false,
|
|
31
|
-
error: 'displayName 是必需的',
|
|
32
|
-
logs
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
try {
|
|
36
|
-
const version = options.versionName || '1.0.0';
|
|
37
|
-
const buildNumber = options.versionCode || '1';
|
|
38
|
-
const projectFiles = deps.readdirSync(options.projectPath).filter(file => file.endsWith('.xcodeproj'));
|
|
39
|
-
if (projectFiles.length === 0) {
|
|
40
|
-
return {
|
|
41
|
-
success: false,
|
|
42
|
-
error: `在 ${options.projectPath} 中未找到 Xcode 项目文件(.xcodeproj)`,
|
|
43
|
-
logs
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
const projectFile = projectFiles[0];
|
|
47
|
-
const projectName = options.sourceDirectoryName || projectFile.replace(/\.xcodeproj$/, '');
|
|
48
|
-
logs.push(`找到 Xcode 项目: ${projectFile}`);
|
|
49
|
-
if (options.sourceDirectoryName) {
|
|
50
|
-
logs.push(`使用指定的源码目录: ${projectName}`);
|
|
51
|
-
}
|
|
52
|
-
logs.push('步骤 1: 同步 project.pbxproj 版本配置');
|
|
53
|
-
const projectPbxprojPath = deps.join(options.projectPath, projectFile, 'project.pbxproj');
|
|
54
|
-
const pbxprojResult = safelyModifyProjectPbxproj(projectPbxprojPath, {
|
|
55
|
-
bundleId: options.bundleId,
|
|
56
|
-
version,
|
|
57
|
-
buildNumber,
|
|
58
|
-
teamId: options.signing?.teamId,
|
|
59
|
-
codeSignIdentity: 'Apple Development'
|
|
60
|
-
}, {
|
|
61
|
-
existsSync: deps.existsSync,
|
|
62
|
-
readFileSync: deps.readFileSync,
|
|
63
|
-
writeFileSync: deps.writeFileSync
|
|
64
|
-
});
|
|
65
|
-
if (pbxprojResult.success) {
|
|
66
|
-
logs.push('project.pbxproj 版本配置同步完成');
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
logs.push(`project.pbxproj 版本配置同步失败: ${pbxprojResult.error}`);
|
|
70
|
-
}
|
|
71
|
-
logs.push('步骤 2: 修改 Info.plist 配置');
|
|
72
|
-
const infoPlistPath = deps.join(options.projectPath, projectName, `${projectName}-Info.plist`);
|
|
73
|
-
if (deps.existsSync(infoPlistPath)) {
|
|
74
|
-
try {
|
|
75
|
-
const xmlContent = deps.readFileSync(infoPlistPath, 'utf8');
|
|
76
|
-
const parser = new deps.xmlParser();
|
|
77
|
-
const xmlDoc = parser.parseFromString(xmlContent, 'text/xml');
|
|
78
|
-
if (options.appkey) {
|
|
79
|
-
modifyInfoPlistKeyValue(xmlDoc, 'dcloud_appkey', options.appkey, 'string');
|
|
80
|
-
}
|
|
81
|
-
if (options.bundleId) {
|
|
82
|
-
modifyInfoPlistKeyValue(xmlDoc, 'CFBundleIdentifier', options.bundleId, 'string');
|
|
83
|
-
}
|
|
84
|
-
if (version) {
|
|
85
|
-
modifyInfoPlistKeyValue(xmlDoc, 'CFBundleShortVersionString', version, 'string');
|
|
86
|
-
}
|
|
87
|
-
if (buildNumber) {
|
|
88
|
-
modifyInfoPlistKeyValue(xmlDoc, 'CFBundleVersion', buildNumber, 'string');
|
|
89
|
-
}
|
|
90
|
-
if (options.displayName) {
|
|
91
|
-
modifyInfoPlistKeyValue(xmlDoc, 'CFBundleDisplayName', options.displayName, 'string');
|
|
92
|
-
}
|
|
93
|
-
modifyInfoPlistKeyValue(xmlDoc, 'UIFileSharingEnabled', true, 'true');
|
|
94
|
-
logs.push('已启用 Application supports iTunes file sharing(插件开发必需)');
|
|
95
|
-
const serializer = new deps.xmlSerializer();
|
|
96
|
-
const newXmlContent = serializer.serializeToString(xmlDoc);
|
|
97
|
-
deps.writeFileSync(infoPlistPath, newXmlContent, 'utf8');
|
|
98
|
-
logs.push('Info.plist 配置完成');
|
|
99
|
-
}
|
|
100
|
-
catch (error) {
|
|
101
|
-
logs.push(`配置 Info.plist 失败: ${error instanceof Error ? error.message : String(error)}`);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
if (options.displayName) {
|
|
105
|
-
logs.push('步骤 2.1: 修改本地化字符串文件');
|
|
106
|
-
const projectDir = deps.join(options.projectPath, projectName);
|
|
107
|
-
const lprojDirs = ['en.lproj', 'zh-Hans.lproj', 'zh-Hant.lproj', 'Base.lproj', 'English.lproj'];
|
|
108
|
-
for (const lprojDir of lprojDirs) {
|
|
109
|
-
const infoPlistStringsPath = deps.join(projectDir, lprojDir, 'InfoPlist.strings');
|
|
110
|
-
if (deps.existsSync(infoPlistStringsPath)) {
|
|
111
|
-
try {
|
|
112
|
-
let content = deps.readFileSync(infoPlistStringsPath, 'utf8');
|
|
113
|
-
const regex = /CFBundleDisplayName\s*=\s*"[^"]*"/;
|
|
114
|
-
if (regex.test(content)) {
|
|
115
|
-
content = content.replace(regex, `CFBundleDisplayName="${options.displayName}"`);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
content += `\nCFBundleDisplayName="${options.displayName}";\n`;
|
|
119
|
-
}
|
|
120
|
-
deps.writeFileSync(infoPlistStringsPath, content, 'utf8');
|
|
121
|
-
logs.push(`已更新 ${lprojDir}/InfoPlist.strings`);
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
logs.push(`更新 ${lprojDir}/InfoPlist.strings 失败: ${error instanceof Error ? error.message : String(error)}`);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
logs.push('步骤 3: 配置自定义基座(control.xml)');
|
|
130
|
-
const controlXmlPath = deps.join(options.projectPath, projectName, 'control.xml');
|
|
131
|
-
if (deps.existsSync(controlXmlPath)) {
|
|
132
|
-
try {
|
|
133
|
-
const xmlContent = deps.readFileSync(controlXmlPath, 'utf8');
|
|
134
|
-
const parser = new deps.xmlParser();
|
|
135
|
-
const xmlDoc = parser.parseFromString(xmlContent, 'text/xml');
|
|
136
|
-
const hbuilderElements = xmlDoc.getElementsByTagName('HBuilder');
|
|
137
|
-
if (hbuilderElements.length > 0) {
|
|
138
|
-
const hbuilderElement = hbuilderElements[0];
|
|
139
|
-
let hasChanges = false;
|
|
140
|
-
if (hbuilderElement.getAttribute('debug') !== 'true') {
|
|
141
|
-
hbuilderElement.setAttribute('debug', 'true');
|
|
142
|
-
hasChanges = true;
|
|
143
|
-
}
|
|
144
|
-
if (hbuilderElement.getAttribute('syncDebug') !== 'true') {
|
|
145
|
-
hbuilderElement.setAttribute('syncDebug', 'true');
|
|
146
|
-
hasChanges = true;
|
|
147
|
-
}
|
|
148
|
-
if (hasChanges) {
|
|
149
|
-
const serializer = new deps.xmlSerializer();
|
|
150
|
-
const newXmlContent = serializer.serializeToString(xmlDoc);
|
|
151
|
-
deps.writeFileSync(controlXmlPath, newXmlContent, 'utf8');
|
|
152
|
-
logs.push('control.xml 自定义基座配置完成:debug="true" syncDebug="true"');
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
logs.push('control.xml 自定义基座配置已存在,无需修改');
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
logs.push('警告:未找到 HBuilder 根节点,无法添加自定义基座配置');
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
catch (error) {
|
|
163
|
-
logs.push(`配置 control.xml 失败: ${error instanceof Error ? error.message : String(error)}`);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
logs.push('步骤 4: 编译 UniApp 项目并复制到 apps 目录');
|
|
167
|
-
let sourcePath;
|
|
168
|
-
if (options.uniappBuildOutputPath) {
|
|
169
|
-
logs.push('使用提供的 UniApp 编译结果路径');
|
|
170
|
-
sourcePath = options.uniappBuildOutputPath;
|
|
171
|
-
if (!deps.existsSync(sourcePath)) {
|
|
172
|
-
return {
|
|
173
|
-
success: false,
|
|
174
|
-
error: `提供的编译结果路径不存在: ${sourcePath}`,
|
|
175
|
-
logs
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
logs.push(`使用编译结果路径: ${sourcePath}`);
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
logs.push('构建 UniApp 项目');
|
|
182
|
-
const buildDeps = {
|
|
183
|
-
exec: deps.exec,
|
|
184
|
-
join: deps.join,
|
|
185
|
-
existsSync: deps.existsSync,
|
|
186
|
-
setTimeout: deps.setTimeout
|
|
187
|
-
};
|
|
188
|
-
const uniBuildResult = await build(options.uniappProjectPath, 'app-plus', buildDeps);
|
|
189
|
-
if (!uniBuildResult.success) {
|
|
190
|
-
return {
|
|
191
|
-
success: false,
|
|
192
|
-
error: `构建失败: ${uniBuildResult.error}`,
|
|
193
|
-
logs: [...logs, ...uniBuildResult.logs]
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
logs.push(...uniBuildResult.logs);
|
|
197
|
-
sourcePath = deps.join(options.uniappProjectPath, 'dist', 'build', 'app');
|
|
198
|
-
}
|
|
199
|
-
const targetPath = deps.join(options.projectPath, projectName, 'Pandora', 'apps', options.uniAppId, 'www');
|
|
200
|
-
try {
|
|
201
|
-
const targetDir = deps.dirname(targetPath);
|
|
202
|
-
if (!deps.existsSync(targetDir)) {
|
|
203
|
-
deps.mkdirSync(targetDir, { recursive: true });
|
|
204
|
-
}
|
|
205
|
-
await deps.cp(sourcePath, targetPath, { recursive: true, force: true });
|
|
206
|
-
logs.push('应用资源复制完成');
|
|
207
|
-
}
|
|
208
|
-
catch (error) {
|
|
209
|
-
return {
|
|
210
|
-
success: false,
|
|
211
|
-
error: `复制应用资源失败: ${error instanceof Error ? error.message : String(error)}`,
|
|
212
|
-
logs
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
if (deps.existsSync(controlXmlPath)) {
|
|
216
|
-
try {
|
|
217
|
-
const xmlContent = deps.readFileSync(controlXmlPath, 'utf8');
|
|
218
|
-
const parser = new deps.xmlParser();
|
|
219
|
-
const xmlDoc = parser.parseFromString(xmlContent, 'text/xml');
|
|
220
|
-
const appsElements = xmlDoc.getElementsByTagName('apps');
|
|
221
|
-
if (appsElements.length > 0) {
|
|
222
|
-
const appsElement = appsElements[0];
|
|
223
|
-
const existingAppElements = appsElement.getElementsByTagName('app');
|
|
224
|
-
let appExists = false;
|
|
225
|
-
let hasChanges = false;
|
|
226
|
-
for (let i = 0; i < existingAppElements.length; i++) {
|
|
227
|
-
const appElement = existingAppElements[i];
|
|
228
|
-
if (appElement.getAttribute('appid') === options.uniAppId) {
|
|
229
|
-
appExists = true;
|
|
230
|
-
if (appElement.getAttribute('appver') !== '') {
|
|
231
|
-
appElement.setAttribute('appver', '');
|
|
232
|
-
hasChanges = true;
|
|
233
|
-
}
|
|
234
|
-
if (options.appkey && appElement.getAttribute('appkey') !== options.appkey) {
|
|
235
|
-
appElement.setAttribute('appkey', options.appkey);
|
|
236
|
-
hasChanges = true;
|
|
237
|
-
logs.push(`更新 appkey: ${options.appkey}`);
|
|
238
|
-
}
|
|
239
|
-
if (hasChanges) {
|
|
240
|
-
logs.push(`更新现有 app 元素,appid: ${options.uniAppId}`);
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
logs.push(`app 元素已存在且配置正确,appid: ${options.uniAppId}`);
|
|
244
|
-
}
|
|
245
|
-
break;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
if (!appExists) {
|
|
249
|
-
while (existingAppElements.length > 0) {
|
|
250
|
-
appsElement.removeChild(existingAppElements[0]);
|
|
251
|
-
}
|
|
252
|
-
logs.push('已删除所有现有的 app 元素');
|
|
253
|
-
const newAppElement = xmlDoc.createElement('app');
|
|
254
|
-
newAppElement.setAttribute('appid', options.uniAppId);
|
|
255
|
-
newAppElement.setAttribute('appver', '');
|
|
256
|
-
if (options.appkey) {
|
|
257
|
-
newAppElement.setAttribute('appkey', options.appkey);
|
|
258
|
-
logs.push(`设置 appkey: ${options.appkey}`);
|
|
259
|
-
}
|
|
260
|
-
appsElement.appendChild(newAppElement);
|
|
261
|
-
logs.push(`添加新的 app 元素,appid: ${options.uniAppId}`);
|
|
262
|
-
hasChanges = true;
|
|
263
|
-
}
|
|
264
|
-
if (hasChanges || !appExists) {
|
|
265
|
-
const serializer = new deps.xmlSerializer();
|
|
266
|
-
const newXmlContent = serializer.serializeToString(xmlDoc);
|
|
267
|
-
deps.writeFileSync(controlXmlPath, newXmlContent, 'utf8');
|
|
268
|
-
logs.push(`control.xml appid 配置完成,appid: ${options.uniAppId}`);
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
logs.push(`control.xml appid 配置已存在,无需修改`);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
275
|
-
logs.push('control.xml 中未找到 apps 元素');
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
catch (error) {
|
|
279
|
-
logs.push(`配置 control.xml appid 失败: ${error instanceof Error ? error.message : String(error)}`);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
if (options.nativePlugins && options.nativePlugins.length > 0) {
|
|
283
|
-
logs.push('步骤 5: 集成 UniApp 原生插件');
|
|
284
|
-
for (const pluginConfig of options.nativePlugins) {
|
|
285
|
-
const pluginResult = await integrateNativePluginIOS(options.projectPath, projectName, pluginConfig.pluginPath, {
|
|
286
|
-
existsSync: deps.existsSync,
|
|
287
|
-
readFileSync: deps.readFileSync,
|
|
288
|
-
writeFileSync: deps.writeFileSync,
|
|
289
|
-
copyFileSync: deps.copyFileSync,
|
|
290
|
-
statSync: deps.statSync,
|
|
291
|
-
mkdirSync: deps.mkdirSync,
|
|
292
|
-
readdirSync: deps.readdirSync,
|
|
293
|
-
cp: deps.cp,
|
|
294
|
-
join: deps.join,
|
|
295
|
-
dirname: deps.dirname,
|
|
296
|
-
basename: deps.basename,
|
|
297
|
-
exec: deps.exec,
|
|
298
|
-
parse: deps.parse,
|
|
299
|
-
xmlParser: deps.xmlParser,
|
|
300
|
-
xmlSerializer: deps.xmlSerializer
|
|
301
|
-
}, pluginConfig.parameters);
|
|
302
|
-
if (pluginResult.success) {
|
|
303
|
-
logs.push(`原生插件集成完成: ${pluginConfig.pluginPath}`);
|
|
304
|
-
logs.push(...pluginResult.logs);
|
|
305
|
-
}
|
|
306
|
-
else {
|
|
307
|
-
logs.push(`原生插件集成失败: ${pluginResult.error}`);
|
|
308
|
-
logs.push(...pluginResult.logs);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
logs.push('步骤 6: 编译 iOS 插件项目');
|
|
313
|
-
const configuration = options.configuration || 'Debug';
|
|
314
|
-
const scheme = options.scheme || projectName;
|
|
315
|
-
logs.push(`提示: 签名配置必须在 Xcode 中手动设置`);
|
|
316
|
-
logs.push(`提示: 请打开项目 ${projectFile},在 Signing & Capabilities 中配置 Team`);
|
|
317
|
-
if (options.signing?.teamId) {
|
|
318
|
-
logs.push(`提示: 开发团队 ID 应该是: ${options.signing.teamId}`);
|
|
319
|
-
}
|
|
320
|
-
const buildBasePath = deps.join(options.outputPath || options.projectPath, 'build');
|
|
321
|
-
const archivePath = deps.join(buildBasePath, `${projectName}.xcarchive`);
|
|
322
|
-
if (options.clean) {
|
|
323
|
-
logs.push('清理构建目录');
|
|
324
|
-
const cleanCommand = `cd "${options.projectPath}" && xcodebuild -project "${projectFile}" -scheme "${scheme}" -destination "generic/platform=iOS" clean`;
|
|
325
|
-
await new Promise((resolve) => {
|
|
326
|
-
deps.exec(cleanCommand, (error, stdout, stderr) => {
|
|
327
|
-
if (error) {
|
|
328
|
-
logs.push(`清理警告: ${error.message}`);
|
|
329
|
-
}
|
|
330
|
-
if (stdout)
|
|
331
|
-
logs.push(`清理输出: ${stdout}`);
|
|
332
|
-
resolve();
|
|
333
|
-
});
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
const buildCommand = `cd "${options.projectPath}" && xcodebuild -project "${projectFile}" -scheme "${scheme}" -configuration "${configuration}" -destination "generic/platform=iOS" -allowProvisioningUpdates -archivePath "${archivePath}" archive`;
|
|
337
|
-
logs.push(`执行构建命令: ${buildCommand}`);
|
|
338
|
-
const buildResult = await new Promise((resolve) => {
|
|
339
|
-
const child = deps.exec(buildCommand, (error, stdout, stderr) => {
|
|
340
|
-
const allOutput = stdout + (stderr ? '\n' + stderr : '');
|
|
341
|
-
if (error) {
|
|
342
|
-
logs.push(`构建错误: ${error.message}`);
|
|
343
|
-
if (stdout)
|
|
344
|
-
logs.push(`标准输出:\n${stdout}`);
|
|
345
|
-
if (stderr)
|
|
346
|
-
logs.push(`错误输出:\n${stderr}`);
|
|
347
|
-
const errorDetails = allOutput.includes('error:')
|
|
348
|
-
? allOutput.split('error:').slice(1).join('error:').split('\n').slice(0, 5).join('\n')
|
|
349
|
-
: (stderr || stdout || error.message);
|
|
350
|
-
resolve({
|
|
351
|
-
success: false,
|
|
352
|
-
error: error.message,
|
|
353
|
-
details: errorDetails
|
|
354
|
-
});
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
if (stdout)
|
|
358
|
-
logs.push(`构建输出:\n${stdout}`);
|
|
359
|
-
if (stderr)
|
|
360
|
-
logs.push(`警告信息:\n${stderr}`);
|
|
361
|
-
resolve({ success: true });
|
|
362
|
-
});
|
|
363
|
-
deps.setTimeout(() => {
|
|
364
|
-
child.kill();
|
|
365
|
-
resolve({ success: false, error: '构建超时' });
|
|
366
|
-
}, 600000);
|
|
367
|
-
});
|
|
368
|
-
if (!buildResult.success) {
|
|
369
|
-
const errorMessage = buildResult.details
|
|
370
|
-
? `编译失败: ${buildResult.error}\n详细信息:\n${buildResult.details}`
|
|
371
|
-
: `编译失败: ${buildResult.error}`;
|
|
372
|
-
return {
|
|
373
|
-
success: false,
|
|
374
|
-
error: errorMessage,
|
|
375
|
-
logs
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
if (!deps.existsSync(archivePath)) {
|
|
379
|
-
const errorMessage = `Archive 文件不存在: ${archivePath}`;
|
|
380
|
-
logs.push(errorMessage);
|
|
381
|
-
return {
|
|
382
|
-
success: false,
|
|
383
|
-
error: errorMessage,
|
|
384
|
-
logs
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
logs.push('iOS 插件项目编译完成');
|
|
388
|
-
logs.push(`Archive 文件: ${archivePath}`);
|
|
389
|
-
logs.push('\n💡 提示: 插件开发构建已完成,可以在 Xcode 中运行项目进行调试');
|
|
390
|
-
logs.push('💡 如需导出 IPA,请使用 buildIOSApp 函数并设置完整的签名配置');
|
|
391
|
-
return {
|
|
392
|
-
success: true,
|
|
393
|
-
outputPath: archivePath,
|
|
394
|
-
logs
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
catch (error) {
|
|
398
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
399
|
-
return {
|
|
400
|
-
success: false,
|
|
401
|
-
error: `构建过程中发生异常: ${errorMessage}`,
|
|
402
|
-
logs
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
//# sourceMappingURL=buildIOSPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildIOSPlugin.js","sourceRoot":"","sources":["../../../../src/functions/uniapp/app-plus/buildIOSPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEhC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAA;AAkBjF,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAAoC,EACpC,IAAqB;IAErB,MAAM,IAAI,GAAa,EAAE,CAAA;IAGzB,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;QAC/B,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,wBAAwB;YAC/B,IAAI;SACL,CAAA;IACH,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QACzB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,kBAAkB;YACzB,IAAI;SACL,CAAA;IACH,CAAC;IAGD,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACtB,OAAO;YACL,O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
|
2
|
-
export interface ParseJwtPayloadDeps {
|
|
3
|
-
base64Decode: (value: string) => string;
|
|
4
|
-
consoleError?: Console['error'];
|
|
5
|
-
}
|
|
6
|
-
export declare function parseJwtPayload<TPayload extends Record<string, any> = Record<string, any>>(token: string, deps: ParseJwtPayloadDeps): TPayload | null;
|
|
7
|
-
export declare function extractJwtSubject(token: string, deps: ParseJwtPayloadDeps): string | null;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export function parseJwtPayload(token, deps) {
|
|
2
|
-
if (!token)
|
|
3
|
-
return null;
|
|
4
|
-
const parts = token.split('.');
|
|
5
|
-
if (parts.length !== 3)
|
|
6
|
-
return null;
|
|
7
|
-
try {
|
|
8
|
-
const normalized = normalizeBase64Url(parts[1]);
|
|
9
|
-
const decoded = deps.base64Decode(normalized);
|
|
10
|
-
return JSON.parse(decoded);
|
|
11
|
-
}
|
|
12
|
-
catch (error) {
|
|
13
|
-
deps.consoleError?.('[parseJwtPayload] Failed to parse JWT payload', error);
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export function extractJwtSubject(token, deps) {
|
|
18
|
-
const payload = parseJwtPayload(token, deps);
|
|
19
|
-
return typeof payload?.sub === 'string' ? payload.sub : null;
|
|
20
|
-
}
|
|
21
|
-
function normalizeBase64Url(input) {
|
|
22
|
-
let output = input.replace(/-/g, '+').replace(/_/g, '/');
|
|
23
|
-
const pad = output.length % 4;
|
|
24
|
-
if (pad === 2)
|
|
25
|
-
output += '==';
|
|
26
|
-
else if (pad === 3)
|
|
27
|
-
output += '=';
|
|
28
|
-
else if (pad !== 0 && pad !== 2 && pad !== 3) {
|
|
29
|
-
output += '='.repeat((4 - pad) % 4);
|
|
30
|
-
}
|
|
31
|
-
return output;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=parseJwtPayload.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseJwtPayload.js","sourceRoot":"","sources":["../../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B,IAAI,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IACrC,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { URL } from '../../../references/url.d';
|
|
2
|
-
export declare const validate: {
|
|
3
|
-
isEmail(value: string): boolean;
|
|
4
|
-
isPhone(value: string): boolean;
|
|
5
|
-
isUrl(value: string, host: {
|
|
6
|
-
URL: typeof URL;
|
|
7
|
-
}): boolean;
|
|
8
|
-
isStrongPassword(value: string): boolean;
|
|
9
|
-
isIdCard(value: string): boolean;
|
|
10
|
-
isPostalCode(value: string): boolean;
|
|
11
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export const validate = {
|
|
2
|
-
isEmail(value) {
|
|
3
|
-
if (!value || typeof value !== 'string')
|
|
4
|
-
return false;
|
|
5
|
-
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
6
|
-
return emailRegex.test(value);
|
|
7
|
-
},
|
|
8
|
-
isPhone(value) {
|
|
9
|
-
if (!value || typeof value !== 'string')
|
|
10
|
-
return false;
|
|
11
|
-
const phoneRegex = /^1[3-9]\d{9}$/;
|
|
12
|
-
return phoneRegex.test(value);
|
|
13
|
-
},
|
|
14
|
-
isUrl(value, host) {
|
|
15
|
-
if (!value || typeof value !== 'string')
|
|
16
|
-
return false;
|
|
17
|
-
try {
|
|
18
|
-
new host.URL(value);
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
isStrongPassword(value) {
|
|
26
|
-
if (!value || typeof value !== 'string')
|
|
27
|
-
return false;
|
|
28
|
-
const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/;
|
|
29
|
-
return passwordRegex.test(value);
|
|
30
|
-
},
|
|
31
|
-
isIdCard(value) {
|
|
32
|
-
if (!value || typeof value !== 'string')
|
|
33
|
-
return false;
|
|
34
|
-
const idCardRegex = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
|
|
35
|
-
return idCardRegex.test(value);
|
|
36
|
-
},
|
|
37
|
-
isPostalCode(value) {
|
|
38
|
-
if (!value || typeof value !== 'string')
|
|
39
|
-
return false;
|
|
40
|
-
const postalCodeRegex = /^[1-9]\d{5}$/;
|
|
41
|
-
return postalCodeRegex.test(value);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=validate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/functions/validation/validate.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,QAAQ,GAAG;IAItB,OAAO,CAAC,KAAa;QACnB,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAA;QACrD,MAAM,UAAU,GAAG,4BAA4B,CAAA;QAC/C,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC/B,CAAC;IAKD,OAAO,CAAC,KAAa;QACnB,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAA;QACrD,MAAM,UAAU,GAAG,eAAe,CAAA;QAClC,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC/B,CAAC;IAKD,KAAK,CAAC,KAAa,EAAE,IAAyB;QAC5C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAA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