@oneblink/sdk-core 0.3.0-beta.2 → 0.3.0-beta.3

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.
@@ -43,6 +43,7 @@ const toLookupElement = (e) => {
43
43
  case 'checkboxes':
44
44
  case 'date':
45
45
  case 'datetime':
46
+ case 'files':
46
47
  case 'location':
47
48
  case 'number':
48
49
  case 'compliance':
@@ -57,6 +58,7 @@ const toLookupElement = (e) => {
57
58
  case 'pointAddress':
58
59
  case 'geoscapeAddress':
59
60
  case 'civicaStreetName':
61
+ case 'bsb':
60
62
  case 'autocomplete': {
61
63
  return e;
62
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"typeCastService.js","sourceRoot":"","sources":["../src/typeCastService.ts"],"names":[],"mappings":";;;AAEA,MAAM,gBAAgB,GAAG,CACvB,CAAwB,EACsB,EAAE;IAChD,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd,KAAK,QAAQ,CAAC;QACd,KAAK,YAAY,CAAC;QAClB,KAAK,OAAO,CAAC;QACb,KAAK,cAAc,CAAC;QACpB,KAAK,YAAY,CAAC,CAAC;YACjB,OAAO,CAAC,CAAA;SACT;QACD,OAAO,CAAC,CAAC;YACP,OAAM;SACP;KACF;AACH,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,CAC5B,CAAwB,EACmB,EAAE;IAC7C,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd,KAAK,MAAM,CAAC;QACZ,KAAK,UAAU,CAAC,CAAC;YACf,OAAO,CAAC,CAAA;SACT;QACD,OAAO,CAAC,CAAC;YACP,OAAM;SACP;KACF;AACH,CAAC,CAAA;AAED,MAAM,wBAAwB,GAAG,CAC/B,CAAwB,EACsB,EAAE;IAChD,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd,KAAK,MAAM,CAAC;QACZ,KAAK,UAAU,CAAC,CAAC;YACf,OAAM;SACP;QACD,OAAO,CAAC,CAAC;YACP,OAAO,CAAC,CA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IAAI,EAAE;QACd,KAAK,eAAe,CAAC;QACrB,KAAK,SAAS,CAAC;QACf,KAAK,MAAM,CAAC,CAAC;YACX,OAAM;SACP;QACD,OAAO,CAAC,CAAC;YACP,OAAO,CAAC,CAAA;SACT;KACF;AACH,CAAC,CAAA;AAED,MAAM,aAAa,GAAG,CACpB,CAAwB,EACW,EAAE;IACrC,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,CAAC,CAAA;SACT;QACD,OAAO,CAAC,CAAC;YACP,OAAM;SACP;KACF;AACH,CAAC,CAAA;AAED,MAAM,sBAAsB,GAAG,CAC7B,CAAwB,EACoB,EAAE;IAC9C,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd,KAAK,eAAe,CAAC,CAAC;YACpB,OAAO,CAAC,CAAA;SACT;QACD,OAAO,CAAC,CAAC;YACP,OAAM;SACP;KACF;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAAG;IACnB,gBAAgB;IAChB,qBAAqB;IACrB,wBAAwB;IACxB,eAAe;IACf,uBAAuB;IACvB,iBAAiB;IACjB,0BAA0B;IAC1B,aAAa;IACb,sBAAsB;CACvB,CAAA;AAqBQ,oCAAY;AAnBrB,MAAM,wBAAwB,GAAG,CAC/B,CAA2C,EACc,EAAE;IAC3D,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ,CAAC;QACd,KAAK,mBAAmB,CAAC,CAAC;YACxB,OAAO,CAAC,CAAA;SACT;QACD,OAAO,CAAC,CAAC;YACP,OAAM;SACP;KACF;AACH,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAG;IACvB,wBAAwB;CACzB,CAAA;AAEsB,4CAAgB","sourcesContent":["import { FormTypes, SubmissionEventTypes } from '@oneblink/types'\n\nconst toOptionsElement = (\n e: FormTypes.FormElement,\n): FormTypes.FormElementWithOptions | undefined => {\n switch (e.type) {\n case 'select':\n case 'compliance':\n case 'radio':\n case 'autocomplete':\n case 'checkboxes': {\n return e\n }\n default: {\n return\n }\n }\n}\n\nconst toFormElementWithForm = (\n e: FormTypes.FormElement,\n): FormTypes.FormElementWithForm | undefined => {\n switch (e.type) {\n case 'form':\n case 'infoPage': {\n return e\n }\n default: {\n return\n }\n }\n}\n\nconst toFormElementWithoutForm = (\n e: FormTypes.FormElement,\n): FormTypes.FormElementWithoutForm | undefined => {\n switch (e.type) {\n case 'form':\n case 'infoPage': {\n return\n }\n default: {\n return e\n }\n }\n}\n\nconst toLookupElement = (\n e: FormTypes.FormElement,\n): FormTypes.LookupFormElement | undefined => {\n switch (e.type) {\n case 'boolean':\n case 'checkboxes':\n case 'date':\n case 'datetime':\n case 'location':\n case 'number':\n case 'compliance':\n case 'radio':\n case 'select':\n case 'text':\n case 'textarea':\n case 'time':\n case 'barcodeScanner':\n case 'email':\n case 'telephone':\n case 'pointAddress':\n case 'geoscapeAddress':\n case 'civicaStreetName':\n case 'autocomplete': {\n return e\n }\n default: {\n return\n }\n }\n}\n\nconst toNestedElementsElement = (\n e: FormTypes.FormElement,\n): FormTypes.NestedElementsElement | undefined => {\n switch (e.type) {\n case 'repeatableSet':\n case 'section':\n case 'page': {\n return e\n }\n default: {\n return\n }\n }\n}\n\ntype NamelessElement = FormTypes.PageElement | FormTypes.SectionElement\nconst toNamelessElement = (\n e: FormTypes.FormElement,\n): NamelessElement | undefined => {\n switch (e.type) {\n case 'section':\n case 'page': {\n return e\n }\n default: {\n return\n }\n }\n}\n\ntype NonNestedElementsFormElement =\n | FormTypes.NonNestedElementsElement\n | FormTypes.FormElementWithForm\nconst toNonNestedElementsElement = (\n e: FormTypes.FormElement,\n): NonNestedElementsFormElement | undefined => {\n switch (e.type) {\n case 'repeatableSet':\n case 'section':\n case 'page': {\n return\n }\n default: {\n return e\n }\n }\n}\n\nconst toPageElement = (\n e: FormTypes.FormElement,\n): FormTypes.PageElement | undefined => {\n switch (e.type) {\n case 'page': {\n return e\n }\n default: {\n return\n }\n }\n}\n\nconst toRepeatableSetElement = (\n e: FormTypes.FormElement,\n): FormTypes.RepeatableSetElement | undefined => {\n switch (e.type) {\n case 'repeatableSet': {\n return e\n }\n default: {\n return\n }\n }\n}\n\nconst formElements = {\n toOptionsElement,\n toFormElementWithForm,\n toFormElementWithoutForm,\n toLookupElement,\n toNestedElementsElement,\n toNamelessElement,\n toNonNestedElementsElement,\n toPageElement,\n toRepeatableSetElement,\n}\n\nconst toPaymentSubmissionEvent = (\n e: SubmissionEventTypes.FormSubmissionEvent,\n): SubmissionEventTypes.PaymentSubmissionEvent | undefined => {\n switch (e.type) {\n case 'BPOINT':\n case 'CP_PAY':\n case 'WESTPAC_QUICK_WEB': {\n return e\n }\n default: {\n return\n }\n }\n}\n\nconst submissionEvents = {\n toPaymentSubmissionEvent,\n}\n\nexport { formElements, submissionEvents }\n"]}
1
+ {"version":3,"file":"typeCastService.js","sourceRoot":"","sources":["../src/typeCastService.ts"],"names":[],"mappings":";;;AAEA,MAAM,gBAAgB,GAAG,CACvB,CAAwB,EACsB,EAAE;IAChD,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd,KAAK,QAAQ,CAAC;QACd,KAAK,YAAY,CAAC;QAClB,KAAK,OAAO,CAAC;QACb,KAAK,cAAc,CAAC;QACpB,KAAK,YAAY,CAAC,CAAC;YACjB,OAAO,CAAC,CAAA;SACT;QACD,OAAO,CAAC,CAAC;YACP,OAAM;SACP;KACF;AACH,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,CAC5B,CAAwB,EACmB,EAAE;IAC7C,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd,KAAK,MAAM,CAAC;QACZ,KAAK,UAAU,CAAC,CAAC;YACf,OAAO,CAAC,CAAA;SACT;QACD,OAAO,CAAC,CAAC;YACP,OAAM;SACP;KACF;AACH,CAAC,CAAA;AAED,MAAM,wBAAwB,GAAG,CAC/B,CAAwB,EACsB,EAAE;IAChD,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd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4CAAgB","sourcesContent":["import { FormTypes, SubmissionEventTypes } from '@oneblink/types'\n\nconst toOptionsElement = (\n e: FormTypes.FormElement,\n): FormTypes.FormElementWithOptions | undefined => {\n switch (e.type) {\n case 'select':\n case 'compliance':\n case 'radio':\n case 'autocomplete':\n case 'checkboxes': {\n return e\n }\n default: {\n return\n }\n }\n}\n\nconst toFormElementWithForm = (\n e: FormTypes.FormElement,\n): FormTypes.FormElementWithForm | undefined => {\n switch (e.type) {\n case 'form':\n case 'infoPage': {\n return e\n }\n default: {\n return\n }\n }\n}\n\nconst toFormElementWithoutForm = (\n e: FormTypes.FormElement,\n): FormTypes.FormElementWithoutForm | undefined => {\n switch (e.type) {\n case 'form':\n case 'infoPage': {\n return\n }\n default: {\n return e\n }\n }\n}\n\nconst toLookupElement = (\n e: FormTypes.FormElement,\n): FormTypes.LookupFormElement | undefined => {\n switch (e.type) {\n case 'boolean':\n case 'checkboxes':\n case 'date':\n case 'datetime':\n case 'files':\n case 'location':\n case 'number':\n case 'compliance':\n case 'radio':\n case 'select':\n case 'text':\n case 'textarea':\n case 'time':\n case 'barcodeScanner':\n case 'email':\n case 'telephone':\n case 'pointAddress':\n case 'geoscapeAddress':\n case 'civicaStreetName':\n case 'bsb':\n case 'autocomplete': {\n return e\n }\n default: {\n return\n }\n }\n}\n\nconst toNestedElementsElement = (\n e: FormTypes.FormElement,\n): FormTypes.NestedElementsElement | undefined => {\n switch (e.type) {\n case 'repeatableSet':\n case 'section':\n case 'page': {\n return e\n }\n default: {\n return\n }\n }\n}\n\ntype NamelessElement = FormTypes.PageElement | FormTypes.SectionElement\nconst toNamelessElement = (\n e: FormTypes.FormElement,\n): NamelessElement | undefined => {\n switch (e.type) {\n case 'section':\n case 'page': {\n return e\n }\n default: {\n return\n }\n }\n}\n\ntype NonNestedElementsFormElement =\n | FormTypes.NonNestedElementsElement\n | FormTypes.FormElementWithForm\nconst toNonNestedElementsElement = (\n e: FormTypes.FormElement,\n): NonNestedElementsFormElement | undefined => {\n switch (e.type) {\n case 'repeatableSet':\n case 'section':\n case 'page': {\n return\n }\n default: {\n return e\n }\n }\n}\n\nconst toPageElement = (\n e: FormTypes.FormElement,\n): FormTypes.PageElement | undefined => {\n switch (e.type) {\n case 'page': {\n return e\n }\n default: {\n return\n }\n }\n}\n\nconst toRepeatableSetElement = (\n e: FormTypes.FormElement,\n): FormTypes.RepeatableSetElement | undefined => {\n switch (e.type) {\n case 'repeatableSet': {\n return e\n }\n default: {\n return\n }\n }\n}\n\nconst formElements = {\n toOptionsElement,\n toFormElementWithForm,\n toFormElementWithoutForm,\n toLookupElement,\n toNestedElementsElement,\n toNamelessElement,\n toNonNestedElementsElement,\n toPageElement,\n toRepeatableSetElement,\n}\n\nconst toPaymentSubmissionEvent = (\n e: SubmissionEventTypes.FormSubmissionEvent,\n): SubmissionEventTypes.PaymentSubmissionEvent | undefined => {\n switch (e.type) {\n case 'BPOINT':\n case 'CP_PAY':\n case 'WESTPAC_QUICK_WEB': {\n return e\n }\n default: {\n return\n }\n }\n}\n\nconst submissionEvents = {\n toPaymentSubmissionEvent,\n}\n\nexport { formElements, submissionEvents }\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oneblink/sdk-core",
3
3
  "description": "OneBlink SDK for JavaScript (works in Browsers and NodeJS)",
4
- "version": "0.3.0-beta.2",
4
+ "version": "0.3.0-beta.3",
5
5
  "author": "OneBlink <developers@oneblink.io> (https://oneblink.io)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/oneblink/sdk-core-js/issues"