datocms-plugin-sdk 0.2.0-alpha.65
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/LICENSE.md +21 -0
- package/README.md +17 -0
- package/dist/cjs/SiteApiSchema.js +6 -0
- package/dist/cjs/SiteApiSchema.js.map +1 -0
- package/dist/cjs/connect.js +236 -0
- package/dist/cjs/connect.js.map +1 -0
- package/dist/cjs/guards.js +17 -0
- package/dist/cjs/guards.js.map +1 -0
- package/dist/cjs/index.js +15 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/SiteApiSchema.d.ts +6841 -0
- package/dist/esm/SiteApiSchema.js +5 -0
- package/dist/esm/SiteApiSchema.js.map +1 -0
- package/dist/esm/connect.d.ts +126 -0
- package/dist/esm/connect.js +229 -0
- package/dist/esm/connect.js.map +1 -0
- package/dist/esm/guards.d.ts +30 -0
- package/dist/esm/guards.js +14 -0
- package/dist/esm/guards.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types.d.ts +937 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/types/SiteApiSchema.d.ts +6841 -0
- package/dist/types/connect.d.ts +126 -0
- package/dist/types/guards.d.ts +30 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/types.d.ts +937 -0
- package/package.json +45 -0
- package/types.json +11672 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [year] [fullname]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# `datocms-plugin-sdk`
|
|
2
|
+
|
|
3
|
+
A set of Typescript types and helpers to work with DatoCMS Structured Text fields.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Using [npm](http://npmjs.org/):
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install datocms-plugin-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Using [yarn](https://yarnpkg.com/):
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
yarn add datocms-plugin-sdk
|
|
17
|
+
```
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable camelcase */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/** This file was automatically generated by hyperschema-to-ts: DO NOT MODIFY IT BY HAND. */
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
//# sourceMappingURL=SiteApiSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SiteApiSchema.js","sourceRoot":"","sources":["../../src/SiteApiSchema.ts"],"names":[],"mappings":";AAAA,8BAA8B;AAC9B,oBAAoB;AACpB,4FAA4F"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.connect = void 0;
|
|
54
|
+
var connectToParent_1 = __importDefault(require("penpal/lib/connectToParent"));
|
|
55
|
+
var guards_1 = require("./guards");
|
|
56
|
+
function toMultifield(fn) {
|
|
57
|
+
return function (fields, ctx) {
|
|
58
|
+
if (!fn) {
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
var result = {};
|
|
62
|
+
for (var _i = 0, fields_1 = fields; _i < fields_1.length; _i++) {
|
|
63
|
+
var field = fields_1[_i];
|
|
64
|
+
var itemType = ctx.itemTypes[field.relationships.item_type.data.id];
|
|
65
|
+
result[field.id] = fn(field, __assign(__assign({}, ctx), { itemType: itemType }));
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
var buildRenderUtils = function (parent) {
|
|
71
|
+
var oldHeight = null;
|
|
72
|
+
var updateHeight = function (height) {
|
|
73
|
+
var realHeight = height === undefined
|
|
74
|
+
? Math.ceil(document.documentElement.getBoundingClientRect().height)
|
|
75
|
+
: height;
|
|
76
|
+
if (realHeight !== oldHeight) {
|
|
77
|
+
parent.setHeight(realHeight);
|
|
78
|
+
oldHeight = realHeight;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var autoResizingActive = false;
|
|
82
|
+
var mutationObserver = null;
|
|
83
|
+
var resetHeight = function () { return updateHeight(); };
|
|
84
|
+
var startAutoResizer = function () {
|
|
85
|
+
updateHeight();
|
|
86
|
+
if (autoResizingActive) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
autoResizingActive = true;
|
|
90
|
+
mutationObserver = new MutationObserver(resetHeight);
|
|
91
|
+
mutationObserver.observe(window.document.body, {
|
|
92
|
+
attributes: true,
|
|
93
|
+
childList: true,
|
|
94
|
+
subtree: true,
|
|
95
|
+
characterData: true,
|
|
96
|
+
});
|
|
97
|
+
window.addEventListener('resize', resetHeight);
|
|
98
|
+
};
|
|
99
|
+
var stopAutoResizer = function () {
|
|
100
|
+
if (!autoResizingActive) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
autoResizingActive = false;
|
|
104
|
+
if (mutationObserver) {
|
|
105
|
+
mutationObserver.disconnect();
|
|
106
|
+
}
|
|
107
|
+
window.removeEventListener('resize', resetHeight);
|
|
108
|
+
};
|
|
109
|
+
return { updateHeight: updateHeight, startAutoResizer: startAutoResizer, stopAutoResizer: stopAutoResizer };
|
|
110
|
+
};
|
|
111
|
+
function connect(configuration) {
|
|
112
|
+
if (configuration === void 0) { configuration = {}; }
|
|
113
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
114
|
+
var mainNavigationTabs, settingsAreaSidebarItemGroups, contentAreaSidebarItems, manualFieldExtensions, itemFormSidebarPanels, listener, penpalConnection, parent, initialSettings, render, render, renderUtils_1, render, renderUtils_2, render, renderUtils_3, render, renderUtils_4, render, renderUtils_5, render;
|
|
115
|
+
return __generator(this, function (_a) {
|
|
116
|
+
switch (_a.label) {
|
|
117
|
+
case 0:
|
|
118
|
+
mainNavigationTabs = configuration.mainNavigationTabs, settingsAreaSidebarItemGroups = configuration.settingsAreaSidebarItemGroups, contentAreaSidebarItems = configuration.contentAreaSidebarItems, manualFieldExtensions = configuration.manualFieldExtensions, itemFormSidebarPanels = configuration.itemFormSidebarPanels;
|
|
119
|
+
listener = null;
|
|
120
|
+
penpalConnection = (0, connectToParent_1.default)({
|
|
121
|
+
methods: {
|
|
122
|
+
sdkVersion: function () { return '0.2.0'; },
|
|
123
|
+
implementedHooks: function () {
|
|
124
|
+
return Object.fromEntries(Object.entries(configuration).map(function (_a) {
|
|
125
|
+
var key = _a[0], value = _a[1];
|
|
126
|
+
if (typeof value === 'function') {
|
|
127
|
+
return [key, true];
|
|
128
|
+
}
|
|
129
|
+
return [key, value];
|
|
130
|
+
}));
|
|
131
|
+
},
|
|
132
|
+
mainNavigationTabs: mainNavigationTabs,
|
|
133
|
+
settingsAreaSidebarItemGroups: settingsAreaSidebarItemGroups,
|
|
134
|
+
contentAreaSidebarItems: contentAreaSidebarItems,
|
|
135
|
+
manualFieldExtensions: manualFieldExtensions,
|
|
136
|
+
itemFormSidebarPanels: itemFormSidebarPanels,
|
|
137
|
+
overrideFieldExtensions: toMultifield(configuration.overrideFieldExtensions),
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
139
|
+
onChange: function (newSettings) {
|
|
140
|
+
if (listener) {
|
|
141
|
+
listener(newSettings);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
validateManualFieldExtensionParameters: configuration.validateManualFieldExtensionParameters,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
return [4 /*yield*/, penpalConnection.promise];
|
|
148
|
+
case 1:
|
|
149
|
+
parent = _a.sent();
|
|
150
|
+
return [4 /*yield*/, parent.getSettings()];
|
|
151
|
+
case 2:
|
|
152
|
+
initialSettings = _a.sent();
|
|
153
|
+
if ((0, guards_1.isInitParent)(parent, initialSettings)) {
|
|
154
|
+
// Nothing to do. Parent calls the method they need.
|
|
155
|
+
}
|
|
156
|
+
if ((0, guards_1.isOnBootParent)(parent, initialSettings)) {
|
|
157
|
+
render = function (settings) {
|
|
158
|
+
if (!configuration.onBoot) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
configuration.onBoot(__assign(__assign({}, parent), settings));
|
|
162
|
+
};
|
|
163
|
+
render(initialSettings);
|
|
164
|
+
}
|
|
165
|
+
if ((0, guards_1.isRenderPageParent)(parent, initialSettings)) {
|
|
166
|
+
render = function (settings) {
|
|
167
|
+
if (!configuration.renderPage) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
configuration.renderPage(settings.pageId, __assign(__assign({}, parent), settings));
|
|
171
|
+
};
|
|
172
|
+
listener = render;
|
|
173
|
+
render(initialSettings);
|
|
174
|
+
}
|
|
175
|
+
if ((0, guards_1.isRenderConfigScreenParent)(parent, initialSettings)) {
|
|
176
|
+
renderUtils_1 = buildRenderUtils(parent);
|
|
177
|
+
render = function (settings) {
|
|
178
|
+
if (!configuration.renderConfigScreen) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
configuration.renderConfigScreen(__assign(__assign(__assign({}, parent), settings), renderUtils_1));
|
|
182
|
+
};
|
|
183
|
+
listener = render;
|
|
184
|
+
render(initialSettings);
|
|
185
|
+
}
|
|
186
|
+
if ((0, guards_1.isRenderModalParent)(parent, initialSettings)) {
|
|
187
|
+
renderUtils_2 = buildRenderUtils(parent);
|
|
188
|
+
render = function (settings) {
|
|
189
|
+
if (!configuration.renderModal) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
configuration.renderModal(settings.modalId, __assign(__assign(__assign({}, parent), settings), renderUtils_2));
|
|
193
|
+
};
|
|
194
|
+
listener = render;
|
|
195
|
+
render(initialSettings);
|
|
196
|
+
}
|
|
197
|
+
if ((0, guards_1.isRenderSidebarPaneParent)(parent, initialSettings)) {
|
|
198
|
+
renderUtils_3 = buildRenderUtils(parent);
|
|
199
|
+
render = function (settings) {
|
|
200
|
+
if (!configuration.renderItemFormSidebarPanel) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
configuration.renderItemFormSidebarPanel(settings.sidebarPaneId, __assign(__assign(__assign({}, parent), settings), renderUtils_3));
|
|
204
|
+
};
|
|
205
|
+
listener = render;
|
|
206
|
+
render(initialSettings);
|
|
207
|
+
}
|
|
208
|
+
if ((0, guards_1.isRenderFieldExtensionParent)(parent, initialSettings)) {
|
|
209
|
+
renderUtils_4 = buildRenderUtils(parent);
|
|
210
|
+
render = function (settings) {
|
|
211
|
+
if (!configuration.renderFieldExtension) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
configuration.renderFieldExtension(settings.fieldExtensionId, __assign(__assign(__assign({}, parent), settings), renderUtils_4));
|
|
215
|
+
};
|
|
216
|
+
listener = render;
|
|
217
|
+
render(initialSettings);
|
|
218
|
+
}
|
|
219
|
+
if ((0, guards_1.isRenderManualFieldExtensionConfigScreenParent)(parent, initialSettings)) {
|
|
220
|
+
renderUtils_5 = buildRenderUtils(parent);
|
|
221
|
+
render = function (settings) {
|
|
222
|
+
if (!configuration.renderManualFieldExtensionConfigScreen) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
configuration.renderManualFieldExtensionConfigScreen(settings.fieldExtensionId, __assign(__assign(__assign({}, parent), settings), renderUtils_5));
|
|
226
|
+
};
|
|
227
|
+
listener = render;
|
|
228
|
+
render(initialSettings);
|
|
229
|
+
}
|
|
230
|
+
return [2 /*return*/];
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
exports.connect = connect;
|
|
236
|
+
//# sourceMappingURL=connect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAAyD;AAyBzD,mCAUkB;AAyJlB,SAAS,YAAY,CACnB,EAA+D;IAE/D,OAAO,UACL,MAAe,EACf,GAA6B;QAE7B,IAAI,CAAC,EAAE,EAAE;YACP,OAAO,EAAE,CAAC;SACX;QAED,IAAM,MAAM,GAA2B,EAAE,CAAC;QAE1C,KAAoB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,EAAE;YAAvB,IAAM,KAAK,eAAA;YACd,IAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAC5B,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CACxB,CAAC;YAChB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,wBAAO,GAAG,KAAE,QAAQ,UAAA,IAAG,CAAC;SACpD;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAcD,IAAM,gBAAgB,GAAG,UAAC,MAA+C;IACvE,IAAI,SAAS,GAAkB,IAAI,CAAC;IAEpC,IAAM,YAAY,GAAG,UAAC,MAAe;QACnC,IAAM,UAAU,GACd,MAAM,KAAK,SAAS;YAClB,CAAC,CAAC,IAAI,CAAC,IAAI,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,sCAAsC,EAAE;gCACzD,OAAO;6BACR;4BAED,aAAa,CAAC,sCAAsC,CAClD,QAAQ,CAAC,gBAAgB,iCAEpB,MAAM,GACN,QAAQ,GACR,aAAW,EAEjB,CAAC;wBACJ,CAAC,CAAC;wBAEF,QAAQ,GAAG,MAAM,CAAC;wBAClB,MAAM,CAAC,eAA2B,CAAC,CAAC;qBACrC;;;;;CACF;AArMD,0BAqMC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRenderManualFieldExtensionConfigScreenParent = exports.isRenderFieldExtensionParent = exports.isRenderSidebarPaneParent = exports.isRenderModalParent = exports.isRenderConfigScreenParent = exports.isRenderPageParent = exports.isOnBootParent = exports.isInitParent = void 0;
|
|
4
|
+
function buildGuard(mode) {
|
|
5
|
+
return function (parent, settings) {
|
|
6
|
+
return settings.mode === mode;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
exports.isInitParent = buildGuard('init');
|
|
10
|
+
exports.isOnBootParent = buildGuard('onBoot');
|
|
11
|
+
exports.isRenderPageParent = buildGuard('renderPage');
|
|
12
|
+
exports.isRenderConfigScreenParent = buildGuard('renderConfigScreen');
|
|
13
|
+
exports.isRenderModalParent = buildGuard('renderModal');
|
|
14
|
+
exports.isRenderSidebarPaneParent = buildGuard('renderItemFormSidebarPanel');
|
|
15
|
+
exports.isRenderFieldExtensionParent = buildGuard('renderFieldExtension');
|
|
16
|
+
exports.isRenderManualFieldExtensionConfigScreenParent = buildGuard('renderManualFieldExtensionConfigScreen');
|
|
17
|
+
//# sourceMappingURL=guards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/guards.ts"],"names":[],"mappings":";;;AAaA,SAAS,UAAU,CAAmB,IAAY;IAChD,OAAO,UAAC,MAAc,EAAE,QAA0B;QAChD,OAAA,QAAQ,CAAC,IAAI,KAAK,IAAI;IAAtB,CAAsB,CAAC;AAC3B,CAAC;AAEY,QAAA,YAAY,GAAG,UAAU,CAAc,MAAM,CAAC,CAAC;AAE/C,QAAA,cAAc,GAAG,UAAU,CAAgB,QAAQ,CAAC,CAAC;AAErD,QAAA,kBAAkB,GAAG,UAAU,CAAoB,YAAY,CAAC,CAAC;AAEjE,QAAA,0BAA0B,GAAG,UAAU,CAClD,oBAAoB,CACrB,CAAC;AAEW,QAAA,mBAAmB,GAAG,UAAU,CAC3C,aAAa,CACd,CAAC;AAEW,QAAA,yBAAyB,GAAG,UAAU,CACjD,4BAA4B,CAC7B,CAAC;AAEW,QAAA,4BAA4B,GAAG,UAAU,CACpD,sBAAsB,CACvB,CAAC;AAEW,QAAA,8CAA8C,GAAG,UAAU,CACtE,wCAAwC,CACzC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./connect"), exports);
|
|
14
|
+
__exportStar(require("./types"), exports);
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AA0BA,4CAA0B;AAC1B,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|