@ram_28/kf-ai-sdk 2.0.18 → 2.0.20-beta.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/README.md +8 -16
- package/dist/{FileField-CZjS2uLh.js → FileField-BWrSHNRq.js} +3 -3
- package/dist/{FileField-DU4UWo_t.cjs → FileField-eDeuzln8.cjs} +1 -1
- package/dist/api.cjs +1 -1
- package/dist/api.mjs +1 -1
- package/dist/auth/authClient.d.ts.map +1 -1
- package/dist/auth/authConfig.d.ts +1 -1
- package/dist/auth/types.d.ts +1 -1
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth.cjs +1 -1
- package/dist/auth.mjs +102 -106
- package/dist/bdo/core/Item.d.ts +4 -0
- package/dist/bdo/core/Item.d.ts.map +1 -1
- package/dist/bdo/fields/ReferenceField.d.ts +1 -1
- package/dist/bdo/fields/ReferenceField.d.ts.map +1 -1
- package/dist/bdo/fields/SelectField.d.ts +1 -1
- package/dist/bdo/fields/SelectField.d.ts.map +1 -1
- package/dist/bdo/fields/UserField.d.ts +1 -1
- package/dist/bdo/fields/UserField.d.ts.map +1 -1
- package/dist/bdo.cjs +1 -1
- package/dist/bdo.mjs +62 -53
- package/dist/components/hooks/useActivityForm/types.d.ts +5 -4
- package/dist/components/hooks/useActivityForm/types.d.ts.map +1 -1
- package/dist/components/hooks/useActivityForm/useActivityForm.d.ts.map +1 -1
- package/dist/components/hooks/useActivityTable/types.d.ts +4 -5
- package/dist/components/hooks/useActivityTable/types.d.ts.map +1 -1
- package/dist/components/hooks/useActivityTable/useActivityTable.d.ts.map +1 -1
- package/dist/components/hooks/useBDOForm/createItemProxy.d.ts +3 -2
- package/dist/components/hooks/useBDOForm/createItemProxy.d.ts.map +1 -1
- package/dist/components/hooks/useBDOTable/types.d.ts +12 -20
- package/dist/components/hooks/useBDOTable/types.d.ts.map +1 -1
- package/dist/components/hooks/useBDOTable/useBDOTable.d.ts +2 -2
- package/dist/components/hooks/useBDOTable/useBDOTable.d.ts.map +1 -1
- package/dist/{constants-Cyi942Yr.js → constants-ConHc1oS.js} +5 -5
- package/dist/constants-QX2RX-wu.cjs +1 -0
- package/dist/filter.cjs +1 -1
- package/dist/filter.mjs +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.mjs +243 -226
- package/dist/table.cjs +1 -1
- package/dist/table.mjs +16 -15
- package/dist/table.types.d.ts +1 -1
- package/dist/table.types.d.ts.map +1 -1
- package/dist/types/constants.d.ts +1 -1
- package/dist/workflow/Activity.d.ts +5 -8
- package/dist/workflow/Activity.d.ts.map +1 -1
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.mjs +476 -461
- package/docs/api.md +95 -0
- package/docs/bdo.md +224 -0
- package/docs/gaps.md +360 -0
- package/docs/useActivityForm.md +393 -0
- package/docs/useActivityTable.md +418 -0
- package/docs/useBDOForm.md +498 -0
- package/docs/useBDOTable.md +284 -0
- package/docs/useFilter.md +188 -0
- package/docs/workflow.md +560 -0
- package/package.json +14 -15
- package/sdk/auth/authClient.ts +15 -21
- package/sdk/auth/authConfig.ts +1 -1
- package/sdk/auth/types.ts +1 -1
- package/sdk/bdo/core/Item.ts +10 -1
- package/sdk/bdo/fields/ReferenceField.ts +1 -1
- package/sdk/bdo/fields/SelectField.ts +1 -1
- package/sdk/bdo/fields/UserField.ts +1 -1
- package/sdk/components/hooks/useActivityForm/types.ts +6 -4
- package/sdk/components/hooks/useActivityForm/useActivityForm.ts +73 -10
- package/sdk/components/hooks/useActivityTable/types.ts +5 -4
- package/sdk/components/hooks/useActivityTable/useActivityTable.ts +8 -10
- package/sdk/components/hooks/useBDOForm/createItemProxy.ts +58 -17
- package/sdk/components/hooks/useBDOTable/types.ts +10 -20
- package/sdk/components/hooks/useBDOTable/useBDOTable.ts +8 -12
- package/sdk/table.types.ts +0 -2
- package/sdk/types/constants.ts +1 -1
- package/sdk/workflow/Activity.ts +7 -39
- package/dist/constants-DEmYwKfC.cjs +0 -1
- package/docs/README.md +0 -57
- package/docs/bdo/README.md +0 -161
- package/docs/bdo/api_reference.md +0 -281
- package/docs/examples/bdo/create-product.md +0 -69
- package/docs/examples/bdo/edit-product-dialog.md +0 -95
- package/docs/examples/bdo/filtered-product-table.md +0 -100
- package/docs/examples/bdo/product-listing.md +0 -73
- package/docs/examples/bdo/supplier-dropdown.md +0 -60
- package/docs/examples/fields/complex-fields.md +0 -248
- package/docs/examples/fields/primitive-fields.md +0 -217
- package/docs/examples/workflow/approve-leave-request.md +0 -76
- package/docs/examples/workflow/filtered-activity-table.md +0 -101
- package/docs/examples/workflow/my-pending-requests.md +0 -90
- package/docs/examples/workflow/start-new-workflow.md +0 -47
- package/docs/examples/workflow/submit-leave-request.md +0 -72
- package/docs/examples/workflow/workflow-progress.md +0 -49
- package/docs/fields/README.md +0 -141
- package/docs/fields/api_reference.md +0 -134
- package/docs/useActivityForm/README.md +0 -244
- package/docs/useActivityForm/api_reference.md +0 -279
- package/docs/useActivityTable/README.md +0 -263
- package/docs/useActivityTable/api_reference.md +0 -294
- package/docs/useBDOForm/README.md +0 -175
- package/docs/useBDOForm/api_reference.md +0 -244
- package/docs/useBDOTable/README.md +0 -242
- package/docs/useBDOTable/api_reference.md +0 -253
- package/docs/useFilter/README.md +0 -323
- package/docs/useFilter/api_reference.md +0 -228
- package/docs/workflow/README.md +0 -158
- package/docs/workflow/api_reference.md +0 -161
- /package/docs/{useAuth/README.md → useAuth.md} +0 -0
package/README.md
CHANGED
|
@@ -461,22 +461,14 @@ cn("text-red-500", condition && "text-blue-500");
|
|
|
461
461
|
|
|
462
462
|
## Documentation
|
|
463
463
|
|
|
464
|
-
Detailed
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
- [
|
|
468
|
-
- [
|
|
469
|
-
- [
|
|
470
|
-
- [
|
|
471
|
-
- [
|
|
472
|
-
|
|
473
|
-
**Core:**
|
|
474
|
-
- [BDO](./docs/bdo/README.md) — Type-safe, role-based data access layer
|
|
475
|
-
- [Workflow](./docs/workflow/README.md) — Business process orchestration
|
|
476
|
-
- [API Client](./docs/api/README.md) — Low-level CRUD, metric, pivot, draft, and attachment operations
|
|
477
|
-
|
|
478
|
-
**Auth:**
|
|
479
|
-
- [useAuth](./docs/useAuth/README.md) — Cookie-based authentication with session management
|
|
464
|
+
Detailed documentation for each feature:
|
|
465
|
+
|
|
466
|
+
- [useBDOTable Documentation](./docs/useBDOTable.md)
|
|
467
|
+
- [useActivityTable Documentation](./docs/useActivityTable.md)
|
|
468
|
+
- [useFilter Documentation](./docs/useFilter.md)
|
|
469
|
+
- [useBDOForm Documentation](./docs/useBDOForm.md)
|
|
470
|
+
- [useAuth Documentation](./docs/useAuth.md)
|
|
471
|
+
- [API Documentation](./docs/api.md)
|
|
480
472
|
|
|
481
473
|
## Requirements
|
|
482
474
|
|
|
@@ -169,7 +169,7 @@ class _ extends s {
|
|
|
169
169
|
/**
|
|
170
170
|
* Fetch dynamic options from the backend, returned as typed SelectOption[]
|
|
171
171
|
*/
|
|
172
|
-
async fetchOptions(e
|
|
172
|
+
async fetchOptions(e) {
|
|
173
173
|
if (!this._parentBoId)
|
|
174
174
|
throw new Error(
|
|
175
175
|
`Field ${this.id} not bound to a BDO. Cannot fetch options.`
|
|
@@ -217,7 +217,7 @@ class v extends s {
|
|
|
217
217
|
* Fetch referenced records from the backend via the fetchField API.
|
|
218
218
|
* Requires the field to be bound to a parent BDO.
|
|
219
219
|
*/
|
|
220
|
-
async fetchOptions(e
|
|
220
|
+
async fetchOptions(e) {
|
|
221
221
|
if (!this._parentBoId)
|
|
222
222
|
throw new Error(
|
|
223
223
|
`Field ${this.id} not bound to a BDO. Cannot fetch options.`
|
|
@@ -238,7 +238,7 @@ class g extends s {
|
|
|
238
238
|
* Fetch user records from the backend via the fetchField API.
|
|
239
239
|
* Requires the field to be bound to a parent BDO.
|
|
240
240
|
*/
|
|
241
|
-
async fetchOptions(e
|
|
241
|
+
async fetchOptions(e) {
|
|
242
242
|
if (!this._parentBoId)
|
|
243
243
|
throw new Error(
|
|
244
244
|
`Field ${this.id} not bound to a BDO. Cannot fetch options.`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var o=(r,e,t)=>e in r?l(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e,t)=>o(r,typeof e!="symbol"?e+"":e,t);const n=require("./client-D5k4SYuw.cjs");class i{constructor(e){a(this,"_meta");a(this,"_parentBoId");this._meta=e}get id(){return this._meta._id}get label(){return this._meta.Name||this._meta._id}get readOnly(){return this._meta.ReadOnly??!1}get required(){var e;return((e=this._meta.Constraint)==null?void 0:e.Required)??this._meta.Required??!1}get defaultValue(){var e;return this._meta.DefaultValue??((e=this._meta.Constraint)==null?void 0:e.DefaultValue)}get primaryKey(){var e;return((e=this._meta.Constraint)==null?void 0:e.PrimaryKey)??!1}get meta(){return this._meta}}class d extends i{constructor(e){super(e)}get length(){var e;return(e=this._meta.Constraint)==null?void 0:e.Length}validate(e){return e!=null&&typeof e!="string"?{valid:!1,errors:[`${this.label} must be a string`]}:{valid:!0,errors:[]}}}class u extends i{constructor(e){super(e)}get integerPart(){var e;return((e=this._meta.Constraint)==null?void 0:e.IntegerPart)??9}get fractionPart(){var e;return(e=this._meta.Constraint)==null?void 0:e.FractionPart}validate(e){return e==null||e===""?{valid:!0,errors:[]}:typeof e!="number"||isNaN(e)?{valid:!1,errors:[`${this.label} must be a valid number`]}:{valid:!0,errors:[]}}}class f extends i{constructor(e){super(e)}validate(e){return e!=null&&typeof e!="boolean"?{valid:!1,errors:[`${this.label} must be a boolean`]}:{valid:!0,errors:[]}}}class c extends i{constructor(e){super(e)}validate(e){if(e==null||e==="")return{valid:!0,errors:[]};if(typeof e!="string")return{valid:!1,errors:[`${this.label} must be a valid date string`]};if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return{valid:!1,errors:[`${this.label} must be in YYYY-MM-DD format`]};const t=new Date(e+"T00:00:00");return isNaN(t.getTime())?{valid:!1,errors:[`${this.label} is not a valid date`]}:{valid:!0,errors:[]}}}class h extends i{constructor(e){super(e)}get precision(){var e;return((e=this._meta.Constraint)==null?void 0:e.Precision)??"Second"}validate(e){if(e==null||e==="")return{valid:!0,errors:[]};if(typeof e!="string")return{valid:!1,errors:[`${this.label} must be a valid date string`]};const t=new Date(e);return isNaN(t.getTime())?{valid:!1,errors:[`${this.label} is not a valid date`]}:{valid:!0,errors:[]}}}class m extends i{constructor(e){super(e)}get format(){var e;return((e=this._meta.Constraint)==null?void 0:e.Format)??"Plain"}validate(e){return e!=null&&typeof e!="string"?{valid:!1,errors:[`${this.label} must be a string`]}:{valid:!0,errors:[]}}}class b extends i{constructor(e){super(e)}get options(){var t;return(((t=this._meta.Constraint)==null?void 0:t.Enum)??[]).map(s=>({value:s,label:s}))}validate(e){if(e==null||e==="")return{valid:!0,errors:[]};if(this.options.length===0)return{valid:!0,errors:[]};const t=this.options.map(s=>s.value);return t.includes(e)?{valid:!0,errors:[]}:{valid:!1,errors:[`${this.label} must be one of: ${t.join(", ")}`]}}async fetchOptions(e
|
|
1
|
+
"use strict";var l=Object.defineProperty;var o=(r,e,t)=>e in r?l(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e,t)=>o(r,typeof e!="symbol"?e+"":e,t);const n=require("./client-D5k4SYuw.cjs");class i{constructor(e){a(this,"_meta");a(this,"_parentBoId");this._meta=e}get id(){return this._meta._id}get label(){return this._meta.Name||this._meta._id}get readOnly(){return this._meta.ReadOnly??!1}get required(){var e;return((e=this._meta.Constraint)==null?void 0:e.Required)??this._meta.Required??!1}get defaultValue(){var e;return this._meta.DefaultValue??((e=this._meta.Constraint)==null?void 0:e.DefaultValue)}get primaryKey(){var e;return((e=this._meta.Constraint)==null?void 0:e.PrimaryKey)??!1}get meta(){return this._meta}}class d extends i{constructor(e){super(e)}get length(){var e;return(e=this._meta.Constraint)==null?void 0:e.Length}validate(e){return e!=null&&typeof e!="string"?{valid:!1,errors:[`${this.label} must be a string`]}:{valid:!0,errors:[]}}}class u extends i{constructor(e){super(e)}get integerPart(){var e;return((e=this._meta.Constraint)==null?void 0:e.IntegerPart)??9}get fractionPart(){var e;return(e=this._meta.Constraint)==null?void 0:e.FractionPart}validate(e){return e==null||e===""?{valid:!0,errors:[]}:typeof e!="number"||isNaN(e)?{valid:!1,errors:[`${this.label} must be a valid number`]}:{valid:!0,errors:[]}}}class f extends i{constructor(e){super(e)}validate(e){return e!=null&&typeof e!="boolean"?{valid:!1,errors:[`${this.label} must be a boolean`]}:{valid:!0,errors:[]}}}class c extends i{constructor(e){super(e)}validate(e){if(e==null||e==="")return{valid:!0,errors:[]};if(typeof e!="string")return{valid:!1,errors:[`${this.label} must be a valid date string`]};if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return{valid:!1,errors:[`${this.label} must be in YYYY-MM-DD format`]};const t=new Date(e+"T00:00:00");return isNaN(t.getTime())?{valid:!1,errors:[`${this.label} is not a valid date`]}:{valid:!0,errors:[]}}}class h extends i{constructor(e){super(e)}get precision(){var e;return((e=this._meta.Constraint)==null?void 0:e.Precision)??"Second"}validate(e){if(e==null||e==="")return{valid:!0,errors:[]};if(typeof e!="string")return{valid:!1,errors:[`${this.label} must be a valid date string`]};const t=new Date(e);return isNaN(t.getTime())?{valid:!1,errors:[`${this.label} is not a valid date`]}:{valid:!0,errors:[]}}}class m extends i{constructor(e){super(e)}get format(){var e;return((e=this._meta.Constraint)==null?void 0:e.Format)??"Plain"}validate(e){return e!=null&&typeof e!="string"?{valid:!1,errors:[`${this.label} must be a string`]}:{valid:!0,errors:[]}}}class b extends i{constructor(e){super(e)}get options(){var t;return(((t=this._meta.Constraint)==null?void 0:t.Enum)??[]).map(s=>({value:s,label:s}))}validate(e){if(e==null||e==="")return{valid:!0,errors:[]};if(this.options.length===0)return{valid:!0,errors:[]};const t=this.options.map(s=>s.value);return t.includes(e)?{valid:!0,errors:[]}:{valid:!1,errors:[`${this.label} must be one of: ${t.join(", ")}`]}}async fetchOptions(e){if(!this._parentBoId)throw new Error(`Field ${this.id} not bound to a BDO. Cannot fetch options.`);return(await n.api(this._parentBoId).fetchField(e,this.id)).map(s=>({value:s.Value,label:s.Label}))}}class p extends i{constructor(e){super(e)}get referenceBdo(){var e,t;return((t=(e=this._meta.View)==null?void 0:e.DataObject)==null?void 0:t.Id)??""}get referenceFields(){var e;return((e=this._meta.View)==null?void 0:e.Fields)??["_id"]}get searchFields(){var e;return((e=this._meta.View)==null?void 0:e.Search)??[]}validate(e){if(e==null)return{valid:!0,errors:[]};if(typeof e!="object")return{valid:!1,errors:[`${this.label} must be a valid reference object`]};const t=e;return!("_id"in t)||typeof t._id!="string"?{valid:!1,errors:[`${this.label} must have a valid _id`]}:{valid:!0,errors:[]}}async fetchOptions(e){if(!this._parentBoId)throw new Error(`Field ${this.id} not bound to a BDO. Cannot fetch options.`);return n.api(this._parentBoId).fetchField(e,this.id)}}class _ extends i{constructor(e){super(e)}get businessEntity(){var e;return(e=this._meta.View)==null?void 0:e.BusinessEntity}async fetchOptions(e){if(!this._parentBoId)throw new Error(`Field ${this.id} not bound to a BDO. Cannot fetch options.`);return n.api(this._parentBoId).fetchField(e,this.id)}validate(e){if(e==null)return{valid:!0,errors:[]};if(typeof e!="object")return{valid:!1,errors:[`${this.label} must be a valid user object`]};const t=e;return!("_id"in t)||typeof t._id!="string"?{valid:!1,errors:[`${this.label} must have a valid _id`]}:{valid:!0,errors:[]}}}class v extends i{constructor(e){super(e)}validate(e){if(e==null)return{valid:!0,errors:[]};if(!Array.isArray(e))return{valid:!1,errors:[`${this.label} must be an array of file objects`]};for(const t of e)if(!t||typeof t!="object"||!t._id)return{valid:!1,errors:[`Each file in ${this.label} must have an _id`]};return{valid:!0,errors:[]}}}exports.BaseField=i;exports.BooleanField=f;exports.DateField=c;exports.DateTimeField=h;exports.FileField=v;exports.NumberField=u;exports.ReferenceField=p;exports.SelectField=b;exports.StringField=d;exports.TextField=m;exports.UserField=_;
|
package/dist/api.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./client-D5k4SYuw.cjs"),u=require("./metadata-DWXQPDav.cjs"),o=require("./constants-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./client-D5k4SYuw.cjs"),u=require("./metadata-DWXQPDav.cjs"),o=require("./constants-QX2RX-wu.cjs"),p={DATE:"%Y-%m-%d",TIME:"%H:%M:%S",DATE_TIME:"%Y-%m-%d %H:%M:%S"};function D(t){const[e,a,r]=t.$__d__.split("-").map(Number);return new Date(e,a-1,r)}function g(t){return new Date(t.$__dt__*1e3)}function l(t){const e=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${a}-${r}`}function S(t){const e=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),s=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),c=String(t.getSeconds()).padStart(2,"0");return`${e}-${a}-${r} ${s}:${i}:${c}`}function y(t){const[e,a,r]=t.split("-").map(Number);return new Date(e,a-1,r)}function f(t){const[e,a]=t.split(" "),[r,s,i]=e.split("-").map(Number),[c,d,m]=a.split(":").map(Number);return new Date(r,s-1,i,c,d,m)}exports.api=n.api;exports.getApiBaseUrl=n.getApiBaseUrl;exports.getDefaultHeaders=n.getDefaultHeaders;exports.setApiBaseUrl=n.setApiBaseUrl;exports.setDefaultHeaders=n.setDefaultHeaders;exports.getBdoSchema=u.getBdoSchema;exports.listMetadata=u.listMetadata;exports.DateEncodingKey=o.DateEncodingKey;exports.DeleteStatus=o.DeleteStatus;exports.HttpMethod=o.HttpMethod;exports.MetricType=o.MetricType;exports.QueryType=o.QueryType;exports.DatetimeFormat=p;exports.decodeDate=D;exports.decodeDateTime=g;exports.formatDate=l;exports.formatDateTime=S;exports.parseDate=y;exports.parseDateTime=f;
|
package/dist/api.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as f, c as h, g as M, s as $, b as T } from "./client-_ayziI1d.js";
|
|
2
2
|
import { g as H, l as b } from "./metadata-Cc1mBcLS.js";
|
|
3
|
-
import { a as w, b as x, H as A, M as N, Q as Y } from "./constants-
|
|
3
|
+
import { a as w, b as x, H as A, M as N, Q as Y } from "./constants-ConHc1oS.js";
|
|
4
4
|
const m = {
|
|
5
5
|
/** Date format: "YYYY-MM-DD" */
|
|
6
6
|
DATE: "%Y-%m-%d",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authClient.d.ts","sourceRoot":"","sources":["../../sdk/auth/authClient.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"authClient.d.ts","sourceRoot":"","sources":["../../sdk/auth/authClient.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAIjB;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,SAAgB,UAAU,EAAE,MAAM,CAAC;gBAEvB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAKhD;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAuBjE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,CAAC,EAAE,oBAAoB,EAC/B,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,KAAK,CAAC,CA2DhB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
|
@@ -8,7 +8,7 @@ import type { AuthConfigType, AuthProviderNameType, AuthEndpointConfigType } fro
|
|
|
8
8
|
* autoRedirect: true,
|
|
9
9
|
* providers: {
|
|
10
10
|
* google: { loginPath: "/api/auth/google/login" },
|
|
11
|
-
*
|
|
11
|
+
* microsoft: { loginPath: "/api/auth/microsoft/login" },
|
|
12
12
|
* },
|
|
13
13
|
* });
|
|
14
14
|
* ```
|
package/dist/auth/types.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export type AuthStatusType = "loading" | "authenticated" | "unauthenticated";
|
|
|
22
22
|
/**
|
|
23
23
|
* Authentication provider type (extensible for multiple OAuth providers)
|
|
24
24
|
*/
|
|
25
|
-
export type AuthProviderNameType = "google" | "
|
|
25
|
+
export type AuthProviderNameType = "google" | "microsoft" | "github" | "azure" | "custom";
|
|
26
26
|
/**
|
|
27
27
|
* Auth endpoint configuration for a specific provider
|
|
28
28
|
*/
|
package/dist/auth/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../sdk/auth/types.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,eAAe,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../sdk/auth/types.ts"],"names":[],"mappings":"AAIA;;G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B,4BAA4B;IAC5B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB,oCAAoC;IACpC,MAAM,EAAE,cAAc,CAAC;IAEvB,kDAAkD;IAClD,eAAe,EAAE,OAAO,CAAC;IAEzB,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAC;IAMnB;;;;OAIG;IACH,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAE7E;;;OAGG;IACH,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD;;OAEG;IACH,cAAc,EAAE,MAAM,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IAE1D;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAEnC;;OAEG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;IAMzC,gCAAgC;IAChC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAEpB,8BAA8B;IAC9B,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,uCAAuC;IACvC,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB"}
|
package/dist/auth.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var J=Object.defineProperty;var X=(e,t,
|
|
1
|
+
"use strict";var J=Object.defineProperty;var X=(e,t,o)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var Q=(e,t,o)=>X(e,typeof t!="symbol"?t+"":t,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),n=require("react"),M=require("@tanstack/react-query"),K=require("./client-D5k4SYuw.cjs"),W=require("./constants-QX2RX-wu.cjs"),Y={sessionEndpoint:"/api/id",providers:{google:{loginPath:"/api/auth/google/login",logoutPath:"/api/auth/logout"}},defaultProvider:"google",autoRedirect:!1,sessionCheckInterval:0,retry:{count:3,delay:1e3},staleTime:5*60*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!0};let h={...Y};function G(e){h={...h,...e,providers:{...h.providers,...e.providers},retry:{...h.retry,...e.retry}}}function Z(e,t){h.providers[e]=t}function b(){return{...h}}function k(){return h.baseUrl||K.getApiBaseUrl()||(typeof window<"u"?window.location.origin:"")}function H(e){return h.providers[e]}function D(){h={...Y}}class m extends Error{constructor(o,r){super(o);Q(this,"statusCode");this.name="AuthenticationError",this.statusCode=r}}async function ee(){const e=b(),t=k(),o=K.getDefaultHeaders(),r=await fetch(`${t}${e.sessionEndpoint}`,{method:"GET",headers:o,credentials:"include"});if(!r.ok)throw r.status===401||r.status===403?new m("Not authenticated",r.status):new m(`Session check failed: ${r.statusText}`,r.status);return await r.json()}function N(e,t){return new Promise(()=>{const o=b(),r=k();if(!r)throw new Error('Auth base URL is not configured. Call setApiBaseUrl("https://...") or configureAuth({ baseUrl: "https://..." }) first.');const i=e||o.defaultProvider,l=H(i);if(!l){const A=Object.keys(o.providers||{}).join(", ")||"none";throw new Error(`Auth provider "${i}" is not configured. Available providers: ${A}`)}if(!l.loginPath)throw new Error(`Login path not configured for provider "${i}". Configure it with: configureAuth({ providers: { ${i}: { loginPath: '/api/auth/...' } } })`);let g;try{g=new URL(`${r}${l.loginPath}`)}catch{throw new Error(`Failed to construct login URL. Base URL: "${r}", Login path: "${l.loginPath}". Ensure baseUrl is a valid URL (e.g., "https://example.com").`)}(t!=null&&t.callbackUrl||o.callbackUrl)&&g.searchParams.set("callbackUrl",(t==null?void 0:t.callbackUrl)||o.callbackUrl||window.location.href),t!=null&&t.params&&Object.entries(t.params).forEach(([A,v])=>{g.searchParams.set(A,v)}),window.open(g.toString(),"_blank")})}async function te(e){const t=b(),o=k(),r=H(t.defaultProvider),i=r==null?void 0:r.logoutPath;if(i&&(e==null?void 0:e.callLogoutEndpoint)!==!1)try{await fetch(`${o}${i}`)}catch(l){console.warn("Logout endpoint call failed:",l)}e!=null&&e.redirectUrl?window.location.href=e.redirectUrl:t.loginRedirectUrl&&(window.location.href=t.loginRedirectUrl)}const V=n.createContext(null),_=["auth","session"];function re({children:e,config:t,onAuthChange:o,onError:r,loadingComponent:i,unauthenticatedComponent:l,skipInitialCheck:g=!1}){const A=n.useRef(!1);t&&!A.current&&(G(t),A.current=!0);const v=M.useQueryClient(),c=b(),{data:u,isLoading:f,error:U,refetch:R,isFetching:C}=M.useQuery({queryKey:_,queryFn:ee,enabled:!g,retry:(s,w)=>w instanceof m&&(w.statusCode===401||w.statusCode===403)?!1:s<c.retry.count,retryDelay:c.retry.delay,staleTime:c.staleTime,gcTime:c.staleTime*2,refetchOnWindowFocus:c.refetchOnWindowFocus??!0,refetchOnReconnect:c.refetchOnReconnect??!0,refetchInterval:c.sessionCheckInterval||!1}),[S,L]=n.useState(null),d=n.useMemo(()=>f||C?"loading":Object.keys((u==null?void 0:u.userDetails)||{}).length>0?"authenticated":"unauthenticated",[f,C,u]),a=(u==null?void 0:u.userDetails)||null,x=(u==null?void 0:u.staticBaseUrl)||null,$=(u==null?void 0:u.buildId)||null,j=d==="authenticated",P=n.useRef(o);P.current=o;const E=n.useRef(r);E.current=r,n.useEffect(()=>{var s;f||(s=P.current)==null||s.call(P,d,a)},[d,a,f]),n.useEffect(()=>{var s;U&&(L(U),(s=E.current)==null||s.call(E,U))},[U]),n.useEffect(()=>{d==="unauthenticated"&&c.autoRedirect&&!f&&N()},[d,f,c.autoRedirect]);const p=n.useCallback((s,w)=>{N(s,w)},[]),q=n.useCallback(async s=>{v.removeQueries({queryKey:_}),await te(s)},[v]),B=n.useCallback(async()=>{if(C)return u||null;try{return(await R()).data||null}catch(s){return L(s),null}},[R,C,u]),O=n.useCallback(s=>(a==null?void 0:a.Role)===s,[a]),I=n.useCallback(s=>s.includes((a==null?void 0:a.Role)||""),[a]),F=n.useCallback(()=>{L(null)},[]),T=n.useCallback(()=>{R()},[R]),z=n.useMemo(()=>({user:a,staticBaseUrl:x,buildId:$,status:d,isAuthenticated:j,isLoading:f,login:p,logout:q,refreshSession:B,hasRole:O,hasAnyRole:I,error:S,clearError:F,_forceCheck:T}),[a,x,$,d,j,f,p,q,B,O,I,S,F,T]);return d==="loading"&&i?y.jsx(y.Fragment,{children:i}):d==="unauthenticated"&&!c.autoRedirect&&l?y.jsx(y.Fragment,{children:l}):y.jsx(V.Provider,{value:z,children:e})}function ne(){const e=n.useContext(V);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function oe(){const e=ne();return n.useMemo(()=>({user:e.user,staticBaseUrl:e.staticBaseUrl,buildId:e.buildId,status:e.status,isAuthenticated:e.isAuthenticated,isLoading:e.isLoading,login:e.login,logout:e.logout,refreshSession:e.refreshSession,hasRole:e.hasRole,hasAnyRole:e.hasAnyRole,error:e.error,clearError:e.clearError}),[e.user,e.staticBaseUrl,e.buildId,e.status,e.isAuthenticated,e.isLoading,e.login,e.logout,e.refreshSession,e.hasRole,e.hasAnyRole,e.error,e.clearError])}exports.AuthProviderName=W.AuthProviderName;exports.AuthStatus=W.AuthStatus;exports.AuthProvider=re;exports.AuthenticationError=m;exports.configureAuth=G;exports.getAuthBaseUrl=k;exports.getAuthConfig=b;exports.resetAuthConfig=D;exports.setAuthProvider=Z;exports.useAuth=oe;
|
package/dist/auth.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var N = (e, t,
|
|
1
|
+
var J = Object.defineProperty;
|
|
2
|
+
var X = (e, t, n) => t in e ? J(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var N = (e, t, n) => X(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as C, Fragment as W } from "react/jsx-runtime";
|
|
5
|
-
import { useRef as p, useState as
|
|
6
|
-
import { useQueryClient as
|
|
7
|
-
import { c as
|
|
8
|
-
import { c as me, A as be } from "./constants-
|
|
9
|
-
const
|
|
5
|
+
import { useRef as p, useState as Z, useMemo as k, useEffect as L, useCallback as f, createContext as D, useContext as ee } from "react";
|
|
6
|
+
import { useQueryClient as te, useQuery as re } from "@tanstack/react-query";
|
|
7
|
+
import { c as ne, g as oe } from "./client-_ayziI1d.js";
|
|
8
|
+
import { c as me, A as be } from "./constants-ConHc1oS.js";
|
|
9
|
+
const H = {
|
|
10
10
|
sessionEndpoint: "/api/id",
|
|
11
11
|
providers: {
|
|
12
12
|
google: {
|
|
@@ -25,7 +25,7 @@ const M = {
|
|
|
25
25
|
refetchOnWindowFocus: !1,
|
|
26
26
|
refetchOnReconnect: !0
|
|
27
27
|
};
|
|
28
|
-
let d = { ...
|
|
28
|
+
let d = { ...H };
|
|
29
29
|
function ie(e) {
|
|
30
30
|
d = {
|
|
31
31
|
...d,
|
|
@@ -43,193 +43,189 @@ function ie(e) {
|
|
|
43
43
|
function ge(e, t) {
|
|
44
44
|
d.providers[e] = t;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function E() {
|
|
47
47
|
return { ...d };
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return d.baseUrl ||
|
|
49
|
+
function $() {
|
|
50
|
+
return d.baseUrl || ne() || (typeof window < "u" ? window.location.origin : "");
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function M(e) {
|
|
53
53
|
return d.providers[e];
|
|
54
54
|
}
|
|
55
55
|
function we() {
|
|
56
|
-
d = { ...
|
|
56
|
+
d = { ...H };
|
|
57
57
|
}
|
|
58
58
|
class x extends Error {
|
|
59
|
-
constructor(
|
|
60
|
-
super(
|
|
59
|
+
constructor(n, r) {
|
|
60
|
+
super(n);
|
|
61
61
|
N(this, "statusCode");
|
|
62
|
-
this.name = "AuthenticationError", this.statusCode =
|
|
62
|
+
this.name = "AuthenticationError", this.statusCode = r;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
async function ae() {
|
|
66
|
-
const e =
|
|
66
|
+
const e = E(), t = $(), n = oe(), r = await fetch(`${t}${e.sessionEndpoint}`, {
|
|
67
67
|
method: "GET",
|
|
68
|
-
headers:
|
|
68
|
+
headers: n,
|
|
69
69
|
credentials: "include"
|
|
70
70
|
});
|
|
71
|
-
if (!
|
|
72
|
-
throw
|
|
73
|
-
`Session check failed: ${
|
|
74
|
-
|
|
71
|
+
if (!r.ok)
|
|
72
|
+
throw r.status === 401 || r.status === 403 ? new x("Not authenticated", r.status) : new x(
|
|
73
|
+
`Session check failed: ${r.statusText}`,
|
|
74
|
+
r.status
|
|
75
75
|
);
|
|
76
|
-
return await
|
|
76
|
+
return await r.json();
|
|
77
77
|
}
|
|
78
78
|
function Y(e, t) {
|
|
79
79
|
return new Promise(() => {
|
|
80
|
-
const
|
|
81
|
-
if (!
|
|
80
|
+
const n = E(), r = $();
|
|
81
|
+
if (!r)
|
|
82
82
|
throw new Error(
|
|
83
83
|
'Auth base URL is not configured. Call setApiBaseUrl("https://...") or configureAuth({ baseUrl: "https://..." }) first.'
|
|
84
84
|
);
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
87
|
-
const w = Object.keys(
|
|
85
|
+
const s = e || n.defaultProvider, u = M(s);
|
|
86
|
+
if (!u) {
|
|
87
|
+
const w = Object.keys(n.providers || {}).join(", ") || "none";
|
|
88
88
|
throw new Error(
|
|
89
|
-
`Auth provider "${
|
|
89
|
+
`Auth provider "${s}" is not configured. Available providers: ${w}`
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
|
-
if (!
|
|
92
|
+
if (!u.loginPath)
|
|
93
93
|
throw new Error(
|
|
94
|
-
`Login path not configured for provider "${
|
|
94
|
+
`Login path not configured for provider "${s}". Configure it with: configureAuth({ providers: { ${s}: { loginPath: '/api/auth/...' } } })`
|
|
95
95
|
);
|
|
96
|
-
let
|
|
96
|
+
let g;
|
|
97
97
|
try {
|
|
98
|
-
|
|
98
|
+
g = new URL(`${r}${u.loginPath}`);
|
|
99
99
|
} catch {
|
|
100
100
|
throw new Error(
|
|
101
|
-
`Failed to construct login URL. Base URL: "${
|
|
101
|
+
`Failed to construct login URL. Base URL: "${r}", Login path: "${u.loginPath}". Ensure baseUrl is a valid URL (e.g., "https://example.com").`
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
|
-
(t != null && t.callbackUrl ||
|
|
104
|
+
(t != null && t.callbackUrl || n.callbackUrl) && g.searchParams.set(
|
|
105
105
|
"callbackUrl",
|
|
106
|
-
(t == null ? void 0 : t.callbackUrl) ||
|
|
106
|
+
(t == null ? void 0 : t.callbackUrl) || n.callbackUrl || window.location.href
|
|
107
107
|
), t != null && t.params && Object.entries(t.params).forEach(([w, A]) => {
|
|
108
|
-
|
|
109
|
-
}), window.open(
|
|
108
|
+
g.searchParams.set(w, A);
|
|
109
|
+
}), window.open(g.toString(), "_blank");
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
async function se(e) {
|
|
113
|
-
const t =
|
|
114
|
-
if (
|
|
113
|
+
const t = E(), n = $(), r = M(t.defaultProvider), s = r == null ? void 0 : r.logoutPath;
|
|
114
|
+
if (s && (e == null ? void 0 : e.callLogoutEndpoint) !== !1)
|
|
115
115
|
try {
|
|
116
|
-
await fetch(`${
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
credentials: "include"
|
|
120
|
-
});
|
|
121
|
-
} catch (h) {
|
|
122
|
-
console.warn("Logout endpoint call failed:", h);
|
|
116
|
+
await fetch(`${n}${s}`);
|
|
117
|
+
} catch (u) {
|
|
118
|
+
console.warn("Logout endpoint call failed:", u);
|
|
123
119
|
}
|
|
124
120
|
e != null && e.redirectUrl ? window.location.href = e.redirectUrl : t.loginRedirectUrl && (window.location.href = t.loginRedirectUrl);
|
|
125
121
|
}
|
|
126
|
-
const
|
|
122
|
+
const V = D(null), G = ["auth", "session"];
|
|
127
123
|
function ye({
|
|
128
124
|
children: e,
|
|
129
125
|
config: t,
|
|
130
|
-
onAuthChange:
|
|
131
|
-
onError:
|
|
132
|
-
loadingComponent:
|
|
133
|
-
unauthenticatedComponent:
|
|
134
|
-
skipInitialCheck:
|
|
126
|
+
onAuthChange: n,
|
|
127
|
+
onError: r,
|
|
128
|
+
loadingComponent: s,
|
|
129
|
+
unauthenticatedComponent: u,
|
|
130
|
+
skipInitialCheck: g = !1
|
|
135
131
|
}) {
|
|
136
132
|
const w = p(!1);
|
|
137
133
|
t && !w.current && (ie(t), w.current = !0);
|
|
138
|
-
const A =
|
|
134
|
+
const A = te(), c = E(), {
|
|
139
135
|
data: i,
|
|
140
|
-
isLoading:
|
|
136
|
+
isLoading: h,
|
|
141
137
|
error: U,
|
|
142
138
|
refetch: v,
|
|
143
139
|
isFetching: m
|
|
144
|
-
} =
|
|
140
|
+
} = re({
|
|
145
141
|
queryKey: G,
|
|
146
142
|
queryFn: ae,
|
|
147
|
-
enabled: !
|
|
148
|
-
retry: (o, y) => y instanceof x && (y.statusCode === 401 || y.statusCode === 403) ? !1 : o <
|
|
149
|
-
retryDelay:
|
|
150
|
-
staleTime:
|
|
151
|
-
gcTime:
|
|
152
|
-
refetchOnWindowFocus:
|
|
153
|
-
refetchOnReconnect:
|
|
154
|
-
refetchInterval:
|
|
155
|
-
}), [
|
|
156
|
-
b.current =
|
|
157
|
-
const R = p(
|
|
158
|
-
R.current =
|
|
143
|
+
enabled: !g,
|
|
144
|
+
retry: (o, y) => y instanceof x && (y.statusCode === 401 || y.statusCode === 403) ? !1 : o < c.retry.count,
|
|
145
|
+
retryDelay: c.retry.delay,
|
|
146
|
+
staleTime: c.staleTime,
|
|
147
|
+
gcTime: c.staleTime * 2,
|
|
148
|
+
refetchOnWindowFocus: c.refetchOnWindowFocus ?? !0,
|
|
149
|
+
refetchOnReconnect: c.refetchOnReconnect ?? !0,
|
|
150
|
+
refetchInterval: c.sessionCheckInterval || !1
|
|
151
|
+
}), [S, P] = Z(null), l = k(() => h || m ? "loading" : Object.keys((i == null ? void 0 : i.userDetails) || {}).length > 0 ? "authenticated" : "unauthenticated", [h, m, i]), a = (i == null ? void 0 : i.userDetails) || null, B = (i == null ? void 0 : i.staticBaseUrl) || null, I = (i == null ? void 0 : i.buildId) || null, O = l === "authenticated", b = p(n);
|
|
152
|
+
b.current = n;
|
|
153
|
+
const R = p(r);
|
|
154
|
+
R.current = r, L(() => {
|
|
159
155
|
var o;
|
|
160
|
-
|
|
161
|
-
}, [l,
|
|
156
|
+
h || (o = b.current) == null || o.call(b, l, a);
|
|
157
|
+
}, [l, a, h]), L(() => {
|
|
162
158
|
var o;
|
|
163
|
-
U && (
|
|
159
|
+
U && (P(U), (o = R.current) == null || o.call(R, U));
|
|
164
160
|
}, [U]), L(() => {
|
|
165
|
-
l === "unauthenticated" &&
|
|
166
|
-
}, [l,
|
|
167
|
-
const
|
|
161
|
+
l === "unauthenticated" && c.autoRedirect && !h && Y();
|
|
162
|
+
}, [l, h, c.autoRedirect]);
|
|
163
|
+
const F = f(
|
|
168
164
|
(o, y) => {
|
|
169
165
|
Y(o, y);
|
|
170
166
|
},
|
|
171
167
|
[]
|
|
172
|
-
),
|
|
168
|
+
), T = f(
|
|
173
169
|
async (o) => {
|
|
174
170
|
A.removeQueries({ queryKey: G }), await se(o);
|
|
175
171
|
},
|
|
176
172
|
[A]
|
|
177
|
-
), j =
|
|
173
|
+
), j = f(async () => {
|
|
178
174
|
if (m)
|
|
179
175
|
return i || null;
|
|
180
176
|
try {
|
|
181
177
|
return (await v()).data || null;
|
|
182
178
|
} catch (o) {
|
|
183
|
-
return
|
|
179
|
+
return P(o), null;
|
|
184
180
|
}
|
|
185
|
-
}, [v, m, i]), q =
|
|
186
|
-
(o) => (
|
|
187
|
-
[
|
|
188
|
-
), Q =
|
|
189
|
-
(o) => o.includes((
|
|
190
|
-
[
|
|
191
|
-
), _ =
|
|
192
|
-
|
|
193
|
-
}, []), K =
|
|
181
|
+
}, [v, m, i]), q = f(
|
|
182
|
+
(o) => (a == null ? void 0 : a.Role) === o,
|
|
183
|
+
[a]
|
|
184
|
+
), Q = f(
|
|
185
|
+
(o) => o.includes((a == null ? void 0 : a.Role) || ""),
|
|
186
|
+
[a]
|
|
187
|
+
), _ = f(() => {
|
|
188
|
+
P(null);
|
|
189
|
+
}, []), K = f(() => {
|
|
194
190
|
v();
|
|
195
|
-
}, [v]),
|
|
191
|
+
}, [v]), z = k(
|
|
196
192
|
() => ({
|
|
197
|
-
user:
|
|
198
|
-
staticBaseUrl:
|
|
199
|
-
buildId:
|
|
193
|
+
user: a,
|
|
194
|
+
staticBaseUrl: B,
|
|
195
|
+
buildId: I,
|
|
200
196
|
status: l,
|
|
201
|
-
isAuthenticated:
|
|
202
|
-
isLoading:
|
|
203
|
-
login:
|
|
204
|
-
logout:
|
|
197
|
+
isAuthenticated: O,
|
|
198
|
+
isLoading: h,
|
|
199
|
+
login: F,
|
|
200
|
+
logout: T,
|
|
205
201
|
refreshSession: j,
|
|
206
202
|
hasRole: q,
|
|
207
203
|
hasAnyRole: Q,
|
|
208
|
-
error:
|
|
204
|
+
error: S,
|
|
209
205
|
clearError: _,
|
|
210
206
|
_forceCheck: K
|
|
211
207
|
}),
|
|
212
208
|
[
|
|
213
|
-
|
|
214
|
-
O,
|
|
209
|
+
a,
|
|
215
210
|
B,
|
|
216
|
-
l,
|
|
217
211
|
I,
|
|
218
|
-
|
|
219
|
-
|
|
212
|
+
l,
|
|
213
|
+
O,
|
|
214
|
+
h,
|
|
220
215
|
F,
|
|
216
|
+
T,
|
|
221
217
|
j,
|
|
222
218
|
q,
|
|
223
219
|
Q,
|
|
224
|
-
|
|
220
|
+
S,
|
|
225
221
|
_,
|
|
226
222
|
K
|
|
227
223
|
]
|
|
228
224
|
);
|
|
229
|
-
return l === "loading" &&
|
|
225
|
+
return l === "loading" && s ? /* @__PURE__ */ C(W, { children: s }) : l === "unauthenticated" && !c.autoRedirect && u ? /* @__PURE__ */ C(W, { children: u }) : /* @__PURE__ */ C(V.Provider, { value: z, children: e });
|
|
230
226
|
}
|
|
231
227
|
function ce() {
|
|
232
|
-
const e =
|
|
228
|
+
const e = ee(V);
|
|
233
229
|
if (!e)
|
|
234
230
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
235
231
|
return e;
|
|
@@ -275,8 +271,8 @@ export {
|
|
|
275
271
|
be as AuthStatus,
|
|
276
272
|
x as AuthenticationError,
|
|
277
273
|
ie as configureAuth,
|
|
278
|
-
|
|
279
|
-
|
|
274
|
+
$ as getAuthBaseUrl,
|
|
275
|
+
E as getAuthConfig,
|
|
280
276
|
we as resetAuthConfig,
|
|
281
277
|
ge as setAuthProvider,
|
|
282
278
|
Ae as useAuth
|
package/dist/bdo/core/Item.d.ts
CHANGED
|
@@ -64,6 +64,10 @@ export declare class Item<T extends Record<string, unknown>> {
|
|
|
64
64
|
private readonly _bdo;
|
|
65
65
|
private readonly _accessorCache;
|
|
66
66
|
constructor(bdo: BdoLike, data: Partial<T>);
|
|
67
|
+
/**
|
|
68
|
+
* Require instanceId or throw.
|
|
69
|
+
* TODO: Support create flow via draftInteraction to get temp _id
|
|
70
|
+
*/
|
|
67
71
|
private _requireInstanceId;
|
|
68
72
|
/**
|
|
69
73
|
* Get or create a field accessor for the given field.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../sdk/bdo/core/Item.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAEV,cAAc,EACd,aAAa,EACd,MAAM,yBAAyB,CAAC;AAYjC;;GAEG;AACH,UAAU,OAAO;IACf,SAAS,IAAI,MAAM,CAAC,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,CAAA;CAAE,CAAC;AAE3B;;;;;;;;;;;;;;GAcG;AACH,qBAAa,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACjD,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAC/B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAsD;gBAEzE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAgF1C;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAU1B;;;OAGG;IACH,OAAO,CAAC,YAAY;IA6PpB;;OAEG;IACH,QAAQ,IAAI,oBAAoB;IAqChC;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC;CAGrB"}
|
|
@@ -28,6 +28,6 @@ export declare class ReferenceField<TRef = unknown> extends BaseField<ReferenceF
|
|
|
28
28
|
* Fetch referenced records from the backend via the fetchField API.
|
|
29
29
|
* Requires the field to be bound to a parent BDO.
|
|
30
30
|
*/
|
|
31
|
-
fetchOptions(instanceId
|
|
31
|
+
fetchOptions(instanceId: string): Promise<TRef[]>;
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=ReferenceField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferenceField.d.ts","sourceRoot":"","sources":["../../../sdk/bdo/fields/ReferenceField.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,sBAAsB,IAAI,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE/G,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAc,CAAC,IAAI,GAAG,OAAO,CAAE,SAAQ,SAAS,CAC3D,kBAAkB,CAAC,IAAI,CAAC,CACzB;gBACa,IAAI,EAAE,yBAAyB;IAI3C,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,IAAI,eAAe,IAAI,SAAS,MAAM,EAAE,CAEvC;IAED,IAAI,YAAY,IAAI,SAAS,MAAM,EAAE,CAEpC;IAED,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,oBAAoB;IAuB3E;;;OAGG;IACG,YAAY,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"ReferenceField.d.ts","sourceRoot":"","sources":["../../../sdk/bdo/fields/ReferenceField.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,sBAAsB,IAAI,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE/G,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAc,CAAC,IAAI,GAAG,OAAO,CAAE,SAAQ,SAAS,CAC3D,kBAAkB,CAAC,IAAI,CAAC,CACzB;gBACa,IAAI,EAAE,yBAAyB;IAI3C,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,IAAI,eAAe,IAAI,SAAS,MAAM,EAAE,CAEvC;IAED,IAAI,YAAY,IAAI,SAAS,MAAM,EAAE,CAEpC;IAED,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,oBAAoB;IAuB3E;;;OAGG;IACG,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;CAQxD"}
|
|
@@ -22,6 +22,6 @@ export declare class SelectField<T extends string | number = string> extends Bas
|
|
|
22
22
|
/**
|
|
23
23
|
* Fetch dynamic options from the backend, returned as typed SelectOption[]
|
|
24
24
|
*/
|
|
25
|
-
fetchOptions(instanceId
|
|
25
|
+
fetchOptions(instanceId: string): Promise<SelectOptionType<T>[]>;
|
|
26
26
|
}
|
|
27
27
|
//# sourceMappingURL=SelectField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../sdk/bdo/fields/SelectField.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,IAAI,sBAAsB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG3H,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;gBACnE,IAAI,EAAE,sBAAsB;IAIxC,kDAAkD;IAClD,IAAI,OAAO,IAAI,SAAS,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAG5C;IAED,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,oBAAoB;IAqBpD;;OAEG;IACG,YAAY,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../sdk/bdo/fields/SelectField.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,IAAI,sBAAsB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG3H,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;gBACnE,IAAI,EAAE,sBAAsB;IAIxC,kDAAkD;IAClD,IAAI,OAAO,IAAI,SAAS,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAG5C;IAED,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,oBAAoB;IAqBpD;;OAEG;IACG,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;CAevE"}
|
|
@@ -19,7 +19,7 @@ export declare class UserField extends BaseField<UserFieldType> {
|
|
|
19
19
|
* Fetch user records from the backend via the fetchField API.
|
|
20
20
|
* Requires the field to be bound to a parent BDO.
|
|
21
21
|
*/
|
|
22
|
-
fetchOptions(instanceId
|
|
22
|
+
fetchOptions(instanceId: string): Promise<UserFieldType[]>;
|
|
23
23
|
validate(value: UserFieldType | undefined): ValidationResultType;
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=UserField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserField.d.ts","sourceRoot":"","sources":["../../../sdk/bdo/fields/UserField.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE7E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;;;GASG;AACH,qBAAa,SAAU,SAAQ,SAAS,CAAC,aAAa,CAAC;gBACzC,IAAI,EAAE,iBAAiB;IAInC,yCAAyC;IACzC,IAAI,cAAc,IAAI,MAAM,GAAG,SAAS,CAEvC;IAED;;;OAGG;IACG,YAAY,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"UserField.d.ts","sourceRoot":"","sources":["../../../sdk/bdo/fields/UserField.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE7E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;;;;GASG;AACH,qBAAa,SAAU,SAAQ,SAAS,CAAC,aAAa,CAAC;gBACzC,IAAI,EAAE,iBAAiB;IAInC,yCAAyC;IACzC,IAAI,cAAc,IAAI,MAAM,GAAG,SAAS,CAEvC;IAED;;;OAGG;IACG,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAShE,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,oBAAoB;CAsBjE"}
|