@archilogic/extension-sdk 0.15.0 → 0.16.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/CHANGELOG.md +7 -0
- package/dist/actions.cjs +1 -0
- package/dist/actions.d.ts +4430 -0
- package/dist/actions.js +74 -0
- package/dist/index.d.ts +38 -4
- package/package.json +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @archilogic/extension-sdk
|
|
2
2
|
|
|
3
|
+
## 0.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ba96fbe: feat(extension-sdk): add the createActionRunner run-lifecycle helper
|
|
8
|
+
- ba96fbe: feat(extension-sdk): accept an undo label on runOperations
|
|
9
|
+
|
|
3
10
|
## 0.15.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
package/dist/actions.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=e=>{if(!e||typeof e!=`object`)return!1;let{code:t,message:n}=e;return t===`METHOD_NOT_FOUND`||typeof n==`string`&&n.includes(`is not found`)},t=t=>{let{hostApi:n}=t,r=t.onError??(e=>console.warn(`[extension-sdk] action start failed:`,e)),i=null,a=!1,o=0,s=null,c=()=>{i?.update(t.controls()).catch(()=>{})},l=async l=>{if(a)return{status:`legacy-host`};let u=++o;s=u;let d=i;i=null,d?.stop().catch(()=>{});try{let e=await n.startActionRun({name:l,controls:t.controls(),onControl:e=>t.onControl?.(e),onEnd:e=>{u===o&&(i=null,t.onEnd?.(e))}});return u===o?e.status===`started`?(i=e.run,c(),{status:`started`}):{status:`unavailable`,reason:e.reason}:(e.status===`started`&&e.run.stop().catch(()=>{}),{status:`superseded`})}catch(t){return u===o?e(t)?(a=!0,{status:`legacy-host`}):(r(t),{status:`error`,error:t}):{status:`superseded`}}finally{s===u&&(s=null)}};return{start:l,ensure:e=>{a||i||s!==null||l(e)},stop:()=>{o++,s=null;let e=i;i=null,e?.stop().catch(()=>{})},sync:c,commit:async e=>{let t=i;if(t){let n=await t.commit(e);if(n.status!==`ended`)return{via:`action`,result:n}}return{via:`operations`,result:await n.runOperations({operations:e.operations,label:e.label})}},get running(){return i!==null},get legacyHost(){return a}}};exports.createActionRunner=t;
|