@nocobase/plugin-flow-engine 2.3.0-beta.15 → 2.3.0-beta.16

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.
Files changed (173) hide show
  1. package/dist/externalVersion.js +9 -9
  2. package/dist/node_modules/@ant-design/icons-svg/package.json +1 -1
  3. package/dist/node_modules/acorn/package.json +1 -1
  4. package/dist/node_modules/acorn-jsx/package.json +1 -1
  5. package/dist/node_modules/acorn-walk/package.json +1 -1
  6. package/dist/node_modules/liquidjs/LICENSE +21 -0
  7. package/dist/node_modules/liquidjs/bin/liquid.js +139 -0
  8. package/dist/node_modules/liquidjs/dist/build/fs-impl-browser.d.ts +7 -0
  9. package/dist/node_modules/liquidjs/dist/build/fs-impl-browser.spec.d.ts +1 -0
  10. package/dist/node_modules/liquidjs/dist/build/streamed-emitter-browser.d.ts +10 -0
  11. package/dist/node_modules/liquidjs/dist/build/streamed-emitter-browser.spec.d.ts +1 -0
  12. package/dist/node_modules/liquidjs/dist/cache/cache.d.ts +7 -0
  13. package/dist/node_modules/liquidjs/dist/cache/index.d.ts +2 -0
  14. package/dist/node_modules/liquidjs/dist/cache/lru.d.ts +14 -0
  15. package/dist/node_modules/liquidjs/dist/cache/lru.spec.d.ts +1 -0
  16. package/dist/node_modules/liquidjs/dist/context/block-mode.d.ts +4 -0
  17. package/dist/node_modules/liquidjs/dist/context/context.d.ts +64 -0
  18. package/dist/node_modules/liquidjs/dist/context/context.spec.d.ts +1 -0
  19. package/dist/node_modules/liquidjs/dist/context/index.d.ts +3 -0
  20. package/dist/node_modules/liquidjs/dist/context/scope.d.ts +6 -0
  21. package/dist/node_modules/liquidjs/dist/drop/blank-drop.d.ts +5 -0
  22. package/dist/node_modules/liquidjs/dist/drop/block-drop.d.ts +11 -0
  23. package/dist/node_modules/liquidjs/dist/drop/comparable.d.ts +8 -0
  24. package/dist/node_modules/liquidjs/dist/drop/drop.d.ts +4 -0
  25. package/dist/node_modules/liquidjs/dist/drop/empty-drop.d.ts +11 -0
  26. package/dist/node_modules/liquidjs/dist/drop/forloop-drop.d.ts +15 -0
  27. package/dist/node_modules/liquidjs/dist/drop/index.d.ts +7 -0
  28. package/dist/node_modules/liquidjs/dist/drop/null-drop.d.ts +10 -0
  29. package/dist/node_modules/liquidjs/dist/drop/tablerowloop-drop.d.ts +10 -0
  30. package/dist/node_modules/liquidjs/dist/emitters/emitter.d.ts +11 -0
  31. package/dist/node_modules/liquidjs/dist/emitters/index.d.ts +4 -0
  32. package/dist/node_modules/liquidjs/dist/emitters/keeping-type-emitter.d.ts +5 -0
  33. package/dist/node_modules/liquidjs/dist/emitters/simple-emitter.d.ts +5 -0
  34. package/dist/node_modules/liquidjs/dist/emitters/streamed-emitter.d.ts +9 -0
  35. package/dist/node_modules/liquidjs/dist/filters/array.d.ts +32 -0
  36. package/dist/node_modules/liquidjs/dist/filters/date.d.ts +6 -0
  37. package/dist/node_modules/liquidjs/dist/filters/html.d.ts +6 -0
  38. package/dist/node_modules/liquidjs/dist/filters/index.d.ts +2 -0
  39. package/dist/node_modules/liquidjs/dist/filters/math.d.ts +11 -0
  40. package/dist/node_modules/liquidjs/dist/filters/misc.d.ts +18 -0
  41. package/dist/node_modules/liquidjs/dist/filters/string.d.ts +27 -0
  42. package/dist/node_modules/liquidjs/dist/filters/url.d.ts +14 -0
  43. package/dist/node_modules/liquidjs/dist/fs/fs-impl.d.ts +9 -0
  44. package/dist/node_modules/liquidjs/dist/fs/fs-impl.spec.d.ts +1 -0
  45. package/dist/node_modules/liquidjs/dist/fs/fs.d.ts +20 -0
  46. package/dist/node_modules/liquidjs/dist/fs/index.d.ts +2 -0
  47. package/dist/node_modules/liquidjs/dist/fs/loader.d.ts +24 -0
  48. package/dist/node_modules/liquidjs/dist/fs/loader.spec.d.ts +1 -0
  49. package/dist/node_modules/liquidjs/dist/fs/map-fs.d.ts +13 -0
  50. package/dist/node_modules/liquidjs/dist/fs/map-fs.spec.d.ts +1 -0
  51. package/dist/node_modules/liquidjs/dist/fs/node-require.d.ts +1 -0
  52. package/dist/node_modules/liquidjs/dist/index.d.ts +16 -0
  53. package/dist/node_modules/liquidjs/dist/liquid-options.d.ts +159 -0
  54. package/dist/node_modules/liquidjs/dist/liquid-options.spec.d.ts +1 -0
  55. package/dist/node_modules/liquidjs/dist/liquid.browser.min.js +2 -0
  56. package/dist/node_modules/liquidjs/dist/liquid.browser.umd.js +7265 -0
  57. package/dist/node_modules/liquidjs/dist/liquid.d.ts +70 -0
  58. package/dist/node_modules/liquidjs/dist/liquid.node.js +1 -0
  59. package/dist/node_modules/liquidjs/dist/parser/filter-arg.d.ts +5 -0
  60. package/dist/node_modules/liquidjs/dist/parser/index.d.ts +4 -0
  61. package/dist/node_modules/liquidjs/dist/parser/parse-stream.d.ts +15 -0
  62. package/dist/node_modules/liquidjs/dist/parser/parse-stream.spec.d.ts +1 -0
  63. package/dist/node_modules/liquidjs/dist/parser/parser.d.ts +20 -0
  64. package/dist/node_modules/liquidjs/dist/parser/parser.spec.d.ts +1 -0
  65. package/dist/node_modules/liquidjs/dist/parser/token-kind.d.ts +16 -0
  66. package/dist/node_modules/liquidjs/dist/parser/tokenizer.d.ts +63 -0
  67. package/dist/node_modules/liquidjs/dist/parser/tokenizer.spec.d.ts +1 -0
  68. package/dist/node_modules/liquidjs/dist/parser/whitespace-ctrl.d.ts +3 -0
  69. package/dist/node_modules/liquidjs/dist/render/boolean.d.ts +3 -0
  70. package/dist/node_modules/liquidjs/dist/render/boolean.spec.d.ts +1 -0
  71. package/dist/node_modules/liquidjs/dist/render/expression.d.ts +10 -0
  72. package/dist/node_modules/liquidjs/dist/render/expression.spec.d.ts +1 -0
  73. package/dist/node_modules/liquidjs/dist/render/index.d.ts +4 -0
  74. package/dist/node_modules/liquidjs/dist/render/operator.d.ts +8 -0
  75. package/dist/node_modules/liquidjs/dist/render/render.d.ts +8 -0
  76. package/dist/node_modules/liquidjs/dist/render/render.spec.d.ts +1 -0
  77. package/dist/node_modules/liquidjs/dist/render/string.d.ts +1 -0
  78. package/dist/node_modules/liquidjs/dist/render/string.spec.d.ts +1 -0
  79. package/dist/node_modules/liquidjs/dist/tags/assign.d.ts +12 -0
  80. package/dist/node_modules/liquidjs/dist/tags/block.d.ts +11 -0
  81. package/dist/node_modules/liquidjs/dist/tags/break.d.ts +4 -0
  82. package/dist/node_modules/liquidjs/dist/tags/capture.d.ts +13 -0
  83. package/dist/node_modules/liquidjs/dist/tags/case.d.ts +15 -0
  84. package/dist/node_modules/liquidjs/dist/tags/comment.d.ts +5 -0
  85. package/dist/node_modules/liquidjs/dist/tags/continue.d.ts +4 -0
  86. package/dist/node_modules/liquidjs/dist/tags/cycle.d.ts +9 -0
  87. package/dist/node_modules/liquidjs/dist/tags/decrement.d.ts +9 -0
  88. package/dist/node_modules/liquidjs/dist/tags/echo.d.ts +8 -0
  89. package/dist/node_modules/liquidjs/dist/tags/for.d.ts +15 -0
  90. package/dist/node_modules/liquidjs/dist/tags/if.d.ts +14 -0
  91. package/dist/node_modules/liquidjs/dist/tags/include.d.ts +12 -0
  92. package/dist/node_modules/liquidjs/dist/tags/increment.d.ts +9 -0
  93. package/dist/node_modules/liquidjs/dist/tags/index.d.ts +24 -0
  94. package/dist/node_modules/liquidjs/dist/tags/inline-comment.d.ts +5 -0
  95. package/dist/node_modules/liquidjs/dist/tags/layout.d.ts +14 -0
  96. package/dist/node_modules/liquidjs/dist/tags/liquid.d.ts +8 -0
  97. package/dist/node_modules/liquidjs/dist/tags/raw.d.ts +6 -0
  98. package/dist/node_modules/liquidjs/dist/tags/render.d.ts +22 -0
  99. package/dist/node_modules/liquidjs/dist/tags/tablerow.d.ts +14 -0
  100. package/dist/node_modules/liquidjs/dist/tags/unless.d.ts +15 -0
  101. package/dist/node_modules/liquidjs/dist/template/analysis.d.ts +85 -0
  102. package/dist/node_modules/liquidjs/dist/template/analysis.spec.d.ts +1 -0
  103. package/dist/node_modules/liquidjs/dist/template/filter-impl-options.d.ts +14 -0
  104. package/dist/node_modules/liquidjs/dist/template/filter.d.ts +15 -0
  105. package/dist/node_modules/liquidjs/dist/template/filter.spec.d.ts +1 -0
  106. package/dist/node_modules/liquidjs/dist/template/hash.d.ts +18 -0
  107. package/dist/node_modules/liquidjs/dist/template/hash.spec.d.ts +1 -0
  108. package/dist/node_modules/liquidjs/dist/template/html.d.ts +9 -0
  109. package/dist/node_modules/liquidjs/dist/template/index.d.ts +11 -0
  110. package/dist/node_modules/liquidjs/dist/template/output.d.ts +12 -0
  111. package/dist/node_modules/liquidjs/dist/template/output.spec.d.ts +1 -0
  112. package/dist/node_modules/liquidjs/dist/template/tag-options-adapter.d.ts +10 -0
  113. package/dist/node_modules/liquidjs/dist/template/tag.d.ts +18 -0
  114. package/dist/node_modules/liquidjs/dist/template/template-impl.d.ts +4 -0
  115. package/dist/node_modules/liquidjs/dist/template/template.d.ts +36 -0
  116. package/dist/node_modules/liquidjs/dist/template/value.d.ts +15 -0
  117. package/dist/node_modules/liquidjs/dist/template/value.spec.d.ts +1 -0
  118. package/dist/node_modules/liquidjs/dist/tokens/delimited-token.d.ts +9 -0
  119. package/dist/node_modules/liquidjs/dist/tokens/filter-token.d.ts +7 -0
  120. package/dist/node_modules/liquidjs/dist/tokens/filtered-value-token.d.ts +17 -0
  121. package/dist/node_modules/liquidjs/dist/tokens/hash-token.d.ts +12 -0
  122. package/dist/node_modules/liquidjs/dist/tokens/html-token.d.ts +11 -0
  123. package/dist/node_modules/liquidjs/dist/tokens/identifier-token.d.ts +9 -0
  124. package/dist/node_modules/liquidjs/dist/tokens/index.d.ts +18 -0
  125. package/dist/node_modules/liquidjs/dist/tokens/liquid-tag-token.d.ts +12 -0
  126. package/dist/node_modules/liquidjs/dist/tokens/literal-token.d.ts +11 -0
  127. package/dist/node_modules/liquidjs/dist/tokens/number-token.d.ts +9 -0
  128. package/dist/node_modules/liquidjs/dist/tokens/operator-token.d.ts +38 -0
  129. package/dist/node_modules/liquidjs/dist/tokens/output-token.d.ts +5 -0
  130. package/dist/node_modules/liquidjs/dist/tokens/property-access-token.d.ts +12 -0
  131. package/dist/node_modules/liquidjs/dist/tokens/quoted-token.d.ts +9 -0
  132. package/dist/node_modules/liquidjs/dist/tokens/range-token.d.ts +11 -0
  133. package/dist/node_modules/liquidjs/dist/tokens/tag-token.d.ts +9 -0
  134. package/dist/node_modules/liquidjs/dist/tokens/token.d.ts +12 -0
  135. package/dist/node_modules/liquidjs/dist/tokens/top-level-token.d.ts +4 -0
  136. package/dist/node_modules/liquidjs/dist/tokens/value-token.d.ts +6 -0
  137. package/dist/node_modules/liquidjs/dist/util/assert.d.ts +2 -0
  138. package/dist/node_modules/liquidjs/dist/util/assert.spec.d.ts +1 -0
  139. package/dist/node_modules/liquidjs/dist/util/async.d.ts +2 -0
  140. package/dist/node_modules/liquidjs/dist/util/async.spec.d.ts +1 -0
  141. package/dist/node_modules/liquidjs/dist/util/character.d.ts +10 -0
  142. package/dist/node_modules/liquidjs/dist/util/error.d.ts +35 -0
  143. package/dist/node_modules/liquidjs/dist/util/error.spec.d.ts +1 -0
  144. package/dist/node_modules/liquidjs/dist/util/index.d.ts +12 -0
  145. package/dist/node_modules/liquidjs/dist/util/intl.d.ts +6 -0
  146. package/dist/node_modules/liquidjs/dist/util/limiter.d.ts +8 -0
  147. package/dist/node_modules/liquidjs/dist/util/liquid-date.d.ts +52 -0
  148. package/dist/node_modules/liquidjs/dist/util/liquid-date.spec.d.ts +1 -0
  149. package/dist/node_modules/liquidjs/dist/util/literal.d.ts +11 -0
  150. package/dist/node_modules/liquidjs/dist/util/operator-trie.d.ts +14 -0
  151. package/dist/node_modules/liquidjs/dist/util/performance.d.ts +5 -0
  152. package/dist/node_modules/liquidjs/dist/util/performance.spec.d.ts +1 -0
  153. package/dist/node_modules/liquidjs/dist/util/strftime.d.ts +2 -0
  154. package/dist/node_modules/liquidjs/dist/util/strftime.spec.d.ts +1 -0
  155. package/dist/node_modules/liquidjs/dist/util/type-guards.d.ts +13 -0
  156. package/dist/node_modules/liquidjs/dist/util/type-guards.spec.d.ts +1 -0
  157. package/dist/node_modules/liquidjs/dist/util/underscore.d.ts +40 -0
  158. package/dist/node_modules/liquidjs/dist/util/underscore.spec.d.ts +1 -0
  159. package/dist/node_modules/liquidjs/node_modules/commander/index.js +27 -0
  160. package/dist/node_modules/liquidjs/node_modules/commander/lib/argument.js +147 -0
  161. package/dist/node_modules/liquidjs/node_modules/commander/lib/command.js +2179 -0
  162. package/dist/node_modules/liquidjs/node_modules/commander/lib/error.js +45 -0
  163. package/dist/node_modules/liquidjs/node_modules/commander/lib/help.js +464 -0
  164. package/dist/node_modules/liquidjs/node_modules/commander/lib/option.js +331 -0
  165. package/dist/node_modules/liquidjs/node_modules/commander/lib/suggestSimilar.js +100 -0
  166. package/dist/node_modules/liquidjs/node_modules/commander/package-support.json +16 -0
  167. package/dist/node_modules/liquidjs/node_modules/commander/package.json +80 -0
  168. package/dist/node_modules/liquidjs/node_modules/commander/typings/index.d.ts +889 -0
  169. package/dist/node_modules/liquidjs/package.json +1 -0
  170. package/dist/node_modules/ses/package.json +1 -1
  171. package/dist/node_modules/zod/package.json +1 -1
  172. package/dist/server/variables/runjs-variable-dependencies.js +21 -1
  173. package/package.json +3 -2
