netlify-cli 20.0.2 → 20.0.4

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 (115) hide show
  1. package/dist/commands/base-command.d.ts +8 -0
  2. package/dist/commands/base-command.d.ts.map +1 -1
  3. package/dist/commands/base-command.js.map +1 -1
  4. package/dist/commands/build/index.d.ts.map +1 -1
  5. package/dist/commands/build/index.js +6 -2
  6. package/dist/commands/build/index.js.map +1 -1
  7. package/dist/commands/deploy/deploy.d.ts +2 -2
  8. package/dist/commands/deploy/deploy.d.ts.map +1 -1
  9. package/dist/commands/deploy/deploy.js +16 -34
  10. package/dist/commands/deploy/deploy.js.map +1 -1
  11. package/dist/commands/deploy/index.d.ts.map +1 -1
  12. package/dist/commands/deploy/index.js +9 -2
  13. package/dist/commands/deploy/index.js.map +1 -1
  14. package/dist/commands/deploy/option_values.d.ts +19 -0
  15. package/dist/commands/deploy/option_values.d.ts.map +1 -0
  16. package/dist/commands/deploy/option_values.js +3 -0
  17. package/dist/commands/deploy/option_values.js.map +1 -0
  18. package/dist/commands/dev/index.d.ts.map +1 -1
  19. package/dist/commands/dev/index.js +4 -2
  20. package/dist/commands/dev/index.js.map +1 -1
  21. package/dist/commands/dev-exec/index.d.ts.map +1 -1
  22. package/dist/commands/dev-exec/index.js +6 -2
  23. package/dist/commands/dev-exec/index.js.map +1 -1
  24. package/dist/commands/env/env-get.d.ts.map +1 -1
  25. package/dist/commands/env/env-get.js +3 -2
  26. package/dist/commands/env/env-get.js.map +1 -1
  27. package/dist/commands/env/env-list.js +2 -2
  28. package/dist/commands/env/env-set.js +5 -5
  29. package/dist/commands/env/env-set.js.map +1 -1
  30. package/dist/commands/env/env-unset.js +3 -3
  31. package/dist/commands/env/env.js +9 -9
  32. package/dist/commands/env/env.js.map +1 -1
  33. package/dist/commands/serve/index.d.ts.map +1 -1
  34. package/dist/commands/serve/index.js +8 -2
  35. package/dist/commands/serve/index.js.map +1 -1
  36. package/dist/lib/account.d.ts +2 -5
  37. package/dist/lib/account.d.ts.map +1 -1
  38. package/dist/lib/account.js +0 -11
  39. package/dist/lib/account.js.map +1 -1
  40. package/dist/lib/build.d.ts +1 -1
  41. package/dist/lib/build.d.ts.map +1 -1
  42. package/dist/lib/completion/get-autocompletion.d.ts +11 -11
  43. package/dist/lib/completion/get-autocompletion.d.ts.map +1 -1
  44. package/dist/lib/completion/get-autocompletion.js +1 -15
  45. package/dist/lib/completion/get-autocompletion.js.map +1 -1
  46. package/dist/lib/edge-functions/proxy.d.ts +6 -2
  47. package/dist/lib/edge-functions/proxy.d.ts.map +1 -1
  48. package/dist/lib/edge-functions/proxy.js.map +1 -1
  49. package/dist/lib/functions/runtimes/go/index.d.ts.map +1 -1
  50. package/dist/lib/functions/runtimes/go/index.js +1 -1
  51. package/dist/lib/functions/runtimes/go/index.js.map +1 -1
  52. package/dist/lib/functions/server.d.ts +1 -1
  53. package/dist/lib/functions/server.d.ts.map +1 -1
  54. package/dist/lib/geo-location.d.ts +15 -30
  55. package/dist/lib/geo-location.d.ts.map +1 -1
  56. package/dist/lib/geo-location.js +4 -28
  57. package/dist/lib/geo-location.js.map +1 -1
  58. package/dist/lib/http-agent.d.ts +14 -10
  59. package/dist/lib/http-agent.d.ts.map +1 -1
  60. package/dist/lib/http-agent.js +1 -2
  61. package/dist/lib/http-agent.js.map +1 -1
  62. package/dist/lib/images/proxy.d.ts +1 -1
  63. package/dist/lib/images/proxy.d.ts.map +1 -1
  64. package/dist/lib/images/proxy.js.map +1 -1
  65. package/dist/tsconfig.build.tsbuildinfo +1 -1
  66. package/dist/utils/copy-template-dir/copy-template-dir.d.ts.map +1 -1
  67. package/dist/utils/copy-template-dir/copy-template-dir.js +0 -4
  68. package/dist/utils/copy-template-dir/copy-template-dir.js.map +1 -1
  69. package/dist/utils/deploy/deploy-site.d.ts.map +1 -1
  70. package/dist/utils/deploy/deploy-site.js +1 -1
  71. package/dist/utils/deploy/deploy-site.js.map +1 -1
  72. package/dist/utils/deploy/hash-files.d.ts +8 -7
  73. package/dist/utils/deploy/hash-files.d.ts.map +1 -1
  74. package/dist/utils/deploy/hash-files.js +1 -11
  75. package/dist/utils/deploy/hash-files.js.map +1 -1
  76. package/dist/utils/deploy/hash-fns.d.ts +17 -8
  77. package/dist/utils/deploy/hash-fns.d.ts.map +1 -1
  78. package/dist/utils/deploy/hash-fns.js +3 -4
  79. package/dist/utils/deploy/hash-fns.js.map +1 -1
  80. package/dist/utils/deploy/upload-files.d.ts.map +1 -1
  81. package/dist/utils/deploy/upload-files.js +1 -1
  82. package/dist/utils/deploy/upload-files.js.map +1 -1
  83. package/dist/utils/deploy/util.d.ts +1 -1
  84. package/dist/utils/deploy/util.d.ts.map +1 -1
  85. package/dist/utils/deploy/util.js +0 -1
  86. package/dist/utils/deploy/util.js.map +1 -1
  87. package/dist/utils/dev.d.ts +13 -1
  88. package/dist/utils/dev.d.ts.map +1 -1
  89. package/dist/utils/dev.js +2 -5
  90. package/dist/utils/dev.js.map +1 -1
  91. package/dist/utils/env/index.d.ts +118 -54
  92. package/dist/utils/env/index.d.ts.map +1 -1
  93. package/dist/utils/env/index.js +94 -71
  94. package/dist/utils/env/index.js.map +1 -1
  95. package/dist/utils/feature-flags.d.ts +6 -3
  96. package/dist/utils/feature-flags.d.ts.map +1 -1
  97. package/dist/utils/feature-flags.js.map +1 -1
  98. package/dist/utils/proxy-server.d.ts +1 -1
  99. package/dist/utils/proxy-server.d.ts.map +1 -1
  100. package/dist/utils/read-repo-url.d.ts +7 -7
  101. package/dist/utils/read-repo-url.d.ts.map +1 -1
  102. package/dist/utils/read-repo-url.js +17 -26
  103. package/dist/utils/read-repo-url.js.map +1 -1
  104. package/dist/utils/rules-proxy.d.ts +1 -1
  105. package/dist/utils/rules-proxy.d.ts.map +1 -1
  106. package/dist/utils/rules-proxy.js +3 -2
  107. package/dist/utils/rules-proxy.js.map +1 -1
  108. package/dist/utils/temporary-file.d.ts +7 -0
  109. package/dist/utils/temporary-file.d.ts.map +1 -0
  110. package/dist/utils/temporary-file.js +16 -0
  111. package/dist/utils/temporary-file.js.map +1 -0
  112. package/dist/utils/types.d.ts +1 -1
  113. package/dist/utils/types.d.ts.map +1 -1
  114. package/npm-shrinkwrap.json +50 -189
  115. package/package.json +9 -7
