@linked.cm/capacitor 0.3.7 → 1.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @linked.cm/capacitor
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#26](https://github.com/linked-cm/capacitor/pull/26) [`35b571e`](https://github.com/linked-cm/capacitor/commit/35b571e4711faff440c0e11b31f2a21ded2d6fff) Thanks [@flyon](https://github.com/flyon)! - The ontology moves to `https://linked.cm/ont/capacitor/` and ships as Turtle with generated
8
+ accessor modules.
9
+
10
+ - **New namespace.** `LocationUpdateAction` moves from
11
+ `http://lincd.org/ont/lincd-capacitor/LocationUpdateAction` to
12
+ `https://linked.cm/ont/capacitor/LocationUpdateAction` (prefix `capacitor`), declared
13
+ `rdfs:subClassOf schema:UpdateAction`. Stored nodes typed with the old class are invisible to
14
+ this release until the app rewrites the namespace.
15
+ - **Generated accessor modules.** `src/data/capacitor.ttl` is the only source of terms;
16
+ `linked generate-ontology` writes `ontologies/capacitor` (one named export per term),
17
+ `ontologies/capacitor.data` (`ns`, `dataFiles`, `loadData`, `_ontologyResource`) and
18
+ `ontologies/capacitor.register`. Import the terms as a namespace:
19
+ `import * as capacitor from '@linked.cm/capacitor/ontologies/capacitor'`.
20
+ - **Removed:** the aggregated `capacitor` and `lincdCapacitor` objects, `_self` (now
21
+ `_ontologyResource` in `ontologies/capacitor.data`), `legacyNs`, `ns`/`dataFiles`/`loadData`
22
+ from `ontologies/capacitor` (now in `ontologies/capacitor.data`), the module
23
+ `ontologies/lincd-capacitor`, and the JSON-LD data `lincd-capacitor.json`.
24
+ - The package is built with `linked build`, which ships `lib/esm/data/capacitor.ttl` and
25
+ `shapes.ttl`. `react` is a declared peer dependency (`^18.2.0 || ^19.0.0`).
26
+ - Requires `@_linked/core` ^2.46.0, `@_linked/schema` ^1.9.2, `@_linked/sioc` ^1.6.2,
27
+ `@_linked/react` ^2.1.0, `@_linked/server-utils` ^1.17.0, `@_linked/auth` ^3.21.0 and
28
+ `@_linked/primitives` ^1.10.0; built with `@_linked/cli` ^1.61.0.
29
+
3
30
  ## 0.3.7
4
31
 
5
32
  ### Patch Changes
