@things-factory/notification 6.0.0-alpha.12 → 6.0.0-alpha.19

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.
@@ -1,6 +1,7 @@
1
1
  import '@material/mwc-formfield'
2
2
  import '@material/mwc-button'
3
3
  import '@material/mwc-checkbox'
4
+ import '@operato/i18n/ox-i18n.js'
4
5
 
5
6
  import { css, html, LitElement } from 'lit'
6
7
 
@@ -89,11 +90,11 @@ export class NotificationSender extends localize(i18next)(LitElement) {
89
90
 
90
91
  <div buttons>
91
92
  <mwc-button raised icon="send" @click=${e => this.ontest()}>
92
- <i18n-msg msgid="button.notification-send"> </i18n-msg>
93
+ <ox-i18n msgid="button.notification-send"> </ox-i18n>
93
94
  </mwc-button>
94
95
 
95
96
  <mwc-button type="reset" outlined @click=${e => this.onreset()}>
96
- <i18n-msg msgid="button.reset"> </i18n-msg>
97
+ <ox-i18n msgid="button.reset"> </ox-i18n>
97
98
  </mwc-button>
98
99
  </div>
99
100
  </form>
@@ -3,6 +3,7 @@ import './notification-sender'
3
3
  import '@material/mwc-formfield'
4
4
  import '@material/mwc-switch'
5
5
  import '@material/mwc-button'
6
+ import '@operato/i18n/ox-i18n.js'
6
7
 
7
8
  import Clipboard from 'clipboard'
8
9
  import { css, html, LitElement } from 'lit'
@@ -71,7 +72,7 @@ export class NotificationSettingLet extends localize(i18next)(LitElement) {
71
72
 
72
73
  return html`
73
74
  <setting-let>
74
- <i18n-msg slot="title" msgid="title.notification subscription"></i18n-msg>
75
+ <oxi18n slot="title" msgid="title.notification subscription"></oxi18n>
75
76
 
76
77
  ${supported
77
78
  ? html`
@@ -85,12 +86,12 @@ export class NotificationSettingLet extends localize(i18next)(LitElement) {
85
86
  </div>
86
87
 
87
88
  <div slot="content" info>
88
- <label for="subscription-token"><i18n-msg msgid="label.subscription token"></i18n-msg></label>
89
+ <label for="subscription-token"><oxi18n msgid="label.subscription token"></oxi18n></label>
89
90
  <input id="subscription-token" type="text" name="subscription-token" .value=${
90
91
  this.subscription || ''
91
92
  } readonly />
92
93
  <mwc-button dense unelevated button-in-field clipboard-copy @click=${e =>
93
- e.preventDefault()}><i18n-msg msgid="button.copy"></mwc-button>
94
+ e.preventDefault()}><oxi18n msgid="button.copy"></mwc-button>
94
95
  </div>
95
96
  `
96
97
  : html` <div slot="content">${i18next.t('text.push notification is not supported in your browser')}</div>`}
@@ -1 +1 @@
1
- {"version":3,"file":"notification-resolver.js","sourceRoot":"","sources":["../../../server/service/notification/notification-resolver.ts"],"names":[],"mappings":";;;;AAAA,iEAAkD;AAClD,+CAAgE;AAEhE,iDAA8C;AAE9C,iDAA6C;AAG7C,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IA6B/B,YAAY,CACF,OAAuC,EACQ,OAAiB;QAExE,OAAO,OAAO,CAAC,YAAY,CAAA;IAC7B,CAAC;CACF,CAAA;AANC;IA5BC,IAAA,2BAAY,EAAC;QACZ,SAAS,EAAE,IAAA,kCAAU,EACnB,GAAG,EAAE,CAAC,cAAM,CAAC,aAAa,CAAC,cAAc,CAAC,EAC1C,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;YACpC,wDAAwD;YACxD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;YAEtC,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,SAAS,CAAA;YACnC,MAAM,EACJ,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAC3C,GAAG,OAAO,CAAA;YAEX,MAAM,SAAS,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,CAAA;YAEpC,IAAI,SAAS,EAAE;gBACb,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,EAAE;oBACrB,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,EAAE;wBAClC,OAAO,KAAK,CAAA;qBACb;iBACF;qBAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,EAAE;oBAC7D,OAAO,KAAK,CAAA;iBACb;aACF;YAED,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;QACrD,CAAC,CACF;KACF,CAAC;IAEC,mBAAA,IAAA,mBAAI,GAAE,CAAA;IACN,mBAAA,IAAA,kBAAG,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;;;4CACrD,2BAAY;wDAEd;AAlCU,oBAAoB;IADhC,IAAA,uBAAQ,GAAE;GACE,oBAAoB,CAmChC;AAnCY,oDAAoB","sourcesContent":["import { withFilter } from 'graphql-subscriptions'\nimport { Arg, Resolver, Root, Subscription } from 'type-graphql'\n\nimport { pubsub } from '@things-factory/shell'\n\nimport { Notification } from './notification'\n\n@Resolver()\nexport class NotificationResolver {\n @Subscription({\n subscribe: withFilter(\n () => pubsub.asyncIterator('notification'),\n (payload, variables, context, info) => {\n /* normally, subscription context doesn't have domain */\n const { domain, user } = context.state\n\n const { subjects = [] } = variables\n const {\n notification: { subject, domain: pdomain }\n } = payload\n\n const subdomain = pdomain?.subdomain\n\n if (subdomain) {\n if (domain?.subdomain) {\n if (subdomain !== domain.subdomain) {\n return false\n }\n } else if (!user.domains.find(d => d.subdomain === subdomain)) {\n return false\n }\n }\n\n return !subject || subjects.indexOf(subject) !== -1\n }\n )\n })\n notification(\n @Root() payload: { notification: Notification },\n @Arg('subjects', type => [String], { nullable: true }) subject: string[]\n ): Notification {\n return payload.notification\n }\n}\n"]}
1
+ {"version":3,"file":"notification-resolver.js","sourceRoot":"","sources":["../../../server/service/notification/notification-resolver.ts"],"names":[],"mappings":";;;;AAAA,iEAAkD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,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;;;4CACrD,2BAAY;wDAEd;AAlCU,oBAAoB;IADhC,IAAA,uBAAQ,GAAE;GACE,oBAAoB,CAmChC;AAnCY,oDAAoB","sourcesContent":["import { withFilter } from 'graphql-subscriptions'\nimport { Arg, Resolver, Root, Subscription } from 'type-graphql'\n\nimport { pubsub } from '@things-factory/shell'\n\nimport { Notification } from './notification'\n\n@Resolver()\nexport class NotificationResolver {\n @Subscription({\n subscribe: withFilter(\n () => pubsub.asyncIterator('notification'),\n (payload, variables, context, info) => {\n /* normally, subscription context doesn't have domain */\n const { domain, user } = context.state\n\n const { subjects = [] } = variables\n const {\n notification: { subject, domain: pdomain }\n } = payload\n\n const subdomain = pdomain?.subdomain\n\n if (subdomain) {\n if (domain?.subdomain) {\n if (subdomain !== domain.subdomain) {\n return false\n }\n } else if (!user.domains.find(d => d.subdomain === subdomain)) {\n return false\n }\n }\n\n return !subject || subjects.indexOf(subject) !== -1\n }\n )\n })\n notification(\n @Root() payload: { notification: Notification },\n @Arg('subjects', type => [String], { nullable: true }) subject: string[]\n ): Notification {\n return payload.notification\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../server/service/notification/notification.ts"],"names":[],"mappings":";;;;AAAA,+CAAgD;AAChD,iDAAyD;AAGzD,IAAa,YAAY,GAAzB,MAAa,YAAY;CA2BxB,CAAA;AAzBC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjC,cAAM;4CAAA;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;AAGb;IADC,IAAA,oBAAK,GAAE;;2CACK;AAGb;IADC,IAAA,oBAAK,GAAE;;0CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACf;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAChC;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;+CAAA;AA1BJ,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CA2BxB;AA3BY,oCAAY","sourcesContent":["import { ObjectType, Field } from 'type-graphql'\nimport { Domain, ScalarAny } from '@things-factory/shell'\n\n@ObjectType()\nexport class Notification {\n @Field(type => Domain, { nullable: true })\n domain?: Domain\n\n @Field({ nullable: true })\n subject?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field()\n title: string\n\n @Field()\n body: string\n\n @Field({ nullable: true })\n url: string\n\n @Field({ nullable: true })\n image: string\n\n @Field(type => ScalarAny, { nullable: true })\n property: any\n\n @Field({ nullable: true })\n timestamp: Date\n}\n"]}
1
+ {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../server/service/notification/notification.ts"],"names":[],"mappings":";;;;AAAA,+CAAgD;AAChD,iDAAyD;AAGlD,IAAM,YAAY,GAAlB,MAAM,YAAY;CA2BxB,CAAA;AA1BC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjC,cAAM;4CAAA;AAEf;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;AAEb;IAAC,IAAA,oBAAK,GAAE;;2CACK;AAEb;IAAC,IAAA,oBAAK,GAAE;;0CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACf;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAChC;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;+CAAA;AA1BJ,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CA2BxB;AA3BY,oCAAY","sourcesContent":["import { ObjectType, Field } from 'type-graphql'\nimport { Domain, ScalarAny } from '@things-factory/shell'\n\n@ObjectType()\nexport class Notification {\n @Field(type => Domain, { nullable: true })\n domain?: Domain\n\n @Field({ nullable: true })\n subject?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field()\n title: string\n\n @Field()\n body: string\n\n @Field({ nullable: true })\n url: string\n\n @Field({ nullable: true })\n image: string\n\n @Field(type => ScalarAny, { nullable: true })\n property: any\n\n @Field({ nullable: true })\n timestamp: Date\n}\n"]}