@things-factory/inquiry 10.1.256 → 10.1.257

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,13 +43,6 @@ export interface InquiryItem {
43
43
  attachments?: FileRow[];
44
44
  replies?: InquiryReplyItem[];
45
45
  }
46
- export interface InquiryInput {
47
- kind: string;
48
- title: string;
49
- body?: string;
50
- visibility?: string;
51
- pageUrl?: string;
52
- }
53
46
  export type InquirySummary = {
54
47
  newAnswers: number;
55
48
  unhandled: number;
@@ -63,11 +56,5 @@ export declare const FULL_FIELDS = "id kind title status visibility replyCount c
63
56
  /** Tells the badge and an open list that an inquiry changed. */
64
57
  export declare const inquiriesChanged: () => boolean;
65
58
  export declare const inquiryApi: {
66
- one: (id: string) => Promise<InquiryItem | null>;
67
59
  summary: () => Promise<InquirySummary>;
68
- create: (input: InquiryInput, attachments: File[], uploading?: (fraction: number) => void) => Promise<InquiryItem>;
69
- reply: (id: string, body: string, asAnswer: boolean, attachments: File[], uploading?: (fraction: number) => void) => Promise<InquiryItem>;
70
- move: (id: string, status: string, reason?: string) => Promise<InquiryItem>;
71
- take: (id: string) => Promise<InquiryItem>;
72
- read: (id: string) => Promise<InquiryItem>;
73
60
  };
@@ -1,8 +1,9 @@
1
1
  /*
2
- * The inquiry doors as the screens call them (ADR-0184). Every call throws the server's words when it is refused.
2
+ * The inquiry shapes and fields the screens read (ADR-0184), and the summary the menu badge and the list share. The
3
+ * screens declare their own reads and saves (ADR-0190).
3
4
  */
4
5
  import gql from 'graphql-tag';
5
- import { client, uploadContext } from '@operato/graphql';
6
+ import { client } from '@operato/graphql';
6
7
  /** The fields a list row needs. */
7
8
  export const LIST_FIELDS = `id kind title status visibility replyCount createdAt mine isNew creator { id name } assignee { id name }`;
8
9
  const FILE = `attachments { id name fullpath size mimetype }`;
@@ -17,18 +18,9 @@ function answer(response, field) {
17
18
  async function ask(query, variables, field) {
18
19
  return answer(await client.query({ query: gql(query), variables, fetchPolicy: 'network-only' }), field);
19
20
  }
20
- async function change(mutation, variables, field, uploading) {
21
- return answer(await client.mutate({ mutation: gql(mutation), variables, ...(uploading ? { context: uploadContext(uploading) } : {}) }), field);
22
- }
23
21
  /** Tells the badge and an open list that an inquiry changed. */
24
22
  export const inquiriesChanged = () => window.dispatchEvent(new CustomEvent('inquiries-changed'));
25
23
  export const inquiryApi = {
26
- one: (id) => ask(`query ($id: String!) { inquiry(id: $id) { ${FULL_FIELDS} } }`, { id }, 'inquiry'),
27
- summary: () => ask(`query { inquirySummary { newAnswers unhandled handler badge } }`, {}, 'inquirySummary'),
28
- create: (input, attachments, uploading) => change(`mutation ($input: InquiryInput!, $attachments: [Upload!]) { createInquiry(input: $input, attachments: $attachments) { id } }`, { input, attachments: attachments.length ? attachments : null }, 'createInquiry', attachments.length ? uploading : undefined),
29
- reply: (id, body, asAnswer, attachments, uploading) => change(`mutation ($id: String!, $body: String, $answer: Boolean, $attachments: [Upload!]) { replyInquiry(id: $id, body: $body, answer: $answer, attachments: $attachments) { id } }`, { id, body, answer: asAnswer, attachments: attachments.length ? attachments : null }, 'replyInquiry', attachments.length ? uploading : undefined),
30
- move: (id, status, reason) => change(`mutation ($id: String!, $status: String!, $reason: String) { moveInquiry(id: $id, status: $status, reason: $reason) { id } }`, { id, status, reason }, 'moveInquiry'),
31
- take: (id) => change(`mutation ($id: String!) { takeInquiry(id: $id) { id } }`, { id }, 'takeInquiry'),
32
- read: (id) => change(`mutation ($id: String!) { readInquiry(id: $id) { id } }`, { id }, 'readInquiry')
24
+ summary: () => ask(`query { inquirySummary { newAnswers unhandled handler badge } }`, {}, 'inquirySummary')
33
25
  };
34
26
  //# sourceMappingURL=inquiry-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inquiry-api.js","sourceRoot":"","sources":["../../client/utils/inquiry-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,aAA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,aAAa,CAAC;IAC3H,IAAI,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,MAAM,CAAc,yDAAyD,EAAE,EAAE,EAAE,EAAE,EAAE,aAAa,CAAC;CAC5H,CAAA","sourcesContent":["/*\n * The inquiry doors as the screens call them (ADR-0184). Every call throws the server's words when it is refused.\n */\nimport gql from 'graphql-tag'\n\nimport { client, uploadContext } from '@operato/graphql'\n\nexport type FileRow = { id: string; name: string; fullpath: string; size?: number; mimetype?: string }\nexport type Person = { id: string; name?: string | null } | null\n\nexport interface InquiryReplyItem {\n id: string\n body?: string | null\n byHandler: boolean\n answer: boolean\n status?: string | null\n createdAt: string\n creator?: Person\n attachments?: FileRow[]\n}\n\nexport interface InquiryItem {\n id: string\n kind: 'QUESTION' | 'BUG' | 'PROPOSAL' | string\n title: string\n body?: string | null\n status: string\n visibility: 'DOMAIN' | 'PRIVATE' | string\n pageUrl?: string | null\n appName?: string | null\n appVersion?: string | null\n replyCount: number\n createdAt: string\n answeredAt?: string | null\n closedAt?: string | null\n mine?: boolean\n isNew?: boolean\n canReply?: boolean\n asHandler?: boolean\n moves?: string[]\n creator?: Person\n assignee?: Person\n attachments?: FileRow[]\n replies?: InquiryReplyItem[]\n}\n\nexport interface InquiryInput {\n kind: string\n title: string\n body?: string\n visibility?: string\n pageUrl?: string\n}\n\nexport type InquirySummary = { newAnswers: number; unhandled: number; handler: boolean; badge: number }\n\n/** The fields a list row needs. */\nexport const LIST_FIELDS = `id kind title status visibility replyCount createdAt mine isNew creator { id name } assignee { id name }`\n\nconst FILE = `attachments { id name fullpath size mimetype }`\n\n/** Everything one inquiry shows. */\nexport const FULL_FIELDS = `${LIST_FIELDS} body pageUrl appName appVersion answeredAt closedAt canReply asHandler moves ${FILE}\n replies { id body byHandler answer status createdAt creator { id name } ${FILE} }`\n\nfunction answer<T>(response: any, field: string): T {\n if (response.errors?.length) throw new Error(response.errors.map((one: any) => one.message).join(' · '))\n return response.data?.[field] as T\n}\n\nasync function ask<T>(query: string, variables: Record<string, unknown>, field: string): Promise<T> {\n return answer<T>(await client.query({ query: gql(query), variables, fetchPolicy: 'network-only' }), field)\n}\n\nasync function change<T>(mutation: string, variables: Record<string, unknown>, field: string, uploading?: (fraction: number) => void): Promise<T> {\n return answer<T>(await client.mutate({ mutation: gql(mutation), variables, ...(uploading ? { context: uploadContext(uploading) } : {}) }), field)\n}\n\n/** Tells the badge and an open list that an inquiry changed. */\nexport const inquiriesChanged = () => window.dispatchEvent(new CustomEvent('inquiries-changed'))\n\nexport const inquiryApi = {\n one: (id: string) => ask<InquiryItem | null>(`query ($id: String!) { inquiry(id: $id) { ${FULL_FIELDS} } }`, { id }, 'inquiry'),\n summary: () => ask<InquirySummary>(`query { inquirySummary { newAnswers unhandled handler badge } }`, {}, 'inquirySummary'),\n create: (input: InquiryInput, attachments: File[], uploading?: (fraction: number) => void) =>\n change<InquiryItem>(\n `mutation ($input: InquiryInput!, $attachments: [Upload!]) { createInquiry(input: $input, attachments: $attachments) { id } }`,\n { input, attachments: attachments.length ? attachments : null },\n 'createInquiry',\n attachments.length ? uploading : undefined\n ),\n reply: (id: string, body: string, asAnswer: boolean, attachments: File[], uploading?: (fraction: number) => void) =>\n change<InquiryItem>(\n `mutation ($id: String!, $body: String, $answer: Boolean, $attachments: [Upload!]) { replyInquiry(id: $id, body: $body, answer: $answer, attachments: $attachments) { id } }`,\n { id, body, answer: asAnswer, attachments: attachments.length ? attachments : null },\n 'replyInquiry',\n attachments.length ? uploading : undefined\n ),\n move: (id: string, status: string, reason?: string) =>\n change<InquiryItem>(`mutation ($id: String!, $status: String!, $reason: String) { moveInquiry(id: $id, status: $status, reason: $reason) { id } }`, { id, status, reason }, 'moveInquiry'),\n take: (id: string) => change<InquiryItem>(`mutation ($id: String!) { takeInquiry(id: $id) { id } }`, { id }, 'takeInquiry'),\n read: (id: string) => change<InquiryItem>(`mutation ($id: String!) { readInquiry(id: $id) { id } }`, { id }, 'readInquiry')\n}\n"]}
1
+ {"version":3,"file":"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n * The inquiry shapes and fields the screens read (ADR-0184), and the summary the menu badge and the list share. The\n * screens declare their own reads and saves (ADR-0190).\n */\nimport gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\n\nexport type FileRow = { id: string; name: string; fullpath: string; size?: number; mimetype?: string }\nexport type Person = { id: string; name?: string | null } | null\n\nexport interface InquiryReplyItem {\n id: string\n body?: string | null\n byHandler: boolean\n answer: boolean\n status?: string | null\n createdAt: string\n creator?: Person\n attachments?: FileRow[]\n}\n\nexport interface InquiryItem {\n id: string\n kind: 'QUESTION' | 'BUG' | 'PROPOSAL' | string\n title: string\n body?: string | null\n status: string\n visibility: 'DOMAIN' | 'PRIVATE' | string\n pageUrl?: string | null\n appName?: string | null\n appVersion?: string | null\n replyCount: number\n createdAt: string\n answeredAt?: string | null\n closedAt?: string | null\n mine?: boolean\n isNew?: boolean\n canReply?: boolean\n asHandler?: boolean\n moves?: string[]\n creator?: Person\n assignee?: Person\n attachments?: FileRow[]\n replies?: InquiryReplyItem[]\n}\n\nexport type InquirySummary = { newAnswers: number; unhandled: number; handler: boolean; badge: number }\n\n/** The fields a list row needs. */\nexport const LIST_FIELDS = `id kind title status visibility replyCount createdAt mine isNew creator { id name } assignee { id name }`\n\nconst FILE = `attachments { id name fullpath size mimetype }`\n\n/** Everything one inquiry shows. */\nexport const FULL_FIELDS = `${LIST_FIELDS} body pageUrl appName appVersion answeredAt closedAt canReply asHandler moves ${FILE}\n replies { id body byHandler answer status createdAt creator { id name } ${FILE} }`\n\nfunction answer<T>(response: any, field: string): T {\n if (response.errors?.length) throw new Error(response.errors.map((one: any) => one.message).join(' · '))\n return response.data?.[field] as T\n}\n\nasync function ask<T>(query: string, variables: Record<string, unknown>, field: string): Promise<T> {\n return answer<T>(await client.query({ query: gql(query), variables, fetchPolicy: 'network-only' }), field)\n}\n\n/** Tells the badge and an open list that an inquiry changed. */\nexport const inquiriesChanged = () => window.dispatchEvent(new CustomEvent('inquiries-changed'))\n\nexport const inquiryApi = {\n summary: () => ask<InquirySummary>(`query { inquirySummary { newAnswers unhandled handler badge } }`, {}, 'inquirySummary')\n}\n"]}
@@ -9,5 +9,3 @@ export declare const visibilityWord: (code?: string | null) => string;
9
9
  export declare const KIND_ICONS: Record<string, string>;
10
10
  /** A day and time as the reader's locale writes it. */
11
11
  export declare function when(value?: string | Date | null): string;
12
- /** The words of a refusal the server gave, or the fallback. */
13
- export declare const reasonOf: (error: unknown) => string;
@@ -17,6 +17,4 @@ export function when(value) {
17
17
  return '';
18
18
  return new Date(value).toLocaleString(i18next.language, { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' });
19
19
  }
20
- /** The words of a refusal the server gave, or the fallback. */
21
- export const reasonOf = (error) => error?.message || t('inquiry.text.failed');
22
20
  //# sourceMappingURL=inquiry-words.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inquiry-words.js","sourceRoot":"","sources":["../../client/utils/inquiry-words.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAW,EAAE,UAAmC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;AAExG,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,CAAA;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;AACjD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAA;AAEhG,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAoB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AACjH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAoB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AACrH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAoB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,sBAAsB,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AAE7H,6BAA6B;AAC7B,MAAM,CAAC,MAAM,UAAU,GAA2B,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAA;AAEhH,uDAAuD;AACvD,MAAM,UAAU,IAAI,CAAC,KAA4B;IAC/C,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAA;IACrB,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAA;AACpJ,CAAC;AAED,+DAA+D;AAC/D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,EAAE,CAAE,KAAe,EAAE,OAAO,IAAI,CAAC,CAAC,qBAAqB,CAAC,CAAA","sourcesContent":["/*\n * The words and marks of inquiries - one place for the list, the thread, the writing window and the to-do.\n */\nimport { i18next } from '@operato/i18n'\n\nexport const t = (key: string, options: Record<string, unknown> = {}) => String(i18next.t(key, options))\n\nexport const KINDS = ['QUESTION', 'BUG', 'PROPOSAL']\nexport const VISIBILITIES = ['DOMAIN', 'PRIVATE']\nexport const STATUSES = ['RECEIVED', 'IN_PROGRESS', 'ANSWERED', 'PLANNED', 'DECLINED', 'CLOSED']\n\nexport const kindWord = (code?: string | null) => (code ? t(`inquiry.kind.${code}`, { defaultValue: code }) : '')\nexport const statusWord = (code?: string | null) => (code ? t(`inquiry.status.${code}`, { defaultValue: code }) : '')\nexport const visibilityWord = (code?: string | null) => (code ? t(`inquiry.visibility.${code}`, { defaultValue: code }) : '')\n\n/** The icon of each kind. */\nexport const KIND_ICONS: Record<string, string> = { QUESTION: 'help', BUG: 'bug_report', PROPOSAL: 'lightbulb' }\n\n/** A day and time as the reader's locale writes it. */\nexport function when(value?: string | Date | null): string {\n if (!value) return ''\n return new Date(value).toLocaleString(i18next.language, { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' })\n}\n\n/** The words of a refusal the server gave, or the fallback. */\nexport const reasonOf = (error: unknown) => (error as Error)?.message || t('inquiry.text.failed')\n"]}
1
+ {"version":3,"file":"inquiry-words.js","sourceRoot":"","sources":["../../client/utils/inquiry-words.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAW,EAAE,UAAmC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;AAExG,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,CAAA;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;AACjD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAA;AAEhG,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAoB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AACjH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAoB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AACrH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAoB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,sBAAsB,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AAE7H,6BAA6B;AAC7B,MAAM,CAAC,MAAM,UAAU,GAA2B,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAA;AAEhH,uDAAuD;AACvD,MAAM,UAAU,IAAI,CAAC,KAA4B;IAC/C,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAA;IACrB,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAA;AACpJ,CAAC","sourcesContent":["/*\n * The words and marks of inquiries - one place for the list, the thread, the writing window and the to-do.\n */\nimport { i18next } from '@operato/i18n'\n\nexport const t = (key: string, options: Record<string, unknown> = {}) => String(i18next.t(key, options))\n\nexport const KINDS = ['QUESTION', 'BUG', 'PROPOSAL']\nexport const VISIBILITIES = ['DOMAIN', 'PRIVATE']\nexport const STATUSES = ['RECEIVED', 'IN_PROGRESS', 'ANSWERED', 'PLANNED', 'DECLINED', 'CLOSED']\n\nexport const kindWord = (code?: string | null) => (code ? t(`inquiry.kind.${code}`, { defaultValue: code }) : '')\nexport const statusWord = (code?: string | null) => (code ? t(`inquiry.status.${code}`, { defaultValue: code }) : '')\nexport const visibilityWord = (code?: string | null) => (code ? t(`inquiry.visibility.${code}`, { defaultValue: code }) : '')\n\n/** The icon of each kind. */\nexport const KIND_ICONS: Record<string, string> = { QUESTION: 'help', BUG: 'bug_report', PROPOSAL: 'lightbulb' }\n\n/** A day and time as the reader's locale writes it. */\nexport function when(value?: string | Date | null): string {\n if (!value) return ''\n return new Date(value).toLocaleString(i18next.language, { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' })\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/inquiry",
3
- "version": "10.1.256",
3
+ "version": "10.1.257",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -27,27 +27,27 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@material/web": "^2.0.0",
30
- "@operato/data-grist": "^10.0.0",
31
- "@operato/graphql": "^10.29.39",
30
+ "@operato/data-grist": "^10.29.69",
31
+ "@operato/graphql": "^10.29.69",
32
32
  "@operato/i18n": "^10.0.0",
33
33
  "@operato/input": "^10.29.43",
34
34
  "@operato/layout": "^10.29.49",
35
35
  "@operato/popup": "^10.29.39",
36
- "@operato/shell": "^10.29.39",
36
+ "@operato/shell": "^10.29.69",
37
37
  "@operato/styles": "^10.29.1",
38
38
  "@operato/utils": "^10.0.0",
39
39
  "@things-factory/apptool-base": "^10.1.254",
40
- "@things-factory/attachment-base": "^10.1.256",
41
- "@things-factory/auth-base": "^10.1.256",
40
+ "@things-factory/attachment-base": "^10.1.257",
41
+ "@things-factory/auth-base": "^10.1.257",
42
42
  "@things-factory/env": "^10.1.149",
43
- "@things-factory/i18n-base": "^10.1.256",
44
- "@things-factory/notification": "^10.1.256",
43
+ "@things-factory/i18n-base": "^10.1.257",
44
+ "@things-factory/notification": "^10.1.257",
45
45
  "@things-factory/shell": "^10.1.254",
46
- "@things-factory/worklist": "^10.1.256",
46
+ "@things-factory/worklist": "^10.1.257",
47
47
  "graphql-scalars": "^1.22.0",
48
48
  "graphql-tag": "^2.12.6",
49
49
  "graphql-upload": "^15.0.2",
50
50
  "lit": "^3.1.2"
51
51
  },
52
- "gitHead": "2fd641697190ce6e87bcf454a60b2321553e8110"
52
+ "gitHead": "885b594299601ca4936f4f39701d6713273bbf1e"
53
53
  }