@boncos.io/sentoo-directus-extension 1.0.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/app.js ADDED
@@ -0,0 +1 @@
1
+ import{defineOperationApp as e}from"@directus/extensions-sdk";var t={exports:{}};function r(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}const i=function(e,t,i){var n=i&&i.stringify||r;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var o=new Array(s);o[0]=n(e);for(var l=1;l<s;l++)o[l]=n(t[l]);return o.join(" ")}if("string"!=typeof e)return e;var a=t.length;if(0===a)return e;for(var c="",u=0,f=-1,p=e&&e.length||0,d=0;d<p;){if(37===e.charCodeAt(d)&&d+1<p){switch(f=f>-1?f:0,e.charCodeAt(d+1)){case 100:case 102:if(u>=a)break;if(null==t[u])break;f<d&&(c+=e.slice(f,d)),c+=Number(t[u]),f=d+2,d++;break;case 105:if(u>=a)break;if(null==t[u])break;f<d&&(c+=e.slice(f,d)),c+=Math.floor(Number(t[u])),f=d+2,d++;break;case 79:case 111:case 106:if(u>=a)break;if(void 0===t[u])break;f<d&&(c+=e.slice(f,d));var h=typeof t[u];if("string"===h){c+="'"+t[u]+"'",f=d+2,d++;break}if("function"===h){c+=t[u].name||"<anonymous>",f=d+2,d++;break}c+=n(t[u]),f=d+2,d++;break;case 115:if(u>=a)break;f<d&&(c+=e.slice(f,d)),c+=String(t[u]),f=d+2,d++;break;case 37:f<d&&(c+=e.slice(f,d)),c+="%",f=d+2,d++,u--}++u}++d}if(-1===f)return e;f<p&&(c+=e.slice(f));return c};t.exports=f;const n=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},s={mapHttpRequest:m,mapHttpResponse:m,wrapRequestSerializer:g,wrapResponseSerializer:g,wrapErrorSerializer:g,req:m,res:m,err:v,errWithCause:v};function o(e,t){return"silent"===e?1/0:t.levels.values[e]}const l=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),c={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){const r={logger:t,parent:e[a]};t[a]=r}function f(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const r=e.browser.write||n;e.browser.write&&(e.browser.asObject=!0);const i=e.serializers||{},s=function(e,t){if(Array.isArray(e))return e.filter((function(e){return"!stdSerializers.err"!==e}));return!0===e&&Object.keys(t)}(e.browser.serialize,i);let a=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);const v=Object.keys(e.customLevels||{}),m=["error","fatal","warn","info","debug","trace"].concat(v);"function"==typeof r&&m.forEach((function(e){r[e]=r})),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const g=e.level||"info",w=Object.create(r);w.log||(w.log=y),function(e,t,r){const i={};t.forEach((e=>{i[e]=r[e]?r[e]:n[e]||n[c[e]||"log"]||y})),e[l]=i}(w,m,r),u({},w),Object.defineProperty(w,"levelVal",{get:function(){return o(this.level,this)}}),Object.defineProperty(w,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,p(this,O,w,"error"),p(this,O,w,"fatal"),p(this,O,w,"warn"),p(this,O,w,"info"),p(this,O,w,"debug"),p(this,O,w,"trace"),v.forEach((e=>{p(this,O,w,e)}))}});const O={transmit:t,serialize:s,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:m,timestamp:b(e),messageKey:e.messageKey||"msg",onChild:e.onChild||y};function j(r,n,o){if(!n)throw new Error("missing bindings for child Pino");o=o||{},s&&n.serializers&&(o.serializers=n.serializers);const l=o.serializers;if(s&&l){var a=Object.assign({},i,l),c=!0===e.browser.serialize?Object.keys(a):s;delete n.serializers,d([n],c,a,this._stdErrSerialize)}function f(e){this._childLevel=1+(0|e._childLevel),this.bindings=n,a&&(this.serializers=a,this._serialize=c),t&&(this._logEvent=h([].concat(e._logEvent.bindings,n)))}f.prototype=this;const p=new f(this);return u(this,p),p.child=function(...e){return j.call(this,r,...e)},p.level=o.level||this.level,r.onChild(p),p}return w.levels=function(e){const t=e.customLevels||{},r=Object.assign({},f.levels.values,t),i=Object.assign({},f.levels.labels,function(e){const t={};return Object.keys(e).forEach((function(r){t[e[r]]=r})),t}(t));return{values:r,labels:i}}(e),w.level=g,w.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},w.setMaxListeners=w.getMaxListeners=w.emit=w.addListener=w.on=w.prependListener=w.once=w.prependOnceListener=w.removeListener=w.removeAllListeners=w.listeners=w.listenerCount=w.eventNames=w.write=w.flush=y,w.serializers=i,w._serialize=s,w._stdErrSerialize=a,w.child=function(...e){return j.call(this,O,...e)},t&&(w._logEvent=h()),w}function p(e,t,r,s){if(Object.defineProperty(e,s,{value:o(e.level,r)>o(s,r)?y:r[l][s],writable:!0,enumerable:!0,configurable:!0}),e[s]===y){if(!t.transmit)return;const i=o(t.transmit.level||e.level,r);if(o(s,r)<i)return}e[s]=function(e,t,r,s){return a=e[l][s],function(){const l=t.timestamp(),c=new Array(arguments.length),u=Object.getPrototypeOf&&Object.getPrototypeOf(this)===n?n:this;for(var f=0;f<c.length;f++)c[f]=arguments[f];var p=!1;if(t.serialize&&(d(c,this._serialize,this.serializers,this._stdErrSerialize),p=!0),t.asObject||t.formatters?a.call(u,...function(e,t,r,n,s){const{level:o,log:l=e=>e}=s.formatters||{},a=r.slice();let c=a[0];const u={};let f=1+(0|e._childLevel);if(f<1&&(f=1),n&&(u.time=n),o){const r=o(t,e.levels.values[t]);Object.assign(u,r)}else u.level=e.levels.values[t];if(s.asObjectBindingsOnly){if(null!==c&&"object"==typeof c)for(;f--&&"object"==typeof a[0];)Object.assign(u,a.shift());return[l(u),...a]}if(null!==c&&"object"==typeof c){for(;f--&&"object"==typeof a[0];)Object.assign(u,a.shift());c=a.length?i(a.shift(),a):void 0}else"string"==typeof c&&(c=i(a.shift(),a));return void 0!==c&&(u[s.messageKey]=c),[l(u)]}(this,s,c,l,t)):a.apply(u,c),t.transmit){const i=t.transmit.level||e._level,n=o(i,r),a=o(s,r);if(a<n)return;!function(e,t,r,i=!1){const n=t.send,s=t.ts,o=t.methodLevel,l=t.methodValue,a=t.val,c=e._logEvent.bindings;i||d(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=s,e._logEvent.messages=r.filter((function(e){return-1===c.indexOf(e)})),e._logEvent.level.label=o,e._logEvent.level.value=l,n(o,e._logEvent,a),e._logEvent=h(c)}(this,{ts:l,methodLevel:s,methodValue:a,transmitLevel:i,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:o(e._level,r)},c,p)}};var a}(e,t,r,s);const c=function(e){const t=[];e.bindings&&t.push(e.bindings);let r=e[a];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}(e);0!==c.length&&(e[s]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(c,e[s]))}function d(e,t,r,i){for(const n in e)if(i&&e[n]instanceof Error)e[n]=f.stdSerializers.err(e[n]);else if("object"==typeof e[n]&&!Array.isArray(e[n])&&t)for(const i in e[n])t.indexOf(i)>-1&&i in r&&(e[n][i]=r[i](e[n][i]))}function h(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function v(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)void 0===t[r]&&(t[r]=e[r]);return t}function b(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?w:O}function m(){return{}}function g(e){return e}function y(){}function w(){return!1}function O(){return Date.now()}f.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},f.stdSerializers=s,f.stdTimeFunctions=Object.assign({},{nullTime:w,epochTime:O,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),t.exports.default=f;var j=(t.exports.pino=f)();const z=[],E=[],x=[],_=[],S=[],k=[],L=[e({id:"pay-with-sentoo",name:"Pay with Sentoo",icon:"payment",description:"Make a payment transaction using Sentoo",overview:({amount:e,currency:t,description:r,return_url:i,customer:n,expires:s})=>{j.info("Generating overview for payment operation"),j.info(`Amount: ${e}, Currency: ${t}, Description: ${r}, Return URL: ${i}, Customer: ${n}, Expires: ${s}`);const o=[{label:"Amount",text:e},{label:"Description",text:r||"Default"}];return t&&o.push({label:"Currency",text:t}),i&&o.push({label:"Return URL",text:i}),n&&o.push({label:"Customer ID",text:n}),s&&o.push({label:"Expiration Time",text:s}),o},options:[{field:"amount",name:"Amount",type:"string",meta:{width:"full",interface:"input",required:!0,note:"Enter the amount for the payment in cents (e.g., 1000 for 10.00 AWG)"}},{field:"currency",name:"Currency",type:"integer",meta:{width:"full",interface:"select-dropdown",required:!1,note:"Select the currency for the payment (leave empty for default)",options:{choices:[{text:"Aruban Florin (AWG)",value:"AWG"},{text:"United States Dollar (USD)",value:"USD"},{text:"Euro (EUR)",value:"EUR"},{text:"East Caribbean Dollar (XCD)",value:"XCD"}]}}},{field:"description",name:"Description",type:"string",meta:{width:"full",interface:"input",required:!0}},{field:"return_url",name:"Return URL",type:"string",meta:{width:"full",interface:"input",required:!1,note:"URL to redirect after payment completion (optional). Leave empty for default behavior url."}},{field:"customer",name:"Customer ID",type:"string",meta:{width:"full",interface:"input",required:!1,note:"Optional customer identifier for tracking purposes"}},{field:"expires",name:"Expiration Time",type:"string",meta:{width:"full",interface:"input",required:!1,note:"(Optional) Provide an expiry date for the transaction in a valid ISO 8601 format (including the timezone offset from UTC). For example, 2023-06-23T02:56:00-04:00. If not provided, the transaction will expire 1 hour after creation. The maximum expiration date is 1 year from now."}}]})];export{E as displays,z as interfaces,x as layouts,_ as modules,L as operations,S as panels,k as themes};
package/package.json ADDED
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "@boncos.io/sentoo-directus-extension",
3
+ "description": "A Directus extension that integrates Sentoo, allowing seamless payment processing by creating transactions directly in a dedicated transaction table.",
4
+ "icon": "extension",
5
+ "version": "1.0.0",
6
+ "license": "MIT",
7
+ "author": "Boncos.io",
8
+ "private": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/boncos-io/sentoo_directus_extension.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/boncos-io/sentoo_directus_extension/issues"
15
+ },
16
+ "homepage": "https://github.com/boncos-io/sentoo_directus_extension#readme",
17
+ "keywords": [
18
+ "directus",
19
+ "directus-extension",
20
+ "directus-extension-bundle",
21
+ "sentoo",
22
+ "payment",
23
+ "payment extension",
24
+ "boncos",
25
+ "boncos aruba"
26
+ ],
27
+ "type": "module",
28
+ "files": [
29
+ "dist",
30
+ "README.md"
31
+ ],
32
+ "directus:extension": {
33
+ "type": "bundle",
34
+ "path": {
35
+ "app": "dist/app.js",
36
+ "api": "dist/api.js"
37
+ },
38
+ "entries": [
39
+ {
40
+ "type": "hook",
41
+ "name": "sentoo-directus-extension-bootstrap-hook",
42
+ "source": "src/hooks/bootstrap/index.ts"
43
+ },
44
+ {
45
+ "type": "operation",
46
+ "name": "directus-extension-pay-with-sentoo",
47
+ "source": {
48
+ "app": "src/operations/pay/app.ts",
49
+ "api": "src/operations/pay/api.ts"
50
+ }
51
+ },
52
+ {
53
+ "type": "endpoint",
54
+ "name": "sentoo-directus-extension-transaction-status-endpoint",
55
+ "source": "src/endpoints/transaction-status/index.ts"
56
+ }
57
+ ],
58
+ "host": "^10.10.0"
59
+ },
60
+ "scripts": {
61
+ "build": "directus-extension build",
62
+ "dev": "directus-extension build -w --no-minify",
63
+ "link": "directus-extension link",
64
+ "validate": "directus-extension validate",
65
+ "add": "directus-extension add"
66
+ },
67
+ "devDependencies": {
68
+ "@directus/errors": "^2.0.1",
69
+ "@directus/extensions": "3.0.6",
70
+ "@directus/extensions-sdk": "13.1.1",
71
+ "@directus/types": "13.1.2",
72
+ "@types/node": "^24.0.3",
73
+ "pino": "9.7.0",
74
+ "typescript": "^5.8.3",
75
+ "vue": "^3.5.17"
76
+ },
77
+ "dependencies": {
78
+ "express": "^5.1.0",
79
+ "liquidjs": "^10.21.1"
80
+ },
81
+ "overrides": {
82
+ "vite": "6.3.5",
83
+ "brace-expansion": "2.0.2"
84
+ }
85
+ }