@overmap-ai/common 0.0.12-captures.1 → 0.0.12-issue-update-updates.1
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/enums/issue.d.ts +7 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +33 -33
- package/dist/typings/index.d.ts +1 -0
- package/dist/typings/models/index.d.ts +0 -1
- package/dist/typings/models/issues.d.ts +43 -19
- package/dist/typings/utils.d.ts +3 -0
- package/dist/utils/models/base.d.ts +0 -3
- package/package.json +1 -1
- package/dist/typings/models/captures.d.ts +0 -31
package/dist/enums/issue.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare enum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
export declare enum IssueUpdateType {
|
|
2
|
+
STATUS_CHANGE = "status_changed",
|
|
3
|
+
PRIORITY_CHANGE = "priority_changed",
|
|
4
|
+
DESCRIPTION_CHANGE = "description_changed",
|
|
5
|
+
TITLE_CHANGE = "title_changed",
|
|
6
|
+
ASSIGNED_TO_CHANGE = "assigned_to_changed",
|
|
7
|
+
DUE_DATE_CHANGE = "due_date_changed"
|
|
8
8
|
}
|
|
9
9
|
export declare enum IssueStatusType {
|
|
10
10
|
BACKLOG = 0,
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("uuid"),l=require("fast-tree-builder");l=s(l,1);let u=require("ts-tree-lib");var d=function(e){return e[e.GUEST=0]=`GUEST`,e[e.BASIC=2]=`BASIC`,e[e.ADMIN=4]=`ADMIN`,e}({}),f=function(e){return e[e.PLANNED=0]=`PLANNED`,e[e.ACTIVE=1]=`ACTIVE`,e[e.MAINTENANCE=2]=`MAINTENANCE`,e[e.INACTIVE=3]=`INACTIVE`,e[e.RETIRED=4]=`RETIRED`,e[e.DISPOSED=5]=`DISPOSED`,e}({}),p=function(e){return e.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("uuid"),l=require("fast-tree-builder");l=s(l,1);let u=require("ts-tree-lib");var d=function(e){return e[e.GUEST=0]=`GUEST`,e[e.BASIC=2]=`BASIC`,e[e.ADMIN=4]=`ADMIN`,e}({}),f=function(e){return e[e.PLANNED=0]=`PLANNED`,e[e.ACTIVE=1]=`ACTIVE`,e[e.MAINTENANCE=2]=`MAINTENANCE`,e[e.INACTIVE=3]=`INACTIVE`,e[e.RETIRED=4]=`RETIRED`,e[e.DISPOSED=5]=`DISPOSED`,e}({}),p=function(e){return e.STATUS_CHANGE=`status_changed`,e.PRIORITY_CHANGE=`priority_changed`,e.DESCRIPTION_CHANGE=`description_changed`,e.TITLE_CHANGE=`title_changed`,e.ASSIGNED_TO_CHANGE=`assigned_to_changed`,e.DUE_DATE_CHANGE=`due_date_changed`,e}({}),m=function(e){return e[e.BACKLOG=0]=`BACKLOG`,e[e.PLANNED=1]=`PLANNED`,e[e.IN_PROGRESS=2]=`IN_PROGRESS`,e[e.COMPLETED=3]=`COMPLETED`,e[e.CANCELLED=4]=`CANCELLED`,e}({}),h=function(e){return e[e.LOWEST=0]=`LOWEST`,e[e.LOW=2]=`LOW`,e[e.MEDIUM=4]=`MEDIUM`,e[e.HIGH=6]=`HIGH`,e[e.HIGHEST=8]=`HIGHEST`,e}({}),g=function(e){return e[e.ADD_ASSIGNEE=0]=`ADD_ASSIGNEE`,e[e.REMOVE_ASSIGNEE=2]=`REMOVE_ASSIGNEE`,e[e.ADD_REVIEWER=4]=`ADD_REVIEWER`,e[e.REMOVE_REVIEWER=6]=`REMOVE_REVIEWER`,e}({}),_=function(e){return e[e.APPROVED=0]=`APPROVED`,e[e.REJECTED=2]=`REJECTED`,e[e.CHANGES_REQUESTED=4]=`CHANGES_REQUESTED`,e}({}),v=function(e){return e[e.USER_REGISTRATION=0]=`USER_REGISTRATION`,e[e.APPLICATION_INVITE=2]=`APPLICATION_INVITE`,e[e.PROJECT_INVITE=4]=`PROJECT_INVITE`,e[e.ORGANIZATION_INVITE=6]=`ORGANIZATION_INVITE`,e[e.ADD_EMAIL_DOMAIN=8]=`ADD_EMAIL_DOMAIN`,e[e.RESET_PASSWORD=10]=`RESET_PASSWORD`,e}({}),y=function(e){return e.PENDING=`pending`,e.GENERATING=`generating`,e.FAILED=`failed`,e.COMPLETE=`complete`,e}({});function ee(e){return{...e,uuid:(0,c.v4)()}}function te(e){return e.uuid}function ne(e){let t={};for(let n of e)t[n.uuid]=n;return t}function b(e){return e.map(({uuid:e})=>e)}function x(e,t){return e.localeCompare(t)}function S(e,t){return e.uuid===t.uuid}function C(e,t){if(e.length<=t)return e;let n=e.slice(0,t-1);return n.slice(0,n.lastIndexOf(` `))+`…`}function w(e,t){return t===1?e:e+`s`}function T(e){let t=e.trim().split(/[\s-_]+/).filter(e=>e.length>0);if(t.length===0)return``;if(t.length===1){let e=t[0];if(e.length<=3)return e.toUpperCase();let n=e.replace(/[aeiouAEIOU]/g,``);return n.length>=2?n.slice(0,3).toUpperCase():e.slice(0,3).toUpperCase()}return t.length===2?(t[0][0]+t[1].slice(0,2)).toUpperCase():t.slice(0,3).map(e=>e[0]).join(``).toUpperCase()}function E(e,t){return e.toLowerCase().includes(t.toLowerCase())}function D(e,t=``,n=255){let r=e.replace(/[^a-z0-9_\-.]/gi,`_`).replace(/_{2,}/g,`_`),i=t?`.${t.replace(/^\.+/,``)}`:``;if(!i){let e=r.lastIndexOf(`.`);e>0&&(i=r.slice(e))}if(!Number.isInteger(n)||n<=i.length)throw RangeError(`maxLength must leave room for the filename and extension.`);return i&&r.toLowerCase().endsWith(i.toLowerCase())&&(r=r.slice(0,-i.length)),r.slice(0,n-i.length)+i}function O(e,t){let n=[],r=0,i=e.length;for(;r<i;)n.push(e.slice(r,r+=t));return n}var k=Object.freeze([]),A=Object.freeze({}),j=Object.freeze(new Set),M=Object.freeze(new Map),N=`Unlabelled asset`,P=[f.PLANNED,f.ACTIVE,f.MAINTENANCE,f.INACTIVE,f.RETIRED,f.DISPOSED],F=`Untitled issue`,I=[h.LOWEST,h.LOW,h.MEDIUM,h.HIGH,h.HIGHEST],L=[m.BACKLOG,m.PLANNED,m.IN_PROGRESS,m.COMPLETED,m.CANCELLED],R=[d.GUEST,d.BASIC,d.ADMIN],z=`Untitled document`,B=`Unknown user`,V=`An unexpected error occurred. Please try again later.`,H=`(Pending)`,U=1,re=7,W=`(Pending)`,G=(e,t)=>e.type===t.type?e.order-t.order:e.type-t.type,K=(e,t)=>E(e.label||`Unlabelled asset`,t)||E(e.index?.toString()??`(Pending)`,t),q=(e,t)=>e.type===t.type?e.order-t.order:e.type-t.type,J=(e,t)=>e.type===t.type?e.order-t.order:e.type-t.type,Y=(e,t)=>E(e.title||`Untitled issue`,t)||E(e.index?.toString()??`(Pending)`,t);function X(e,t){return e.id===t.id}function ie(e){return e.id}function ae(e,t){return x(e.uuid,t.uuid)}var oe=(e,t)=>e.submitted_at===t.submitted_at?0:e.submitted_at<t.submitted_at?-1:1,se=(e,t)=>e.name.localeCompare(t.name),ce=(e,t)=>E(e.name,t),le=(e,t)=>`${e.abbr}-${t.index??`(Pending)`}`,ue=e=>e?!e.published_at:!1,Z=e=>(0,l.default)(e,{id:e=>e.uuid,parentId:e=>e.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),de=e=>{let{roots:t}=Z(e);return t.map(e=>new u.Tree(e))},fe=(e,t)=>{let{nodes:n}=Z(t),r=n.get(e);if(!r)throw Error(`Node with uuid ${e} does not exist in document tree.`);return new u.Tree(r)},pe=(e,t)=>e.email.localeCompare(t.email),me=e=>e.length===0?k:e,Q=e=>Object.keys(e).length===0?A:e,he=e=>e.size===0?j:e,ge=e=>e.size===0?A:e;function _e(e){return e instanceof Error&&e.name===`AbortError`}var $=e=>e instanceof Date?e:new Date(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00`:e),ve=e=>$(e).toLocaleString(void 0,{year:`numeric`,month:`numeric`,day:`numeric`}),ye=e=>$(e).toLocaleString(void 0,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`}),be=e=>$(e).toLocaleString(void 0,{month:`long`,day:`numeric`,year:`numeric`}),xe=e=>$(e).toLocaleString(void 0,{month:`long`,day:`numeric`,year:`numeric`,hour:`numeric`,minute:`numeric`}),Se=class e extends Promise{_uuid;constructor(e,t){super(e),this._uuid=t}get uuid(){return this._uuid}set uuid(e){this._uuid=e}static from(t,n){return new e((e,n)=>{Promise.resolve(t).then(e).catch(n)},n)}then(e,t){let n=super.then(e,t);return n.uuid=this.uuid,n}catch(e){let t=super.catch(e);return t.uuid=this.uuid,t}finally(e){let t=super.finally(e);return t.uuid=this.uuid,t}};exports.ABBREVIATION_MAX_LENGTH=re,exports.ABBREVIATION_MIN_LENGTH=U,exports.ASSET_STATUS_TYPES=P,exports.AssetStatusType=f,exports.EMPTY_ARRAY=k,exports.EMPTY_MAP=M,exports.EMPTY_OBJECT=A,exports.EMPTY_SET=j,exports.ERROR_MSG_UNEXPECTED=V,exports.INDEX_FALLBACK=H,exports.ISSUE_PRIORITY_TYPES=I,exports.ISSUE_STATUS_TYPES=L,exports.IssuePriorityType=h,exports.IssueStatusType=m,exports.IssueUpdateType=p,exports.NON_EXISTING_USER_NAME=B,exports.ORGANIZATION_ACCESS_LEVELS=R,exports.OrganizationAccessLevel=d,exports.ProcedureStepEventType=g,exports.ProcedureStepFieldValuesReviewType=_,exports.REVISION_FALLBACK=W,exports.ReportStatus=y,exports.UNLABELLED_ASSET_LABEL=N,exports.UNTITLED_DOCUMENT_TITLE=z,exports.UNTITLED_ISSUE_TITLE=F,exports.UUIDPromise=Se,exports.VerificationCodeType=v,exports.assetFilterCallback=K,exports.assetTypeStatusSortFn=G,exports.chunkArray=O,exports.computeModelIndex=le,exports.fallbackToEmptyArray=me,exports.fallbackToEmptyMap=ge,exports.fallbackToEmptyObject=Q,exports.fallbackToEmptySet=he,exports.formatCompactDate=ve,exports.formatCompactDateWithTime=ye,exports.formatDate=be,exports.formatDateWithTime=xe,exports.generateAbbreviation=T,exports.getDocumentSubTree=fe,exports.getDocumentTrees=de,exports.getIsFieldValuesDraft=ue,exports.idModelEqualityFn=X,exports.includesLowercase=E,exports.isAbortError=_e,exports.issueFilterCallback=Y,exports.issueTypePrioritySortFn=J,exports.issueTypeStatusSortFn=q,exports.nameModelFilterFn=ce,exports.nameModelSortFn=se,exports.pluralize=w,exports.submittedAtModelSortFn=oe,exports.toFileNameSafeString=D,exports.toId=ie,exports.toUuid=te,exports.toUuidArray=b,exports.toUuidIdRecord=ne,exports.truncate=C,exports.userSortFn=pe,exports.uuidModelEqualityFn=S,exports.uuidModelSortFn=ae,exports.uuidObj=ee,exports.uuidSortFn=x;
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var r = /* @__PURE__ */ function(e) {
|
|
|
7
7
|
}({}), i = /* @__PURE__ */ function(e) {
|
|
8
8
|
return e[e.PLANNED = 0] = "PLANNED", e[e.ACTIVE = 1] = "ACTIVE", e[e.MAINTENANCE = 2] = "MAINTENANCE", e[e.INACTIVE = 3] = "INACTIVE", e[e.RETIRED = 4] = "RETIRED", e[e.DISPOSED = 5] = "DISPOSED", e;
|
|
9
9
|
}({}), a = /* @__PURE__ */ function(e) {
|
|
10
|
-
return e.
|
|
10
|
+
return e.STATUS_CHANGE = "status_changed", e.PRIORITY_CHANGE = "priority_changed", e.DESCRIPTION_CHANGE = "description_changed", e.TITLE_CHANGE = "title_changed", e.ASSIGNED_TO_CHANGE = "assigned_to_changed", e.DUE_DATE_CHANGE = "due_date_changed", e;
|
|
11
11
|
}({}), o = /* @__PURE__ */ function(e) {
|
|
12
12
|
return e[e.BACKLOG = 0] = "BACKLOG", e[e.PLANNED = 1] = "PLANNED", e[e.IN_PROGRESS = 2] = "IN_PROGRESS", e[e.COMPLETED = 3] = "COMPLETED", e[e.CANCELLED = 4] = "CANCELLED", e;
|
|
13
13
|
}({}), s = /* @__PURE__ */ function(e) {
|
|
@@ -22,39 +22,39 @@ var r = /* @__PURE__ */ function(e) {
|
|
|
22
22
|
return e.PENDING = "pending", e.GENERATING = "generating", e.FAILED = "failed", e.COMPLETE = "complete", e;
|
|
23
23
|
}({});
|
|
24
24
|
// src/utils/uuid.ts
|
|
25
|
-
function
|
|
25
|
+
function f(t) {
|
|
26
26
|
return {
|
|
27
27
|
...t,
|
|
28
28
|
uuid: e()
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function ee(e) {
|
|
32
32
|
return e.uuid;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function te(e) {
|
|
35
35
|
let t = {};
|
|
36
36
|
for (let n of e) t[n.uuid] = n;
|
|
37
37
|
return t;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function p(e) {
|
|
40
40
|
return e.map(({ uuid: e }) => e);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function m(e, t) {
|
|
43
43
|
return e.localeCompare(t);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function h(e, t) {
|
|
46
46
|
return e.uuid === t.uuid;
|
|
47
47
|
}
|
|
48
48
|
// src/utils/string.ts
|
|
49
|
-
function
|
|
49
|
+
function g(e, t) {
|
|
50
50
|
if (e.length <= t) return e;
|
|
51
51
|
let n = e.slice(0, t - 1);
|
|
52
52
|
return n.slice(0, n.lastIndexOf(" ")) + "…";
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function _(e, t) {
|
|
55
55
|
return t === 1 ? e : e + "s";
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function v(e) {
|
|
58
58
|
let t = e.trim().split(/[\s-_]+/).filter((e) => e.length > 0);
|
|
59
59
|
if (t.length === 0) return "";
|
|
60
60
|
if (t.length === 1) {
|
|
@@ -65,10 +65,10 @@ function _(e) {
|
|
|
65
65
|
}
|
|
66
66
|
return t.length === 2 ? (t[0][0] + t[1].slice(0, 2)).toUpperCase() : t.slice(0, 3).map((e) => e[0]).join("").toUpperCase();
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function y(e, t) {
|
|
69
69
|
return e.toLowerCase().includes(t.toLowerCase());
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function b(e, t = "", n = 255) {
|
|
72
72
|
let r = e.replace(/[^a-z0-9_\-.]/gi, "_").replace(/_{2,}/g, "_"), i = t ? `.${t.replace(/^\.+/, "")}` : "";
|
|
73
73
|
if (!i) {
|
|
74
74
|
let e = r.lastIndexOf(".");
|
|
@@ -78,85 +78,85 @@ function y(e, t = "", n = 255) {
|
|
|
78
78
|
return i && r.toLowerCase().endsWith(i.toLowerCase()) && (r = r.slice(0, -i.length)), r.slice(0, n - i.length) + i;
|
|
79
79
|
}
|
|
80
80
|
// src/utils/array.ts
|
|
81
|
-
function
|
|
81
|
+
function x(e, t) {
|
|
82
82
|
let n = [], r = 0, i = e.length;
|
|
83
83
|
for (; r < i;) n.push(e.slice(r, r += t));
|
|
84
84
|
return n;
|
|
85
85
|
}
|
|
86
86
|
// src/constants/empty.ts
|
|
87
|
-
var
|
|
87
|
+
var S = Object.freeze([]), C = Object.freeze({}), w = Object.freeze(/* @__PURE__ */ new Set()), T = Object.freeze(/* @__PURE__ */ new Map()), E = "Unlabelled asset", D = [
|
|
88
88
|
i.PLANNED,
|
|
89
89
|
i.ACTIVE,
|
|
90
90
|
i.MAINTENANCE,
|
|
91
91
|
i.INACTIVE,
|
|
92
92
|
i.RETIRED,
|
|
93
93
|
i.DISPOSED
|
|
94
|
-
],
|
|
94
|
+
], O = "Untitled issue", k = [
|
|
95
95
|
s.LOWEST,
|
|
96
96
|
s.LOW,
|
|
97
97
|
s.MEDIUM,
|
|
98
98
|
s.HIGH,
|
|
99
99
|
s.HIGHEST
|
|
100
|
-
],
|
|
100
|
+
], A = [
|
|
101
101
|
o.BACKLOG,
|
|
102
102
|
o.PLANNED,
|
|
103
103
|
o.IN_PROGRESS,
|
|
104
104
|
o.COMPLETED,
|
|
105
105
|
o.CANCELLED
|
|
106
|
-
],
|
|
106
|
+
], j = [
|
|
107
107
|
r.GUEST,
|
|
108
108
|
r.BASIC,
|
|
109
109
|
r.ADMIN
|
|
110
|
-
],
|
|
110
|
+
], M = "Untitled document", N = "Unknown user", P = "An unexpected error occurred. Please try again later.", F = "(Pending)", I = 1, ne = 7, L = "(Pending)", R = (e, t) => e.type === t.type ? e.order - t.order : e.type - t.type, z = (e, t) => y(e.label || "Unlabelled asset", t) || y(e.index?.toString() ?? "(Pending)", t), B = (e, t) => e.type === t.type ? e.order - t.order : e.type - t.type, V = (e, t) => e.type === t.type ? e.order - t.order : e.type - t.type, H = (e, t) => y(e.title || "Untitled issue", t) || y(e.index?.toString() ?? "(Pending)", t);
|
|
111
111
|
// src/utils/models/base.ts
|
|
112
|
-
function
|
|
112
|
+
function U(e, t) {
|
|
113
113
|
return e.id === t.id;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function W(e) {
|
|
116
116
|
return e.id;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
return
|
|
118
|
+
function G(e, t) {
|
|
119
|
+
return m(e.uuid, t.uuid);
|
|
120
120
|
}
|
|
121
|
-
var
|
|
121
|
+
var K = (e, t) => e.submitted_at === t.submitted_at ? 0 : e.submitted_at < t.submitted_at ? -1 : 1, q = (e, t) => e.name.localeCompare(t.name), J = (e, t) => y(e.name, t), Y = (e, t) => `${e.abbr}-${t.index ?? "(Pending)"}`, X = (e) => e ? !e.published_at : !1, Z = (e) => t(e, {
|
|
122
122
|
id: (e) => e.uuid,
|
|
123
123
|
parentId: (e) => e.parent_document,
|
|
124
124
|
includeEmptyChildrenArray: !0,
|
|
125
125
|
valueKey: !1
|
|
126
|
-
}),
|
|
126
|
+
}), re = (e) => {
|
|
127
127
|
let { roots: t } = Z(e);
|
|
128
128
|
return t.map((e) => new n(e));
|
|
129
|
-
},
|
|
129
|
+
}, ie = (e, t) => {
|
|
130
130
|
let { nodes: r } = Z(t), i = r.get(e);
|
|
131
131
|
if (!i) throw Error(`Node with uuid ${e} does not exist in document tree.`);
|
|
132
132
|
return new n(i);
|
|
133
|
-
},
|
|
133
|
+
}, ae = (e, t) => e.email.localeCompare(t.email), oe = (e) => e.length === 0 ? S : e, se = (e) => Object.keys(e).length === 0 ? C : e, Q = (e) => e.size === 0 ? w : e, ce = (e) => e.size === 0 ? C : e;
|
|
134
134
|
// src/utils/errors.ts
|
|
135
|
-
function
|
|
135
|
+
function le(e) {
|
|
136
136
|
return e instanceof Error && e.name === "AbortError";
|
|
137
137
|
}
|
|
138
138
|
// src/utils/date.ts
|
|
139
|
-
var $ = (e) => e instanceof Date ? e : new Date(/^\d{4}-\d{2}-\d{2}$/.test(e) ? `${e}T00:00:00` : e),
|
|
139
|
+
var $ = (e) => e instanceof Date ? e : new Date(/^\d{4}-\d{2}-\d{2}$/.test(e) ? `${e}T00:00:00` : e), ue = (e) => $(e).toLocaleString(void 0, {
|
|
140
140
|
year: "numeric",
|
|
141
141
|
month: "numeric",
|
|
142
142
|
day: "numeric"
|
|
143
|
-
}),
|
|
143
|
+
}), de = (e) => $(e).toLocaleString(void 0, {
|
|
144
144
|
year: "numeric",
|
|
145
145
|
month: "numeric",
|
|
146
146
|
day: "numeric",
|
|
147
147
|
hour: "numeric",
|
|
148
148
|
minute: "numeric"
|
|
149
|
-
}),
|
|
149
|
+
}), fe = (e) => $(e).toLocaleString(void 0, {
|
|
150
150
|
month: "long",
|
|
151
151
|
day: "numeric",
|
|
152
152
|
year: "numeric"
|
|
153
|
-
}),
|
|
153
|
+
}), pe = (e) => $(e).toLocaleString(void 0, {
|
|
154
154
|
month: "long",
|
|
155
155
|
day: "numeric",
|
|
156
156
|
year: "numeric",
|
|
157
157
|
hour: "numeric",
|
|
158
158
|
minute: "numeric"
|
|
159
|
-
}),
|
|
159
|
+
}), me = class e extends Promise {
|
|
160
160
|
_uuid;
|
|
161
161
|
constructor(e, t) {
|
|
162
162
|
super(e), this._uuid = t;
|
|
@@ -185,4 +185,4 @@ var $ = (e) => e instanceof Date ? e : new Date(/^\d{4}-\d{2}-\d{2}$/.test(e) ?
|
|
|
185
185
|
return t.uuid = this.uuid, t;
|
|
186
186
|
}
|
|
187
187
|
};
|
|
188
|
-
export {
|
|
188
|
+
export { ne as ABBREVIATION_MAX_LENGTH, I as ABBREVIATION_MIN_LENGTH, D as ASSET_STATUS_TYPES, i as AssetStatusType, S as EMPTY_ARRAY, T as EMPTY_MAP, C as EMPTY_OBJECT, w as EMPTY_SET, P as ERROR_MSG_UNEXPECTED, F as INDEX_FALLBACK, k as ISSUE_PRIORITY_TYPES, A as ISSUE_STATUS_TYPES, s as IssuePriorityType, o as IssueStatusType, a as IssueUpdateType, N as NON_EXISTING_USER_NAME, j as ORGANIZATION_ACCESS_LEVELS, r as OrganizationAccessLevel, c as ProcedureStepEventType, l as ProcedureStepFieldValuesReviewType, L as REVISION_FALLBACK, d as ReportStatus, E as UNLABELLED_ASSET_LABEL, M as UNTITLED_DOCUMENT_TITLE, O as UNTITLED_ISSUE_TITLE, me as UUIDPromise, u as VerificationCodeType, z as assetFilterCallback, R as assetTypeStatusSortFn, x as chunkArray, Y as computeModelIndex, oe as fallbackToEmptyArray, ce as fallbackToEmptyMap, se as fallbackToEmptyObject, Q as fallbackToEmptySet, ue as formatCompactDate, de as formatCompactDateWithTime, fe as formatDate, pe as formatDateWithTime, v as generateAbbreviation, ie as getDocumentSubTree, re as getDocumentTrees, X as getIsFieldValuesDraft, U as idModelEqualityFn, y as includesLowercase, le as isAbortError, H as issueFilterCallback, V as issueTypePrioritySortFn, B as issueTypeStatusSortFn, J as nameModelFilterFn, q as nameModelSortFn, _ as pluralize, K as submittedAtModelSortFn, b as toFileNameSafeString, W as toId, ee as toUuid, p as toUuidArray, te as toUuidIdRecord, g as truncate, ae as userSortFn, h as uuidModelEqualityFn, G as uuidModelSortFn, f as uuidObj, m as uuidSortFn };
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { IssuePriorityType, IssueStatusType,
|
|
1
|
+
import { IssuePriorityType, IssueStatusType, IssueUpdateType } from '../../enums';
|
|
2
|
+
import { VersionAnnotated } from '../utils';
|
|
2
3
|
import { Asset } from './assets';
|
|
3
4
|
import { AbbreviationModel, ColorModel, CreatedByModel, FieldsAttachmentModel, FieldsModel, FieldValuesModel, IconModel, IdentifierModel, IdentifierValueModel, IndexedModel, MarkableModel, RequiredFileModel, SubmittedAtModel, TimestampedModel, UUIDModel } from './base';
|
|
4
5
|
import { Organization } from './organizations';
|
|
@@ -20,30 +21,53 @@ export interface IssueComment extends UUIDModel, SubmittedAtModel, TimestampedMo
|
|
|
20
21
|
resolved: boolean;
|
|
21
22
|
}
|
|
22
23
|
export interface IssueUpdateChangeTypes {
|
|
23
|
-
[
|
|
24
|
+
[IssueUpdateType.STATUS_CHANGE]: VersionAnnotated<0, {
|
|
25
|
+
uuid: IssueTypeStatus["uuid"];
|
|
24
26
|
name: IssueTypeStatus["name"];
|
|
25
27
|
color: IssueTypeStatus["color"];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
}> | VersionAnnotated<1, {
|
|
29
|
+
before: IssueTypeStatus["uuid"];
|
|
30
|
+
after: IssueTypeStatus["uuid"];
|
|
31
|
+
}>;
|
|
32
|
+
[IssueUpdateType.PRIORITY_CHANGE]: VersionAnnotated<0, {
|
|
33
|
+
uuid: IssueTypePriority["uuid"];
|
|
29
34
|
name: IssueTypePriority["name"];
|
|
30
35
|
color: IssueTypePriority["color"];
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
[
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} |
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
}> | VersionAnnotated<1, {
|
|
37
|
+
before: IssueTypePriority["uuid"];
|
|
38
|
+
after: IssueTypePriority["uuid"];
|
|
39
|
+
}>;
|
|
40
|
+
[IssueUpdateType.DESCRIPTION_CHANGE]: VersionAnnotated<0, {}> | VersionAnnotated<1, {}>;
|
|
41
|
+
[IssueUpdateType.TITLE_CHANGE]: VersionAnnotated<0, {
|
|
42
|
+
title: string;
|
|
43
|
+
}> | VersionAnnotated<1, {
|
|
44
|
+
before: string;
|
|
45
|
+
after: string;
|
|
46
|
+
}>;
|
|
47
|
+
[IssueUpdateType.ASSIGNED_TO_CHANGE]: VersionAnnotated<0, {
|
|
48
|
+
assigned_to: {
|
|
49
|
+
full_name: string;
|
|
50
|
+
id: User["id"];
|
|
51
|
+
} | null;
|
|
52
|
+
}> | VersionAnnotated<1, {
|
|
53
|
+
before: User["id"] | null;
|
|
54
|
+
after: User["id"] | null;
|
|
55
|
+
}>;
|
|
56
|
+
[IssueUpdateType.DUE_DATE_CHANGE]: VersionAnnotated<0, {
|
|
57
|
+
due_date: string | null;
|
|
58
|
+
}> | VersionAnnotated<1, {
|
|
59
|
+
before: string | null;
|
|
60
|
+
after: string | null;
|
|
45
61
|
}>;
|
|
46
62
|
}
|
|
63
|
+
export type IssueUpdate = UUIDModel & CreatedByModel & TimestampedModel & {
|
|
64
|
+
issue: Issue["uuid"];
|
|
65
|
+
} & {
|
|
66
|
+
[TType in IssueUpdateType]: {
|
|
67
|
+
type: TType;
|
|
68
|
+
data: IssueUpdateChangeTypes[TType];
|
|
69
|
+
};
|
|
70
|
+
}[IssueUpdateType];
|
|
47
71
|
export interface IssueAssociation extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel {
|
|
48
72
|
issue: Issue["uuid"];
|
|
49
73
|
asset: Asset["uuid"];
|
|
@@ -3,9 +3,6 @@ export declare function idModelEqualityFn<TModel extends IdModel>(a: TModel, b:
|
|
|
3
3
|
export declare function toId<TModel extends IdModel>(value: TModel): number;
|
|
4
4
|
export declare function uuidModelSortFn<TModel extends UUIDModel>(a: TModel, b: TModel): number;
|
|
5
5
|
export declare const submittedAtModelSortFn: <TModel extends SubmittedAtModel>(a: TModel, b: TModel) => 0 | 1 | -1;
|
|
6
|
-
export declare const createdAtModelSortFn: <TModel extends {
|
|
7
|
-
created_at: string;
|
|
8
|
-
}>(a: TModel, b: TModel) => 0 | 1 | -1;
|
|
9
6
|
export declare const nameModelSortFn: <TModel extends {
|
|
10
7
|
name: string;
|
|
11
8
|
}>(a: TModel, b: TModel) => number;
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { CreatedByModel, IndexedModel, RequiredFileModel, TimestampedModel, UUIDModel } from './base';
|
|
2
|
-
import { Project } from './projects';
|
|
3
|
-
export interface Capture extends UUIDModel, TimestampedModel, CreatedByModel, IndexedModel, RequiredFileModel {
|
|
4
|
-
project: Project["uuid"];
|
|
5
|
-
captured_at: string;
|
|
6
|
-
}
|
|
7
|
-
export interface CaptureSidecar extends UUIDModel, TimestampedModel, CreatedByModel, RequiredFileModel {
|
|
8
|
-
capture: Capture["uuid"];
|
|
9
|
-
}
|
|
10
|
-
export type CaptureAnalysisStatus = "queued" | "processing" | "completed" | "failed";
|
|
11
|
-
export interface CaptureAnalysis extends UUIDModel, TimestampedModel, CreatedByModel {
|
|
12
|
-
capture: Capture["uuid"];
|
|
13
|
-
status: CaptureAnalysisStatus;
|
|
14
|
-
celery_task_id: string;
|
|
15
|
-
model_name: string;
|
|
16
|
-
schema_version: number;
|
|
17
|
-
error_message: string;
|
|
18
|
-
started_at: string | null;
|
|
19
|
-
finished_at: string | null;
|
|
20
|
-
}
|
|
21
|
-
export interface CaptureAnalysisItem extends UUIDModel, TimestampedModel {
|
|
22
|
-
analysis: CaptureAnalysis["uuid"];
|
|
23
|
-
position: number;
|
|
24
|
-
start_timestamp_ms: number;
|
|
25
|
-
end_timestamp_ms: number;
|
|
26
|
-
title: string;
|
|
27
|
-
description: string;
|
|
28
|
-
confidence: number;
|
|
29
|
-
visual_evidence: string;
|
|
30
|
-
sensor_evidence: string | null;
|
|
31
|
-
}
|