etincidunt 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.prettierignore +2 -0
- package/.travis.yml +29 -0
- package/.vscode/launch.json +24 -0
- package/.vscode/settings.json +3 -0
- package/demos/ago-node-cli/README.md +29 -0
- package/demos/ago-node-cli/ago.js +32 -0
- package/demos/ago-node-cli/index.js +11 -0
- package/demos/ago-node-cli/lib/item-export-command.js +48 -0
- package/demos/ago-node-cli/lib/item-search-command.js +35 -0
- package/demos/ago-node-cli/package-lock.json +172 -0
- package/demos/ago-node-cli/package.json +30 -0
- package/demos/attachments/README.md +5 -0
- package/demos/attachments/index.html +164 -0
- package/demos/attachments/package-lock.json +182 -0
- package/demos/attachments/package.json +18 -0
- package/demos/batch-geocoder-node/NYC_Restaurant_Inspection_Results.csv +100 -0
- package/demos/batch-geocoder-node/README.md +14 -0
- package/demos/batch-geocoder-node/batch-geocode.js +112 -0
- package/demos/batch-geocoder-node/config-template.js +18 -0
- package/demos/batch-geocoder-node/package-lock.json +109 -0
- package/demos/batch-geocoder-node/package.json +37 -0
- package/demos/express/README.md +10 -0
- package/demos/express/config.json.template +3 -0
- package/demos/express/package-lock.json +388 -0
- package/demos/express/package.json +18 -0
- package/demos/express/server.js +28 -0
- package/demos/feature-service-browser/README.md +6 -0
- package/demos/feature-service-browser/index.html +122 -0
- package/demos/feature-service-browser/package-lock.json +182 -0
- package/demos/feature-service-browser/package.json +18 -0
- package/demos/geocoder-browser/README.md +10 -0
- package/demos/geocoder-browser/config.js.template +1 -0
- package/demos/geocoder-browser/index.html +131 -0
- package/demos/geocoder-browser/package-lock.json +163 -0
- package/demos/geocoder-browser/package.json +19 -0
- package/demos/geocoder-browser/post-sign-in.html +25 -0
- package/demos/jsapi-integration/README.md +8 -0
- package/demos/jsapi-integration/config.js +6 -0
- package/demos/jsapi-integration/index.html +79 -0
- package/demos/jsapi-integration/package-lock.json +184 -0
- package/demos/jsapi-integration/package.json +19 -0
- package/demos/oauth2-browser/README.md +12 -0
- package/demos/oauth2-browser/authenticate.html +32 -0
- package/demos/oauth2-browser/config.js.template +6 -0
- package/demos/oauth2-browser/index.html +202 -0
- package/demos/oauth2-browser/logo.svg +4 -0
- package/demos/oauth2-browser/package-lock.json +163 -0
- package/demos/oauth2-browser/package.json +18 -0
- package/demos/oauth2-browser/style.css +36 -0
- package/demos/vue/.babelrc +6 -0
- package/demos/vue/.env.example +8 -0
- package/demos/vue/README.md +17 -0
- package/demos/vue/index.html +21 -0
- package/demos/vue/package-lock.json +7236 -0
- package/demos/vue/package.json +39 -0
- package/demos/vue/src/assets/logo.svg +29 -0
- package/demos/vue/src/components/App.vue +302 -0
- package/demos/vue/src/components/Authenticate.vue +68 -0
- package/demos/vue/src/components/Loader.vue +216 -0
- package/demos/vue/src/main.js +75 -0
- package/demos/vue/webpack.config.js +84 -0
- package/docs/FAQ.md +28 -0
- package/docs/HISTORY.md +62 -0
- package/docs/acetate.config.js +214 -0
- package/docs/build-typedoc.js +301 -0
- package/docs/src/_layout.html +82 -0
- package/docs/src/api/_declaration.html +496 -0
- package/docs/src/api/_layout.html +127 -0
- package/docs/src/api/_package.html +13 -0
- package/docs/src/api/index.html +23 -0
- package/docs/src/guides/_layout.html +24 -0
- package/docs/src/guides/amd-requirejs-dojo.md +40 -0
- package/docs/src/guides/babel-and-rollup.md +30 -0
- package/docs/src/guides/babel-and-webpack.md +30 -0
- package/docs/src/guides/browser-authentication.md +9 -0
- package/docs/src/guides/browserify.md +9 -0
- package/docs/src/guides/cli-authentication.md +9 -0
- package/docs/src/guides/client-server-authentication.md +9 -0
- package/docs/src/guides/from-a-cdn.md +36 -0
- package/docs/src/guides/index.md +52 -0
- package/docs/src/guides/node.md +30 -0
- package/docs/src/guides/package-overview.md +8 -0
- package/docs/src/guides/server-authentication.md +9 -0
- package/docs/src/guides/typescript-and-webpack.md +9 -0
- package/docs/src/img/icons.png +0 -0
- package/docs/src/img/icons@2x.png +0 -0
- package/docs/src/index.html +12 -0
- package/docs/src/js/api-search.js +113 -0
- package/docs/src/js/index.js +1 -0
- package/docs/src/js/nav-toggle.js +41 -0
- package/docs/src/sass/_highlight.scss +96 -0
- package/docs/src/sass/_icons.scss +157 -0
- package/docs/src/sass/style.scss +169 -0
- package/jasmine.json +7 -0
- package/karma.conf.js +100 -0
- package/lerna.json +8 -0
- package/notes/README.md +88 -0
- package/package.json +91 -0
- package/packages/arcgis-rest-auth/README.md +64 -0
- package/packages/arcgis-rest-auth/package-lock.json +11 -0
- package/packages/arcgis-rest-auth/package.json +51 -0
- package/packages/arcgis-rest-auth/src/ApplicationSession.ts +91 -0
- package/packages/arcgis-rest-auth/src/UserSession.ts +829 -0
- package/packages/arcgis-rest-auth/src/authenticated-request-options.ts +21 -0
- package/packages/arcgis-rest-auth/src/fetch-token.ts +55 -0
- package/packages/arcgis-rest-auth/src/generate-token.ts +36 -0
- package/packages/arcgis-rest-auth/src/index.ts +5 -0
- package/packages/arcgis-rest-auth/test/ApplicationSession.test.ts +121 -0
- package/packages/arcgis-rest-auth/test/UserSession.test.ts +883 -0
- package/packages/arcgis-rest-auth/test/fetchToken.test.ts +76 -0
- package/packages/arcgis-rest-auth/test/generateToken.test.ts +36 -0
- package/packages/arcgis-rest-auth/test/utils.ts +11 -0
- package/packages/arcgis-rest-auth/tsconfig.json +6 -0
- package/packages/arcgis-rest-common-types/README.md +61 -0
- package/packages/arcgis-rest-common-types/package.json +38 -0
- package/packages/arcgis-rest-common-types/src/group.ts +51 -0
- package/packages/arcgis-rest-common-types/src/index.ts +467 -0
- package/packages/arcgis-rest-common-types/src/item.ts +45 -0
- package/packages/arcgis-rest-common-types/src/webmap.ts +1225 -0
- package/packages/arcgis-rest-common-types/tsconfig.json +11 -0
- package/packages/arcgis-rest-feature-service/README.md +70 -0
- package/packages/arcgis-rest-feature-service/package-lock.json +11 -0
- package/packages/arcgis-rest-feature-service/package.json +50 -0
- package/packages/arcgis-rest-feature-service/src/add.ts +82 -0
- package/packages/arcgis-rest-feature-service/src/addAttachment.ts +65 -0
- package/packages/arcgis-rest-feature-service/src/delete.ts +85 -0
- package/packages/arcgis-rest-feature-service/src/deleteAttachments.ts +68 -0
- package/packages/arcgis-rest-feature-service/src/getAttachments.ts +64 -0
- package/packages/arcgis-rest-feature-service/src/helpers.ts +77 -0
- package/packages/arcgis-rest-feature-service/src/index.ts +8 -0
- package/packages/arcgis-rest-feature-service/src/query.ts +174 -0
- package/packages/arcgis-rest-feature-service/src/update.ts +81 -0
- package/packages/arcgis-rest-feature-service/src/updateAttachment.ts +74 -0
- package/packages/arcgis-rest-feature-service/test/attachments.test.ts +179 -0
- package/packages/arcgis-rest-feature-service/test/features.test.ts +172 -0
- package/packages/arcgis-rest-feature-service/test/mocks/feature.ts +220 -0
- package/packages/arcgis-rest-feature-service/test/mocks/foo.txt +1 -0
- package/packages/arcgis-rest-feature-service/tsconfig.json +6 -0
- package/packages/arcgis-rest-geocoder/README.md +73 -0
- package/packages/arcgis-rest-geocoder/package-lock.json +11 -0
- package/packages/arcgis-rest-geocoder/package.json +52 -0
- package/packages/arcgis-rest-geocoder/src/bulk.ts +102 -0
- package/packages/arcgis-rest-geocoder/src/geocode.ts +117 -0
- package/packages/arcgis-rest-geocoder/src/helpers.ts +81 -0
- package/packages/arcgis-rest-geocoder/src/index.ts +4 -0
- package/packages/arcgis-rest-geocoder/src/reverse.ts +84 -0
- package/packages/arcgis-rest-geocoder/src/suggest.ts +72 -0
- package/packages/arcgis-rest-geocoder/test/geocoder.test.ts +510 -0
- package/packages/arcgis-rest-geocoder/test/mocks/responses.ts +588 -0
- package/packages/arcgis-rest-geocoder/tsconfig.json +6 -0
- package/packages/arcgis-rest-groups/README.md +64 -0
- package/packages/arcgis-rest-groups/package-lock.json +11 -0
- package/packages/arcgis-rest-groups/package.json +52 -0
- package/packages/arcgis-rest-groups/src/groups.ts +272 -0
- package/packages/arcgis-rest-groups/src/index.ts +1 -0
- package/packages/arcgis-rest-groups/test/groups.test.ts +280 -0
- package/packages/arcgis-rest-groups/test/mocks/responses.ts +137 -0
- package/packages/arcgis-rest-groups/tsconfig.json +6 -0
- package/packages/arcgis-rest-items/README.md +66 -0
- package/packages/arcgis-rest-items/package-lock.json +11 -0
- package/packages/arcgis-rest-items/package.json +52 -0
- package/packages/arcgis-rest-items/src/index.ts +1 -0
- package/packages/arcgis-rest-items/src/items.ts +498 -0
- package/packages/arcgis-rest-items/test/items.test.ts +1153 -0
- package/packages/arcgis-rest-items/test/mocks/foo.zip +0 -0
- package/packages/arcgis-rest-items/test/mocks/item.ts +30 -0
- package/packages/arcgis-rest-items/test/mocks/resources.ts +28 -0
- package/packages/arcgis-rest-items/test/mocks/search.ts +60 -0
- package/packages/arcgis-rest-items/tsconfig.json +6 -0
- package/packages/arcgis-rest-request/README.md +65 -0
- package/packages/arcgis-rest-request/package-lock.json +11 -0
- package/packages/arcgis-rest-request/package.json +42 -0
- package/packages/arcgis-rest-request/src/index.ts +10 -0
- package/packages/arcgis-rest-request/src/request.ts +259 -0
- package/packages/arcgis-rest-request/src/utils/ArcGISAuthError.ts +67 -0
- package/packages/arcgis-rest-request/src/utils/ArcGISRequestError.ts +73 -0
- package/packages/arcgis-rest-request/src/utils/ErrorTypes.ts +29 -0
- package/packages/arcgis-rest-request/src/utils/check-for-errors.ts +65 -0
- package/packages/arcgis-rest-request/src/utils/encode-form-data.ts +29 -0
- package/packages/arcgis-rest-request/src/utils/encode-query-string.ts +23 -0
- package/packages/arcgis-rest-request/src/utils/get-portal-url.ts +25 -0
- package/packages/arcgis-rest-request/src/utils/get-portal.ts +45 -0
- package/packages/arcgis-rest-request/src/utils/process-params.ts +99 -0
- package/packages/arcgis-rest-request/test/mocks/errors.ts +59 -0
- package/packages/arcgis-rest-request/test/mocks/geojson-feature-collection.ts +10 -0
- package/packages/arcgis-rest-request/test/mocks/portal.ts +109 -0
- package/packages/arcgis-rest-request/test/mocks/sharing-rest-info.ts +38 -0
- package/packages/arcgis-rest-request/test/mocks/webmap.ts +38 -0
- package/packages/arcgis-rest-request/test/request.test.ts +296 -0
- package/packages/arcgis-rest-request/test/utils/ArcGISAuthError.test.ts +167 -0
- package/packages/arcgis-rest-request/test/utils/ArcGISRequestError.test.ts +40 -0
- package/packages/arcgis-rest-request/test/utils/check-for-errors.test.ts +101 -0
- package/packages/arcgis-rest-request/test/utils/encode-form-data.test.ts +112 -0
- package/packages/arcgis-rest-request/test/utils/get-portal-url.test.ts +34 -0
- package/packages/arcgis-rest-request/test/utils/portal.test.ts +94 -0
- package/packages/arcgis-rest-request/test/utils/process-params.test.ts +190 -0
- package/packages/arcgis-rest-request/tsconfig.json +6 -0
- package/packages/arcgis-rest-sharing/README.md +67 -0
- package/packages/arcgis-rest-sharing/package-lock.json +11 -0
- package/packages/arcgis-rest-sharing/package.json +55 -0
- package/packages/arcgis-rest-sharing/src/access.ts +91 -0
- package/packages/arcgis-rest-sharing/src/group-sharing.ts +212 -0
- package/packages/arcgis-rest-sharing/src/helpers.ts +92 -0
- package/packages/arcgis-rest-sharing/src/index.ts +2 -0
- package/packages/arcgis-rest-sharing/test/access.test.ts +153 -0
- package/packages/arcgis-rest-sharing/test/group-sharing.test.ts +436 -0
- package/packages/arcgis-rest-sharing/test/mocks/sharing.ts +15 -0
- package/packages/arcgis-rest-sharing/tsconfig.json +6 -0
- package/packages/arcgis-rest-users/README.md +71 -0
- package/packages/arcgis-rest-users/package-lock.json +11 -0
- package/packages/arcgis-rest-users/package.json +51 -0
- package/packages/arcgis-rest-users/src/index.ts +1 -0
- package/packages/arcgis-rest-users/src/users.ts +70 -0
- package/packages/arcgis-rest-users/test/mocks/responses.ts +170 -0
- package/packages/arcgis-rest-users/test/users.test.ts +97 -0
- package/packages/arcgis-rest-users/tsconfig.json +6 -0
- package/support/FormData.d.ts +1 -0
- package/support/changelog.js +388 -0
- package/support/commit-template.txt +19 -0
- package/support/deploy-doc-site.js +16 -0
- package/support/publish.sh +40 -0
- package/support/test-helpers.js +8 -0
- package/tsconfig.json +69 -0
- package/tslint.json +14 -0
- package/umd-base-profile.js +82 -0
- package/umd-production-profile.js +13 -0
@@ -0,0 +1,301 @@
|
|
1
|
+
const spawn = require("cross-spawn");
|
2
|
+
const { join, resolve } = require("path");
|
3
|
+
const { readFile, writeFile } = require("fs");
|
4
|
+
const _ = require("lodash");
|
5
|
+
const OUTPUT = join(process.cwd(), "docs", "src", `typedoc.json`);
|
6
|
+
const { prettyifyUrl } = require("acetate/lib/utils.js");
|
7
|
+
const slug = require("slug");
|
8
|
+
const minimatch = require("minimatch");
|
9
|
+
const cheerio = require("cheerio");
|
10
|
+
const MarkdownIt = require("markdown-it");
|
11
|
+
const md = new MarkdownIt();
|
12
|
+
|
13
|
+
(function generateTypeDoc() {
|
14
|
+
return new Promise((resolve, reject) => {
|
15
|
+
const typedoc = spawn(
|
16
|
+
"typedoc",
|
17
|
+
[
|
18
|
+
"-json",
|
19
|
+
OUTPUT,
|
20
|
+
"--ignoreCompilerErrors",
|
21
|
+
"--module",
|
22
|
+
"common",
|
23
|
+
"--tsconfig",
|
24
|
+
"./tsconfig.json"
|
25
|
+
],
|
26
|
+
{
|
27
|
+
stdio: "inherit"
|
28
|
+
}
|
29
|
+
);
|
30
|
+
|
31
|
+
typedoc.on("close", code => {
|
32
|
+
if (code !== 0) {
|
33
|
+
reject(code);
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
|
37
|
+
readFile(OUTPUT, (error, content) => {
|
38
|
+
if (error) {
|
39
|
+
reject(error);
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
|
43
|
+
resolve(JSON.parse(content.toString()));
|
44
|
+
});
|
45
|
+
});
|
46
|
+
})
|
47
|
+
.then(json => {
|
48
|
+
/**
|
49
|
+
* `json.children` will be a list of all TypeScript files in our project.
|
50
|
+
* We dont care about the files, we just need all their children so we reduce
|
51
|
+
* to a single list of everything in the entire project.
|
52
|
+
*/
|
53
|
+
return json.children.reduce(
|
54
|
+
(allChildren, fileChildren) => allChildren.concat(fileChildren),
|
55
|
+
[]
|
56
|
+
);
|
57
|
+
})
|
58
|
+
.then(children => {
|
59
|
+
/**
|
60
|
+
* We dont want TypeScript files that have been symlinked into `node_modules`
|
61
|
+
* folders by Lerna so ignore any child whose source file has `node_modules`
|
62
|
+
* in its `fileName`
|
63
|
+
*/
|
64
|
+
return children.filter(
|
65
|
+
c => !minimatch(c.sources[0].fileName, "**/node_modules/**")
|
66
|
+
);
|
67
|
+
})
|
68
|
+
.then(children => {
|
69
|
+
/**
|
70
|
+
* We now only want children that are actual source files, not tests, so
|
71
|
+
* filter out all children without `src` in their path.
|
72
|
+
*/
|
73
|
+
return children.filter(c =>
|
74
|
+
minimatch(c.sources[0].fileName, "**/src/**/*.ts")
|
75
|
+
);
|
76
|
+
})
|
77
|
+
.then(children => {
|
78
|
+
/**
|
79
|
+
* Some children might be empty so there is nothing to document in them.
|
80
|
+
* For example most `index.ts` files don't have anything besides `import`
|
81
|
+
* or `export` so we can safely filter these children out.
|
82
|
+
*/
|
83
|
+
return children.filter(c => !!c.children);
|
84
|
+
})
|
85
|
+
.then(children => {
|
86
|
+
/**
|
87
|
+
* The `name` of each child is wrapped in extra quote marks remove these
|
88
|
+
* quote marks and add `.ts` back to the end of the `name`,
|
89
|
+
*/
|
90
|
+
return children.map(child => {
|
91
|
+
child.name = child.name.replace(/\"/g, "") + ".ts";
|
92
|
+
return child;
|
93
|
+
});
|
94
|
+
})
|
95
|
+
.then(children => {
|
96
|
+
/**
|
97
|
+
* Now determine which `package` each of our children belongs to based on
|
98
|
+
* its name.
|
99
|
+
*/
|
100
|
+
return children.map(child => {
|
101
|
+
child.name = _.first(child.name.split("/"));
|
102
|
+
child.package = child.name;
|
103
|
+
return child;
|
104
|
+
});
|
105
|
+
})
|
106
|
+
.then(children => {
|
107
|
+
/**
|
108
|
+
* `children` is currently a list of all TypeScript source files in
|
109
|
+
* `packages`. `children.children` is an array of all declarations in that
|
110
|
+
* source file. We need to concat all `children.children` arrays together
|
111
|
+
* into a giant array of all declarations in all packages.
|
112
|
+
*/
|
113
|
+
return children.reduce((allChildren, child) => {
|
114
|
+
return allChildren.concat(
|
115
|
+
child.children.map(c => {
|
116
|
+
c.package = child.package;
|
117
|
+
return c;
|
118
|
+
})
|
119
|
+
);
|
120
|
+
}, []);
|
121
|
+
})
|
122
|
+
.then(children => {
|
123
|
+
/**
|
124
|
+
* Next we remove all children that are not exported out of their files.
|
125
|
+
*/
|
126
|
+
return children.filter(c => c.flags && c.flags.isExported);
|
127
|
+
})
|
128
|
+
.then(declarations => {
|
129
|
+
/**
|
130
|
+
* Now that we have a list of all declarations across the entire project
|
131
|
+
* we can begin to generate additional information about each declaration.
|
132
|
+
* For example we can now determine the `src` of the page that will
|
133
|
+
* be generated for this declaration. Each `declaration` will also have
|
134
|
+
* `children` which we can generate and define an `icon` property for. These
|
135
|
+
* additional properties, `src`, `pageUrl`, `icon` and `children` are then
|
136
|
+
* merged into the `declaration`. This also adds a `title`, `description`
|
137
|
+
* and `titleSegments` to each page which are used in the template for SEO.
|
138
|
+
*/
|
139
|
+
return declarations.map(declaration => {
|
140
|
+
const abbreviatedPackageName = declaration.package.replace("arcgis-rest-", "")
|
141
|
+
const src = `api/${abbreviatedPackageName}/${declaration.name}.html`;
|
142
|
+
let children;
|
143
|
+
|
144
|
+
if (declaration.children) {
|
145
|
+
children = declaration.children.map(child => {
|
146
|
+
child.icon = `tsd-kind-${slug(
|
147
|
+
child.kindString
|
148
|
+
).toLowerCase()} tsd-parent-kind-${slug(
|
149
|
+
declaration.kindString
|
150
|
+
).toLowerCase()}`;
|
151
|
+
|
152
|
+
if (child.flags.isPrivate) {
|
153
|
+
child.icon += ` tsd-is-private`;
|
154
|
+
}
|
155
|
+
|
156
|
+
if (child.flags.isProtected) {
|
157
|
+
child.icon += ` tsd-is-protected`;
|
158
|
+
}
|
159
|
+
|
160
|
+
if (child.flags.isStatic) {
|
161
|
+
child.icon += ` tsd-is-static`;
|
162
|
+
}
|
163
|
+
|
164
|
+
if (child.signatures) {
|
165
|
+
child.signatures = child.signatures.map(sig => {
|
166
|
+
sig.icon = child.icon;
|
167
|
+
return sig;
|
168
|
+
});
|
169
|
+
}
|
170
|
+
|
171
|
+
return child;
|
172
|
+
});
|
173
|
+
}
|
174
|
+
|
175
|
+
declaration.title = declaration.name;
|
176
|
+
declaration.titleSegments = ["API Reference"];
|
177
|
+
declaration.description =
|
178
|
+
declaration.comment && declaration.comment.shortText
|
179
|
+
? cheerio
|
180
|
+
.load(md.render(declaration.comment.shortText))
|
181
|
+
.text()
|
182
|
+
.replace("\n", "")
|
183
|
+
: "API Reference documentation for ${child.name}, part of ${declaration.package}.";
|
184
|
+
|
185
|
+
return Object.assign(declaration, {
|
186
|
+
src,
|
187
|
+
pageUrl: prettyifyUrl(src),
|
188
|
+
icon: `tsd-kind-${slug(declaration.kindString).toLowerCase()}`,
|
189
|
+
children
|
190
|
+
});
|
191
|
+
});
|
192
|
+
})
|
193
|
+
.then(declarations => {
|
194
|
+
/**
|
195
|
+
* We now have a list of `declarations` that will be used to generate the
|
196
|
+
* individual API reference pages, but we still need to generate a landing
|
197
|
+
* page for each `package`. Return a new object with our `declarations` and
|
198
|
+
* a new property `packages` which is an array of every `package` with a
|
199
|
+
* page `src`, a `pageUrl`, an `icon` and a list of `declarations`. This
|
200
|
+
* also adds a `title`, `description` and `titleSegments` to each page
|
201
|
+
* which are used in the template for SEO.
|
202
|
+
*/
|
203
|
+
return {
|
204
|
+
declarations,
|
205
|
+
packages: _(declarations)
|
206
|
+
.map(d => d.package)
|
207
|
+
.uniq()
|
208
|
+
.reduce((packages, package) => {
|
209
|
+
const abbreviatedPackageName = package.replace("arcgis-rest-", "")
|
210
|
+
const src = `api/${abbreviatedPackageName}.html`;
|
211
|
+
const pkg = require(`${process.cwd()}/packages/${package}/package.json`);
|
212
|
+
|
213
|
+
packages.push({
|
214
|
+
package,
|
215
|
+
pkg,
|
216
|
+
title: package,
|
217
|
+
description: pkg.description,
|
218
|
+
titleSegments: ["API Reference"],
|
219
|
+
name: package,
|
220
|
+
declarations: declarations.filter(d => d.package === package),
|
221
|
+
icon: "tsd-kind-module",
|
222
|
+
src,
|
223
|
+
pageUrl: prettyifyUrl(src)
|
224
|
+
});
|
225
|
+
return packages;
|
226
|
+
}, [])
|
227
|
+
};
|
228
|
+
})
|
229
|
+
.then(api => {
|
230
|
+
/**
|
231
|
+
* Since we generated the TypeDoc for the entire project at once each
|
232
|
+
* `declaration` has a unique numerical `id` property. We occasionally
|
233
|
+
* need to lookup a declaration by its `id` so we can prebuild an index of
|
234
|
+
* them here.
|
235
|
+
*/
|
236
|
+
api.index = api.declarations.reduce((index, declaration) => {
|
237
|
+
index[declaration.id] = declaration;
|
238
|
+
return index;
|
239
|
+
}, {});
|
240
|
+
|
241
|
+
return api;
|
242
|
+
})
|
243
|
+
.then(api => {
|
244
|
+
/**
|
245
|
+
* In order to power the API reference quick search we can build an array
|
246
|
+
* of all declarations and child items
|
247
|
+
*/
|
248
|
+
api.quickSearchIndex = api.declarations.reduce(
|
249
|
+
(quickSearchIndex, declaration) => {
|
250
|
+
if (declaration.children) {
|
251
|
+
quickSearchIndex = quickSearchIndex.concat(
|
252
|
+
declaration.children.map(child => {
|
253
|
+
return {
|
254
|
+
title: `${declaration.name}.${child.name}`,
|
255
|
+
url: `${declaration.pageUrl}#${child.name}`,
|
256
|
+
icon: child.icon
|
257
|
+
};
|
258
|
+
})
|
259
|
+
);
|
260
|
+
}
|
261
|
+
|
262
|
+
return quickSearchIndex.concat([
|
263
|
+
{
|
264
|
+
title: declaration.name,
|
265
|
+
url: declaration.pageUrl,
|
266
|
+
icon: declaration.icon
|
267
|
+
}
|
268
|
+
]);
|
269
|
+
},
|
270
|
+
[]
|
271
|
+
);
|
272
|
+
|
273
|
+
return api;
|
274
|
+
})
|
275
|
+
.then(api => {
|
276
|
+
/**
|
277
|
+
* Our final object looks like this:
|
278
|
+
*
|
279
|
+
* {
|
280
|
+
* packages: [Array of packages.],
|
281
|
+
* declarations: [Array of each exported declaration accross all source files.]
|
282
|
+
* index: { Object mapping each declaration.id as a key with the declaration as its value}
|
283
|
+
* }
|
284
|
+
*
|
285
|
+
* We now export this to the Acetate source directory.
|
286
|
+
*/
|
287
|
+
return new Promise((resolve, reject) => {
|
288
|
+
writeFile(OUTPUT, JSON.stringify(api, null, 2), e => {
|
289
|
+
if (e) {
|
290
|
+
reject(e);
|
291
|
+
return;
|
292
|
+
}
|
293
|
+
|
294
|
+
resolve(api);
|
295
|
+
});
|
296
|
+
});
|
297
|
+
})
|
298
|
+
.catch(e => {
|
299
|
+
console.error(e);
|
300
|
+
});
|
301
|
+
})();
|
@@ -0,0 +1,82 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta content="IE=edge" http-equiv="X-UA-Compatible">
|
6
|
+
<meta name="viewport" content="width=device-width, user-scalable=no">
|
7
|
+
<title>{{title if title}}{{" | " + titleSegments | join(" |") if titleSegments}}{{" | " if title}}ArcGIS REST JS</title>
|
8
|
+
{% if description %}
|
9
|
+
<meta name="description" content="A modular, high quality toolkit for working with the ArcGIS REST API.">
|
10
|
+
{% endif %}
|
11
|
+
<link rel="stylesheet" href="https://s3-us-west-1.amazonaws.com/patterns.esri.com/files/calcite-web/1.0.0-rc.7/css/calcite-web.min.css">
|
12
|
+
<link rel="stylesheet" href="{{baseUrl}}/css/style.css">
|
13
|
+
{% block css %}{% endblock %}
|
14
|
+
</head>
|
15
|
+
<body>
|
16
|
+
<!-- Drawer -->
|
17
|
+
<div class="drawer drawer-left js-drawer" data-drawer="top-nav" tabindex="0">
|
18
|
+
<nav class="drawer-nav" role="navigation">
|
19
|
+
<aside class="side-nav">
|
20
|
+
<h2 class="side-nav-title">ArcGIS REST JS</h2>
|
21
|
+
{% link baseUrl + "/guides/", "Guides", class="side-nav-link" %}
|
22
|
+
{% link baseUrl + "/api/", "API Reference", class="side-nav-link"%}
|
23
|
+
</aside>
|
24
|
+
</nav>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div id="page" class="wrapper">
|
28
|
+
<!-- Sample HTML -->
|
29
|
+
<header class="top-nav">
|
30
|
+
<div class="grid-container">
|
31
|
+
<div class="column-24">
|
32
|
+
<!-- desktop sized navigation -->
|
33
|
+
<div class="tablet-hide">
|
34
|
+
<!-- logo / home -->
|
35
|
+
<a href="{{baseUrl}}/" class="top-nav-title">ArcGIS REST JS</a>
|
36
|
+
<!-- primary navigation sections -->
|
37
|
+
<nav class="top-nav-list" role="navigation" aria-labelledby="topnav">
|
38
|
+
{% link baseUrl + "/guides/", "Guides", class="top-nav-link" %}
|
39
|
+
{% link baseUrl + "/api/", "API Reference", class="top-nav-link"%}
|
40
|
+
</nav>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<!-- tablet and mobile sized navigation -->
|
44
|
+
<div class="tablet-show top-nav-flex">
|
45
|
+
<!-- open primary navigation drawer -->
|
46
|
+
<nav class="top-nav-flex-list" role="navigation" aria-labelledby="topnav">
|
47
|
+
<a href="{{baseUrl}}/" class="icon-ui-menu top-nav-link js-drawer-toggle" data-drawer="top-nav"><span class="phone-hide">Menu</span></a>
|
48
|
+
</nav>
|
49
|
+
<!-- logo / home -->
|
50
|
+
<header class="top-nav-flex-title">
|
51
|
+
<a href="{{baseUrl}}/" class="top-nav-link">ArcGIS REST API JavaScript Client</a>
|
52
|
+
</header>
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
</header>
|
58
|
+
|
59
|
+
|
60
|
+
<main id="#skip-to-content">
|
61
|
+
{% block main %}{% endblock %}
|
62
|
+
</main>
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<footer class="footer leader-1">
|
66
|
+
{% block footer %}{% endblock %}
|
67
|
+
<div class="grid-container">
|
68
|
+
<div class="column-24 trailer-half">
|
69
|
+
<a href="https://github.com/Esri/arcgis-rest-js" class="font-size--1">Fork this project on GitHub</a>
|
70
|
+
</div>
|
71
|
+
</div>
|
72
|
+
</footer>
|
73
|
+
|
74
|
+
<script src="https://s3-us-west-1.amazonaws.com/patterns.esri.com/files/calcite-web/1.0.0-rc.7/js/calcite-web.min.js"></script>
|
75
|
+
|
76
|
+
<script>
|
77
|
+
calcite.init()
|
78
|
+
</script>
|
79
|
+
|
80
|
+
{% block scripts %}{% endblock %}
|
81
|
+
</body>
|
82
|
+
</html>
|