@@ -0,0 +1,12 @@
1
+ import { Token } from './token';
2
+ import { LiteralToken } from './literal-token';
3
+ import { ValueToken } from './value-token';
4
+ import { IdentifierToken } from './identifier-token';
5
+ import { NumberToken } from './number-token';
6
+ import { RangeToken } from './range-token';
7
+ import { QuotedToken } from './quoted-token';
8
+ export declare class PropertyAccessToken extends Token {
9
+ variable: QuotedToken | RangeToken | LiteralToken | NumberToken | undefined;
10
+ props: (ValueToken | IdentifierToken)[];
11
+ constructor(variable: QuotedToken | RangeToken | LiteralToken | NumberToken | undefined, props: (ValueToken | IdentifierToken)[], input: string, begin: number, end: number, file?: string);
12
+ }
@@ -0,0 +1,9 @@
1
+ import { Token } from './token';
2
+ export declare class QuotedToken extends Token {
3
+ input: string;
4
+ begin: number;
5
+ end: number;
6
+ file?: string | undefined;
7
+ readonly content: string;
8
+ constructor(input: string, begin: number, end: number, file?: string | undefined);
9
+ }
@@ -0,0 +1,11 @@
1
+ import { Token } from './token';
2
+ import { ValueToken } from './value-token';
3
+ export declare class RangeToken extends Token {
4
+ input: string;
5
+ begin: number;
6
+ end: number;
7
+ lhs: ValueToken;
8
+ rhs: ValueToken;
9
+ file?: string | undefined;
10
+ constructor(input: string, begin: number, end: number, lhs: ValueToken, rhs: ValueToken, file?: string | undefined);
11
+ }
@@ -0,0 +1,9 @@
1
+ import { DelimitedToken } from './delimited-token';
2
+ import { Tokenizer } from '../parser';
3
+ import type { NormalizedFullOptions } from '../liquid-options';
4
+ export declare class TagToken extends DelimitedToken {
5
+ name: string;
6
+ tokenizer: Tokenizer;
7
+ readonly args: string;
8
+ constructor(input: string, begin: number, end: number, options: NormalizedFullOptions, file?: string);
9
+ }
@@ -0,0 +1,12 @@
1
+ import { TokenKind } from '../parser';
2
+ export declare abstract class Token {
3
+ kind: TokenKind;
4
+ input: string;
5
+ begin: number;
6
+ end: number;
7
+ file?: string | undefined;
8
+ constructor(kind: TokenKind, input: string, begin: number, end: number, file?: string | undefined);
9
+ getText(): string;
10
+ getPosition(): number[];
11
+ size(): number;
12
+ }
@@ -0,0 +1,4 @@
1
+ import type { TagToken } from './tag-token';
2
+ import type { HTMLToken } from './html-token';
3
+ import type { OutputToken } from './output-token';
4
+ export type TopLevelToken = TagToken | OutputToken | HTMLToken;
@@ -0,0 +1,6 @@
1
+ import { RangeToken } from './range-token';
2
+ import { LiteralToken } from './literal-token';
3
+ import { NumberToken } from './number-token';
4
+ import { QuotedToken } from './quoted-token';
5
+ import { PropertyAccessToken } from './property-access-token';
6
+ export type ValueToken = RangeToken | LiteralToken | QuotedToken | PropertyAccessToken | NumberToken;
@@ -0,0 +1,2 @@
1
+ export declare function assert<T>(predicate: T | null | undefined, message?: string | (() => string)): void;
2
+ export declare function assertEmpty<T>(predicate: T | null | undefined, message?: string): void;
@@ -0,0 +1,2 @@
1
+ export declare function toPromise<T>(val: Generator<unknown, T, unknown> | Promise<T> | T): Promise<T>;
2
+ export declare function toValueSync<T>(val: Generator<unknown, T, unknown> | T): T;
@@ -0,0 +1,10 @@
1
+ export declare const TYPES: number[];
2
+ export declare const WORD = 1;
3
+ export declare const OPERATOR = 2;
4
+ export declare const BLANK = 4;
5
+ export declare const QUOTE = 8;
6
+ export declare const INLINE_BLANK = 16;
7
+ export declare const NUMBER = 32;
8
+ export declare const SIGN = 64;
9
+ export declare const PUNCTUATION = 128;
10
+ export declare function isWord(char: string): boolean;
@@ -0,0 +1,35 @@
1
+ import { Token } from '../tokens/token';
2
+ import { Template } from '../template/template';
3
+ export declare abstract class LiquidError extends Error {
4
+ token: Token;
5
+ context: string;
6
+ originalError?: Error;
7
+ constructor(err: Error | string, token: Token);
8
+ protected update(): void;
9
+ static is(obj: unknown): obj is LiquidError;
10
+ }
11
+ export declare class TokenizationError extends LiquidError {
12
+ constructor(message: string, token: Token);
13
+ }
14
+ export declare class ParseError extends LiquidError {
15
+ constructor(err: Error, token: Token);
16
+ }
17
+ export declare class RenderError extends LiquidError {
18
+ constructor(err: Error, tpl: Template);
19
+ static is(obj: any): obj is RenderError;
20
+ }
21
+ export declare class LiquidErrors extends LiquidError {
22
+ errors: RenderError[];
23
+ constructor(errors: RenderError[]);
24
+ static is(obj: any): obj is LiquidErrors;
25
+ }
26
+ export declare class UndefinedVariableError extends LiquidError {
27
+ constructor(err: Error, token: Token);
28
+ }
29
+ export declare class InternalUndefinedVariableError extends Error {
30
+ variableName: string;
31
+ constructor(variableName: string);
32
+ }
33
+ export declare class AssertionError extends Error {
34
+ constructor(message: string);
35
+ }
@@ -0,0 +1,12 @@
1
+ export * from './error';
2
+ export * from './character';
3
+ export * from './assert';
4
+ export * from './literal';
5
+ export * from './underscore';
6
+ export * from './operator-trie';
7
+ export * from './type-guards';
8
+ export * from './async';
9
+ export * from './strftime';
10
+ export * from './liquid-date';
11
+ export * from './limiter';
12
+ export * from './intl';
@@ -0,0 +1,6 @@
1
+ export declare function getDateTimeFormat(): {
2
+ (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): Intl.DateTimeFormat;
3
+ new (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): Intl.DateTimeFormat;
4
+ supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions | undefined): string[];
5
+ readonly prototype: Intl.DateTimeFormat;
6
+ } | undefined;
@@ -0,0 +1,8 @@
1
+ export declare class Limiter {
2
+ private message;
3
+ private base;
4
+ private limit;
5
+ constructor(resource: string, limit: number);
6
+ use(count: number): void;
7
+ check(count: number): void;
8
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * A date implementation with timezone info, just like Ruby date
3
+ *
4
+ * Implementation:
5
+ * - create a Date offset by it's timezone difference, avoiding overriding a bunch of methods
6
+ * - rewrite getTimezoneOffset() to trick strftime
7
+ */
8
+ export declare class LiquidDate {
9
+ private locale;
10
+ private timezoneOffset;
11
+ private timezoneName;
12
+ private date;
13
+ private displayDate;
14
+ private DateTimeFormat;
15
+ timezoneFixed: boolean;
16
+ constructor(init: string | number | Date, locale: string, timezone?: number | string);
17
+ getTime(): number;
18
+ getMilliseconds(): number;
19
+ getSeconds(): number;
20
+ getMinutes(): number;
21
+ getHours(): number;
22
+ getDay(): number;
23
+ getDate(): number;
24
+ getMonth(): number;
25
+ getFullYear(): number;
26
+ toLocaleString(locale?: string, init?: any): string;
27
+ toLocaleTimeString(locale?: string): string;
28
+ toLocaleDateString(locale?: string): string;
29
+ getTimezoneOffset(): number;
30
+ getTimeZoneName(): string | undefined;
31
+ getLongMonthName(): string;
32
+ getShortMonthName(): string;
33
+ getLongWeekdayName(): string;
34
+ getShortWeekdayName(): string;
35
+ valid(): boolean;
36
+ private format;
37
+ /**
38
+ * Create a Date object fixed to it's declared Timezone. Both
39
+ * - 2021-08-06T02:29:00.000Z and
40
+ * - 2021-08-06T02:29:00.000+08:00
41
+ * will always be displayed as
42
+ * - 2021-08-06 02:29:00
43
+ * regardless timezoneOffset in JavaScript realm
44
+ *
45
+ * The implementation hack:
46
+ * Instead of calling `.getMonth()`/`.getUTCMonth()` respect to `preserveTimezones`,
47
+ * we create a different Date to trick strftime, it's both simpler and more performant.
48
+ * Given that a template is expected to be parsed fewer times than rendered.
49
+ */
50
+ static createDateFixedToTimezone(dateString: string, locale: string): LiquidDate;
51
+ private static getTimezoneOffset;
52
+ }
@@ -0,0 +1,11 @@
1
+ import { BlankDrop, EmptyDrop, NullDrop } from '../drop';
2
+ export declare const literalValues: {
3
+ true: boolean;
4
+ false: boolean;
5
+ nil: NullDrop;
6
+ null: NullDrop;
7
+ empty: EmptyDrop;
8
+ blank: BlankDrop;
9
+ };
10
+ export type LiteralKey = keyof typeof literalValues;
11
+ export type LiteralValue = typeof literalValues[LiteralKey];
@@ -0,0 +1,14 @@
1
+ interface TrieInput<T> {
2
+ [key: string]: T;
3
+ }
4
+ interface TrieLeafNode<T> {
5
+ data: T;
6
+ end: true;
7
+ needBoundary?: true;
8
+ }
9
+ export interface Trie<T> {
10
+ [key: string]: Trie<T> | TrieLeafNode<T>;
11
+ }
12
+ export type TrieNode<T> = Trie<T> | TrieLeafNode<T>;
13
+ export declare function createTrie<T = any>(input: TrieInput<T>): Trie<T>;
14
+ export {};
@@ -0,0 +1,5 @@
1
+ interface LiquidPerformance {
2
+ now: () => number;
3
+ }
4
+ export declare function getPerformance(): LiquidPerformance;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ import { LiquidDate } from './liquid-date';
2
+ export declare function strftime(d: LiquidDate, formatStr: string): string;
@@ -0,0 +1,13 @@
1
+ import { RangeToken, NumberToken, QuotedToken, LiteralToken, PropertyAccessToken, OutputToken, HTMLToken, TagToken, IdentifierToken, DelimitedToken, OperatorToken, ValueToken } from '../tokens';
2
+ export declare function isDelimitedToken(val: any): val is DelimitedToken;
3
+ export declare function isOperatorToken(val: any): val is OperatorToken;
4
+ export declare function isHTMLToken(val: any): val is HTMLToken;
5
+ export declare function isOutputToken(val: any): val is OutputToken;
6
+ export declare function isTagToken(val: any): val is TagToken;
7
+ export declare function isQuotedToken(val: any): val is QuotedToken;
8
+ export declare function isLiteralToken(val: any): val is LiteralToken;
9
+ export declare function isNumberToken(val: any): val is NumberToken;
10
+ export declare function isPropertyAccessToken(val: any): val is PropertyAccessToken;
11
+ export declare function isWordToken(val: any): val is IdentifierToken;
12
+ export declare function isRangeToken(val: any): val is RangeToken;
13
+ export declare function isValueToken(val: any): val is ValueToken;
@@ -0,0 +1,40 @@
1
+ export declare const toString: () => string;
2
+ export declare const hasOwnProperty: (v: PropertyKey) => boolean;
3
+ export declare function isString(value: any): value is string;
4
+ export declare function isFunction(value: any): value is Function;
5
+ export declare function isPromise<T>(val: any): val is Promise<T>;
6
+ export declare function isIterator(val: any): val is IterableIterator<any>;
7
+ export declare function escapeRegex(str: string): string;
8
+ export declare function promisify<T1, T2>(fn: (arg1: T1, cb: (err: Error | null, result: T2) => void) => void): (arg1: T1) => Promise<T2>;
9
+ export declare function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, cb: (err: Error | null, result: T3) => void) => void): (arg1: T1, arg2: T2) => Promise<T3>;
10
+ export declare function stringify(value: any): string;
11
+ export declare function toEnumerable<T = unknown>(val: any): T[];
12
+ export declare function toArray(val: any): any[];
13
+ export declare function toValue(value: any): any;
14
+ export declare function toNumber(value: any): number;
15
+ export declare function isNumber(value: any): value is number;
16
+ export declare function toLiquid(value: any): any;
17
+ export declare function isNil(value: any): boolean;
18
+ export declare function isUndefined(value: any): boolean;
19
+ export declare function isArray(value: any): value is any[];
20
+ export declare function isArrayLike(value: any): value is any[];
21
+ export declare function isIterable(value: any): value is Iterable<any>;
22
+ export declare function forOwn<T>(obj: Record<string, T> | undefined, iteratee: ((val: T, key: string, obj: {
23
+ [key: string]: T;
24
+ }) => boolean | void)): Record<string, T>;
25
+ export declare function last<T>(arr: T[]): T;
26
+ export declare function last(arr: string): string;
27
+ export declare function isObject(value: any): value is object;
28
+ export declare function range(start: number, stop: number, step?: number): number[];
29
+ export declare function padStart(str: any, length: number, ch?: string): any;
30
+ export declare function padEnd(str: any, length: number, ch?: string): any;
31
+ export declare function pad(str: any, length: number, ch: string, add: (str: string, ch: string) => string): any;
32
+ export declare function identify<T>(val: T): T;
33
+ export declare function changeCase(str: string): string;
34
+ export declare function ellipsis(str: string, N: number): string;
35
+ export declare function caseInsensitiveCompare(a: any, b: any): 0 | 1 | -1;
36
+ export declare function argumentsToValue<F extends (...args: any) => any, T>(fn: F): (this: T, ...args: Parameters<F>) => any;
37
+ export declare function argumentsToNumber<F extends (...args: any) => any, T>(fn: F): (this: T, ...args: Parameters<F>) => any;
38
+ export declare function escapeRegExp(text: string): string;
39
+ /** Return an array containing unique elements from _array_. Works with nested arrays and objects. */
40
+ export declare function strictUniq<T>(array: Array<T>): Generator<T>;
@@ -0,0 +1,27 @@
1
+ const { Argument } = require('./lib/argument.js');
2
+ const { Command } = require('./lib/command.js');
3
+ const { CommanderError, InvalidArgumentError } = require('./lib/error.js');
4
+ const { Help } = require('./lib/help.js');
5
+ const { Option } = require('./lib/option.js');
6
+
7
+ // @ts-check
8
+
9
+ /**
10
+ * Expose the root command.
11
+ */
12
+
13
+ exports = module.exports = new Command();
14
+ exports.program = exports; // More explicit access to global command.
15
+ // Implicit export of createArgument, createCommand, and createOption.
16
+
17
+ /**
18
+ * Expose classes
19
+ */
20
+
21
+ exports.Argument = Argument;
22
+ exports.Command = Command;
23
+ exports.CommanderError = CommanderError;
24
+ exports.Help = Help;
25
+ exports.InvalidArgumentError = InvalidArgumentError;
26
+ exports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated
27
+ exports.Option = Option;
@@ -0,0 +1,147 @@
1
+ const { InvalidArgumentError } = require('./error.js');
2
+
3
+ // @ts-check
4
+
5
+ class Argument {
6
+ /**
7
+ * Initialize a new command argument with the given name and description.
8
+ * The default is that the argument is required, and you can explicitly
9
+ * indicate this with <> around the name. Put [] around the name for an optional argument.
10
+ *
11
+ * @param {string} name
12
+ * @param {string} [description]
13
+ */
14
+
15
+ constructor(name, description) {
16
+ this.description = description || '';
17
+ this.variadic = false;
18
+ this.parseArg = undefined;
19
+ this.defaultValue = undefined;
20
+ this.defaultValueDescription = undefined;
21
+ this.argChoices = undefined;
22
+
23
+ switch (name[0]) {
24
+ case '<': // e.g. <required>
25
+ this.required = true;
26
+ this._name = name.slice(1, -1);
27
+ break;
28
+ case '[': // e.g. [optional]
29
+ this.required = false;
30
+ this._name = name.slice(1, -1);
31
+ break;
32
+ default:
33
+ this.required = true;
34
+ this._name = name;
35
+ break;
36
+ }
37
+
38
+ if (this._name.length > 3 && this._name.slice(-3) === '...') {
39
+ this.variadic = true;
40
+ this._name = this._name.slice(0, -3);
41
+ }
42
+ }
43
+
44
+ /**
45
+ * Return argument name.
46
+ *
47
+ * @return {string}
48
+ */
49
+
50
+ name() {
51
+ return this._name;
52
+ }
53
+
54
+ /**
55
+ * @api private
56
+ */
57
+
58
+ _concatValue(value, previous) {
59
+ if (previous === this.defaultValue || !Array.isArray(previous)) {
60
+ return [value];
61
+ }
62
+
63
+ return previous.concat(value);
64
+ }
65
+
66
+ /**
67
+ * Set the default value, and optionally supply the description to be displayed in the help.
68
+ *
69
+ * @param {any} value
70
+ * @param {string} [description]
71
+ * @return {Argument}
72
+ */
73
+
74
+ default(value, description) {
75
+ this.defaultValue = value;
76
+ this.defaultValueDescription = description;
77
+ return this;
78
+ }
79
+
80
+ /**
81
+ * Set the custom handler for processing CLI command arguments into argument values.
82
+ *
83
+ * @param {Function} [fn]
84
+ * @return {Argument}
85
+ */
86
+
87
+ argParser(fn) {
88
+ this.parseArg = fn;
89
+ return this;
90
+ }
91
+
92
+ /**
93
+ * Only allow argument value to be one of choices.
94
+ *
95
+ * @param {string[]} values
96
+ * @return {Argument}
97
+ */
98
+
99
+ choices(values) {
100
+ this.argChoices = values.slice();
101
+ this.parseArg = (arg, previous) => {
102
+ if (!this.argChoices.includes(arg)) {
103
+ throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(', ')}.`);
104
+ }
105
+ if (this.variadic) {
106
+ return this._concatValue(arg, previous);
107
+ }
108
+ return arg;
109
+ };
110
+ return this;
111
+ }
112
+
113
+ /**
114
+ * Make argument required.
115
+ */
116
+ argRequired() {
117
+ this.required = true;
118
+ return this;
119
+ }
120
+
121
+ /**
122
+ * Make argument optional.
123
+ */
124
+ argOptional() {
125
+ this.required = false;
126
+ return this;
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Takes an argument and returns its human readable equivalent for help usage.
132
+ *
133
+ * @param {Argument} arg
134
+ * @return {string}
135
+ * @api private
136
+ */
137
+
138
+ function humanReadableArgName(arg) {
139
+ const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');
140
+
141
+ return arg.required
142
+ ? '<' + nameOutput + '>'
143
+ : '[' + nameOutput + ']';
144
+ }
145
+
146
+ exports.Argument = Argument;
147
+ exports.humanReadableArgName = humanReadableArgName;