@instantdb/admin 0.22.97 → 0.22.98

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,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  const index_ts_1 = require("../index.js");
13
4
  const schema = index_ts_1.i.schema({
@@ -18,90 +9,80 @@ const schema = index_ts_1.i.schema({
18
9
  }),
19
10
  },
20
11
  });
21
- function _testUseDatesTest() {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- const db = (0, index_ts_1.init)({
24
- schema,
25
- appId: '123',
26
- useDateObjects: true,
27
- });
28
- const data = yield db.query({ tbl: {} });
29
- const item = data === null || data === void 0 ? void 0 : data.tbl[0];
30
- if (item) {
31
- }
12
+ async function _testUseDatesTest() {
13
+ const db = (0, index_ts_1.init)({
14
+ schema,
15
+ appId: '123',
16
+ useDateObjects: true,
32
17
  });
18
+ const data = await db.query({ tbl: {} });
19
+ const item = data?.tbl[0];
20
+ if (item) {
21
+ }
33
22
  }
34
- function _testUseDatesFalseTest() {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- const db = (0, index_ts_1.init)({
37
- schema,
38
- appId: '123',
39
- useDateObjects: false,
40
- });
41
- const data = yield db.query({ tbl: {} });
42
- const item = data === null || data === void 0 ? void 0 : data.tbl[0];
43
- if (item) {
44
- }
23
+ async function _testUseDatesFalseTest() {
24
+ const db = (0, index_ts_1.init)({
25
+ schema,
26
+ appId: '123',
27
+ useDateObjects: false,
45
28
  });
29
+ const data = await db.query({ tbl: {} });
30
+ const item = data?.tbl[0];
31
+ if (item) {
32
+ }
46
33
  }
47
- function _testUseDatesUndefinedTest() {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- const db = (0, index_ts_1.init)({
50
- schema,
51
- appId: '123',
52
- });
53
- const data = yield db.query({ tbl: {} });
54
- const item = data === null || data === void 0 ? void 0 : data.tbl[0];
55
- if (item) {
56
- }
34
+ async function _testUseDatesUndefinedTest() {
35
+ const db = (0, index_ts_1.init)({
36
+ schema,
37
+ appId: '123',
57
38
  });
39
+ const data = await db.query({ tbl: {} });
40
+ const item = data?.tbl[0];
41
+ if (item) {
42
+ }
58
43
  }
59
- function _testDataNoSchema() {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- const db = (0, index_ts_1.init)({
62
- appId: '123',
63
- });
64
- const data = yield db.query({ tbl: {} });
65
- const item = data === null || data === void 0 ? void 0 : data.tbl[0];
66
- if (item) {
67
- }
44
+ async function _testDataNoSchema() {
45
+ const db = (0, index_ts_1.init)({
46
+ appId: '123',
68
47
  });
48
+ const data = await db.query({ tbl: {} });
49
+ const item = data?.tbl[0];
50
+ if (item) {
51
+ }
69
52
  }
70
- function _testSubscribe() {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- // No useDateObjects
73
- (0, index_ts_1.init)({
74
- appId: '123',
75
- schema,
76
- }).subscribeQuery({ tbl: {} }, (payload) => {
77
- if (payload.type === 'ok') {
78
- const item = payload.data.tbl[0];
79
- if (item) {
80
- }
53
+ async function _testSubscribe() {
54
+ // No useDateObjects
55
+ (0, index_ts_1.init)({
56
+ appId: '123',
57
+ schema,
58
+ }).subscribeQuery({ tbl: {} }, (payload) => {
59
+ if (payload.type === 'ok') {
60
+ const item = payload.data.tbl[0];
61
+ if (item) {
81
62
  }
82
- });
83
- // UseDateObjects
84
- (0, index_ts_1.init)({
85
- appId: '123',
86
- schema,
87
- useDateObjects: true,
88
- }).subscribeQuery({ tbl: {} }, (payload) => {
89
- if (payload.type === 'ok') {
90
- const item = payload.data.tbl[0];
91
- if (item) {
92
- }
63
+ }
64
+ });
65
+ // UseDateObjects
66
+ (0, index_ts_1.init)({
67
+ appId: '123',
68
+ schema,
69
+ useDateObjects: true,
70
+ }).subscribeQuery({ tbl: {} }, (payload) => {
71
+ if (payload.type === 'ok') {
72
+ const item = payload.data.tbl[0];
73
+ if (item) {
93
74
  }
94
- });
95
- // No schema
96
- (0, index_ts_1.init)({
97
- appId: '123',
98
- }).subscribeQuery({ tbl: {} }, (payload) => {
99
- if (payload.type === 'ok') {
100
- const item = payload.data.tbl[0];
101
- if (item) {
102
- }
75
+ }
76
+ });
77
+ // No schema
78
+ (0, index_ts_1.init)({
79
+ appId: '123',
80
+ }).subscribeQuery({ tbl: {} }, (payload) => {
81
+ if (payload.type === 'ok') {
82
+ const item = payload.data.tbl[0];
83
+ if (item) {
103
84
  }
104
- });
85
+ }
105
86
  });
106
87
  }
107
88
  //# sourceMappingURL=typesTests.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typesTests.js","sourceRoot":"","sources":["../../../src/__types__/typesTests.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,0CAAsC;AAEtC,MAAM,MAAM,GAAG,YAAC,CAAC,MAAM,CAAC;IACtB,QAAQ,EAAE;QACR,GAAG,EAAE,YAAC,CAAC,MAAM,CAAC;YACZ,CAAC,EAAE,YAAC,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE;YACrB,SAAS,EAAE,YAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;SAC/B,CAAC;KACH;CACF,CAAC,CAAC;AAEH,SAAe,iBAAiB;;QAC9B,MAAM,EAAE,GAAG,IAAA,eAAI,EAAC;YACd,MAAM;YACN,KAAK,EAAE,KAAK;YACZ,cAAc,EAAE,IAAI;SACrB,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,KAAK,C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AAC;CAAA","sourcesContent":["import type { Equal, Expect, IsAny, NotAny } from './typeUtils.ts';\nimport { i, init } from '../index.ts';\n\nconst schema = i.schema({\n entities: {\n tbl: i.entity({\n d: i.date().indexed(),\n dOptional: i.date().optional(),\n }),\n },\n});\n\nasync function _testUseDatesTest() {\n const db = init({\n schema,\n appId: '123',\n useDateObjects: true,\n });\n\n const data = await db.query({ tbl: {} });\n const item = data?.tbl[0];\n if (item) {\n type t = typeof item.d;\n type _cases = [Expect<NotAny<t>>, Expect<Equal<t, Date>>];\n\n type tOpt = typeof item.dOptional;\n type _cases_2 = [\n Expect<NotAny<tOpt>>,\n Expect<Equal<tOpt, Date | undefined>>,\n ];\n }\n}\n\nasync function _testUseDatesFalseTest() {\n const db = init({\n schema,\n appId: '123',\n useDateObjects: false,\n });\n\n const data = await db.query({ tbl: {} });\n const item = data?.tbl[0];\n if (item) {\n type t = typeof item.d;\n type _cases = [Expect<NotAny<t>>, Expect<Equal<t, string | number>>];\n\n type tOpt = typeof item.dOptional;\n type _cases_2 = [\n Expect<NotAny<tOpt>>,\n Expect<Equal<tOpt, string | number | undefined>>,\n ];\n }\n}\n\nasync function _testUseDatesUndefinedTest() {\n const db = init({\n schema,\n appId: '123',\n });\n\n const data = await db.query({ tbl: {} });\n const item = data?.tbl[0];\n if (item) {\n type t = typeof item.d;\n type _cases = [Expect<NotAny<t>>, Expect<Equal<t, string | number>>];\n\n type tOpt = typeof item.dOptional;\n type _cases_2 = [\n Expect<NotAny<tOpt>>,\n Expect<Equal<tOpt, string | number | undefined>>,\n ];\n }\n}\n\nasync function _testDataNoSchema() {\n const db = init({\n appId: '123',\n });\n\n const data = await db.query({ tbl: {} });\n const item = data?.tbl[0];\n if (item) {\n type t = typeof item.d;\n type _cases = [Expect<IsAny<t>>, Expect<Equal<typeof item.id, string>>];\n }\n}\n\nasync function _testSubscribe() {\n // No useDateObjects\n init({\n appId: '123',\n schema,\n }).subscribeQuery({ tbl: {} }, (payload) => {\n if (payload.type === 'ok') {\n const item = payload.data.tbl[0];\n if (item) {\n type _cases = [\n Expect<Equal<typeof item.id, string>>,\n Expect<Equal<typeof item.d, string | number>>,\n Expect<Equal<typeof item.dOptional, string | number | undefined>>,\n ];\n }\n }\n });\n\n // UseDateObjects\n init({\n appId: '123',\n schema,\n useDateObjects: true,\n }).subscribeQuery({ tbl: {} }, (payload) => {\n if (payload.type === 'ok') {\n const item = payload.data.tbl[0];\n if (item) {\n type _cases = [\n Expect<Equal<typeof item.id, string>>,\n Expect<Equal<typeof item.d, Date>>,\n Expect<Equal<typeof item.dOptional, Date | undefined>>,\n ];\n }\n }\n });\n\n // No schema\n init({\n appId: '123',\n }).subscribeQuery({ tbl: {} }, (payload) => {\n if (payload.type === 'ok') {\n const item = payload.data.tbl[0];\n if (item) {\n type _cases = [\n Expect<Equal<typeof item.id, string>>,\n Expect<IsAny<typeof item.d>>,\n Expect<IsAny<typeof item.dOptional>>,\n ];\n }\n }\n });\n}\n"]}
1
+ {"version":3,"file":"typesTests.js","sourceRoot":"","sources":["../../../src/__types__/typesTests.ts"],"names":[],"mappings":";;AACA,0CAAsC;AAEtC,MAAM,MAAM,GAAG,YAAC,CAAC,MAAM,CAAC;IACtB,QAAQ,EAAE;QACR,GAAG,EAAE,YAAC,CAAC,MAAM,CAAC;YACZ,CAAC,EAAE,YAAC,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE;YACrB,SAAS,EAAE,YAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;SAC/B,CAAC;KACH;CACF,CAAC,CAAC;AAEH,KAAK,UAAU,iBAAiB;IAC9B,MAAM,EAAE,GAAG,IAAA,eAAI,EAAC;QACd,MAAM;QACN,KAAK,EAAE,KAAK;QACZ,cAAc,EAAE,IAAI;KACrB,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,IAAI,EAA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E,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE;QACzC,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACjC,IAAI,IAAI,EAAE,CAAC;YAMX,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,iBAAiB;IACjB,IAAA,eAAI,EAAC;QACH,KAAK,EAAE,KAAK;QACZ,MAAM;QACN,cAAc,EAAE,IAAI;KACrB,CAAC,CAAC,cAAc,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE;QACzC,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACjC,IAAI,IAAI,EAAE,CAAC;YAMX,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,YAAY;IACZ,IAAA,eAAI,EAAC;QACH,KAAK,EAAE,KAAK;KACb,CAAC,CAAC,cAAc,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE;QACzC,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACjC,IAAI,IAAI,EAAE,CAAC;YAMX,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Equal, Expect, IsAny, NotAny } from './typeUtils.ts';\nimport { i, init } from '../index.ts';\n\nconst schema = i.schema({\n entities: {\n tbl: i.entity({\n d: i.date().indexed(),\n dOptional: i.date().optional(),\n }),\n },\n});\n\nasync function _testUseDatesTest() {\n const db = init({\n schema,\n appId: '123',\n useDateObjects: true,\n });\n\n const data = await db.query({ tbl: {} });\n const item = data?.tbl[0];\n if (item) {\n type t = typeof item.d;\n type _cases = [Expect<NotAny<t>>, Expect<Equal<t, Date>>];\n\n type tOpt = typeof item.dOptional;\n type _cases_2 = [\n Expect<NotAny<tOpt>>,\n Expect<Equal<tOpt, Date | undefined>>,\n ];\n }\n}\n\nasync function _testUseDatesFalseTest() {\n const db = init({\n schema,\n appId: '123',\n useDateObjects: false,\n });\n\n const data = await db.query({ tbl: {} });\n const item = data?.tbl[0];\n if (item) {\n type t = typeof item.d;\n type _cases = [Expect<NotAny<t>>, Expect<Equal<t, string | number>>];\n\n type tOpt = typeof item.dOptional;\n type _cases_2 = [\n Expect<NotAny<tOpt>>,\n Expect<Equal<tOpt, string | number | undefined>>,\n ];\n }\n}\n\nasync function _testUseDatesUndefinedTest() {\n const db = init({\n schema,\n appId: '123',\n });\n\n const data = await db.query({ tbl: {} });\n const item = data?.tbl[0];\n if (item) {\n type t = typeof item.d;\n type _cases = [Expect<NotAny<t>>, Expect<Equal<t, string | number>>];\n\n type tOpt = typeof item.dOptional;\n type _cases_2 = [\n Expect<NotAny<tOpt>>,\n Expect<Equal<tOpt, string | number | undefined>>,\n ];\n }\n}\n\nasync function _testDataNoSchema() {\n const db = init({\n appId: '123',\n });\n\n const data = await db.query({ tbl: {} });\n const item = data?.tbl[0];\n if (item) {\n type t = typeof item.d;\n type _cases = [Expect<IsAny<t>>, Expect<Equal<typeof item.id, string>>];\n }\n}\n\nasync function _testSubscribe() {\n // No useDateObjects\n init({\n appId: '123',\n schema,\n }).subscribeQuery({ tbl: {} }, (payload) => {\n if (payload.type === 'ok') {\n const item = payload.data.tbl[0];\n if (item) {\n type _cases = [\n Expect<Equal<typeof item.id, string>>,\n Expect<Equal<typeof item.d, string | number>>,\n Expect<Equal<typeof item.dOptional, string | number | undefined>>,\n ];\n }\n }\n });\n\n // UseDateObjects\n init({\n appId: '123',\n schema,\n useDateObjects: true,\n }).subscribeQuery({ tbl: {} }, (payload) => {\n if (payload.type === 'ok') {\n const item = payload.data.tbl[0];\n if (item) {\n type _cases = [\n Expect<Equal<typeof item.id, string>>,\n Expect<Equal<typeof item.d, Date>>,\n Expect<Equal<typeof item.dOptional, Date | undefined>>,\n ];\n }\n }\n });\n\n // No schema\n init({\n appId: '123',\n }).subscribeQuery({ tbl: {} }, (payload) => {\n if (payload.type === 'ok') {\n const item = payload.data.tbl[0];\n if (item) {\n type _cases = [\n Expect<Equal<typeof item.id, string>>,\n Expect<IsAny<typeof item.d>>,\n Expect<IsAny<typeof item.dOptional>>,\n ];\n }\n }\n });\n}\n"]}