@@ -15,6 +15,7 @@ export default class CapacitorBackendProvider extends BackendProvider {
15
15
  } & import("@_linked/auth/utils/token.js").RefreshTokenExpiry) | {
16
16
  error: string;
17
17
  action?: string;
18
+ retryAfter?: number;
18
19
  } | {
19
20
  error: string;
20
21
  code: string;
@@ -0,0 +1,15 @@
1
+ @prefix capacitor: <https://linked.cm/ont/capacitor/> .
2
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
3
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4
+ @prefix dcterms: <http://purl.org/dc/terms/> .
5
+ @prefix schema: <http://schema.org/> .
6
+
7
+ capacitor:
8
+ a owl:Ontology ;
9
+ dcterms:description "Native app helpers for sign-in, safe area, location, and updates."@en ;
10
+ dcterms:title "Linked capacitor"@en .
11
+
12
+ capacitor:LocationUpdateAction
13
+ a owl:Class ;
14
+ rdfs:comment "An update of a user's location, sent from the device."@en ;
15
+ rdfs:subClassOf schema:UpdateAction .
@@ -0,0 +1,10 @@
1
+ @prefix core: <https://linked.cm/ont/core/> .
2
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
5
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
6
+
7
+ <https://linked.cm/shape/capacitor/LocationUpdateAction>
8
+ a sh:NodeShape ;
9
+ sh:targetClass <https://linked.cm/ont/capacitor/LocationUpdateAction> ;
10
+ core:isExtending <https://linked.cm/shape/schema/UpdateAction> .
@@ -1,6 +1,6 @@
1
1
  import './types.js';
2
2
  export * from './auth/SocialLoginClient.js';
3
- import './ontologies/lincd-capacitor.register.js';
3
+ import './ontologies/capacitor.register.js';
4
4
  import './shapes/index.js';
5
5
  import './components/LocationEnabler.js';
6
6
  import './components/SigninWithFacebookButton.js';
package/lib/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import './types.js';
2
2
  export * from './auth/SocialLoginClient.js';
3
- import './ontologies/lincd-capacitor.register.js';
3
+ import './ontologies/capacitor.register.js';
4
4
  //SHAPES FIRST
5
5
  import './shapes/index.js';
6
6
  //THEN COMPONENTS
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,cAAc,6BAA6B,CAAC;AAC5C,OAAO,0CAA0C,CAAC;AAElD,cAAc;AACd,OAAO,mBAAmB,CAAC;AAE3B,iBAAiB;AACjB,OAAO,iCAAiC,CAAC;AACzC,OAAO,0CAA0C,CAAC;AAClD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,wCAAwC,CAAC;AAChD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,yBAAyB,CAAC;AACjC,OAAO,gCAAgC,CAAC;AACxC,OAAO,+BAA+B,CAAC","sourcesContent":["import './types.js';\nexport * from './auth/SocialLoginClient.js';\nimport './ontologies/lincd-capacitor.register.js';\n\n//SHAPES FIRST\nimport './shapes/index.js';\n\n//THEN COMPONENTS\nimport './components/LocationEnabler.js';\nimport './components/SigninWithFacebookButton.js';\nimport './components/SigninWithAppleButton.js';\nimport './components/SigninWithGoogleButton.js';\nimport './components/SafeAreaContainer.js';\nimport './components/SignInWithWhatsapp.js';\nimport './hooks/useCapacitor.js';\nimport './hooks/useAutomaticUpdates.js';\nimport './hooks/useNativeAppUpdate.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,cAAc,6BAA6B,CAAC;AAC5C,OAAO,oCAAoC,CAAC;AAE5C,cAAc;AACd,OAAO,mBAAmB,CAAC;AAE3B,iBAAiB;AACjB,OAAO,iCAAiC,CAAC;AACzC,OAAO,0CAA0C,CAAC;AAClD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,wCAAwC,CAAC;AAChD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,yBAAyB,CAAC;AACjC,OAAO,gCAAgC,CAAC;AACxC,OAAO,+BAA+B,CAAC","sourcesContent":["import './types.js';\nexport * from './auth/SocialLoginClient.js';\nimport './ontologies/capacitor.register.js';\n\n//SHAPES FIRST\nimport './shapes/index.js';\n\n//THEN COMPONENTS\nimport './components/LocationEnabler.js';\nimport './components/SigninWithFacebookButton.js';\nimport './components/SigninWithAppleButton.js';\nimport './components/SigninWithGoogleButton.js';\nimport './components/SafeAreaContainer.js';\nimport './components/SignInWithWhatsapp.js';\nimport './hooks/useCapacitor.js';\nimport './hooks/useAutomaticUpdates.js';\nimport './hooks/useNativeAppUpdate.js';\n"]}
@@ -0,0 +1,2 @@
1
+ /** An update of a user's location, sent from the device. */
2
+ export declare const LocationUpdateAction: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
@@ -0,0 +1,8 @@
1
+ /** The ontology data, relative to this module (Turtle, copied into `lib/` by the build). */
2
+ export declare const dataFiles: string[];
3
+ /** Reads the ontology data (server only). */
4
+ export declare const loadData: () => Promise<string[]>;
5
+ /** The namespace: `ns('Term')` is the `{id}` reference of any term, listed or not. */
6
+ export declare const ns: (term: string) => import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
7
+ /** The ontology itself (its namespace IRI). */
8
+ export declare const _ontologyResource: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
@@ -0,0 +1,15 @@
1
+ // Generated by `linked generate-ontology`. Do not edit: change the data and run it again.
2
+ // Data: src/data/capacitor.ttl
3
+ import { Prefix } from '@_linked/core/utils/Prefix';
4
+ import { createNameSpace } from '@_linked/core/utils/NameSpace';
5
+ import { loadOntologyFiles } from '@_linked/core/ontology/loadOntologyFiles';
6
+ /** The ontology data, relative to this module (Turtle, copied into `lib/` by the build). */
7
+ export const dataFiles = ['../data/capacitor.ttl'];
8
+ /** Reads the ontology data (server only). */
9
+ export const loadData = () => loadOntologyFiles(import.meta.url, dataFiles);
10
+ /** The namespace: `ns('Term')` is the `{id}` reference of any term, listed or not. */
11
+ export const ns = createNameSpace('https://linked.cm/ont/capacitor/');
12
+ Prefix.add('capacitor', 'https://linked.cm/ont/capacitor/');
13
+ /** The ontology itself (its namespace IRI). */
14
+ export const _ontologyResource = ns('');
15
+ //# sourceMappingURL=capacitor.data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capacitor.data.js","sourceRoot":"","sources":["../../../src/ontologies/capacitor.data.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,+BAA+B;AAC/B,OAAO,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;AAE3E,4FAA4F;AAC5F,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAEnD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAE5E,sFAAsF;AACtF,MAAM,CAAC,MAAM,EAAE,GAAG,eAAe,CAAC,kCAAkC,CAAC,CAAC;AACtE,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,kCAAkC,CAAC,CAAC;AAE5D,+CAA+C;AAC/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC","sourcesContent":["// Generated by `linked generate-ontology`. Do not edit: change the data and run it again.\n// Data: src/data/capacitor.ttl\nimport {Prefix} from '@_linked/core/utils/Prefix';\nimport {createNameSpace} from '@_linked/core/utils/NameSpace';\nimport {loadOntologyFiles} from '@_linked/core/ontology/loadOntologyFiles';\n\n/** The ontology data, relative to this module (Turtle, copied into `lib/` by the build). */\nexport const dataFiles = ['../data/capacitor.ttl'];\n\n/** Reads the ontology data (server only). */\nexport const loadData = () => loadOntologyFiles(import.meta.url, dataFiles);\n\n/** The namespace: `ns('Term')` is the `{id}` reference of any term, listed or not. */\nexport const ns = createNameSpace('https://linked.cm/ont/capacitor/');\nPrefix.add('capacitor', 'https://linked.cm/ont/capacitor/');\n\n/** The ontology itself (its namespace IRI). */\nexport const _ontologyResource = ns('');\n"]}
@@ -0,0 +1,6 @@
1
+ // Generated by `linked generate-ontology`. Do not edit: change the data and run it again.
2
+ // Data: src/data/capacitor.ttl
3
+ import { ns } from './capacitor.data.js';
4
+ /** An update of a user's location, sent from the device. */
5
+ export const LocationUpdateAction = /*#__PURE__*/ ns('LocationUpdateAction');
6
+ //# sourceMappingURL=capacitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capacitor.js","sourceRoot":"","sources":["../../../src/ontologies/capacitor.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,+BAA+B;AAC/B,OAAO,EAAC,EAAE,EAAC,MAAM,qBAAqB,CAAC;AAEvC,4DAA4D;AAC5D,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["// Generated by `linked generate-ontology`. Do not edit: change the data and run it again.\n// Data: src/data/capacitor.ttl\nimport {ns} from './capacitor.data.js';\n\n/** An update of a user's location, sent from the device. */\nexport const LocationUpdateAction = /*#__PURE__*/ ns('LocationUpdateAction');\n"]}
@@ -0,0 +1,15 @@
1
+ // Generated by `linked generate-ontology`. Do not edit.
2
+ /**
3
+ * Registers this ontology.
4
+ *
5
+ * Kept out of `capacitor.ts` because registration needs that module's whole export namespace, and
6
+ * a module cannot import itself once a bundler is involved: Rollup treats a static
7
+ * self-reference as a circular import and elides it, so the binding is undefined at runtime
8
+ * and the app dies at boot with `_this is not defined`. From a sibling module the same import
9
+ * is ordinary and survives.
10
+ */
11
+ import * as terms from './capacitor.js';
12
+ import { dataFiles, loadData, ns } from './capacitor.data.js';
13
+ import { linkedOntology } from '../package.js';
14
+ linkedOntology(terms, ns, 'capacitor', loadData, dataFiles);
15
+ //# sourceMappingURL=capacitor.register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capacitor.register.js","sourceRoot":"","sources":["../../../src/ontologies/capacitor.register.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD;;;;;;;;GAQG;AACH,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAC,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAE7C,cAAc,CAAC,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC","sourcesContent":["// Generated by `linked generate-ontology`. Do not edit.\n/**\n * Registers this ontology.\n *\n * Kept out of `capacitor.ts` because registration needs that module's whole export namespace, and\n * a module cannot import itself once a bundler is involved: Rollup treats a static\n * self-reference as a circular import and elides it, so the binding is undefined at runtime\n * and the app dies at boot with `_this is not defined`. From a sibling module the same import\n * is ordinary and survives.\n */\nimport * as terms from './capacitor.js';\nimport {dataFiles, loadData, ns} from './capacitor.data.js';\nimport {linkedOntology} from '../package.js';\n\nlinkedOntology(terms, ns, 'capacitor', loadData, dataFiles);\n"]}
@@ -1,7 +1,7 @@
1
1
  declare const linkedShape: {
2
2
  <T extends typeof import("@_linked/core/shapes/Shape.js").Shape>(constructor: T): void;
3
3
  <T extends typeof import("@_linked/core/shapes/Shape.js").Shape>(config?: import("@_linked/core/utils/Package").ShapeConfig): (constructor: T) => void;
4
- }, linkedUtil: (constructor: any) => any, linkedOntology: (allFileExports: any, nameSpace: (term: string) => import("@_linked/core/utils/NodeReference.js").NodeReferenceValue, suggestedPrefixAndFileName: string, loadDataFunction?: () => Promise<any>, dataSource?: string | string[]) => void, registerPackageExport: (exportedObject: any) => void, registerPackageModule: (_module: any) => void, getPackageShape: (name: string) => import("@_linked/core/shapes/Shape.js").ShapeConstructor | undefined, packageExports: any, packageName: string;
4
+ }, linkedUtil: (constructor: any) => any, linkedOntology: (allFileExports: any, nameSpace: (term: string) => import("@_linked/core/utils/NodeReference.js").NodeReferenceValue, suggestedPrefixAndFileName: string, loadDataFunction?: () => Promise<unknown>, dataSource?: string | string[]) => void, registerPackageExport: (exportedObject: any) => void, registerPackageModule: (_module: any) => void, getPackageShape: (name: string) => import("@_linked/core/shapes/Shape.js").ShapeConstructor | undefined, packageExports: any, packageName: string;
5
5
  declare const linkedComponent: {
6
6
  <QueryType extends import("@_linked/core/queries/QueryBuilder.js").SelectBuilder<any> = null, CustomProps = {}, ShapeType extends import("@_linked/core/shapes/Shape.js").Shape = QueryType extends import("@_linked/core/queries/QueryBuilder.js").SelectBuilder<infer S extends import("@_linked/core/shapes/Shape.js").Shape, any, any> ? S : never, Res = QueryType extends import("@_linked/core/queries/QueryBuilder.js").SelectBuilder<any, infer R, any> ? R : QueryType extends import("@_linked/core/queries/FieldSet.js").FieldSet<infer R_1, any> ? R_1 : QueryType>(query: QueryType, functionalComponent: import("@_linked/react/utils/LinkedComponent").LinkableComponent<CustomProps & import("@_linked/core/queries/SelectQuery.js").QueryResponseToResultType<Res, ShapeType>, ShapeType>): import("@_linked/react/utils/LinkedComponent").LinkedComponent<CustomProps, ShapeType, Res>;
7
7
  <QueryType extends import("@_linked/core/queries/QueryBuilder.js").SelectBuilder<any> = null, CustomProps = {}, ShapeType extends import("@_linked/core/shapes/Shape.js").Shape = QueryType extends import("@_linked/core/queries/QueryBuilder.js").SelectBuilder<infer S extends import("@_linked/core/shapes/Shape.js").Shape, any, any> ? S : never, Res = QueryType extends import("@_linked/core/queries/QueryBuilder.js").SelectBuilder<any, infer R, any> ? R : QueryType extends import("@_linked/core/queries/FieldSet.js").FieldSet<infer R_1, any> ? R_1 : QueryType>(query: QueryType, functionalComponent: import("@_linked/react/utils/LinkedComponent").LinkableComponent<CustomProps & import("@_linked/core/queries/SelectQuery.js").QueryResponseToResultType<Res, ShapeType>, ShapeType>, options: import("@_linked/react/utils/LinkedComponent").LinkedComponentOptions): import("@_linked/react/utils/LinkedComponent").LinkedComponent<CustomProps, ShapeType, Res>;
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { Server } from '@_linked/server-utils/utils/Server';
8
8
  import { linkedShape, packageName } from '../package.js';
9
9
  import { UpdateAction } from '@_linked/schema/shapes/UpdateAction';
10
- import { lincdCapacitor } from '../ontologies/lincd-capacitor.js';
10
+ import * as capacitor from '../ontologies/capacitor.js';
11
11
  let LocationUpdateAction = class LocationUpdateAction extends UpdateAction {
12
12
  /**
13
13
  * update user location
@@ -26,7 +26,7 @@ let LocationUpdateAction = class LocationUpdateAction extends UpdateAction {
26
26
  });
27
27
  }
28
28
  };
29
- LocationUpdateAction.targetClass = lincdCapacitor.LocationUpdateAction;
29
+ LocationUpdateAction.targetClass = capacitor.LocationUpdateAction;
30
30
  LocationUpdateAction = __decorate([
31
31
  linkedShape
32
32
  ], LocationUpdateAction);
@@ -1 +1 @@
1
- {"version":3,"file":"LocationUpdateAction.js","sourceRoot":"","sources":["../../../src/shapes/LocationUpdateAction.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAG3D,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,YAAY;IAGpD;;;;;OAKG;IACH,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,QAAgB,EAAE,SAAiB;QACjE,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,oBAAoB,EAAE,QAAQ,EAAE,SAAS,CAAC;aACvE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACf,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC;;AAjBM,gCAAW,GAAG,cAAc,CAAC,oBAAoB,AAAtC,CAAuC;AAD9C,oBAAoB;IADhC,WAAW;GACC,oBAAoB,CAmBhC","sourcesContent":["import { Server } from '@_linked/server-utils/utils/Server';\nimport { linkedShape, packageName } from '../package.js';\nimport { UpdateAction } from '@_linked/schema/shapes/UpdateAction';\nimport { lincdCapacitor } from '../ontologies/lincd-capacitor.js';\n\n@linkedShape\nexport class LocationUpdateAction extends UpdateAction {\n static targetClass = lincdCapacitor.LocationUpdateAction;\n\n /**\n * update user location\n *\n * @param latitude\n * @param longitude\n */\n static async updateUserLocation(latitude: number, longitude: number) {\n return Server.call(packageName, 'updateUserLocation', latitude, longitude)\n .then((result) => {\n return result;\n })\n .catch((err) => {\n console.log('Update user location failed', err);\n throw new Error(err);\n });\n }\n}\n"]}
1
+ {"version":3,"file":"LocationUpdateAction.js","sourceRoot":"","sources":["../../../src/shapes/LocationUpdateAction.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAC;AAGjD,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,YAAY;IAGpD;;;;;OAKG;IACH,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,QAAgB,EAAE,SAAiB;QACjE,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,oBAAoB,EAAE,QAAQ,EAAE,SAAS,CAAC;aACvE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACf,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC;;AAjBM,gCAAW,GAAG,SAAS,CAAC,oBAAoB,AAAjC,CAAkC;AADzC,oBAAoB;IADhC,WAAW;GACC,oBAAoB,CAmBhC","sourcesContent":["import { Server } from '@_linked/server-utils/utils/Server';\nimport { linkedShape, packageName } from '../package.js';\nimport { UpdateAction } from '@_linked/schema/shapes/UpdateAction';\nimport * as capacitor from '../ontologies/capacitor.js';\n\n@linkedShape\nexport class LocationUpdateAction extends UpdateAction {\n static targetClass = capacitor.LocationUpdateAction;\n\n /**\n * update user location\n *\n * @param latitude\n * @param longitude\n */\n static async updateUserLocation(latitude: number, longitude: number) {\n return Server.call(packageName, 'updateUserLocation', latitude, longitude)\n .then((result) => {\n return result;\n })\n .catch((err) => {\n console.log('Update user location failed', err);\n throw new Error(err);\n });\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- import '../ontologies/lincd-capacitor.register.js';
1
+ import '../ontologies/capacitor.register.js';
2
2
  import './LocationUpdateAction.js';
@@ -1,5 +1,5 @@
1
1
  // Side-effect imports only. Apps register every shape with import '@linked.cm/capacitor/shapes/index'.
2
2
  // The register import stays here so that path registers the ontology without loading the components.
3
- import '../ontologies/lincd-capacitor.register.js';
3
+ import '../ontologies/capacitor.register.js';
4
4
  import './LocationUpdateAction.js';
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shapes/index.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,qGAAqG;AACrG,OAAO,2CAA2C,CAAC;AACnD,OAAO,2BAA2B,CAAC","sourcesContent":["// Side-effect imports only. Apps register every shape with import '@linked.cm/capacitor/shapes/index'.\n// The register import stays here so that path registers the ontology without loading the components.\nimport '../ontologies/lincd-capacitor.register.js';\nimport './LocationUpdateAction.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shapes/index.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,qGAAqG;AACrG,OAAO,qCAAqC,CAAC;AAC7C,OAAO,2BAA2B,CAAC","sourcesContent":["// Side-effect imports only. Apps register every shape with import '@linked.cm/capacitor/shapes/index'.\n// The register import stays here so that path registers the ontology without loading the components.\nimport '../ontologies/capacitor.register.js';\nimport './LocationUpdateAction.js';\n"]}
package/package.json CHANGED
@@ -10,8 +10,15 @@
10
10
  "type": "git",
11
11
  "url": "git+ssh://git@github.com/linked-cm/capacitor.git"
12
12
  },
13
- "version": "0.3.7",
14
- "linkedPackage": true,
13
+ "version": "1.0.0",
14
+ "linked": {
15
+ "kind": "library"
16
+ },
17
+ "linkedOntologies": {
18
+ "capacitor": {
19
+ "namespace": "https://linked.cm/ont/capacitor/"
20
+ }
21
+ },
15
22
  "type": "module",
16
23
  "main": "lib/esm/index.js",
17
24
  "module": "lib/esm/index.js",
@@ -20,10 +27,8 @@
20
27
  "license": "ISC",
21
28
  "scripts": {
22
29
  "start": "linked dev",
23
- "test": "npm run build-esm && node --test tests/*.test.mjs",
24
- "build": "rimraf ./lib && npm run build-esm && npm run copy-to-lib",
25
- "build-esm": "echo \"compiling ESM\" && rimraf ./lib/esm && tsc -p tsconfig-esm.json",
26
- "copy-to-lib": "echo 'copying CSS + JSON assets to lib folder' && copyfiles -u 1 'src/**/*.css' 'src/**/*.json' lib/esm"
30
+ "test": "npm run build && node --test tests/*.test.mjs",
31
+ "build": "linked build"
27
32
  },
28
33
  "keywords": [
29
34
  "linked",
@@ -53,19 +58,19 @@
53
58
  }
54
59
  },
55
60
  "dependencies": {
56
- "@_linked/auth": "^3.1.0",
57
- "@_linked/core": "^2.27.0",
58
- "@_linked/primitives": "^1.8.0",
59
- "@_linked/react": "^2.0.0",
60
- "@_linked/schema": "^1.5.0",
61
- "@_linked/server-utils": "^1.12.0",
62
- "@_linked/sioc": "^1.4.0",
61
+ "@_linked/auth": "^3.21.0",
62
+ "@_linked/core": "^2.46.0",
63
+ "@_linked/primitives": "^1.10.0",
64
+ "@_linked/react": "^2.1.0",
65
+ "@_linked/schema": "^1.9.2",
66
+ "@_linked/server-utils": "^1.17.0",
67
+ "@_linked/sioc": "^1.6.2",
63
68
  "google-libphonenumber": "3.2.33",
64
69
  "react-international-phone": "4.0.4",
65
70
  "react-router-dom": "^6.22.3"
66
71
  },
67
72
  "devDependencies": {
68
- "@_linked/cli": "^1.2",
73
+ "@_linked/cli": "^1.61.0",
69
74
  "@capacitor/app": "^7.0.0",
70
75
  "@capacitor/core": "^7.0.0",
71
76
  "@capacitor/dialog": "^7.0.0",
@@ -81,12 +86,13 @@
81
86
  "@types/react": "^19.3.0",
82
87
  "@types/react-dom": "^19.3.0",
83
88
  "capacitor-plugin-safe-area": "^4.0.3",
84
- "copyfiles": "^2.4.1",
85
- "rimraf": "^5.0.7",
89
+ "react": "^19.3.1",
90
+ "react-dom": "^19.3.1",
86
91
  "typescript": "^5.7.3",
87
92
  "typescript-plugin-css-modules": "^5.1.0"
88
93
  },
89
94
  "peerDependencies": {
95
+ "react": "^18.2.0 || ^19.0.0",
90
96
  "@capacitor/app": ">=7 <8",
91
97
  "@capacitor/core": ">=7 <8",
92
98
  "@capacitor/dialog": ">=7 <8",
package/readme.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Native app helpers for social sign-in, WhatsApp one-time codes, safe area, location, and store or bundle updates.
4
4
 
5
- The location term stays on `http://lincd.org/ont/lincd-capacitor/`. Shape registration uses `@linked.cm/capacitor`.
5
+ The location term `LocationUpdateAction` (a `schema:UpdateAction`) lives at `https://linked.cm/ont/capacitor/` (prefix `capacitor`), declared in `src/data/capacitor.ttl`, the only source of terms. `linked generate-ontology` writes the accessor modules from it (`package.json` `"linkedOntologies"`), and `linked build` fails when they are stale. Import the terms as a namespace: `import * as capacitor from '@linked.cm/capacitor/ontologies/capacitor'` (`capacitor.LocationUpdateAction`), and `ns`/`loadData` from `@linked.cm/capacitor/ontologies/capacitor.data`. Shape registration uses `@linked.cm/capacitor`.
6
6
 
7
7
  ## Public entry points
8
8
 
@@ -0,0 +1,39 @@
1
+ // The capacitor ontology lives at https://linked.cm/ont/capacitor/, ships as Turtle, and the
2
+ // package's shapes agree with it under the shape check `linked build` runs.
3
+ import assert from 'node:assert/strict';
4
+ import test from 'node:test';
5
+
6
+ import { Prefix } from '@_linked/core/utils/Prefix';
7
+ import { definedTermsFromTurtle } from '@_linked/core/ontology/hierarchy';
8
+ import { checkShapeHierarchy } from '@_linked/core/shapes/checkShapeHierarchy';
9
+ import '@_linked/schema/shapes/index';
10
+ import * as capacitor from '../lib/esm/ontologies/capacitor.js';
11
+ import { _ontologyResource, loadData } from '../lib/esm/ontologies/capacitor.data.js';
12
+ import '../lib/esm/shapes/index.js';
13
+ import { packageName } from '../lib/esm/package.js';
14
+
15
+ const NAMESPACE = 'https://linked.cm/ont/capacitor/';
16
+
17
+ test('mints terms under https://linked.cm/ont/capacitor/ and exports only terms', () => {
18
+ assert.equal(_ontologyResource.id, NAMESPACE);
19
+ assert.equal(capacitor.LocationUpdateAction.id, `${NAMESPACE}LocationUpdateAction`);
20
+ assert.deepEqual(Object.keys(capacitor), ['LocationUpdateAction']);
21
+ assert.equal(Prefix.getFullURI('capacitor'), NAMESPACE);
22
+ });
23
+
24
+ test('declares LocationUpdateAction, a schema:UpdateAction, in its Turtle data', async () => {
25
+ const defined = await definedTermsFromTurtle(await loadData());
26
+ assert.ok(defined.has(capacitor.LocationUpdateAction.id));
27
+ });
28
+
29
+ test('passes the shape check', async () => {
30
+ const findings = await checkShapeHierarchy({
31
+ dependencies: { [packageName]: ['@_linked/core', '@_linked/schema'] },
32
+ });
33
+ assert.deepEqual(
34
+ findings
35
+ .filter((f) => f.shape?.includes('/shape/capacitor/'))
36
+ .map((f) => `${f.severity} ${f.kind}: ${f.message}`),
37
+ []
38
+ );
39
+ });
@@ -1,20 +0,0 @@
1
- {
2
- "@context": {
3
- "dc": "http://purl.org/dc/elements/1.1/",
4
- "owl": "http://www.w3.org/2002/07/owl#",
5
- "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
6
- "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
7
- "lincd-capacitor": "http://lincd.org/ont/lincd-capacitor/"
8
- },
9
- "@graph": [
10
- {
11
- "@id": "lincd-capacitor:ExampleClass",
12
- "@type": "rdfs:Class",
13
- "rdfs:comment": "This is an example class. You can remove or rename it",
14
- "rdfs:isDefinedBy": {
15
- "@id": "lincd-capacitor:"
16
- },
17
- "rdfs:label": "Example Class"
18
- }
19
- ]
20
- }
@@ -1,30 +0,0 @@
1
- /**
2
- * Load the data of this ontology into memory
3
- */
4
- export declare var loadData: () => Promise<{
5
- "@context": {
6
- dc: string;
7
- owl: string;
8
- rdf: string;
9
- rdfs: string;
10
- "lincd-capacitor": string;
11
- };
12
- "@graph": {
13
- "@id": string;
14
- "@type": string;
15
- "rdfs:comment": string;
16
- "rdfs:isDefinedBy": {
17
- "@id": string;
18
- };
19
- "rdfs:label": string;
20
- }[];
21
- }>;
22
- /**
23
- * The namespace of this ontology
24
- */
25
- export declare var ns: (term: string) => import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
26
- export declare var _self: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
27
- export declare var LocationUpdateAction: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
28
- export declare const lincdCapacitor: {
29
- LocationUpdateAction: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
30
- };
@@ -1,28 +0,0 @@
1
- import { createNameSpace } from '@_linked/core/utils/NameSpace';
2
- /**
3
- * Load the data of this ontology into memory
4
- */
5
- export var loadData = () => {
6
- if (typeof module !== 'undefined' && typeof exports !== 'undefined') {
7
- // CommonJS import
8
- return import('../data/lincd-capacitor.json');
9
- }
10
- else {
11
- // ESM import
12
- //@ts-ignore
13
- return import('../data/lincd-capacitor.json', {
14
- with: { type: 'json' },
15
- }).then((data) => data.default);
16
- }
17
- };
18
- /**
19
- * The namespace of this ontology
20
- */
21
- export var ns = createNameSpace('http://lincd.org/ont/lincd-capacitor/');
22
- export var _self = ns('');
23
- export var LocationUpdateAction = ns('LocationUpdateAction');
24
- //An extra grouping object so all the entities can be accessed from the prefix/name
25
- export const lincdCapacitor = {
26
- LocationUpdateAction,
27
- };
28
- //# sourceMappingURL=lincd-capacitor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lincd-capacitor.js","sourceRoot":"","sources":["../../../src/ontologies/lincd-capacitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,IAAI,QAAQ,GAAG,GAAG,EAAE;IACzB,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;QACpE,kBAAkB;QAClB,OAAO,MAAM,CAAC,8BAA8B,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,aAAa;QACb,YAAY;QACZ,OAAO,MAAM,CAAC,8BAA8B,EAAE;YAC5C,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACvB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;AACH,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAI,EAAE,GAAG,eAAe,CAAC,uCAAuC,CAAC,CAAC;AAEzE,MAAM,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;AAE1B,MAAM,CAAC,IAAI,oBAAoB,GAAG,EAAE,CAAC,sBAAsB,CAAC,CAAC;AAE7D,mFAAmF;AACnF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,oBAAoB;CACrB,CAAC","sourcesContent":["import { createNameSpace } from '@_linked/core/utils/NameSpace';\n\n/**\n * Load the data of this ontology into memory\n */\nexport var loadData = () => {\n if (typeof module !== 'undefined' && typeof exports !== 'undefined') {\n // CommonJS import\n return import('../data/lincd-capacitor.json');\n } else {\n // ESM import\n //@ts-ignore\n return import('../data/lincd-capacitor.json', {\n with: { type: 'json' },\n }).then((data) => data.default);\n }\n};\n\n/**\n * The namespace of this ontology\n */\nexport var ns = createNameSpace('http://lincd.org/ont/lincd-capacitor/');\n\nexport var _self = ns('');\n\nexport var LocationUpdateAction = ns('LocationUpdateAction');\n\n//An extra grouping object so all the entities can be accessed from the prefix/name\nexport const lincdCapacitor = {\n LocationUpdateAction,\n};\n"]}
@@ -1,15 +0,0 @@
1
- /**
2
- * Registers this ontology.
3
- *
4
- * Kept out of `lincd-capacitor.ts` because registration needs that module's whole export
5
- * namespace, and a module cannot import itself once a bundler is involved: Rollup treats
6
- * a static self-reference as a circular import and elides it, so the binding is undefined
7
- * at runtime and the app dies at boot with `_this is not defined`. `tsc` preserves it,
8
- * which is why the pattern worked for as long as packages were only built with `tsc`.
9
- *
10
- * From a sibling module the same import is ordinary and survives.
11
- */
12
- import * as terms from './lincd-capacitor.js';
13
- import { linkedOntology } from '../package.js';
14
- linkedOntology(terms, terms.ns, 'lincd-capacitor', terms.loadData, '../data/lincd-capacitor.json');
15
- //# sourceMappingURL=lincd-capacitor.register.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lincd-capacitor.register.js","sourceRoot":"","sources":["../../../src/ontologies/lincd-capacitor.register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,cAAc,CACZ,KAAK,EACL,KAAK,CAAC,EAAE,EACR,iBAAiB,EACjB,KAAK,CAAC,QAAQ,EACd,8BAA8B,CAC/B,CAAC","sourcesContent":["/**\n * Registers this ontology.\n *\n * Kept out of `lincd-capacitor.ts` because registration needs that module's whole export\n * namespace, and a module cannot import itself once a bundler is involved: Rollup treats\n * a static self-reference as a circular import and elides it, so the binding is undefined\n * at runtime and the app dies at boot with `_this is not defined`. `tsc` preserves it,\n * which is why the pattern worked for as long as packages were only built with `tsc`.\n *\n * From a sibling module the same import is ordinary and survives.\n */\nimport * as terms from './lincd-capacitor.js';\nimport { linkedOntology } from '../package.js';\n\nlinkedOntology(\n terms,\n terms.ns,\n 'lincd-capacitor',\n terms.loadData,\n '../data/lincd-capacitor.json'\n);\n"]}