@@ -1,34 +1,83 @@
1
- import { $TSFixMe } from '../../commands/types.js';
2
- export declare const AVAILABLE_CONTEXTS: string[];
3
- export declare const AVAILABLE_SCOPES: string[];
1
+ import type { NetlifyAPI } from 'netlify';
2
+ import type { SiteInfo, EnvironmentVariableSource } from '../../utils/types.js';
4
3
  /**
5
- * @param {string|undefined} context - The deploy context or branch of the environment variable value
6
- * @returns {Array<string|undefined>} The normalized context or branch name
4
+ * Supported values for the user-provided env `context` option.
5
+ * These all match possible `context` values returned by the Envelope API.
6
+ * Note that a user may also specify a branch name with the special `branch:my-branch-name` format.
7
7
  */
8
- export declare const normalizeContext: (context: any) => any;
8
+ export declare const SUPPORTED_CONTEXTS: readonly ["all", "production", "deploy-preview", "branch-deploy", "dev"];
9
9
  /**
10
- * Finds a matching environment variable value from a given context
11
- * @param {Array<object>} values - An array of environment variable values from Envelope
12
- * @param {string} context - The deploy context or branch of the environment variable value
13
- * @returns {object<context: enum<dev,branch-deploy,deploy-preview,production,branch>, context_parameter: <string>, value: string>} The matching environment variable value object
10
+ * Supported values for the user-provided env `scope` option.
11
+ * These exactly match possible `scope` values returned by the Envelope API.
12
+ * Note that `any` is also supported.
14
13
  */
