@smileid/usesmileid_vision_document 12.3.0 → 12.3.1-SNAPSHOT.49
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smileid/usesmileid_vision_document",
|
|
3
|
-
"version": "12.3.
|
|
3
|
+
"version": "12.3.1-SNAPSHOT.49",
|
|
4
4
|
"description": "Apple Vision document detection implementation for the UseSmileID React Native (Expo) SDK.",
|
|
5
5
|
"homepage": "https://usesmileid.com",
|
|
6
6
|
"repository": {
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"CHANGELOG.md"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@smileid/usesmileid_platform_interface": "12.3.
|
|
50
|
-
"@smileid/usesmileid_bridge": "12.3.
|
|
49
|
+
"@smileid/usesmileid_platform_interface": "12.3.1-SNAPSHOT.49",
|
|
50
|
+
"@smileid/usesmileid_bridge": "12.3.1-SNAPSHOT.49"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"expo": ">=56.0.0",
|
package/plugin/build/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(i,r,t,e){e===void 0&&(e=t);var o=Object.getOwnPropertyDescriptor(r,t);(!o||("get"in o?!r.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(i,e,o)}):(function(i,r,t,e){e===void 0&&(e=t),i[e]=r[t]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(i,r){Object.defineProperty(i,"default",{enumerable:!0,value:r})}):function(i,r){i.default=r}),__importStar=this&&this.__importStar||(function(){var i=function(r){return i=Object.getOwnPropertyNames||function(t){var e=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[e.length]=o);return e},i(r)};return function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e=i(r),o=0;o<e.length;o++)e[o]!=="default"&&__createBinding(t,r,e[o]);return __setModuleDefault(t,r),t}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.SPM_PRODUCTS=void 0;const config_plugins_1=require("expo/config-plugins"),fs=__importStar(require("fs")),path=__importStar(require("path")),deployment_target_1=require("./lib/deployment_target"),podfile_1=require("./lib/podfile"),signature_dedup_1=require("./lib/signature_dedup"),spm_1=require("./lib/spm"),IOS_DEPLOYMENT_TARGET="16.4",SMILE_ID_PACKAGE={url:"https://github.com/smileidentity/ios-spm",requirement:{kind:"exactVersion",version:"12.3.0"}},POD_TARGET="UseSmileIDVisionDocumentExpo";exports.SPM_PRODUCTS=["UseSmileIDVisionDocument"];const PODFILE_MARKER="usesmileid_vision_document",BRIDGE_POD_TARGET="UseSmileIDBridgeExpo",BRIDGE_SPM_PRODUCTS=["UseSmileIDBridge"],BRIDGE_PODFILE_MARKER="usesmileid_bridge",withVisionDocumentSpm=(i,r)=>(i=(0,deployment_target_1.withIosDeploymentTargetFloor)(i,IOS_DEPLOYMENT_TARGET),i=(0,config_plugins_1.withXcodeProject)(i,t=>{const e=t.modRequest.projectName;if(!e)throw new Error("[usesmileid_vision_document] Unable to resolve host app native target name from Expo config.");return(0,spm_1.linkSpmPackage)(t.modResults,SMILE_ID_PACKAGE,{targetName:e,products:[...exports.SPM_PRODUCTS]}),r?.iosSignatureAggregation==="disabled"?(0,signature_dedup_1.disableSignatureAggregation)(t.modResults,e):(0,signature_dedup_1.ensureSignatureDedupPhase)(t.modResults,e),t}),i=(0,config_plugins_1.withDangerousMod)(i,["ios",t=>{const e=path.join(t.modRequest.platformProjectRoot,"Podfile"),o=fs.readFileSync(e,"utf-8");let n=(0,podfile_1.injectPodfileSpmBlock)(o,{marker:PODFILE_MARKER,package:SMILE_ID_PACKAGE,podTarget:POD_TARGET,products:[...exports.SPM_PRODUCTS]});return n=(0,podfile_1.injectPodfileSpmBlock)(n,{marker:BRIDGE_PODFILE_MARKER,package:SMILE_ID_PACKAGE,podTarget:BRIDGE_POD_TARGET,products:[...BRIDGE_SPM_PRODUCTS],required:!0}),n=(0,podfile_1.injectPodfileKameraLinkBlock)(n),n=(0,podfile_1.injectPodfileSignatureDedupBlock)(n),n!==o&&fs.writeFileSync(e,n),t}]),i);exports.default=withVisionDocumentSpm;
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(i,r,t,e){e===void 0&&(e=t);var o=Object.getOwnPropertyDescriptor(r,t);(!o||("get"in o?!r.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(i,e,o)}):(function(i,r,t,e){e===void 0&&(e=t),i[e]=r[t]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(i,r){Object.defineProperty(i,"default",{enumerable:!0,value:r})}):function(i,r){i.default=r}),__importStar=this&&this.__importStar||(function(){var i=function(r){return i=Object.getOwnPropertyNames||function(t){var e=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[e.length]=o);return e},i(r)};return function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e=i(r),o=0;o<e.length;o++)e[o]!=="default"&&__createBinding(t,r,e[o]);return __setModuleDefault(t,r),t}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.SPM_PRODUCTS=void 0;const config_plugins_1=require("expo/config-plugins"),fs=__importStar(require("fs")),path=__importStar(require("path")),deployment_target_1=require("./lib/deployment_target"),podfile_1=require("./lib/podfile"),signature_dedup_1=require("./lib/signature_dedup"),spm_1=require("./lib/spm"),IOS_DEPLOYMENT_TARGET="16.4",SMILE_ID_PACKAGE={url:"https://github.com/smileidentity/ios-spm",requirement:{kind:"exactVersion",version:"12.3.0"}},POD_TARGET="UseSmileIDVisionDocumentExpo";exports.SPM_PRODUCTS=["UseSmileIDVisionDocument"];const PODFILE_MARKER="usesmileid_vision_document",BRIDGE_POD_TARGET="UseSmileIDBridgeExpo",BRIDGE_SPM_PRODUCTS=["UseSmileIDBridge"],BRIDGE_PODFILE_MARKER="usesmileid_bridge",withVisionDocumentSpm=(i,r)=>(i=(0,deployment_target_1.withIosDeploymentTargetFloor)(i,IOS_DEPLOYMENT_TARGET),i=(0,config_plugins_1.withXcodeProject)(i,t=>{const e=t.modRequest.projectName;if(!e)throw new Error("[usesmileid_vision_document] Unable to resolve host app native target name from Expo config.");return(0,spm_1.linkSpmPackage)(t.modResults,SMILE_ID_PACKAGE,{targetName:e,products:[...exports.SPM_PRODUCTS]}),r?.iosSignatureAggregation==="disabled"?(0,signature_dedup_1.disableSignatureAggregation)(t.modResults,e):(0,signature_dedup_1.ensureSignatureDedupPhase)(t.modResults,e),t}),i=(0,config_plugins_1.withDangerousMod)(i,["ios",t=>{const e=path.join(t.modRequest.platformProjectRoot,"Podfile"),o=fs.readFileSync(e,"utf-8");let n=(0,podfile_1.injectPodfileSpmBlock)(o,{marker:PODFILE_MARKER,package:SMILE_ID_PACKAGE,podTarget:POD_TARGET,products:[...exports.SPM_PRODUCTS]});return n=(0,podfile_1.injectPodfileSpmBlock)(n,{marker:BRIDGE_PODFILE_MARKER,package:SMILE_ID_PACKAGE,podTarget:BRIDGE_POD_TARGET,products:[...BRIDGE_SPM_PRODUCTS],required:!0}),n=(0,podfile_1.injectPodfileKameraLinkBlock)(n),n=(0,podfile_1.injectPodfileNjiaLinkBlock)(n),n=(0,podfile_1.injectPodfileSignatureDedupBlock)(n),n!==o&&fs.writeFileSync(e,n),t}]),i);exports.default=withVisionDocumentSpm;
|
|
@@ -26,6 +26,14 @@ export declare function injectPodfileSpmBlock(podfile: string, options: PodfileL
|
|
|
26
26
|
* version, so the pin can never drift from the JS side. Idempotent per marker.
|
|
27
27
|
*/
|
|
28
28
|
export declare function injectPodfileKameraLinkBlock(podfile: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Links njia-spm's `Njia` product into the `njia-rn` pod target with the helper
|
|
31
|
+
* `@smileid/njia` ships. The SDK's flows route through njia's native engine, which that
|
|
32
|
+
* pod hosts. The helper pins njia-spm at the installed package's own version, lists the
|
|
33
|
+
* package on the app's own project, and links Njia into its app targets, so Xcode
|
|
34
|
+
* resolves the package and embeds the dynamic framework. Idempotent per marker.
|
|
35
|
+
*/
|
|
36
|
+
export declare function injectPodfileNjiaLinkBlock(podfile: string): string;
|
|
29
37
|
/**
|
|
30
38
|
* Adds the archive signature-dedup phase to the app target of the user's own
|
|
31
39
|
* project — the path for apps whose `ios/` is hand-maintained, where no config
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.injectPodfileSpmBlock=injectPodfileSpmBlock,exports.injectPodfileKameraLinkBlock=injectPodfileKameraLinkBlock,exports.injectPodfileSignatureDedupBlock=injectPodfileSignatureDedupBlock;const signature_dedup_1=require("./signature_dedup"),BEGIN_PREFIX="# === BEGIN smileid-spm:",END_PREFIX="# === END smileid-spm:",SIGNATURE_DEDUP_MARKER="usesmileid_signature_dedup",KAMERA_LINK_MARKER="kamera_spm";function injectPodfileSpmBlock(e,r){return validateRubySafe(r),injectMarkerBlock(e,r.marker,renderBlock(r))}function injectPodfileKameraLinkBlock(e){return injectMarkerBlock(e,KAMERA_LINK_MARKER,renderKameraLinkBlock())}function injectPodfileSignatureDedupBlock(e){return injectMarkerBlock(e,SIGNATURE_DEDUP_MARKER,renderSignatureDedupBlock())}function injectMarkerBlock(e,r,a){const t=`${BEGIN_PREFIX} ${r} ===`,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.injectPodfileSpmBlock=injectPodfileSpmBlock,exports.injectPodfileKameraLinkBlock=injectPodfileKameraLinkBlock,exports.injectPodfileNjiaLinkBlock=injectPodfileNjiaLinkBlock,exports.injectPodfileSignatureDedupBlock=injectPodfileSignatureDedupBlock;const signature_dedup_1=require("./signature_dedup"),BEGIN_PREFIX="# === BEGIN smileid-spm:",END_PREFIX="# === END smileid-spm:",SIGNATURE_DEDUP_MARKER="usesmileid_signature_dedup",KAMERA_LINK_MARKER="kamera_spm",NJIA_LINK_MARKER="njia_spm";function injectPodfileSpmBlock(e,r){return validateRubySafe(r),injectMarkerBlock(e,r.marker,renderBlock(r))}function injectPodfileKameraLinkBlock(e){return injectMarkerBlock(e,KAMERA_LINK_MARKER,renderKameraLinkBlock())}function injectPodfileNjiaLinkBlock(e){return injectMarkerBlock(e,NJIA_LINK_MARKER,renderNjiaLinkBlock())}function injectPodfileSignatureDedupBlock(e){return injectMarkerBlock(e,SIGNATURE_DEDUP_MARKER,renderSignatureDedupBlock())}function injectMarkerBlock(e,r,a){const t=`${BEGIN_PREFIX} ${r} ===`,o=`${END_PREFIX} ${r} ===`,s=new RegExp(`([ \\t]*)${escapeRegExp(t)}[\\s\\S]*?${escapeRegExp(o)}`,"m"),i=e.match(s);if(i)return e.replace(s,()=>indentBlock(a,i[1]??""));const p=/(post_install\s+do\s*\|\s*installer\s*\|)\r?\n/,n=e.match(p);if(!n||n.index===void 0)throw new Error("[smileid-spm] Could not locate `post_install do |installer|` in Podfile. Refusing to append a top-level post_install hook because CocoaPods only honors one \u2014 adding a second would silently override the React Native post-install plumbing. Restore the Expo Podfile template or wire the SPM block in manually.");const d=n.index+n[0].length,c=`${indentBlock(a," ")}
|
|
2
2
|
`;return e.slice(0,d)+c+e.slice(d)}function indentBlock(e,r){return e.split(`
|
|
3
3
|
`).map(a=>a.length>0?`${r}${a}`:a).join(`
|
|
4
|
-
`)}function validateRubySafe(e){const r=[["marker",e.marker],["package.url",e.package.url],["podTarget",e.podTarget]];for(const a of e.products)r.push(["products[*]",a]);switch(e.package.requirement.kind){case"upToNextMajorVersion":case"upToNextMinorVersion":r.push(["requirement.minimumVersion",e.package.requirement.minimumVersion]);break;case"exactVersion":r.push(["requirement.version",e.package.requirement.version]);break;case"branch":r.push(["requirement.branch",e.package.requirement.branch]);break}for(const[a,t]of r)if(/['"#\\\n\r\t]/.test(t))throw new Error(`[smileid-spm] Refusing to inject Podfile block: '${a}' contains an unsafe character (got: ${JSON.stringify(t)}).`)}function renderBlock(e){const r=`${BEGIN_PREFIX} ${e.marker} ===`,a=`${END_PREFIX} ${e.marker} ===`,t=renderRequirement(e.package.requirement),
|
|
4
|
+
`)}function validateRubySafe(e){const r=[["marker",e.marker],["package.url",e.package.url],["podTarget",e.podTarget]];for(const a of e.products)r.push(["products[*]",a]);switch(e.package.requirement.kind){case"upToNextMajorVersion":case"upToNextMinorVersion":r.push(["requirement.minimumVersion",e.package.requirement.minimumVersion]);break;case"exactVersion":r.push(["requirement.version",e.package.requirement.version]);break;case"branch":r.push(["requirement.branch",e.package.requirement.branch]);break}for(const[a,t]of r)if(/['"#\\\n\r\t]/.test(t))throw new Error(`[smileid-spm] Refusing to inject Podfile block: '${a}' contains an unsafe character (got: ${JSON.stringify(t)}).`)}function renderBlock(e){const r=`${BEGIN_PREFIX} ${e.marker} ===`,a=`${END_PREFIX} ${e.marker} ===`,t=renderRequirement(e.package.requirement),o=e.products.map(i=>`'${i}'`).join(", "),s=e.required?`raise "[smileid-spm] Pod target #{target_name} is missing from Pods.xcodeproj, so #{product_names.join(', ')} cannot be linked and the Smile ID bridge will not compile. Check that '@smileid/usesmileid_bridge' is installed and that its npm package ships its 'ios' directory."`:'Pod::UI.warn "[smileid-spm] Pod target #{target_name} not found; skipping SPM link."';return`${r}
|
|
5
5
|
# Wires ${e.package.url} into Pods.xcodeproj and links its
|
|
6
6
|
# products to the '${e.podTarget}' pod target so the Swift
|
|
7
7
|
# bridge code can \`import\` them. Idempotent across pod installs.
|
|
@@ -22,7 +22,7 @@ begin
|
|
|
22
22
|
pods_project = installer.pods_project
|
|
23
23
|
spm_url = '${e.package.url}'
|
|
24
24
|
spm_requirement = ${t}
|
|
25
|
-
product_names = [${
|
|
25
|
+
product_names = [${o}]
|
|
26
26
|
target_name = '${e.podTarget}'
|
|
27
27
|
|
|
28
28
|
smileid_spm_safe_uuid = lambda do |project|
|
|
@@ -121,7 +121,7 @@ ${a}`}function renderKameraLinkBlock(){return`${BEGIN_PREFIX} ${KAMERA_LINK_MARK
|
|
|
121
121
|
require 'json'
|
|
122
122
|
require 'securerandom'
|
|
123
123
|
begin
|
|
124
|
-
kamera_package_json = \`node --print "require.resolve('@smileid/kamera/package.json')"\`.strip
|
|
124
|
+
kamera_package_json = \`node --print "const p=require('path');let d=[process.cwd()];try{d.unshift(p.dirname(require.resolve('@smileid/usesmileid')))}catch(e){}require.resolve('@smileid/kamera/package.json',{paths:d})"\`.strip
|
|
125
125
|
if kamera_package_json.empty?
|
|
126
126
|
raise "[smileid-spm] @smileid/kamera is not installed, so its kamera-rn pod cannot be linked to kamera-spm."
|
|
127
127
|
end
|
|
@@ -208,7 +208,17 @@ rescue => e
|
|
|
208
208
|
Pod::UI.warn "[smileid-spm] Failed to link kamera-spm into the kamera pods: #{e.message}"
|
|
209
209
|
raise
|
|
210
210
|
end
|
|
211
|
-
${END_PREFIX} ${KAMERA_LINK_MARKER} ===`}function
|
|
211
|
+
${END_PREFIX} ${KAMERA_LINK_MARKER} ===`}function renderNjiaLinkBlock(){return`${BEGIN_PREFIX} ${NJIA_LINK_MARKER} ===
|
|
212
|
+
# The SDK's flows route through njia's native engine. Links njia-spm's Njia product into the
|
|
213
|
+
# njia-rn pod, and into the app so Xcode embeds the framework, with the helper @smileid/njia
|
|
214
|
+
# ships, pinned at the installed package's own version.
|
|
215
|
+
njia_package_json = \`node --print "const p=require('path');let d=[process.cwd()];try{d.unshift(p.dirname(require.resolve('@smileid/usesmileid')))}catch(e){}require.resolve('@smileid/njia/package.json',{paths:d})"\`.strip
|
|
216
|
+
if njia_package_json.empty?
|
|
217
|
+
raise "[smileid-spm] @smileid/njia is not installed, so the njia-rn pod cannot be linked to njia-spm."
|
|
218
|
+
end
|
|
219
|
+
require File.join(File.dirname(njia_package_json), 'ios', 'njia_spm_link.rb')
|
|
220
|
+
njia_spm_link!(installer)
|
|
221
|
+
${END_PREFIX} ${NJIA_LINK_MARKER} ===`}function renderSignatureDedupBlock(){return`${BEGIN_PREFIX} ${SIGNATURE_DEDUP_MARKER} ===
|
|
212
222
|
# For apps whose \`ios/\` is hand-maintained, so no config plugin ever runs.
|
|
213
223
|
# UUIDs come from SecureRandom for the same reason as above.
|
|
214
224
|
begin
|