@maka/maka-cli 5.3.11 → 5.3.13
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/bundle/typescript/package.json +1 -1
- package/bundle/typescript/src/templates/meteor/app/client/main.js.ts +2 -0
- package/bundle/typescript/src/templates/meteor/app/client/main.js.tsx +2 -0
- package/bundle/typescript/src/templates/meteor/app/maka.d.ts +30 -2
- package/bundle/typescript/src/templates/meteor/app/meteor.d.ts +19 -792
- package/bundle/typescript/src/templates/meteor/app/server/helmet-csp.js.ts +12 -12
- package/bundle/typescript/src/templates/meteor/app/server/helmet-csp.js.tsx +12 -12
- package/bundle/typescript/src/templates/meteor/app/server/main.js.ts +1 -0
- package/bundle/typescript/src/templates/meteor/app/server/main.js.tsx +1 -0
- package/bundle/typescript/src/templates/react/component/component.js.jsx +1 -1
- package/bundle/typescript/src/templates/react/component/component.js.tsx +1 -1
- package/bundle/typescript/src/templates/react/hook/hook.js.jsx +3 -3
- package/bundle/typescript/src/templates/react/hook/hook.js.tsx +3 -3
- package/bundle/typescript/src/templates/react/test/test.js.tsx +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 2.x applications using React.",
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
interface Window { cordova: any; }
|
|
2
2
|
|
|
3
|
+
declare module "*.css";
|
|
4
|
+
|
|
5
|
+
// Meteor's server-injected runtime config global. Genuinely undocumented --
|
|
6
|
+
// not part of @types/meteor's app-facing API coverage.
|
|
7
|
+
declare var __meteor_runtime_config__: any;
|
|
8
|
+
|
|
9
|
+
// No official types; not covered by @types/meteor.
|
|
10
|
+
declare module 'meteor/autoupdate' {
|
|
11
|
+
export const Autoupdate: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Adds the one real WebApp member @types/meteor doesn't have yet. This
|
|
15
|
+
// merges additively with @types/meteor's own `declare module "meteor/webapp"`
|
|
16
|
+
// -- it must not redeclare anything already defined there.
|
|
17
|
+
declare module 'meteor/webapp' {
|
|
18
|
+
namespace WebApp {
|
|
19
|
+
function addHtmlAttributeHook(callback: (request?: any) => Record<string, string>): void;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
3
23
|
declare module 'meteor/maka:http' {
|
|
4
24
|
export const HTTP: {
|
|
5
25
|
/**
|
|
@@ -147,10 +167,18 @@ declare module 'meteor/maka:http' {
|
|
|
147
167
|
|
|
148
168
|
declare module 'meteor/maka:rest' {
|
|
149
169
|
import { IncomingMessage, ServerResponse } from 'http';
|
|
150
|
-
import { RateLimiterMemory, RateLimiterRedis, IRateLimiterOptions } from 'rate-limiter-flexible';
|
|
151
|
-
import { RedisClientType } from '@redis/client';
|
|
152
170
|
import { Meteor } from 'meteor/meteor';
|
|
153
171
|
|
|
172
|
+
// rate-limiter-flexible and @redis/client are optional peer packages used
|
|
173
|
+
// only by maka:rest's rate-limiting feature -- they're bundled by the
|
|
174
|
+
// Meteor package itself, not something every app needs to npm install
|
|
175
|
+
// just to typecheck. Typed as `any` rather than pulling those packages in
|
|
176
|
+
// as devDependencies for every scaffolded project.
|
|
177
|
+
type IRateLimiterOptions = any;
|
|
178
|
+
type RateLimiterMemory = any;
|
|
179
|
+
type RateLimiterRedis = any;
|
|
180
|
+
type RedisClientType = any;
|
|
181
|
+
|
|
154
182
|
export type LoginType = 'default' | null;
|
|
155
183
|
|
|
156
184
|
export interface MakaRestOptions {
|
|
@@ -1,35 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @types/meteor now provides comprehensive, actively-maintained coverage for
|
|
3
|
+
* all of Meteor's core packages (meteor, mongo, ddp, http, random, blaze,
|
|
4
|
+
* browser-policy-common, accounts-base, tracker, reactive-var, tiny-test,
|
|
5
|
+
* email, ejson, and more). This file used to hand-roll ambient types for all
|
|
6
|
+
* of those too, which -- since TypeScript merges multiple `declare module`
|
|
7
|
+
* blocks for the same module specifier -- collided with @types/meteor's real
|
|
8
|
+
* (and differently-shaped) declarations rather than replacing them, breaking
|
|
9
|
+
* `tsc` outright with dozens of duplicate-identifier/conflicting-type errors.
|
|
10
|
+
* What's left here is only what @types/meteor genuinely doesn't cover:
|
|
11
|
+
* community packages without official types, and Meteor's build-time
|
|
12
|
+
* (package.js / mobile-config.js) globals, which are a different API surface
|
|
13
|
+
* than the app-runtime types @types/meteor focuses on.
|
|
3
14
|
*/
|
|
4
15
|
|
|
5
|
-
//
|
|
6
|
-
declare let require: Function;
|
|
7
|
-
declare let beforeEach: Function;
|
|
8
|
-
declare let afterEach: Function;
|
|
9
|
-
declare let it: Function;
|
|
10
|
-
declare let describe: Function;
|
|
11
|
-
declare let assert: any;
|
|
12
|
-
declare let equal: any;
|
|
13
|
-
declare let Map: MapConstructor;
|
|
14
|
-
declare let Meteor: any;
|
|
15
|
-
|
|
16
|
-
// TODO: These should be worked out ...
|
|
17
|
-
declare module 'meteor/react-meteor-data';
|
|
16
|
+
// Community packages with no official type definitions.
|
|
18
17
|
declare module 'meteor/mdg:validated-method';
|
|
19
18
|
declare module 'meteor/apollo';
|
|
20
|
-
declare module 'meteor/server-render';
|
|
21
|
-
declare module 'meteor/underscore';
|
|
22
|
-
declare module 'meteor/ddp-rate-limiter';
|
|
23
|
-
declare module 'meteor/check';
|
|
24
|
-
declare module 'meteor/webapp';
|
|
25
|
-
|
|
26
|
-
interface EJSONable {
|
|
27
|
-
[key: string]: number | string | boolean | object | number[] | string[] | object[] | Date | Uint8Array | EJSON.CustomType;
|
|
28
|
-
}
|
|
29
|
-
interface JSONable {
|
|
30
|
-
[key: string]: number | string | boolean | object | number[] | string[] | object[];
|
|
31
|
-
}
|
|
32
|
-
type EJSON = EJSONable
|
|
33
19
|
|
|
34
20
|
declare module "meteor/match" {
|
|
35
21
|
export namespace Match {
|
|
@@ -47,279 +33,8 @@ declare module "meteor/match" {
|
|
|
47
33
|
}
|
|
48
34
|
}
|
|
49
35
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
export namespace Meteor {
|
|
53
|
-
export var isDevelopment: any;
|
|
54
|
-
export var isServer: any;
|
|
55
|
-
export var isClient: any;
|
|
56
|
-
|
|
57
|
-
interface UserEmail {
|
|
58
|
-
address: string;
|
|
59
|
-
verified: boolean;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
interface User {
|
|
63
|
-
_id?: string;
|
|
64
|
-
username?: string;
|
|
65
|
-
emails?: Meteor.UserEmail[];
|
|
66
|
-
createdAt?: number;
|
|
67
|
-
profile?: any;
|
|
68
|
-
services?: any;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
enum StatusEnum {
|
|
72
|
-
connected,
|
|
73
|
-
connecting,
|
|
74
|
-
failed,
|
|
75
|
-
waiting,
|
|
76
|
-
offline
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
interface LiveQueryHandle {
|
|
80
|
-
stop(): void;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
declare module "meteor/ddp" {
|
|
86
|
-
import { Meteor } from "meteor/meteor";
|
|
87
|
-
|
|
88
|
-
export namespace DDP {
|
|
89
|
-
interface DDPStatic {
|
|
90
|
-
subscribe(name: string, ...rest: any[]): Meteor.SubscriptionHandle;
|
|
91
|
-
call(method: string, ...parameters: any[]): void;
|
|
92
|
-
apply(method: string, ...parameters: any[]): void;
|
|
93
|
-
methods(IMeteorMethodsDictionary: any): any;
|
|
94
|
-
status(): DDPStatus;
|
|
95
|
-
reconnect(): void;
|
|
96
|
-
disconnect(): void;
|
|
97
|
-
onReconnect(): void;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
interface DDPStatus {
|
|
101
|
-
connected: boolean;
|
|
102
|
-
status: Meteor.StatusEnum;
|
|
103
|
-
retryCount: number;
|
|
104
|
-
//To turn this into an interval until the next reconnection, use retryTime - (new Date()).getTime()
|
|
105
|
-
retryTime?: number;
|
|
106
|
-
reason?: string;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
declare module "meteor/mongo" {
|
|
112
|
-
export namespace Mongo {
|
|
113
|
-
interface Selector {
|
|
114
|
-
[key: string]: any;
|
|
115
|
-
}
|
|
116
|
-
type Selector = object
|
|
117
|
-
interface Modifier { }
|
|
118
|
-
interface SortSpecifier { }
|
|
119
|
-
interface FieldSpecifier {
|
|
120
|
-
[id: string]: number;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
declare module "meteor/http" {
|
|
126
|
-
export namespace HTTP {
|
|
127
|
-
|
|
128
|
-
interface HTTPRequest {
|
|
129
|
-
content?: string;
|
|
130
|
-
data?: any;
|
|
131
|
-
query?: string;
|
|
132
|
-
params?: { [id: string]: string };
|
|
133
|
-
auth?: string;
|
|
134
|
-
headers?: { [id: string]: string };
|
|
135
|
-
timeout?: number;
|
|
136
|
-
followRedirects?: boolean;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
interface HTTPResponse {
|
|
140
|
-
statusCode?: number;
|
|
141
|
-
headers?: { [id: string]: string };
|
|
142
|
-
content?: string;
|
|
143
|
-
data?: any;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function call(method: string, url: string, options?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse;
|
|
147
|
-
function del(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse;
|
|
148
|
-
function get(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse;
|
|
149
|
-
function post(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse;
|
|
150
|
-
function put(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
declare module "meteor/random" {
|
|
155
|
-
export namespace Random {
|
|
156
|
-
function id(numberOfChars?: number): string;
|
|
157
|
-
function secret(numberOfChars?: number): string;
|
|
158
|
-
function fraction(): number;
|
|
159
|
-
function hexString(numberOfDigits: number): string; // @param numberOfDigits, @returns a random hex string of the given length
|
|
160
|
-
function choice(array: any[]): string; // @param array, @return a random element in array
|
|
161
|
-
function choice(str: string): string; // @param str, @return a random char in str
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* These are the client modules and interfaces that can't be automatically generated from the Meteor data.js file
|
|
167
|
-
*/
|
|
168
|
-
|
|
169
|
-
declare module "meteor/meteor" {
|
|
170
|
-
import { Blaze } from "meteor/blaze";
|
|
171
|
-
|
|
172
|
-
export namespace Meteor {
|
|
173
|
-
/** Start definitions for Template **/
|
|
174
|
-
interface Event {
|
|
175
|
-
type: string;
|
|
176
|
-
target: HTMLElement;
|
|
177
|
-
currentTarget: HTMLElement;
|
|
178
|
-
which: number;
|
|
179
|
-
stopPropagation(): void;
|
|
180
|
-
stopImmediatePropagation(): void;
|
|
181
|
-
preventDefault(): void;
|
|
182
|
-
isPropagationStopped(): boolean;
|
|
183
|
-
isImmediatePropagationStopped(): boolean;
|
|
184
|
-
isDefaultPrevented(): boolean;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
interface EventHandlerFunction extends Function {
|
|
188
|
-
(event?: Meteor.Event, templateInstance?: Blaze.TemplateInstance): void;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
interface EventMap {
|
|
192
|
-
[id: string]: Meteor.EventHandlerFunction;
|
|
193
|
-
}
|
|
194
|
-
/** End definitions for Template **/
|
|
195
|
-
|
|
196
|
-
interface LoginWithExternalServiceOptions {
|
|
197
|
-
requestPermissions?: string[];
|
|
198
|
-
requestOfflineToken?: boolean;
|
|
199
|
-
forceApprovalPrompt?: boolean;
|
|
200
|
-
userEmail?: string;
|
|
201
|
-
loginStyle?: string;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function loginWithMeteorDeveloperAccount(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
|
|
205
|
-
function loginWithFacebook(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
|
|
206
|
-
function loginWithGithub(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
|
|
207
|
-
function loginWithGoogle(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
|
|
208
|
-
function loginWithMeetup(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
|
|
209
|
-
function loginWithTwitter(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
|
|
210
|
-
function loginWithWeibo(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void;
|
|
211
|
-
|
|
212
|
-
interface SubscriptionHandle {
|
|
213
|
-
stop(): void;
|
|
214
|
-
ready(): boolean;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
declare module "meteor/blaze" {
|
|
220
|
-
export namespace Blaze {
|
|
221
|
-
interface View {
|
|
222
|
-
name: string;
|
|
223
|
-
parentView: Blaze.View;
|
|
224
|
-
isCreated: boolean;
|
|
225
|
-
isRendered: boolean;
|
|
226
|
-
isDestroyed: boolean;
|
|
227
|
-
renderCount: number;
|
|
228
|
-
autorun(runFunc: Function): void;
|
|
229
|
-
onViewCreated(func: Function): void;
|
|
230
|
-
onViewReady(func: Function): void;
|
|
231
|
-
onViewDestroyed(func: Function): void;
|
|
232
|
-
firstNode(): Node;
|
|
233
|
-
lastNode(): Node;
|
|
234
|
-
template: Blaze.Template;
|
|
235
|
-
templateInstance(): any;
|
|
236
|
-
}
|
|
237
|
-
interface Template {
|
|
238
|
-
viewName: string;
|
|
239
|
-
renderFunction: Function;
|
|
240
|
-
constructView(): Blaze.View;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
declare module "meteor/browser-policy" {
|
|
246
|
-
export namespace BrowserPolicy {
|
|
247
|
-
|
|
248
|
-
interface framing {
|
|
249
|
-
disallow(): void;
|
|
250
|
-
restrictToOrigin(origin: string): void;
|
|
251
|
-
allowAll(): void;
|
|
252
|
-
}
|
|
253
|
-
interface content {
|
|
254
|
-
allowEval(): void;
|
|
255
|
-
allowInlineStyles(): void;
|
|
256
|
-
allowInlineScripts(): void;
|
|
257
|
-
allowSameOriginForAll(): void;
|
|
258
|
-
allowDataUrlForAll(): void;
|
|
259
|
-
allowOriginForAll(origin: string): void;
|
|
260
|
-
allowImageOrigin(origin: string): void;
|
|
261
|
-
allowFrameOrigin(origin: string): void;
|
|
262
|
-
allowContentTypeSniffing(): void;
|
|
263
|
-
allowAllContentOrigin(): void;
|
|
264
|
-
allowAllContentDataUrl(): void;
|
|
265
|
-
allowAllContentSameOrigin(): void;
|
|
266
|
-
|
|
267
|
-
disallowAll(): void;
|
|
268
|
-
disallowInlineStyles(): void;
|
|
269
|
-
disallowEval(): void;
|
|
270
|
-
disallowInlineScripts(): void;
|
|
271
|
-
disallowFont(): void;
|
|
272
|
-
disallowObject(): void;
|
|
273
|
-
disallowAllContent(): void;
|
|
274
|
-
//TODO: add the basic content types
|
|
275
|
-
// allow<content type>Origin(origin)
|
|
276
|
-
// allow<content type>DataUrl()
|
|
277
|
-
// allow<content type>SameOrigin()
|
|
278
|
-
// disallow<content type>()
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* These are the server modules and interfaces that can't be automatically generated from the Meteor data.js file
|
|
286
|
-
*/
|
|
287
|
-
|
|
288
|
-
declare module "meteor/meteor" {
|
|
289
|
-
export namespace Meteor {
|
|
290
|
-
interface EmailFields {
|
|
291
|
-
subject?: Function;
|
|
292
|
-
text?: Function;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
interface EmailTemplates {
|
|
296
|
-
from: string;
|
|
297
|
-
siteName: string;
|
|
298
|
-
resetPassword: Meteor.EmailFields;
|
|
299
|
-
enrollAccount: Meteor.EmailFields;
|
|
300
|
-
verifyEmail: Meteor.EmailFields;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
interface Connection {
|
|
304
|
-
id: string;
|
|
305
|
-
close: Function;
|
|
306
|
-
onClose: Function;
|
|
307
|
-
clientAddress: string;
|
|
308
|
-
httpHeaders: object;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
declare module "meteor/mongo" {
|
|
314
|
-
export namespace Mongo {
|
|
315
|
-
interface AllowDenyOptions {
|
|
316
|
-
insert?: (userId: string, doc: any) => boolean;
|
|
317
|
-
update?: (userId: string, doc: any, fieldNames: string[], modifier: any) => boolean;
|
|
318
|
-
remove?: (userId: string, doc: any) => boolean;
|
|
319
|
-
fetch?: string[];
|
|
320
|
-
transform?: Function;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
36
|
+
interface EJSONable {
|
|
37
|
+
[key: string]: number | string | boolean | object | number[] | string[] | object[] | Date | Uint8Array;
|
|
323
38
|
}
|
|
324
39
|
|
|
325
40
|
interface MailComposerOptions {
|
|
@@ -340,118 +55,12 @@ interface MailComposer {
|
|
|
340
55
|
streamMessage(): void;
|
|
341
56
|
pipe(stream: any /** fs.WriteStream **/): void;
|
|
342
57
|
}
|
|
58
|
+
|
|
343
59
|
/**
|
|
344
|
-
*
|
|
60
|
+
* Build-time globals available in package.js / mobile-config.js, which fall
|
|
61
|
+
* outside @types/meteor's app-runtime coverage.
|
|
345
62
|
*/
|
|
346
63
|
|
|
347
|
-
interface ILengthAble {
|
|
348
|
-
length: number;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
interface ITinytestAssertions {
|
|
352
|
-
ok(doc: object): void;
|
|
353
|
-
expect_fail(): void;
|
|
354
|
-
fail(doc: object): void;
|
|
355
|
-
runId(): string;
|
|
356
|
-
equal<T>(actual: T, expected: T, message?: string, not?: boolean): void;
|
|
357
|
-
notEqual<T>(actual: T, expected: T, message?: string): void;
|
|
358
|
-
instanceOf(obj: object, klass: Function, message?: string): void;
|
|
359
|
-
notInstanceOf(obj: object, klass: Function, message?: string): void;
|
|
360
|
-
matches(actual: any, regexp: RegExp, message?: string): void;
|
|
361
|
-
notMatches(actual: any, regexp: RegExp, message?: string): void;
|
|
362
|
-
throws(f: Function, expected?: string | RegExp): void;
|
|
363
|
-
isTrue(v: boolean, msg?: string): void;
|
|
364
|
-
isFalse(v: boolean, msg?: string): void;
|
|
365
|
-
isNull(v: any, msg?: string): void;
|
|
366
|
-
isNotNull(v: any, msg?: string): void;
|
|
367
|
-
isUndefined(v: any, msg?: string): void;
|
|
368
|
-
isNotUndefined(v: any, msg?: string): void;
|
|
369
|
-
isNan(v: any, msg?: string): void;
|
|
370
|
-
isNotNan(v: any, msg?: string): void;
|
|
371
|
-
include<T>(s: Array<T> | object | string, value: any, msg?: string, not?: boolean): void;
|
|
372
|
-
|
|
373
|
-
notInclude<T>(s: Array<T> | object | string, value: any, msg?: string, not?: boolean): void;
|
|
374
|
-
length(obj: ILengthAble, expected_length: number, msg?: string): void;
|
|
375
|
-
_stringEqual(actual: string, expected: string, msg?: string): void;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
declare module "meteor/tiny-test" {
|
|
379
|
-
export namespace Tinytest {
|
|
380
|
-
function add(description: string, func: (test: ITinytestAssertions) => void): void;
|
|
381
|
-
function addAsync(description: string, func: (test: ITinytestAssertions) => void): void;
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
// Kept in for backwards compatibility
|
|
387
|
-
declare module "meteor/meteor" {
|
|
388
|
-
export namespace Meteor {
|
|
389
|
-
interface Tinytest {
|
|
390
|
-
add(description: string, func: (test: ITinytestAssertions) => void): void;
|
|
391
|
-
addAsync(description: string, func: (test: ITinytestAssertions) => void): void;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
declare module "meteor/accounts-base" {
|
|
397
|
-
import { Meteor } from "meteor/meteor";
|
|
398
|
-
|
|
399
|
-
export namespace Accounts {
|
|
400
|
-
function addEmail(userId: string, newEmail: string, verified?: boolean): void;
|
|
401
|
-
function changePassword(oldPassword: string, newPassword: string, callback?: Function): void;
|
|
402
|
-
function createUser(options: {
|
|
403
|
-
username?: string;
|
|
404
|
-
email?: string;
|
|
405
|
-
password?: string;
|
|
406
|
-
profile?: object;
|
|
407
|
-
}, callback?: Function): string;
|
|
408
|
-
var emailTemplates: Meteor.EmailTemplates;
|
|
409
|
-
function findUserByEmail(email: string): object;
|
|
410
|
-
function findUserByUsername(username: string): object;
|
|
411
|
-
function forgotPassword(options: {
|
|
412
|
-
email?: string;
|
|
413
|
-
}, callback?: Function): void;
|
|
414
|
-
function onEmailVerificationLink(callback: Function): void;
|
|
415
|
-
function onEnrollmentLink(callback: Function): void;
|
|
416
|
-
function onResetPasswordLink(callback: Function): void;
|
|
417
|
-
function removeEmail(userId: string, email: string): void;
|
|
418
|
-
function resetPassword(token: string, newPassword: string, callback?: Function): void;
|
|
419
|
-
function sendEnrollmentEmail(userId: string, email?: string): void;
|
|
420
|
-
function sendResetPasswordEmail(userId: string, email?: string): void;
|
|
421
|
-
function sendVerificationEmail(userId: string, email?: string): void;
|
|
422
|
-
function setPassword(userId: string, newPassword: string, options?: {
|
|
423
|
-
logout?: object;
|
|
424
|
-
}): void;
|
|
425
|
-
function setUsername(userId: string, newUsername: string): void;
|
|
426
|
-
var ui: {
|
|
427
|
-
config(options: {
|
|
428
|
-
requestPermissions?: object;
|
|
429
|
-
requestOfflineToken?: object;
|
|
430
|
-
forceApprovalPrompt?: object;
|
|
431
|
-
passwordSignupFields?: string;
|
|
432
|
-
}): void;
|
|
433
|
-
};
|
|
434
|
-
function verifyEmail(token: string, callback?: Function): void;
|
|
435
|
-
function config(options: {
|
|
436
|
-
sendVerificationEmail?: boolean;
|
|
437
|
-
forbidClientAccountCreation?: boolean;
|
|
438
|
-
restrictCreationByEmailDomain?: string | Function;
|
|
439
|
-
loginExpirationInDays?: number;
|
|
440
|
-
oauthSecretKey?: string;
|
|
441
|
-
}): void;
|
|
442
|
-
function onLogin(func: Function): { stop: () => void };
|
|
443
|
-
function onLoginFailure(func: Function): { stop: () => void };
|
|
444
|
-
function user(): Meteor.User;
|
|
445
|
-
function userId(): string;
|
|
446
|
-
function loggingIn(): boolean;
|
|
447
|
-
function logout(callback?: Function): void;
|
|
448
|
-
function logoutOtherClients(callback?: Function): void;
|
|
449
|
-
function onCreateUser(func: Function): void;
|
|
450
|
-
function validateLoginAttempt(func: Function): { stop: () => void };
|
|
451
|
-
function validateNewUser(func: Function): boolean;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
|
|
455
64
|
declare namespace App {
|
|
456
65
|
function accessRule(domainRule: string, options?: {
|
|
457
66
|
launchExternal?: boolean;
|
|
@@ -472,252 +81,14 @@ declare namespace App {
|
|
|
472
81
|
}
|
|
473
82
|
|
|
474
83
|
declare namespace Assets {
|
|
475
|
-
function getBinary(assetPath: string, asyncCallback?: Function):
|
|
84
|
+
function getBinary(assetPath: string, asyncCallback?: Function): any;
|
|
476
85
|
function getText(assetPath: string, asyncCallback?: Function): string;
|
|
477
86
|
}
|
|
478
87
|
|
|
479
|
-
declare module "meteor/blaze" {
|
|
480
|
-
import { Meteor } from "meteor/meteor";
|
|
481
|
-
export namespace Blaze {
|
|
482
|
-
function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View;
|
|
483
|
-
function If(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View;
|
|
484
|
-
function Let(bindings: Function, contentFunc: Function): Blaze.View;
|
|
485
|
-
var Template: TemplateStatic;
|
|
486
|
-
interface TemplateStatic {
|
|
487
|
-
new (viewName?: string, renderFunction?: Function): Template;
|
|
488
|
-
// It should be [templateName: string]: TemplateInstance but this is not possible -- user will need to cast to TemplateInstance
|
|
489
|
-
[templateName: string]: any | Template; // added "any" to make it work
|
|
490
|
-
head: Template;
|
|
491
|
-
find(selector: string): Blaze.Template;
|
|
492
|
-
findAll(selector: string): Blaze.Template[];
|
|
493
|
-
$: any;
|
|
494
|
-
}
|
|
495
|
-
interface Template {
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
var TemplateInstance: TemplateInstanceStatic;
|
|
499
|
-
interface TemplateInstanceStatic {
|
|
500
|
-
new (view: Blaze.View): TemplateInstance;
|
|
501
|
-
}
|
|
502
|
-
interface TemplateInstance {
|
|
503
|
-
$(selector: string): any;
|
|
504
|
-
autorun(runFunc: Function): object;
|
|
505
|
-
data: object;
|
|
506
|
-
find(selector?: string): Blaze.TemplateInstance;
|
|
507
|
-
findAll(selector: string): Blaze.TemplateInstance[];
|
|
508
|
-
firstNode: object;
|
|
509
|
-
lastNode: object;
|
|
510
|
-
subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle;
|
|
511
|
-
subscriptionsReady(): boolean;
|
|
512
|
-
view: object;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
function Unless(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View;
|
|
516
|
-
var View: ViewStatic;
|
|
517
|
-
interface ViewStatic {
|
|
518
|
-
new (name?: string, renderFunction?: Function): View;
|
|
519
|
-
}
|
|
520
|
-
interface View {
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
function With(data: object | Function, contentFunc: Function): Blaze.View;
|
|
524
|
-
var currentView: Blaze.View;
|
|
525
|
-
function getData(elementOrView?: HTMLElement | Blaze.View): object;
|
|
526
|
-
function getView(element?: HTMLElement): Blaze.View;
|
|
527
|
-
function isTemplate(value: any): boolean;
|
|
528
|
-
function remove(renderedView: Blaze.View): void;
|
|
529
|
-
function render(templateOrView: Template | Blaze.View, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View;
|
|
530
|
-
function renderWithData(templateOrView: Template | Blaze.View, data: object | Function, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View;
|
|
531
|
-
function toHTML(templateOrView: Template | Blaze.View): string;
|
|
532
|
-
function toHTMLWithData(templateOrView: Template | Blaze.View, data: object | Function): string;
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
|
|
536
88
|
declare namespace Cordova {
|
|
537
89
|
function depends(dependencies: { [id: string]: string }): void;
|
|
538
90
|
}
|
|
539
91
|
|
|
540
|
-
declare module "meteor/ddp" {
|
|
541
|
-
export namespace DDP {
|
|
542
|
-
function connect(url: string): DDP.DDPStatic;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
declare namespace DDPCommon {
|
|
547
|
-
function MethodInvocation(options: {
|
|
548
|
-
}): any;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
declare namespace EJSON {
|
|
552
|
-
var CustomType: CustomTypeStatic;
|
|
553
|
-
interface CustomTypeStatic {
|
|
554
|
-
new (): CustomType;
|
|
555
|
-
}
|
|
556
|
-
interface CustomType {
|
|
557
|
-
clone(): EJSON.CustomType;
|
|
558
|
-
equals(other: object): boolean;
|
|
559
|
-
toJSONValue(): JSONable;
|
|
560
|
-
typeName(): string;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
function addType(name: string, factory: (val: JSONable) => EJSON.CustomType): void;
|
|
564
|
-
function clone<T>(val: T): T;
|
|
565
|
-
function equals(a: EJSON, b: EJSON, options?: {
|
|
566
|
-
keyOrderSensitive?: boolean;
|
|
567
|
-
}): boolean;
|
|
568
|
-
function fromJSONValue(val: JSONable): any;
|
|
569
|
-
function isBinary(x: object): boolean;
|
|
570
|
-
var newBinary: any;
|
|
571
|
-
function parse(str: string): EJSON;
|
|
572
|
-
function stringify(val: EJSON, options?: {
|
|
573
|
-
indent?: boolean | number | string;
|
|
574
|
-
canonical?: boolean;
|
|
575
|
-
}): string;
|
|
576
|
-
function toJSONValue(val: EJSON): JSONable;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
declare namespace Match {
|
|
580
|
-
function test(value: any, pattern: any): boolean;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
declare module "meteor/meteor" {
|
|
584
|
-
import { Mongo } from "meteor/mongo";
|
|
585
|
-
|
|
586
|
-
export namespace Meteor {
|
|
587
|
-
var Error: ErrorStatic;
|
|
588
|
-
interface ErrorStatic {
|
|
589
|
-
new (error: string | number, reason?: string, details?: string): Error;
|
|
590
|
-
}
|
|
591
|
-
interface Error {
|
|
592
|
-
error: string | number;
|
|
593
|
-
reason?: string;
|
|
594
|
-
details?: string;
|
|
595
|
-
}
|
|
596
|
-
function absoluteUrl(path?: string, options?: {
|
|
597
|
-
secure?: boolean;
|
|
598
|
-
replaceLocalhost?: boolean;
|
|
599
|
-
rootUrl?: string;
|
|
600
|
-
}): string;
|
|
601
|
-
function apply(name: string, args: EJSONable[], options?: {
|
|
602
|
-
wait?: boolean;
|
|
603
|
-
onResultReceived?: Function;
|
|
604
|
-
}, asyncCallback?: Function): any;
|
|
605
|
-
function call(name: string, ...args: any[]): any;
|
|
606
|
-
function clearInterval(id: number): void;
|
|
607
|
-
function clearTimeout(id: number): void;
|
|
608
|
-
function disconnect(): void;
|
|
609
|
-
var isClient: any;
|
|
610
|
-
var isCordova: boolean;
|
|
611
|
-
var isServer: any;
|
|
612
|
-
function loggingIn(): boolean;
|
|
613
|
-
function loginWith<ExternalService>(options?: {
|
|
614
|
-
requestPermissions?: string[];
|
|
615
|
-
requestOfflineToken?: boolean;
|
|
616
|
-
loginUrlParameters?: object;
|
|
617
|
-
userEmail?: string;
|
|
618
|
-
loginStyle?: string;
|
|
619
|
-
redirectUrl?: string;
|
|
620
|
-
}, callback?: Function): void;
|
|
621
|
-
function loginWithPassword(user: object | string, password: string, callback?: Function): void;
|
|
622
|
-
function logout(callback?: Function): void;
|
|
623
|
-
function logoutOtherClients(callback?: Function): void;
|
|
624
|
-
function methods(methods: object): void;
|
|
625
|
-
function onConnection(callback: Function): void;
|
|
626
|
-
function publish(name: string, func: Function): void;
|
|
627
|
-
function reconnect(): void;
|
|
628
|
-
var release: string;
|
|
629
|
-
function setInterval(func: Function, delay: number): number;
|
|
630
|
-
function setTimeout(func: Function, delay: number): number;
|
|
631
|
-
var settings: { [id: string]: any };
|
|
632
|
-
function startup(func: Function): void;
|
|
633
|
-
function status(): Meteor.StatusEnum;
|
|
634
|
-
function subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle;
|
|
635
|
-
function user(): Meteor.User;
|
|
636
|
-
function userId(): string;
|
|
637
|
-
var users: Mongo.Collection<User>;
|
|
638
|
-
function wrapAsync(func: Function, context?: object): any;
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
declare module "meteor/mongo" {
|
|
643
|
-
import { Meteor } from "meteor/meteor";
|
|
644
|
-
|
|
645
|
-
export namespace Mongo {
|
|
646
|
-
var Collection: CollectionStatic;
|
|
647
|
-
interface CollectionStatic {
|
|
648
|
-
new <T>(name: string, options?: {
|
|
649
|
-
connection?: object;
|
|
650
|
-
idGeneration?: string;
|
|
651
|
-
transform?: Function;
|
|
652
|
-
}): Collection<T>;
|
|
653
|
-
}
|
|
654
|
-
interface Collection<T> {
|
|
655
|
-
allow(options: {
|
|
656
|
-
insert?: (userId: string, doc: T) => boolean;
|
|
657
|
-
update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean;
|
|
658
|
-
remove?: (userId: string, doc: T) => boolean;
|
|
659
|
-
fetch?: string[];
|
|
660
|
-
transform?: Function;
|
|
661
|
-
}): boolean;
|
|
662
|
-
deny(options: {
|
|
663
|
-
insert?: (userId: string, doc: T) => boolean;
|
|
664
|
-
update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean;
|
|
665
|
-
remove?: (userId: string, doc: T) => boolean;
|
|
666
|
-
fetch?: string[];
|
|
667
|
-
transform?: Function;
|
|
668
|
-
}): boolean;
|
|
669
|
-
find(selector?: Mongo.Selector | Mongo.ObjectID | string, options?: {
|
|
670
|
-
sort?: Mongo.SortSpecifier;
|
|
671
|
-
skip?: number;
|
|
672
|
-
limit?: number;
|
|
673
|
-
fields?: Mongo.FieldSpecifier;
|
|
674
|
-
reactive?: boolean;
|
|
675
|
-
transform?: Function;
|
|
676
|
-
}): Mongo.Cursor<T>;
|
|
677
|
-
findOne(selector?: Mongo.Selector | Mongo.ObjectID | string, options?: {
|
|
678
|
-
sort?: Mongo.SortSpecifier;
|
|
679
|
-
skip?: number;
|
|
680
|
-
fields?: Mongo.FieldSpecifier;
|
|
681
|
-
reactive?: boolean;
|
|
682
|
-
transform?: Function;
|
|
683
|
-
}): T;
|
|
684
|
-
insert(doc: T, callback?: Function): string;
|
|
685
|
-
rawCollection(): any;
|
|
686
|
-
rawDatabase(): any;
|
|
687
|
-
remove(selector: Mongo.Selector | Mongo.ObjectID | string, callback?: Function): number;
|
|
688
|
-
update(selector: Mongo.Selector | Mongo.ObjectID | string, modifier: Mongo.Modifier, options?: {
|
|
689
|
-
multi?: boolean;
|
|
690
|
-
upsert?: boolean;
|
|
691
|
-
}, callback?: Function): number;
|
|
692
|
-
upsert(selector: Mongo.Selector | Mongo.ObjectID | string, modifier: Mongo.Modifier, options?: {
|
|
693
|
-
multi?: boolean;
|
|
694
|
-
}, callback?: Function): { numberAffected?: number; insertedId?: string; };
|
|
695
|
-
_ensureIndex(indexName: string, options?: { [key: string]: any }): void;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
var Cursor: CursorStatic;
|
|
699
|
-
interface CursorStatic {
|
|
700
|
-
new <T>(): Cursor<T>;
|
|
701
|
-
}
|
|
702
|
-
interface Cursor<T> {
|
|
703
|
-
count(): number;
|
|
704
|
-
fetch(): Array<T>;
|
|
705
|
-
forEach(callback: <T>(doc: T, index: number, cursor: Mongo.Cursor<T>) => void, thisArg?: any): void;
|
|
706
|
-
map<U>(callback: (doc: T, index: number, cursor: Mongo.Cursor<T>) => U, thisArg?: any): Array<U>;
|
|
707
|
-
observe(callbacks: object): Meteor.LiveQueryHandle;
|
|
708
|
-
observeChanges(callbacks: object): Meteor.LiveQueryHandle;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
var ObjectID: ObjectIDStatic;
|
|
712
|
-
interface ObjectIDStatic {
|
|
713
|
-
new (hexString?: string): ObjectID;
|
|
714
|
-
}
|
|
715
|
-
interface ObjectID {
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
|
|
721
92
|
declare namespace Npm {
|
|
722
93
|
function depends(dependencies: { [id: string]: string }): void;
|
|
723
94
|
function require(name: string): any;
|
|
@@ -743,89 +114,6 @@ declare namespace Package {
|
|
|
743
114
|
}): void;
|
|
744
115
|
}
|
|
745
116
|
|
|
746
|
-
declare module "meteor/tracker" {
|
|
747
|
-
export namespace Tracker {
|
|
748
|
-
function Computation(): void;
|
|
749
|
-
interface Computation {
|
|
750
|
-
firstRun: boolean;
|
|
751
|
-
invalidate(): void;
|
|
752
|
-
invalidated: boolean;
|
|
753
|
-
onInvalidate(callback: Function): void;
|
|
754
|
-
onStop(callback: Function): void;
|
|
755
|
-
stop(): void;
|
|
756
|
-
stopped: boolean;
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
var Dependency: DependencyStatic;
|
|
760
|
-
interface DependencyStatic {
|
|
761
|
-
new (): Dependency;
|
|
762
|
-
}
|
|
763
|
-
interface Dependency {
|
|
764
|
-
changed(): void;
|
|
765
|
-
depend(fromComputation?: Tracker.Computation): boolean;
|
|
766
|
-
hasDependents(): boolean;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
var active: boolean;
|
|
770
|
-
function afterFlush(callback: Function): void;
|
|
771
|
-
function autorun(runFunc: (computation: Tracker.Computation) => void, options?: {
|
|
772
|
-
onError?: Function;
|
|
773
|
-
}): Tracker.Computation;
|
|
774
|
-
var currentComputation: Tracker.Computation;
|
|
775
|
-
function flush(): void;
|
|
776
|
-
function nonreactive(func: Function): void;
|
|
777
|
-
function onInvalidate(callback: Function): void;
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
declare namespace Session {
|
|
782
|
-
function equals(key: string, value: string | number | boolean | any /** Null **/ | any /** Undefined **/): boolean;
|
|
783
|
-
function get(key: string): any;
|
|
784
|
-
function set(key: string, value: EJSONable | any /** Undefined **/): void;
|
|
785
|
-
function setDefault(key: string, value: EJSONable | any /** Undefined **/): void;
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
declare module "meteor/http" {
|
|
789
|
-
import { Meteor } from "meteor/meteor";
|
|
790
|
-
export namespace HTTP {
|
|
791
|
-
|
|
792
|
-
function call(method: string, url: string, options?: {
|
|
793
|
-
content?: string;
|
|
794
|
-
data?: object;
|
|
795
|
-
query?: string;
|
|
796
|
-
params?: object;
|
|
797
|
-
auth?: string;
|
|
798
|
-
headers?: object;
|
|
799
|
-
timeout?: number;
|
|
800
|
-
followRedirects?: boolean;
|
|
801
|
-
npmRequestOptions?: object;
|
|
802
|
-
beforeSend?: Function;
|
|
803
|
-
}, asyncCallback?: Function): HTTP.HTTPResponse;
|
|
804
|
-
function del(url: string, callOptions?: object, asyncCallback?: Function): HTTP.HTTPResponse;
|
|
805
|
-
function get(url: string, callOptions?: object, asyncCallback?: Function): HTTP.HTTPResponse;
|
|
806
|
-
function post(url: string, callOptions?: object, asyncCallback?: Function): HTTP.HTTPResponse;
|
|
807
|
-
function put(url: string, callOptions?: object, asyncCallback?: Function): HTTP.HTTPResponse;
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
declare module "meteor/email" {
|
|
812
|
-
export namespace Email {
|
|
813
|
-
function send(options: {
|
|
814
|
-
from?: string;
|
|
815
|
-
to?: string | string[];
|
|
816
|
-
cc?: string | string[];
|
|
817
|
-
bcc?: string | string[];
|
|
818
|
-
replyTo?: string | string[];
|
|
819
|
-
subject?: string;
|
|
820
|
-
text?: string;
|
|
821
|
-
html?: string;
|
|
822
|
-
headers?: object;
|
|
823
|
-
attachments?: object[];
|
|
824
|
-
mailComposer?: MailComposer;
|
|
825
|
-
}): void;
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
|
|
829
117
|
declare var CompileStep: CompileStepStatic;
|
|
830
118
|
interface CompileStepStatic {
|
|
831
119
|
new (): CompileStep;
|
|
@@ -876,66 +164,6 @@ interface PackageAPI {
|
|
|
876
164
|
versionsFrom(meteorRelease: string | string[]): void;
|
|
877
165
|
}
|
|
878
166
|
|
|
879
|
-
declare module "meteor/reactive-var" {
|
|
880
|
-
import { Meteor } from "meteor/meteor";
|
|
881
|
-
|
|
882
|
-
export var ReactiveVar: ReactiveVarStatic;
|
|
883
|
-
interface ReactiveVarStatic {
|
|
884
|
-
new <T>(initialValue: T, equalsFunc?: Function): ReactiveVar<T>;
|
|
885
|
-
}
|
|
886
|
-
interface ReactiveVar<T> {
|
|
887
|
-
get(): T;
|
|
888
|
-
set(newValue: T): void;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
export var Subscription: SubscriptionStatic;
|
|
892
|
-
interface SubscriptionStatic {
|
|
893
|
-
new (): Subscription;
|
|
894
|
-
}
|
|
895
|
-
interface Subscription {
|
|
896
|
-
added(collection: string, id: string, fields: object): void;
|
|
897
|
-
changed(collection: string, id: string, fields: object): void;
|
|
898
|
-
connection: Meteor.Connection;
|
|
899
|
-
error(error: Error): void;
|
|
900
|
-
onStop(func: Function): void;
|
|
901
|
-
ready(): void;
|
|
902
|
-
removed(collection: string, id: string): void;
|
|
903
|
-
stop(): void;
|
|
904
|
-
userId: string;
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
declare module "meteor/blaze" {
|
|
909
|
-
import { Meteor } from "meteor/meteor";
|
|
910
|
-
|
|
911
|
-
export var Template: TemplateStatic;
|
|
912
|
-
interface TemplateStatic {
|
|
913
|
-
new (): Template;
|
|
914
|
-
// It should be [templateName: string]: TemplateInstance but this is not possible -- user will need to cast to TemplateInstance
|
|
915
|
-
[templateName: string]: any | Template; // added "any" to make it work
|
|
916
|
-
head: Template;
|
|
917
|
-
find(selector: string): Blaze.Template;
|
|
918
|
-
findAll(selector: string): Blaze.Template[];
|
|
919
|
-
$: any;
|
|
920
|
-
body: Template;
|
|
921
|
-
currentData(): {};
|
|
922
|
-
instance(): Blaze.TemplateInstance;
|
|
923
|
-
parentData(numLevels?: number): {};
|
|
924
|
-
registerHelper(name: string, helperFunction: Function): void;
|
|
925
|
-
}
|
|
926
|
-
interface Template {
|
|
927
|
-
created: Function;
|
|
928
|
-
destroyed: Function;
|
|
929
|
-
events(eventMap: Meteor.EventMap): void;
|
|
930
|
-
helpers(helpers: { [id: string]: any }): void;
|
|
931
|
-
onCreated: Function;
|
|
932
|
-
onDestroyed: Function;
|
|
933
|
-
onRendered: Function;
|
|
934
|
-
rendered: Function;
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
declare function check(value: any, pattern: any): void;
|
|
939
167
|
declare function execFileAsync(command: string, args?: any[], options?: {
|
|
940
168
|
cwd?: object;
|
|
941
169
|
env?: object;
|
|
@@ -951,4 +179,3 @@ declare function execFileSync(command: string, args?: any[], options?: {
|
|
|
951
179
|
waitForClose?: string;
|
|
952
180
|
}): string;
|
|
953
181
|
declare function getExtension(): string;
|
|
954
|
-
|
|
@@ -8,6 +8,7 @@ import { Meteor } from 'meteor/meteor'
|
|
|
8
8
|
import { WebApp } from 'meteor/webapp'
|
|
9
9
|
import { Autoupdate } from 'meteor/autoupdate'
|
|
10
10
|
import crypto from 'crypto'
|
|
11
|
+
import type { HelmetOptions } from 'helmet'
|
|
11
12
|
|
|
12
13
|
const self = '\'self\''
|
|
13
14
|
const data = 'data:'
|
|
@@ -42,13 +43,18 @@ const runtimeConfig = Object.assign(__meteor_runtime_config__, Autoupdate, {
|
|
|
42
43
|
})
|
|
43
44
|
|
|
44
45
|
// add client versions to __meteor_runtime_config__
|
|
46
|
+
// clientProgram is typed `any` here: @types/meteor's WebApp.clientPrograms
|
|
47
|
+
// shape only documents `version` as a plain string, but Meteor's real
|
|
48
|
+
// runtime object also carries the versionRefreshable/versionNonRefreshable/
|
|
49
|
+
// versionReplaceable accessor methods used below.
|
|
45
50
|
Object.keys(WebApp.clientPrograms).forEach(arch => {
|
|
51
|
+
const clientProgram: any = WebApp.clientPrograms[arch];
|
|
46
52
|
__meteor_runtime_config__.versions[arch] = {
|
|
47
|
-
version: Autoupdate.autoupdateVersion ||
|
|
48
|
-
versionRefreshable: Autoupdate.autoupdateVersion ||
|
|
49
|
-
versionNonRefreshable: Autoupdate.autoupdateVersion ||
|
|
53
|
+
version: Autoupdate.autoupdateVersion || clientProgram.version(),
|
|
54
|
+
versionRefreshable: Autoupdate.autoupdateVersion || clientProgram.versionRefreshable(),
|
|
55
|
+
versionNonRefreshable: Autoupdate.autoupdateVersion || clientProgram.versionNonRefreshable(),
|
|
50
56
|
// comment the following line if you use Meteor < 2.0
|
|
51
|
-
versionReplaceable: Autoupdate.autoupdateVersion ||
|
|
57
|
+
versionReplaceable: Autoupdate.autoupdateVersion || clientProgram.versionReplaceable()
|
|
52
58
|
}
|
|
53
59
|
})
|
|
54
60
|
|
|
@@ -62,7 +68,6 @@ const helmetOptions = {
|
|
|
62
68
|
//If this is truu, site's won't be able to link to you
|
|
63
69
|
crossOriginEmbedderPolicy: false,
|
|
64
70
|
contentSecurityPolicy: {
|
|
65
|
-
blockAllMixedContent: true,
|
|
66
71
|
directives: {
|
|
67
72
|
defaultSrc: [self].concat(allowedOrigins),
|
|
68
73
|
scriptSrc: [
|
|
@@ -121,10 +126,6 @@ const helmetOptions = {
|
|
|
121
126
|
referrerPolicy: {
|
|
122
127
|
policy: 'no-referrer'
|
|
123
128
|
},
|
|
124
|
-
expectCt: {
|
|
125
|
-
enforce: true,
|
|
126
|
-
maxAge: 604800
|
|
127
|
-
},
|
|
128
129
|
frameguard: {
|
|
129
130
|
action: 'sameorigin'
|
|
130
131
|
},
|
|
@@ -134,13 +135,12 @@ const helmetOptions = {
|
|
|
134
135
|
permittedCrossDomainPolicies: {
|
|
135
136
|
permittedPolicies: 'none'
|
|
136
137
|
}
|
|
137
|
-
};
|
|
138
|
+
} satisfies HelmetOptions;
|
|
138
139
|
|
|
139
140
|
// We assume, that we are working on a localhost when there is no https
|
|
140
141
|
// connection available.
|
|
141
142
|
// Run your project with --production flag to simulate script-src hashing
|
|
142
143
|
if (!usesHttps && Meteor.isDevelopment && devAllowedOrigins) {
|
|
143
|
-
delete helmetOptions.contentSecurityPolicy.blockAllMixedContent;
|
|
144
144
|
helmetOptions.contentSecurityPolicy.directives.scriptSrc = [
|
|
145
145
|
self,
|
|
146
146
|
devAllowedOrigins.join(' '),
|
|
@@ -173,7 +173,7 @@ if (!usesHttps && Meteor.isDevelopment && devAllowedOrigins) {
|
|
|
173
173
|
unsafeInline,
|
|
174
174
|
];
|
|
175
175
|
|
|
176
|
-
helmetOptions.contentSecurityPolicy.directives['script-src-attr'] = null;
|
|
176
|
+
(helmetOptions.contentSecurityPolicy.directives as Record<string, any>)['script-src-attr'] = null;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
export default helmetOptions;
|
|
@@ -8,6 +8,7 @@ import { Meteor } from 'meteor/meteor'
|
|
|
8
8
|
import { WebApp } from 'meteor/webapp'
|
|
9
9
|
import { Autoupdate } from 'meteor/autoupdate'
|
|
10
10
|
import crypto from 'crypto'
|
|
11
|
+
import type { HelmetOptions } from 'helmet'
|
|
11
12
|
|
|
12
13
|
const self = '\'self\''
|
|
13
14
|
const data = 'data:'
|
|
@@ -42,13 +43,18 @@ const runtimeConfig = Object.assign(__meteor_runtime_config__, Autoupdate, {
|
|
|
42
43
|
})
|
|
43
44
|
|
|
44
45
|
// add client versions to __meteor_runtime_config__
|
|
46
|
+
// clientProgram is typed `any` here: @types/meteor's WebApp.clientPrograms
|
|
47
|
+
// shape only documents `version` as a plain string, but Meteor's real
|
|
48
|
+
// runtime object also carries the versionRefreshable/versionNonRefreshable/
|
|
49
|
+
// versionReplaceable accessor methods used below.
|
|
45
50
|
Object.keys(WebApp.clientPrograms).forEach(arch => {
|
|
51
|
+
const clientProgram: any = WebApp.clientPrograms[arch];
|
|
46
52
|
__meteor_runtime_config__.versions[arch] = {
|
|
47
|
-
version: Autoupdate.autoupdateVersion ||
|
|
48
|
-
versionRefreshable: Autoupdate.autoupdateVersion ||
|
|
49
|
-
versionNonRefreshable: Autoupdate.autoupdateVersion ||
|
|
53
|
+
version: Autoupdate.autoupdateVersion || clientProgram.version(),
|
|
54
|
+
versionRefreshable: Autoupdate.autoupdateVersion || clientProgram.versionRefreshable(),
|
|
55
|
+
versionNonRefreshable: Autoupdate.autoupdateVersion || clientProgram.versionNonRefreshable(),
|
|
50
56
|
// comment the following line if you use Meteor < 2.0
|
|
51
|
-
versionReplaceable: Autoupdate.autoupdateVersion ||
|
|
57
|
+
versionReplaceable: Autoupdate.autoupdateVersion || clientProgram.versionReplaceable()
|
|
52
58
|
}
|
|
53
59
|
})
|
|
54
60
|
|
|
@@ -62,7 +68,6 @@ const helmetOptions = {
|
|
|
62
68
|
//If this is truu, site's won't be able to link to you
|
|
63
69
|
crossOriginEmbedderPolicy: false,
|
|
64
70
|
contentSecurityPolicy: {
|
|
65
|
-
blockAllMixedContent: true,
|
|
66
71
|
directives: {
|
|
67
72
|
defaultSrc: [self].concat(allowedOrigins),
|
|
68
73
|
scriptSrc: [
|
|
@@ -121,10 +126,6 @@ const helmetOptions = {
|
|
|
121
126
|
referrerPolicy: {
|
|
122
127
|
policy: 'no-referrer'
|
|
123
128
|
},
|
|
124
|
-
expectCt: {
|
|
125
|
-
enforce: true,
|
|
126
|
-
maxAge: 604800
|
|
127
|
-
},
|
|
128
129
|
frameguard: {
|
|
129
130
|
action: 'sameorigin'
|
|
130
131
|
},
|
|
@@ -134,13 +135,12 @@ const helmetOptions = {
|
|
|
134
135
|
permittedCrossDomainPolicies: {
|
|
135
136
|
permittedPolicies: 'none'
|
|
136
137
|
}
|
|
137
|
-
};
|
|
138
|
+
} satisfies HelmetOptions;
|
|
138
139
|
|
|
139
140
|
// We assume, that we are working on a localhost when there is no https
|
|
140
141
|
// connection available.
|
|
141
142
|
// Run your project with --production flag to simulate script-src hashing
|
|
142
143
|
if (!usesHttps && Meteor.isDevelopment && devAllowedOrigins) {
|
|
143
|
-
delete helmetOptions.contentSecurityPolicy.blockAllMixedContent;
|
|
144
144
|
helmetOptions.contentSecurityPolicy.directives.scriptSrc = [
|
|
145
145
|
self,
|
|
146
146
|
devAllowedOrigins.join(' '),
|
|
@@ -173,7 +173,7 @@ if (!usesHttps && Meteor.isDevelopment && devAllowedOrigins) {
|
|
|
173
173
|
unsafeInline,
|
|
174
174
|
];
|
|
175
175
|
|
|
176
|
-
helmetOptions.contentSecurityPolicy.directives['script-src-attr'] = null;
|
|
176
|
+
(helmetOptions.contentSecurityPolicy.directives as Record<string, any>)['script-src-attr'] = null;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
export default helmetOptions;
|
|
@@ -42,7 +42,7 @@ class <%= className %> extends Component {
|
|
|
42
42
|
* This is the main render method, and will rerun anytime either this.state or this.props is changed.
|
|
43
43
|
*/
|
|
44
44
|
render() {<% if(clientGraphql === 'apollo') { %>
|
|
45
|
-
// Consider using the Query component or graphql() HOC from @apollo/client for class components<% } %><% if (withTranslations) { %>
|
|
45
|
+
// Consider using the Query component or graphql() HOC from @apollo/client for class components<% } %><% if (withTranslations && !isLayout) { %>
|
|
46
46
|
const { t } = this.props;<% } %>
|
|
47
47
|
return (
|
|
48
48
|
<div id="<%= cssCaseName %>">
|
|
@@ -48,7 +48,7 @@ class <%= className %> extends React.Component<I<%= className %>> {
|
|
|
48
48
|
* This is the main render method, and will rerun anytime either this.state or this.props is changed.
|
|
49
49
|
*/
|
|
50
50
|
render() {<% if(clientGraphql === 'apollo') { %>
|
|
51
|
-
// Consider using the Query component or graphql() HOC from @apollo/client for class components<% } %><% if (withTranslations) { %>
|
|
51
|
+
// Consider using the Query component or graphql() HOC from @apollo/client for class components<% } %><% if (withTranslations && !isLayout) { %>
|
|
52
52
|
const { t } = this.props;<% } %>
|
|
53
53
|
return (
|
|
54
54
|
<div id="<%= cssCaseName %>">
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'<%if (withTranslations && !isLayout) { %>
|
|
2
2
|
import { useTranslation } from 'react-i18next';<% } %>
|
|
3
3
|
<% if (isLayout) { %>
|
|
4
4
|
import { Outlet } from 'react-router-dom';
|
|
5
5
|
<% }%>
|
|
6
6
|
|
|
7
|
-
function <%= className %>(
|
|
7
|
+
function <%= className %>() {
|
|
8
8
|
<% if(clientGraphql === 'apollo') { %>
|
|
9
|
-
//const { loading, error, data } = useQuery(gql`query Todos { todos }`, { variables: {/* input */} }); <% } %><% if (withTranslations) { %>
|
|
9
|
+
//const { loading, error, data } = useQuery(gql`query Todos { todos }`, { variables: {/* input */} }); <% } %><% if (withTranslations && !isLayout) { %>
|
|
10
10
|
const { t } = useTranslation();<% } %>
|
|
11
11
|
|
|
12
12
|
return (
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as React from 'react';<%if (withTranslations) { %>
|
|
1
|
+
import * as React from 'react';<%if (withTranslations && !isLayout) { %>
|
|
2
2
|
import { useTranslation } from 'react-i18next';<% } %>
|
|
3
3
|
<% if (isLayout) { %>
|
|
4
4
|
import { Outlet } from 'react-router-dom';
|
|
5
5
|
<% }%>
|
|
6
6
|
|
|
7
|
-
function <%= className %>(
|
|
7
|
+
function <%= className %>() {
|
|
8
8
|
<% if(clientGraphql === 'apollo') { %>
|
|
9
|
-
//const { loading, error, data } = useQuery(gql`query Todos { todos }`, { variables: {/* input */} }); <% } %><% if (withTranslations) { %>
|
|
9
|
+
//const { loading, error, data } = useQuery(gql`query Todos { todos }`, { variables: {/* input */} }); <% } %><% if (withTranslations && !isLayout) { %>
|
|
10
10
|
const { t } = useTranslation();<% } %>
|
|
11
11
|
|
|
12
12
|
return (
|
|
@@ -33,6 +33,6 @@ describe('<<%= className %>/>', function() {
|
|
|
33
33
|
const <%=camelCaseName%> = render(<<%= className %>/>);<% } %>
|
|
34
34
|
const testMessage = <% if (isLayout) { %>''<% } else if (withTranslations) { %>'<h2>example</h2>'<% } else { %>'<h2>Find me in <%= myPath %></h2>'<% } %>
|
|
35
35
|
const node = <%=camelCaseName%>.container.querySelector('#<%=cssCaseName%>');
|
|
36
|
-
<% if (test === 'mocha') { %>expect(node
|
|
36
|
+
<% if (test === 'mocha') { %>expect(node!.innerHTML).equals(testMessage);<% } else { %>expect(node!.innerHTML).toBe(testMessage);<% } %>
|
|
37
37
|
});
|
|
38
38
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 2.x applications using React.",
|