15
- export declare const findValueInValues: (values: any, context: any) => any;
14
+ export declare const ALL_ENVELOPE_SCOPES: readonly ["builds", "functions", "runtime", "post_processing"];
15
+ type EnvelopeEnvVarScope = Exclude<NonNullable<Awaited<ReturnType<NetlifyAPI['getEnvVars']>>[number]['scopes']>[number], 'post-processing'> | 'post_processing';
16
+ type EnvelopeEnvVar = Awaited<ReturnType<NetlifyAPI['getEnvVars']>>[number] & {
17
+ scopes: EnvelopeEnvVarScope[];
18
+ };
19
+ type EnvelopeEnvVarContext = NonNullable<NonNullable<EnvelopeEnvVar['values']>[number]['context']>;
20
+ export type EnvelopeEnvVarValue = {
21
+ /**
22
+ * The deploy context of the this env var value
23
+ */
24
+ context?: EnvelopeEnvVarContext;
25
+ /**
26
+ * For parameterized contexts (i.e. only `branch`), context parameter (i.e. the branch name)
27
+ */
28
+ context_parameter?: string | undefined;
29
+ /**
30
+ * The value of the environment variable for this context. Note that this appears to be an empty string
31
+ * when the env var is not set for this context.
32
+ */
33
+ value?: string | undefined;
34
+ };
35
+ export type EnvelopeItem = {
36
+ key: string;
37
+ scopes: EnvelopeEnvVarScope[];
38
+ values: EnvelopeEnvVarValue[];
39
+ };
40
+ type SupportedScope = EnvelopeEnvVarScope | 'post_processing' | 'any';
41
+ type ContextOrBranch = string;
42
+ /**
43
+ * Normalizes a user-provided "context". Note that this may be the special `branch:my-branch-name` format.
44
+ *
45
+ * - If this is a supported alias of a context, it will be normalized to the canonical context.
46
+ * - Valid canonical contexts are returned as is.
47
+ * - If this starts with `branch:`, it will be normalized to the branch name.
48
+ *
49
+ * @param context A user-provided context, context alias, or a string in the `branch:my-branch-name` format.
50
+ *
51
+ * @returns The normalized context name or just the branch name
52
+ */
53
+ export declare const normalizeContext: (context: string) => ContextOrBranch;
54
+ /**
55
+ * Finds a matching environment variable value for a given context
56
+ * @private
57
+ */
58
+ export declare const getValueForContext: (
59
+ /**
60
+ * An array of environment variable values from Envelope
61
+ */
62
+ values: EnvelopeEnvVarValue[],
63
+ /**
64
+ * The deploy context or branch of the environment variable value
65
+ */
66
+ contextOrBranch: ContextOrBranch) => EnvelopeEnvVarValue | undefined;
16
67
  /**
17
68
  * Finds environment variables that match a given source
18
- * @param {object} env - The dictionary of environment variables
19
- * @param {enum<general,account,addons,ui,configFile>} source - The source of the environment variable
20
- * @returns {object} The dictionary of env vars that match the given source
69
+ * @param env - The dictionary of environment variables
70
+ * @param source - The source of the environment variable
71
+ * @returns The dictionary of env vars that match the given source
21
72
  */
22
- export declare const filterEnvBySource: (env: any, source: any) => {
23
- [k: string]: unknown;
24
- };
73
+ export declare const filterEnvBySource: (env: object, source: EnvironmentVariableSource) => typeof env;
25
74
  /**
26
75
  * Filters and sorts data from Envelope by a given context and/or scope
27
- * @param {string} context - The deploy context or branch of the environment variable value
28
- * @param {Array<object>} envelopeItems - An array of environment variables from the Envelope service
29
- * @param {enum<any,builds,functions,runtime,post_processing>} scope - The scope of the environment variables
30
- * @param {enum<general,account,addons,ui,configFile>} source - The source of the environment variable
31
- * @returns {object} A dicionary in the following format:
76
+ * @param context - The deploy context or branch of the environment variable value
77
+ * @param envelopeItems - An array of environment variables from the Envelope service
78
+ * @param scope - The scope of the environment variables
79
+ * @param source - The source of the environment variable
80
+ * @returns A dicionary in the following format:
32
81
  * {
33
82
  * FOO: {
34
83
  * context: 'dev',
@@ -46,55 +95,70 @@ export declare const filterEnvBySource: (env: any, source: any) => {
46
95
  * }
47
96
  */
48
97
  export declare const formatEnvelopeData: ({ context, envelopeItems, scope, source, }: {
49
- context?: string;
50
- envelopeItems: $TSFixMe[];
51
- scope?: string;
98
+ context?: ContextOrBranch;
99
+ envelopeItems: EnvelopeItem[];
100
+ scope?: SupportedScope;
52
101
  source: string;
53
- }) => any;
102
+ }) => Record<string, {
103
+ context: ContextOrBranch;
104
+ branch: string | undefined;
105
+ scopes: string[];
106
+ sources: string[];
107
+ value: string;
108
+ }>;
54
109
  /**
55
110
  * Collects env vars from multiple sources and arranges them in the correct order of precedence
56
- * @param {object} api - The api singleton object
57
- * @param {string} context - The deploy context or branch of the environment variable
58
- * @param {object} env - The dictionary of environment variables
59
- * @param {string} key - If present, fetch a single key (case-sensitive)
60
- * @param {boolean} raw - Return a dictionary of raw key/value pairs for only the account and site sources
61
- * @param {enum<any,builds,functions,runtime,post_processing>} scope - The scope of the environment variables
62
- * @param {object} siteInfo - The site object
63
- * @returns {object} An object of environment variables keys and their metadata
111
+ * @param opts.api The api singleton object
112
+ * @param opts.context The deploy context or branch of the environment variable
113
+ * @param opts.env The dictionary of environment variables
114
+ * @param opts.key If present, fetch a single key (case-sensitive)
115
+ * @param opts.raw Return a dictionary of raw key/value pairs for only the account and site sources
116
+ * @param opts.scope The scope of the environment variables
117
+ * @param opts.siteInfo The site object
118
+ * @returns An object of environment variables keys and their metadata
64
119
  */
65
- export declare const getEnvelopeEnv: ({ api, context, env, key, raw, scope, siteInfo }: {
66
- api: any;
67
- context?: string | undefined;
68
- env: any;
120
+ export declare const getEnvelopeEnv: ({ api, context, env, key, raw, scope, siteInfo, }: {
121
+ api: NetlifyAPI;
122
+ context?: ContextOrBranch | undefined;
123
+ env: object;
69
124
  key?: string | undefined;
70
125
  raw?: boolean | undefined;
71
- scope?: string | undefined;
72
- siteInfo: any;
73
- }) => Promise<any>;
126
+ scope?: SupportedScope | undefined;
127
+ siteInfo: SiteInfo;
128
+ }) => Promise<{}>;
74
129
  /**
75
130
  * Returns a human-readable, comma-separated list of scopes
76
- * @param {Array<enum<builds,functions,runtime,post_processing>>} scopes - An array of scopes
77
- * @returns {string} A human-readable, comma-separated list of scopes
131
+ * @param scopes An array of scopes
132
+ * @returns A human-readable, comma-separated list of scopes
78
133
  */
79
- export declare const getHumanReadableScopes: (scopes: any) => any;
134
+ export declare const getHumanReadableScopes: (scopes?: EnvelopeEnvVarScope[]) => string;
80
135
  /**
81
136
  * Translates a Mongo env into an Envelope env
82
- * @param {object} env - The site's env as it exists in Mongo
83
- * @returns {Array<object>} The array of Envelope env vars
137
+ * @param env The site's env as it exists in Mongo
138
+ * @returns The array of Envelope env vars
84
139
  */
85
- export declare const translateFromMongoToEnvelope: (env?: {}) => {
140
+ export declare const translateFromMongoToEnvelope: (env?: Record<string, string>) => {
86
141
  key: string;
87
- scopes: string[];
142
+ scopes: readonly ["builds", "functions", "runtime", "post_processing"];
88
143
  values: {
89
- context: string;
90
- value: unknown;
144
+ context: "all";
145
+ value: string;
91
146
  }[];
92
147
  }[];
93
148
  /**
94
149
  * Translates an Envelope env into a Mongo env
95
- * @param {Array<object>} envVars - The array of Envelope env vars
96
- * @param {string} context - The deploy context or branch of the environment variable
97
- * @returns {object} The env object as compatible with Mongo
150
+ * @param envVars The array of Envelope env vars
151
+ * @param context The deploy context or branch of the environment variable
152
+ * @returns The env object as compatible with Mongo
98
153
  */
99
- export declare const translateFromEnvelopeToMongo: (envVars?: never[], context?: string) => {};
154
+ export declare const translateFromEnvelopeToMongo: (envVars?: {
155
+ key: string;
156
+ scopes: string[];
157
+ values: {
158
+ context: string;
159
+ value: string;
160
+ context_parameter?: string | undefined;
161
+ }[];
162
+ }[], context?: string) => {};
163
+ export {};
100
164
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/env/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAGlD,eAAO,MAAM,kBAAkB,UAAkE,CAAA;AACjG,eAAO,MAAM,gBAAgB,UAAwD,CAAA;AAErF;;;GAGG;AAEH,eAAO,MAAM,gBAAgB,GAAI,YAAO,QAmBvC,CAAA;AAED;;;;;GAKG;AAEH,eAAO,MAAM,iBAAiB,GAAI,WAAM,EAAE,YAAO,QAQ7C,CAAA;AAEJ;;;;;GAKG;AAEH,eAAO,MAAM,iBAAiB,GAAI,QAAG,EAAE,WAAM;;CAEqD,CAAA;AAiClG;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,kBAAkB,GAAI,4CAKhC;IACD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,QAAQ,EAAE,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf,QAqBS,CAAA;AAEV;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,cAAc,GAAU;;;;;;;;CAA6E,iBAyCjH,CAAA;AAED;;;;GAIG;AAEH,eAAO,MAAM,sBAAsB,GAAI,WAAM,QAoB5C,CAAA;AA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AO,GAAG,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;IAClC,QAAQ,EAAE,QAAQ,CAAA;CACnB,gBAuCA,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAS,mBAAmB,EAAE,KAAG,MAqBvE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,GAAI,MAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;;;;;;;GAa5E,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GACvC,UAAS;IACP,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,EAAE,CAAA;CACrF,EAAO,EACR,gBAAe,OAaP,CAAA"}
@@ -1,58 +1,81 @@
1
1
  import { logAndThrowError } from '../command-helpers.js';
2
- export const AVAILABLE_CONTEXTS = ['all', 'production', 'deploy-preview', 'branch-deploy', 'dev'];
3
- export const AVAILABLE_SCOPES = ['builds', 'functions', 'runtime', 'post_processing'];
4
2
  /**
5
- * @param {string|undefined} context - The deploy context or branch of the environment variable value
6
- * @returns {Array<string|undefined>} The normalized context or branch name
3
+ * Supported values for the user-provided env `context` option.
4
+ * These all match possible `context` values returned by the Envelope API.
5
+ * Note that a user may also specify a branch name with the special `branch:my-branch-name` format.
6
+ */
7
+ export const SUPPORTED_CONTEXTS = ['all', 'production', 'deploy-preview', 'branch-deploy', 'dev'];
8
+ /**
9
+ * Additional aliases for the user-provided env `context` option.
10
+ */
11
+ const SUPPORTED_CONTEXT_ALIASES = {
12
+ dp: 'deploy-preview',
13
+ prod: 'production',
14
+ };
15
+ /**
16
+ * Supported values for the user-provided env `scope` option.
17
+ * These exactly match possible `scope` values returned by the Envelope API.
18
+ * Note that `any` is also supported.
19
+ */
20
+ export const ALL_ENVELOPE_SCOPES = ['builds', 'functions', 'runtime', 'post_processing'];
21
+ /**
22
+ * Normalizes a user-provided "context". Note that this may be the special `branch:my-branch-name` format.
23
+ *
24
+ * - If this is a supported alias of a context, it will be normalized to the canonical context.
25
+ * - Valid canonical contexts are returned as is.
26
+ * - If this starts with `branch:`, it will be normalized to the branch name.
27
+ *
28
+ * @param context A user-provided context, context alias, or a string in the `branch:my-branch-name` format.
29
+ *
30
+ * @returns The normalized context name or just the branch name
7
31
  */
8
- // @ts-expect-error TS(7006) FIXME: Parameter 'context' implicitly has an 'any' type.
9
32
  export const normalizeContext = (context) => {
10
33
  if (!context) {
11
34
  return context;
12
35
  }
13
- const CONTEXT_SYNONYMS = {
14
- dp: 'deploy-preview',
15
- prod: 'production',
16
- };
17
36
  context = context.toLowerCase();
18
- if (context in CONTEXT_SYNONYMS) {
19
- // @ts-expect-error TS(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
20
- context = CONTEXT_SYNONYMS[context];
37
+ if (context in SUPPORTED_CONTEXT_ALIASES) {
38
+ context = SUPPORTED_CONTEXT_ALIASES[context];
21
39
  }
22
- const forbiddenContexts = AVAILABLE_CONTEXTS.map((ctx) => `branch:${ctx}`);
40
+ const forbiddenContexts = SUPPORTED_CONTEXTS.map((ctx) => `branch:${ctx}`);
23
41
  if (forbiddenContexts.includes(context)) {
24
42
  return logAndThrowError(`The context ${context} includes a reserved keyword and is not allowed`);
25
43
  }
26
- context = context.replace(/^branch:/, '');
27
- return context;
44
+ return context.replace(/^branch:/, '');
28
45
  };
29
46
  /**
30
- * Finds a matching environment variable value from a given context
31
- * @param {Array<object>} values - An array of environment variable values from Envelope
32
- * @param {string} context - The deploy context or branch of the environment variable value
33
- * @returns {object<context: enum<dev,branch-deploy,deploy-preview,production,branch>, context_parameter: <string>, value: string>} The matching environment variable value object
47
+ * Finds a matching environment variable value for a given context
48
+ * @private
34
49
  */
35
- // @ts-expect-error TS(7006) FIXME: Parameter 'values' implicitly has an 'any' type.
36
- export const findValueInValues = (values, context) =>
37
- // @ts-expect-error TS(7006) FIXME: Parameter 'val' implicitly has an 'any' type.
38
- values.find((val) => {
39
- if (!AVAILABLE_CONTEXTS.includes(context)) {
40
- // the "context" option passed in is actually the name of a branch
41
- return val.context === 'all' || val.context_parameter === context;
50
+ export const getValueForContext = (
51
+ /**
52
+ * An array of environment variable values from Envelope
53
+ */
54
+ values,
55
+ /**
56
+ * The deploy context or branch of the environment variable value
57
+ */
58
+ contextOrBranch) => {
59
+ const isSupportedContext = SUPPORTED_CONTEXTS.includes(contextOrBranch);
60
+ if (!isSupportedContext) {
61
+ const valueMatchingAsBranch = values.find((val) => val.context_parameter === contextOrBranch);
62
+ // This is a `branch` context, which is an override, so it takes precedence
63
+ if (valueMatchingAsBranch != null) {
64
+ return valueMatchingAsBranch;
65
+ }
66
+ const valueMatchingContext = values.find((val) => val.context === 'all' || val.context === 'branch-deploy');
67
+ return valueMatchingContext ?? undefined;
42
68
  }
43
- return [context, 'all'].includes(val.context);
44
- });
69
+ const valueMatchingAsContext = values.find((val) => val.context === 'all' || val.context === contextOrBranch);
70
+ return valueMatchingAsContext ?? undefined;
71
+ };
45
72
  /**
46
73
  * Finds environment variables that match a given source
47
- * @param {object} env - The dictionary of environment variables
48
- * @param {enum<general,account,addons,ui,configFile>} source - The source of the environment variable
49
- * @returns {object} The dictionary of env vars that match the given source
74
+ * @param env - The dictionary of environment variables
75
+ * @param source - The source of the environment variable
76
+ * @returns The dictionary of env vars that match the given source
50
77
  */
51
- // @ts-expect-error TS(7006) FIXME: Parameter 'env' implicitly has an 'any' type.
52
- export const filterEnvBySource = (env, source) =>
53
- // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
54
- Object.fromEntries(Object.entries(env).filter(([, variable]) => variable.sources[0] === source));
55
- // Fetches data from Envelope
78
+ export const filterEnvBySource = (env, source) => Object.fromEntries(Object.entries(env).filter(([, variable]) => variable.sources[0] === source));
56
79
  const fetchEnvelopeItems = async function ({ accountId, api, key, siteId, }) {
57
80
  if (accountId === undefined) {
58
81
  return [];
@@ -61,10 +84,12 @@ const fetchEnvelopeItems = async function ({ accountId, api, key, siteId, }) {
61
84
  // if a single key is passed, fetch that single env var
62
85
  if (key) {
63
86
  const envelopeItem = await api.getEnvVar({ accountId, key, siteId });
87
+ // See FIXME(serhalp) above
64
88
  return [envelopeItem];
65
89
  }
66
90
  // otherwise, fetch the entire list of env vars
67
91
  const envelopeItems = await api.getEnvVars({ accountId, siteId });
92
+ // See FIXME(serhalp) above
68
93
  return envelopeItems;
69
94
  }
70
95
  catch {
@@ -75,11 +100,11 @@ const fetchEnvelopeItems = async function ({ accountId, api, key, siteId, }) {
75
100
  };
76
101
  /**
77
102
  * Filters and sorts data from Envelope by a given context and/or scope
78
- * @param {string} context - The deploy context or branch of the environment variable value
79
- * @param {Array<object>} envelopeItems - An array of environment variables from the Envelope service
80
- * @param {enum<any,builds,functions,runtime,post_processing>} scope - The scope of the environment variables
81
- * @param {enum<general,account,addons,ui,configFile>} source - The source of the environment variable
82
- * @returns {object} A dicionary in the following format:
103
+ * @param context - The deploy context or branch of the environment variable value
104
+ * @param envelopeItems - An array of environment variables from the Envelope service
105
+ * @param scope - The scope of the environment variables
106
+ * @param source - The source of the environment variable
107
+ * @returns A dicionary in the following format:
83
108
  * {
84
109
  * FOO: {
85
110
  * context: 'dev',
@@ -98,18 +123,22 @@ const fetchEnvelopeItems = async function ({ accountId, api, key, siteId, }) {
98
123
  */
99
124
  export const formatEnvelopeData = ({ context = 'dev', envelopeItems = [], scope = 'any', source, }) => envelopeItems
100
125
  // filter by context
101
- .filter(({ values }) => Boolean(findValueInValues(values, context)))
126
+ .filter(({ values }) => Boolean(getValueForContext(values, context)))
102
127
  // filter by scope
103
128
  .filter(({ scopes }) => (scope === 'any' ? true : scopes.includes(scope)))
104
129
  // sort alphabetically, case insensitive
105
130
  .sort((left, right) => (left.key.toLowerCase() < right.key.toLowerCase() ? -1 : 1))
106
131
  // format the data
107
132
  .reduce((acc, cur) => {
108
- const { context: ctx, context_parameter: branch, value } = findValueInValues(cur.values, context);
133
+ const val = getValueForContext(cur.values, context);
134
+ if (val === undefined) {
135
+ throw new TypeError(`failed to locate environment variable value for ${context} context`);
136
+ }
137
+ const { context: itemContext, context_parameter: branch, value } = val;
109
138
  return {
110
139
  ...acc,
111
140
  [cur.key]: {
112
- context: ctx,
141
+ context: itemContext,
113
142
  branch,
114
143
  scopes: cur.scopes,
115
144
  sources: [source],
@@ -119,20 +148,18 @@ export const formatEnvelopeData = ({ context = 'dev', envelopeItems = [], scope
119
148
  }, {});
120
149
  /**
121
150
  * Collects env vars from multiple sources and arranges them in the correct order of precedence
122
- * @param {object} api - The api singleton object
123
- * @param {string} context - The deploy context or branch of the environment variable
124
- * @param {object} env - The dictionary of environment variables
125
- * @param {string} key - If present, fetch a single key (case-sensitive)
126
- * @param {boolean} raw - Return a dictionary of raw key/value pairs for only the account and site sources
127
- * @param {enum<any,builds,functions,runtime,post_processing>} scope - The scope of the environment variables
128
- * @param {object} siteInfo - The site object
129
- * @returns {object} An object of environment variables keys and their metadata
151
+ * @param opts.api The api singleton object
152
+ * @param opts.context The deploy context or branch of the environment variable
153
+ * @param opts.env The dictionary of environment variables
154
+ * @param opts.key If present, fetch a single key (case-sensitive)
155
+ * @param opts.raw Return a dictionary of raw key/value pairs for only the account and site sources
156
+ * @param opts.scope The scope of the environment variables
157
+ * @param opts.siteInfo The site object
158
+ * @returns An object of environment variables keys and their metadata
130
159
  */
131
- // @ts-expect-error TS(7031) FIXME: Binding element 'api' implicitly has an 'any' type... Remove this comment to see the full error message
132
- export const getEnvelopeEnv = async ({ api, context = 'dev', env, key = '', raw = false, scope = 'any', siteInfo }) => {
160
+ export const getEnvelopeEnv = async ({ api, context = 'dev', env, key = '', raw = false, scope = 'any', siteInfo, }) => {
133
161
  const { account_slug: accountId, id: siteId } = siteInfo;
134
162
  const [accountEnvelopeItems, siteEnvelopeItems] = await Promise.all([
135
- // @ts-expect-error TS(2345) FIXME: Argument of type '{ api: any; accountId: any; key:... Remove this comment to see the full error message
136
163
  fetchEnvelopeItems({ api, accountId, key }),
137
164
  fetchEnvelopeItems({ api, accountId, key, siteId }),
138
165
  ]);
@@ -142,7 +169,6 @@ export const getEnvelopeEnv = async ({ api, context = 'dev', env, key = '', raw
142
169
  const entries = Object.entries({ ...accountEnv, ...siteEnv });
143
170
  return entries.reduce((obj, [envVarKey, metadata]) => ({
144
171
  ...obj,
145
- // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
146
172
  [envVarKey]: metadata.value,
147
173
  }), {});
148
174
  }
@@ -164,10 +190,9 @@ export const getEnvelopeEnv = async ({ api, context = 'dev', env, key = '', raw
164
190
  };
165
191
  /**
166
192
  * Returns a human-readable, comma-separated list of scopes
167
- * @param {Array<enum<builds,functions,runtime,post_processing>>} scopes - An array of scopes
168
- * @returns {string} A human-readable, comma-separated list of scopes
193
+ * @param scopes An array of scopes
194
+ * @returns A human-readable, comma-separated list of scopes
169
195
  */
170
- // @ts-expect-error TS(7006) FIXME: Parameter 'scopes' implicitly has an 'any' type.
171
196
  export const getHumanReadableScopes = (scopes) => {
172
197
  const HUMAN_SCOPES = ['Builds', 'Functions', 'Runtime', 'Post processing'];
173
198
  const SCOPES_MAP = {
@@ -175,6 +200,8 @@ export const getHumanReadableScopes = (scopes) => {
175
200
  functions: HUMAN_SCOPES[1],
176
201
  runtime: HUMAN_SCOPES[2],
177
202
  post_processing: HUMAN_SCOPES[3],
203
+ // TODO(serhalp) I believe this isn't needed, as `post-processing` is a user-provided
204
+ // CLI option, not a scope returned by the Envelope API.
178
205
  'post-processing': HUMAN_SCOPES[3],
179
206
  };
180
207
  if (!scopes) {
@@ -186,18 +213,17 @@ export const getHumanReadableScopes = (scopes) => {
186
213
  // shorthand instead of listing every available scope
187
214
  return 'All';
188
215
  }
189
- // @ts-expect-error TS(7006) FIXME: Parameter 'scope' implicitly has an 'any' type.
190
216
  return scopes.map((scope) => SCOPES_MAP[scope]).join(', ');
191
217
  };
192
218
  /**
193
219
  * Translates a Mongo env into an Envelope env
194
- * @param {object} env - The site's env as it exists in Mongo
195
- * @returns {Array<object>} The array of Envelope env vars
220
+ * @param env The site's env as it exists in Mongo
221
+ * @returns The array of Envelope env vars
196
222
  */
197
223
  export const translateFromMongoToEnvelope = (env = {}) => {
198
224
  const envVars = Object.entries(env).map(([key, value]) => ({
199
225
  key,
200
- scopes: AVAILABLE_SCOPES,
226
+ scopes: ALL_ENVELOPE_SCOPES,
201
227
  values: [
202
228
  {
203
229
  context: 'all',
@@ -209,20 +235,17 @@ export const translateFromMongoToEnvelope = (env = {}) => {
209
235
  };
210
236
  /**
211
237
  * Translates an Envelope env into a Mongo env
212
- * @param {Array<object>} envVars - The array of Envelope env vars
213
- * @param {string} context - The deploy context or branch of the environment variable
214
- * @returns {object} The env object as compatible with Mongo
238
+ * @param envVars The array of Envelope env vars
239
+ * @param context The deploy context or branch of the environment variable
240
+ * @returns The env object as compatible with Mongo
215
241
  */
216
242
  export const translateFromEnvelopeToMongo = (envVars = [], context = 'dev') => envVars
217
- // @ts-expect-error TS(2339) FIXME: Property 'key' does not exist on type 'never'.
218
- .sort((left, right) => (left.key.toLowerCase() < right.key.toLowerCase() ? -1 : 1))
243
+ .sort((a, b) => (a.key.toLowerCase() < b.key.toLowerCase() ? -1 : 1))
219
244
  .reduce((acc, cur) => {
220
- // @ts-expect-error TS(2339) FIXME: Property 'values' does not exist on type 'never'.
221
- const envVar = cur.values.find((val) => [context, 'all'].includes(val.context_parameter || val.context));
245
+ const envVar = cur.values.find((val) => [context, 'all'].includes((val.context_parameter ?? '') || val.context));
222
246
  if (envVar && envVar.value) {
223
247
  return {
224
248
  ...acc,
225
- // @ts-expect-error TS(2339) FIXME: Property 'key' does not exist on type 'never'.
226
249
  [cur.key]: envVar.value,
227
250
  };
228
251
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRo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CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QACzD,GAAG;QACH,MAAM,EAAE,mBAAmB;QAC3B,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,KAAc;gBACvB,KAAK;aACN;SACF;KACF,CAAC,CAAC,CAAA;IAEH,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,UAIM,EAAE,EACR,OAAO,GAAG,KAAK,EACf,EAAE,CACF,OAAO;KACJ,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACpE,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACnB,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,iBAAiB,IAAI,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IAChH,IAAI,MAAM,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QAC3B,OAAO;YACL,GAAG,GAAG;YACN,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,KAAK;SACxB,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC,EAAE,EAAE,CAAC,CAAA"}
@@ -1,4 +1,3 @@
1
- import type { SiteInfo } from './types.js';
2
1
  /**
3
2
  * Allows us to check if a feature flag is enabled for a site.
4
3
  * Due to versioning of the cli, and the desire to remove flags from
@@ -8,10 +7,14 @@ import type { SiteInfo } from './types.js';
8
7
  * Instead, we return that the feature flag is enabled if it isn't
9
8
  * specifically set to false in the response
10
9
  */
11
- export declare const isFeatureFlagEnabled: (flagName: string, siteInfo: SiteInfo) => boolean;
10
+ export declare const isFeatureFlagEnabled: (flagName: string, siteInfo: {
11
+ feature_flags?: Record<string, string | boolean> | undefined;
12
+ }) => boolean;
12
13
  /**
13
14
  * Retrieves all Feature flags from the siteInfo
14
15
  */
15
- export declare const getFeatureFlagsFromSiteInfo: (siteInfo: SiteInfo) => FeatureFlags;
16
+ export declare const getFeatureFlagsFromSiteInfo: (siteInfo: {
17
+ feature_flags?: Record<string, string | boolean> | undefined;
18
+ }) => FeatureFlags;
16
19
  export type FeatureFlags = Record<string, boolean | string | number>;
17
20
  //# sourceMappingURL=feature-flags.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature-flags.d.ts","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE1C;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAAI,UAAU,MAAM,EAAE,UAAU,QAAQ,KAAG,OACG,CAAA;AAE/E;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,UAAU,QAAQ,KAAG,YAM/D,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,CAAA"}
1
+ {"version":3,"file":"feature-flags.d.ts","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,MAAM,EAChB,UAAU;IAAE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,SAAS,CAAA;CAAE,KACzE,OAAwF,CAAA;AAE3F;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,UAAU;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,SAAS,CAAA;CAC7D,KAAG,YAMF,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature-flags.js","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAAgB,EAAE,QAAkB,EAAW,EAAE,CACpF,OAAO,CAAC,QAAQ,CAAC,aAAa,IAAI,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,KAAK,CAAC,CAAA;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,QAAkB,EAAgB,EAAE,CAAC,CAAC;IAChF,GAAG,QAAQ,CAAC,aAAa;IACzB,wFAAwF;IACxF,mBAAmB,EAAE,oBAAoB,CAAC,oBAAoB,EAAE,QAAQ,CAAC;IACzE,4BAA4B,EAAE,IAAI;IAClC,oBAAoB,EAAE,IAAI;CAC3B,CAAC,CAAA"}
1
+ {"version":3,"file":"feature-flags.js","sourceRoot":"","sources":["../../src/utils/feature-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,QAAgB,EAChB,QAA0E,EACjE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,IAAI,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,KAAK,CAAC,CAAA;AAE3F;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,QAE3C,EAAgB,EAAE,CAAC,CAAC;IACnB,GAAG,QAAQ,CAAC,aAAa;IACzB,wFAAwF;IACxF,mBAAmB,EAAE,oBAAoB,CAAC,oBAAoB,EAAE,QAAQ,CAAC;IACzE,4BAA4B,EAAE,IAAI;IAClC,oBAAoB,EAAE,IAAI;CAC3B,CAAC,CAAA"}
@@ -12,7 +12,7 @@ interface InspectSettings {
12
12
  }
13
13
  export declare const generateInspectSettings: (edgeInspect: boolean | string, edgeInspectBrk: boolean | string) => InspectSettings;
14
14
  export declare const startProxyServer: ({ accountId, addonsUrls, api, blobsContext, command, config, configPath, debug, disableEdgeFunctions, env, functionsRegistry, geoCountry, geolocationMode, getUpdatedConfig, inspectSettings, offline, projectDir, repositoryRoot, settings, site, siteInfo, state, }: {
15
- accountId: string;
15
+ accountId: string | undefined;
16
16
  addonsUrls: $TSFixMe;
17
17
  api?: NetlifyOptions["api"];
18
18
  blobsContext?: BlobsContextWithEdgeAccess;
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-server.d.ts","sourceRoot":"","sources":["../../src/utils/proxy-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAA;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAErE,OAAO,EAA4B,KAAK,4BAA4B,EAAE,MAAM,sBAAsB,CAAA;AAElG,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,UAAU,eAAe;IAEvB,OAAO,EAAE,OAAO,CAAA;IAEhB,KAAK,EAAE,OAAO,CAAA;IAEd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,uBAAuB,GAClC,aAAa,OAAO,GAAG,MAAM,EAC7B,gBAAgB,OAAO,GAAG,MAAM,KAC/B,eAiBF,CAAA;AAED,eAAO,MAAM,g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1
2
  /**
2
- * @param {string} _url
3
3
  * Takes a url like https://github.com/netlify-labs/all-the-functions/tree/master/functions/9-using-middleware
4
4
  * and returns https://api.github.com/repos/netlify-labs/all-the-functions/contents/functions/9-using-middleware
5
5
  */
6
- export declare const readRepoURL: (_url: any) => Promise<unknown>;
7
- /**
8
- * @param {string} _url
9
- */
10
- export declare const validateRepoURL: (_url: any) => "GitHub" | null;
11
- export declare const parseRepoURL: (repoHost: any, URL: any) => any[];
6
+ export declare const readRepoURL: (url: string) => Promise<unknown>;
7
+ export declare const validateRepoURL: (url: string) => typeof GITHUB | null;
8
+ export declare const parseRepoURL: (repoHost: string, url: {
9
+ path: string | null;
10
+ }) => string[];
11
+ export {};
12
12
  //# sourceMappingURL=read-repo-url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"read-repo-url.d.ts","sourceRoot":"","sources":["../../src/utils/read-repo-url.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AAEH,eAAO,MAAM,WAAW,GAAmB,SAAI,qBAS9C,CAAA;AAkBD;;GAEG;AAEH,eAAO,MAAM,eAAe,GAAa,SAAI,oBAO5C,CAAA;AAGD,eAAO,MAAM,YAAY,GAAa,aAAQ,EAAE,QAAG,UASlD,CAAA"}
1
+ {"version":3,"file":"read-repo-url.d.ts","sourceRoot":"","sources":["../../src/utils/read-repo-url.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,WAAW,CAAA;AAEvB;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAmB,KAAK,MAAM,qBAWrD,CAAA;AAqBD,eAAO,MAAM,eAAe,GAAa,KAAK,MAAM,KAAG,OAAO,MAAM,GAAG,IAOtE,CAAA;AAED,eAAO,MAAM,YAAY,GAAa,UAAU,MAAM,EAAE,KAAK;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,aASnF,CAAA"}